[cfe-commits] r106106 - /cfe/trunk/lib/CodeGen/TargetInfo.cpp
Rafael Espíndola
rafael.espindola at gmail.com
Wed Jun 16 11:11:14 PDT 2010
On 16 June 2010 13:02, Anton Korobeynikov <anton at korobeynikov.info> wrote:
> Hi, Rafael
>
>> - // ARM always overrides the calling convention.
>> + const llvm::Triple &Triple(Context.Target.getTriple());
>> + llvm::CallingConv::ID DefaultCC;
>> + if (Triple.getOS() == llvm::Triple::Darwin)
>> + DefaultCC = llvm::CallingConv::ARM_APCS;
>> + else
>> + DefaultCC = llvm::CallingConv::ARM_AAPCS;
> As we already discussed AAPCS should only be used if EABI is in effect.
> Please at least put a FIXME here.
So, this is based on Tools.cpp:
---------------------------------------------------------------------------------
const char *ABIName = 0;
if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {
ABIName = A->getValue(Args);
} else {
// Select the default based on the platform.
switch (getToolChain().getTriple().getOS()) {
// FIXME: Is this right for non-Darwin and non-Linux?
default:
ABIName = "aapcs";
break;
case llvm::Triple::Darwin:
ABIName = "apcs-gnu";
break;
case llvm::Triple::Linux:
ABIName = "aapcs-linux";
break;
}
}
CmdArgs.push_back("-target-abi");
CmdArgs.push_back(ABIName);
---------------------------------------------------------------------------------
Should that be changed to pass apcs-gnu for everything but a target
that ends in eabi?
Cheers,
Rafael
More information about the cfe-commits
mailing list