mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-24 18:20:38 +00:00
Change the test for which ABI/CC to use on ARM to be base on the environment
(the last argument of the triple). llvm-svn: 106131
This commit is contained in:
parent
1d44608cc1
commit
23a8a06554
@ -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:
|
||||
|
@ -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:
|
||||
ABIName = "aapcs";
|
||||
break;
|
||||
|
||||
case llvm::Triple::Darwin:
|
||||
ABIName = "apcs-gnu";
|
||||
break;
|
||||
|
||||
case llvm::Triple::Linux:
|
||||
llvm::StringRef env = getToolChain().getTriple().getEnvironmentName();
|
||||
if (env == "gnueabi")
|
||||
ABIName = "aapcs-linux";
|
||||
break;
|
||||
}
|
||||
else if (env == "eabi")
|
||||
ABIName = "aapcs";
|
||||
else
|
||||
ABIName = "apcs-gnu";
|
||||
}
|
||||
CmdArgs.push_back("-target-abi");
|
||||
CmdArgs.push_back(ABIName);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -triple arm-unknown-unknown -emit-llvm -o - %s | FileCheck %s
|
||||
// RUN: %clang_cc1 -triple arm-unknown-linux-gnueabi -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
// CHECK: declare i32 @printf(i8*, ...)
|
||||
void f0() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 %s -triple=arm-linux-gnueabi -target-abi aapcs -emit-llvm -o - | FileCheck %s
|
||||
// RUN: %clang_cc1 %s -triple=arm-unknown-linux-gnueabi -target-abi aapcs -emit-llvm -o - | FileCheck %s
|
||||
|
||||
class SMLoc {
|
||||
const char *Ptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user