[LLVMdev] Function Attributes in LLVM
Nick Johnson
npjohnso at cs.princeton.edu
Tue Feb 17 09:26:16 PST 2009
I too have been seeking something like this.
To the best of my understanding, the annotation attributes let you
attach only text attributes, and only at the function scope, but not
to individual basic blocks or instructions. There are intrinsic
functions for the purposes of annotating values, but these cannot be
used to annotate branch or store instructions (as they produce no
value). Additionally, these are only overrided against integer types,
and so one cannot annotate a floating point or aggregate value.
And although one can easily use an auxillary data to hold additional
attributes for basic blocks or instructions, it would be ideal if such
annotations could be de/serialized to bitcode files.
Your input is appreciated,
Nick
On Tue, Feb 17, 2009 at 11:35 AM, Anton Korobeynikov
<anton at korobeynikov.info> wrote:
> Hello, Josef
>
>> useful for some low level targets. As far as I know function
>> attributes
>> are GCC specific or am I wrong?
> That's correct
>
>> Is there a Standard-C way to add this
>> kind of meta information to a function?
> Well... You can store function pointers into some array and add any
> extra information your like.
>
>> I think it would be a pretty nice feature if a target could specify
>> special function attributes or am I totally missing the point?
> Look for annotation attribute.
>
> ---
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
--
Nick Johnson
More information about the llvm-dev
mailing list