type attributes

Hello,

Does the bitcode representation retain any information about gcc attributes placed on types?

Thanks,
Zach

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.

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: