[LLVMdev] Adding a new function attribute
Sandeep Patel
deeppatel1987 at gmail.com
Fri Mar 9 17:47:33 PST 2012
On Sun, Mar 4, 2012 at 9:07 PM, Borja Ferrer <borja.ferav at gmail.com> wrote:
> I'm adding a new function attribute in clang and llvm for a backend I'm
> writing that treats prolog and epilogue code in a special way inside
> interrupt handlers, similar to what naked does. One way I've seen to do this
> is to add a new attribute type in Attributes.h, however to me it feels bad
> to add a target dependent attribute into this place which is very target
> independent. So what's the best way to do this or is there an api to handle
> this kind of issues?
FWIW, GCC has something similar.
In LLVM IR, interrupt handlers could be considered either a function
attribute or a calling convention. I don't have a particular
preference. If using a CC, I'd suggest making it be target neutral
like fastcc.
deep
More information about the llvm-dev
mailing list