diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Basic/Targets.cpp | 10 | ||||
-rw-r--r-- | lib/CodeGen/TargetABIInfo.cpp | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index c9a3deab28..eed9e2cc19 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -991,8 +991,13 @@ class ARMTargetInfo : public TargetInfo { 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-" @@ -1016,7 +1021,10 @@ public: 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 diff --git a/lib/CodeGen/TargetABIInfo.cpp b/lib/CodeGen/TargetABIInfo.cpp index 892994af10..6d95adad86 100644 --- a/lib/CodeGen/TargetABIInfo.cpp +++ b/lib/CodeGen/TargetABIInfo.cpp @@ -1682,11 +1682,8 @@ const ABIInfo &CodeGenTypes::getABIInfo() const { 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)); |