Skip to content

[ffigen] Parse ns_returns_retained and ns_consumed for blocks #1490

Open
@liamappelbe

Description

@liamappelbe

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions