[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
   http://llvm.org/docs/LangRef.html#paramattrs
and
   http://llvm.org/docs/LangRef.html#fnattrs

> 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).

Ciao,

Duncan.



More information about the llvm-dev mailing list