Skip to content

[ffigen] Parse ns_returns_retained and ns_consumed for blocks #1490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
liamappelbe opened this issue Sep 2, 2024 · 0 comments
Open

[ffigen] Parse ns_returns_retained and ns_consumed for blocks #1490

liamappelbe opened this issue Sep 2, 2024 · 0 comments
Labels
lang-objective_c Related to Objective C support package:ffigen

Comments

@liamappelbe
Copy link
Contributor

We have all the infra for handling these annotations in ffigen, but libclang doesn't seem to have a way of accessing __attribute__((ns_returns_retained)) and __attribute__((ns_consumed)) annotations on blocks.

For methods and top level functions, these annotations are on the CXCursor of the declaration, but for blocks I only have a CXType with no declaration cursor. If I annotate a block with NS_RETURNS_RETAINED, the CXType's kind changes from FunctionProto to Unexposed. If I annotate it with __attribute__((ns_returns_retained)) the kind changes to Attributed, which is a bit more promising, but I can't find a way of getting the attribute. If I annotate one of the args with __attribute__((ns_consumed)), nothing happens at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-objective_c Related to Objective C support package:ffigen
Projects
Status: Backlog
Development

No branches or pull requests

1 participant