[cfe-dev] Annotations on extern

Julian Bangert via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 25 15:12:21 PDT 2016


Hello,

is there anything similar to __attribute__((annotate("foo"))) that works on
declarations (and their parameters) instead of definitions?

I am trying to get Clang to pass an annotation such as

extern void foo(int *a __attribute__((annotate("foo"))) , int *b)

 or, if the above isnt possible, an annotation on the entire function

extern void foo(int *a , int *b) __attribute__((annotate("foo")))


down to the LLVM IR in any way. At the moment, this is for a prototype and
I would like to have a quick and dirty way that I can iterate on -- so
ideally something string-based.

Is there a solution I have missed, or should I roll my own attribute. If
so, what would the cleanest way of emitting this in the IR be -- perhaps
weak symbols in the LLVM IR?

Regards,
Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160325/19ae4b28/attachment-0001.html>


More information about the cfe-dev mailing list