[LLVMdev] type attributes

Zachary Anderson zra at cs.berkeley.edu
Wed Apr 9 01:15:12 PDT 2008


I see. I was hoping to preserve some of my own custom type attributes
for use in a type based analysis I'm working on, but from your answer it
seems as though this won't be possible.

Thanks for your help,
Zach

Duncan Sands wrote:
> Hi Zach,
> 
>> Does the bitcode representation retain any information about gcc attributes 
>> placed on types?
> 
> yes it does, at least for some of them.  For example, suppose you specify
> that a type should be 16 byte aligned.  This will not change the LLVM type,
> instead every time an object of your type is created the object creation
> operation (eg: an alloca) will ensure that the object is 16 byte aligned.
> Volatile types are another example: types are not volatile in LLVM, only
> load and store operations are.  Loads and stores to an object for which the
> gcc type was volatile are marked volatile.  In LLVM the general rule is that
> operations have attributes, not types.  It is the job of llvm-gcc to output
> the right operation given the attributes on the gcc type.  Which attributes
> are you interested in?
> 
> Ciao,
> 
> Duncan.



More information about the llvm-dev mailing list