[LLVMdev] Function Attributes in LLVM

Josef Eisl zapster at zapster.cc
Tue Feb 17 07:36:31 PST 2009


Hello,

I was wondering if there is a way to add more, maybe target dependant,
function attributes? I think in certain circumstances they are a good
way to give the compiler more information about a function. For example
GCC supports attributes to mark an interrupt function witch is very
useful for some low level targets. As far as I know function attributes
are GCC specific or am I wrong? Is there a Standard-C way to add this
kind of meta information to a function?

Now the LLVM specific questions :): Is there currently a way that
special function attributes are passed to the back end? A solution would
be to add custom function attributes to the LLVM IR but changing a core
system in order to support a feature of a new device seems not to be the
best way IMO. Additionally the front end must be changed too.
I think it would be a pretty nice feature if a target could specify
special function attributes or am I totally missing the point?

Thanks in advance!

BR
Josef



More information about the llvm-dev mailing list