[cfe-dev] Custom calling conventions in C code
matthijs at stdin.nl
Thu Jul 10 12:19:22 PDT 2008
> or whatever. The best way to do this is to have __interrupt__ be a
> target-specific #define for __attribute__((interrupt)) and then have your
> target handle the interrupt attribute however you want.
> Yep, supporting specific calling conventions is fine, I just don't want
> something like:
Okay, sounds reasonable. However, is there any generic way to do this in
clang, or will I end up locally patching clang for this?
If the latter is the case, might function annotation be an alternative?
Currently, I can specify __attribute__((annotate("foo"))) for global
variables, but not for functions (both in clang and gcc). I'm not sure where
this limitation comes from, but enabling generic annotation for functions
should also work for me (I can simply add a frontend pass that translates
those annotations into calling conventions for my backend, or leave them as
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: Digital signature
More information about the cfe-dev