[cfe-commits] r106106 - /cfe/trunk/lib/CodeGen/TargetInfo.cpp
Rafael Espindola
rafael.espindola at gmail.com
Wed Jun 16 09:13:39 PDT 2010
Author: rafael
Date: Wed Jun 16 11:13:39 2010
New Revision: 106106
URL: http://llvm.org/viewvc/llvm-project?rev=106106&view=rev
Log:
Don't set the calling convention for ARM if it is already the default.
Modified:
cfe/trunk/lib/CodeGen/TargetInfo.cpp
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=106106&r1=106105&r2=106106&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Wed Jun 16 11:13:39 2010
@@ -1776,14 +1776,22 @@
it->info = classifyArgumentType(it->type, Context, VMContext);
}
- // 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;
+
switch (getABIKind()) {
case APCS:
- FI.setEffectiveCallingConvention(llvm::CallingConv::ARM_APCS);
+ if (DefaultCC != llvm::CallingConv::ARM_APCS)
+ FI.setEffectiveCallingConvention(llvm::CallingConv::ARM_APCS);
break;
case AAPCS:
- FI.setEffectiveCallingConvention(llvm::CallingConv::ARM_AAPCS);
+ if (DefaultCC != llvm::CallingConv::ARM_AAPCS)
+ FI.setEffectiveCallingConvention(llvm::CallingConv::ARM_AAPCS);
break;
case AAPCS_VFP:
More information about the cfe-commits
mailing list