[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    [cfe-dev] Annotations on extern
From:       Julian Bangert via cfe-dev <cfe-dev () lists ! llvm ! org>
Date:       2016-03-25 22:12:21
Message-ID: CAOn4P0NgnqYQq3EXRaWOAwdomKFtGTqkDSx1tj1TR6pXVOcUeQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

<div dir="ltr"><div>Hello,</div><div><br></div><div>is there anything similar to \
__attribute__((annotate(&quot;foo&quot;))) that works on declarations (and their \
parameters) instead of definitions?  </div><div><br></div><div>I am trying to get \
Clang to pass an annotation such as</div><div><br></div><div>extern void foo(int *a \
__attribute__((annotate(&quot;foo&quot;))) , int *b)</div><div><br></div><div>  or, \
if the above isnt possible, an annotation on the entire \
function</div><div><br></div><div>extern void foo(int *a , int *b) \
__attribute__((annotate(&quot;foo&quot;)))</div><div><br></div><div><br></div><div>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.  </div><div><br></div><div>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?  \
</div><div><br></div><div>Regards,</div><div>Julian  </div></div>


[Attachment #6 (text/plain)]

_______________________________________________
cfe-dev mailing list
cfe-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic