[LLVMdev] "Attribute" Translation

Duncan Sands baldrick at free.fr
Wed Jul 28 06:15:27 PDT 2010

Hi Xiaolong,

> Could anyone give me any hint on how llvm-g++ translates the
> "__attribute__" annotations (supported by GCC)?

most attributes are ignored.  Those that are not ignored are usually
converted into an LLVM parameter or function attribute, see

> template<typename T>
> class __attribute__((may_alias)) list  { ... };

In LLVM, attributes are not placed on types, instead they are placed
on operations (eg: where gcc has an attribute on a function type, LLVM
will place the attribute on calls to a function of that type).



More information about the llvm-dev mailing list