calling conventions

I have some needs in the Mips compiler to have some special calling conventions; for now just
used internally by the compiler.

In the ir there is the general "cc <n>".

Is there a way to register a calling convention with target independent code so that if those attribute is attached to the function ir , that the corresponding calling convention will be
used when generating calls to that function?



Hi Reed,

It may be useful to have a look at how clang handles this for ARM’s AAPCS and AAPCS_VFP calling conventions. In particular, look in lib/CodeGen/CGCall.cpp and lib/CodeGen/TargetInfo.cpp. That’s probably not going to be exactly what you need, but hopefully it will at least help point in the right direction.