[llvm-dev] [C API] Binding for attributes

Amaury SECHET via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 8 14:10:08 PST 2016


So one of the big blind spot of the C API is LLVM attributes. Not only a
subset of attribute only are usable from C, but they can't be used in
various position (like function return).

There are various approach to go with this, and I'm willing to do the work,
but i'm not sure which one we should prefers.

Here are solution I considered:

1/ Extend the generation from Attribute.td to generate an enum for the C
API so we can access AttrKind from there. The problem is that i'm not sure
values in there will be conserved over time. I'd assume they need to for
bytecode backward compatibility ?

2/ Add binding for AttributeSet. Not sure it solves the problem of AttrKind
in any way, so not sure it is viable.

3/ Double down on current approach, but that mean we will accumulate crap
in AttrBuilder::addRawValue over time. Maybe we are ok with that.

Thought ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160308/4270b423/attachment.html>


More information about the llvm-dev mailing list