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

Anton Korobeynikov anton at korobeynikov.info
Tue Oct 9 05:34:30 PDT 2012


> My understanding is that clang should be generating function calls with the appropriate default convention, and that default ought to be be being set somewhere in Toolchain.cpp or other driver files. I don't think your patch is right: there's a difference between using the default calling convention which happens to be X and explicitly asking, via function attributes, for a specific calling convention X; in the latter case it has to be preserved. (I think it would be legal, although probably insane, to have explicit calls using apcs, aapcs and aapcs_vfp in the same binary as well as whatever default is being used.) I'm still investigating.
It's pretty fine to use both aapcs and aapcs_vfp in the same binary.
E.g. aapcs is used for varargs / library calls.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the cfe-dev mailing list