[cfe-dev] Bugfixer's question about how C calling convention corresponds to platform CC

David Tweed david.tweed at arm.com
Wed Oct 3 01:42:50 PDT 2012


Hi, I'm lost in the twisty maze of Tools.cpp and Toolchain.cpp in the course
of tracking down some regression test issues on ARM. I can see in
AsmWriter.cpp that an explicit call convention marker, such as ARM_AAPCS
will be emitted in every case except when the calling convention is C.
However, my impression is sometimes the C calling convention _is_ a specific
convention, such as ARM_AAPCS and in that case basic generated function
calls from clang are marked with a C calling convention. However, I'm
haven't been able to find the piece of code that implements this
"knowledge". Could anyone help point it out to me, or is this understanding
wrong? It looks like FileCheck expects CC markers to appear only when
explicitly requested and not that the triple-implied ABI CC marker gets
attached to every generated function: that's what a general user should
expect of clang as well?

(While I'm asking, I gather that configuration "magic" is basically written
in response to need from specific users (rather than attempting the mammoth
task of being complete). In Tools.cpp Clang::AddARMTargetArgs it a "default"
ABIName of "aapcs-linux" is set for the GNUEABI and GNUEABIHF triples from
the environment. Does anyone know what the use-case is that motivates that
is? It'd be useful to know so if the code does get changed I can try to get
it retested on that platform as well as the ones I've got access to.)

Many thanks for any insight,
David







More information about the cfe-dev mailing list