aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/TargetInfo.cpp7
-rw-r--r--lib/Driver/Tools.cpp17
2 files changed, 9 insertions, 15 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 608929270d..1de0ebc41c 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -1778,10 +1778,11 @@ void ARMABIInfo::computeInfo(CGFunctionInfo &FI, ASTContext &Context,
const llvm::Triple &Triple(Context.Target.getTriple());
llvm::CallingConv::ID DefaultCC;
- if (Triple.getOS() == llvm::Triple::Darwin)
- DefaultCC = llvm::CallingConv::ARM_APCS;
- else
+ if (Triple.getEnvironmentName() == "gnueabi" ||
+ Triple.getEnvironmentName() == "eabi")
DefaultCC = llvm::CallingConv::ARM_AAPCS;
+ else
+ DefaultCC = llvm::CallingConv::ARM_APCS;
switch (getABIKind()) {
case APCS:
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 0a88d9f979..ae197fbeba 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -394,20 +394,13 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
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:
+ llvm::StringRef env = getToolChain().getTriple().getEnvironmentName();
+ if (env == "gnueabi")
+ ABIName = "aapcs-linux";
+ else if (env == "eabi")
ABIName = "aapcs";
- break;
-
- case llvm::Triple::Darwin:
+ else
ABIName = "apcs-gnu";
- break;
-
- case llvm::Triple::Linux:
- ABIName = "aapcs-linux";
- break;
- }
}
CmdArgs.push_back("-target-abi");
CmdArgs.push_back(ABIName);