[llvm] r280833 - CodeGen: ensure that libcalls are always AAPCS CC

Anton Korobeynikov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 11:14:48 PDT 2016


> -/// InitLibcallCallingConvs - Set default libcall CallingConvs.
> -///
> -static void InitLibcallCallingConvs(CallingConv::ID *CCs) {
> -  for (int i = 0; i < RTLIB::UNKNOWN_LIBCALL; ++i) {
> -    CCs[i] = CallingConv::C;
> -  }
> +/// Set default libcall CallingConvs.
> +static void InitLibcallCallingConvs(CallingConv::ID *CCs, const Triple &T) {
> +  for (int LC = 0; LC < RTLIB::UNKNOWN_LIBCALL; ++LC)
> +    CCs[LC] = CallingConv::C;
> +
> +  // The builtins on ARM always use AAPCS, irrespective of wheter C is AAPCS or
> +  // AAPCS_VFP.
> +  if (T.getArch() == Triple::arm || T.getArch() == Triple::thumb)
That's gross hack in the generic target lowering code... Why can't you
initialize the CC from the backend?

-- 
With best regards, Anton Korobeynikov
Department of Statistical Modelling, Saint Petersburg State University


More information about the llvm-commits mailing list