[cfe-dev] Custom calling conventions in C code

Matthijs Kooijman 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:
>
> __attribute__((callingconv(47)))

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

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080710/41982d61/attachment.sig>


More information about the cfe-dev mailing list