llvm::StringMap<bool> &Features) const {
}
+ /// getABI - Get the ABI in use.
+ virtual const char *getABI() const {
+ return "";
+ }
+
/// setABI - Use the specific ABI.
///
/// \return - False on error (invalid ABI name).
Armv7a,
XScale
} ArmArch;
+
+ std::string ABI;
+
public:
- ARMTargetInfo(const std::string& triple) : TargetInfo(triple) {
+ ARMTargetInfo(const std::string& triple)
+ : TargetInfo(triple), ABI("aapcs-linux")
+ {
// FIXME: Are the defaults correct for ARM?
DescriptionString = ("e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-"
"i64:32:32-f32:32:32-f64:32:32-"
ArmArch = Armv6;
}
}
+ virtual const char *getABI() const { return ABI.c_str(); }
virtual bool setABI(const std::string &Name) {
+ ABI = Name;
+
// The defaults (above) are for AAPCS, check if we need to change them.
//
// FIXME: We need support for -meabi... we could just mangle it into the
case llvm::Triple::arm:
case llvm::Triple::thumb:
- // FIXME: We should get this from the target, we also need a -target-abi
- // because the user should have some control over this.
- //
// FIXME: We want to know the float calling convention as well.
- if (Triple.getOS() == llvm::Triple::Darwin)
+ if (strcmp(getContext().Target.getABI(), "apcs-gnu") == 0)
return *(TheABIInfo = new ARMABIInfo(ARMABIInfo::APCS));
return *(TheABIInfo = new ARMABIInfo(ARMABIInfo::AAPCS));
// RUX: iphone-llvm-gcc -arch armv7 -flto -S -o - %s | FileCheck %s
-// RUN: clang-cc -triple armv7-apple-darwin9 -emit-llvm -w -o - %s | FileCheck %s
+// RUN: clang-cc -triple armv7-apple-darwin9 -target-abi=apcs-gnu -emit-llvm -w -o - %s | FileCheck %s
// CHECK: define arm_apcscc signext i8 @f0()
char f0(void) {