]> granicus.if.org Git - clang/commitdiff
ARM: Define __thumb2__ for V6T2 targets and only define
authorDaniel Dunbar <daniel@zuster.org>
Fri, 18 Dec 2009 19:57:13 +0000 (19:57 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 18 Dec 2009 19:57:13 +0000 (19:57 +0000)
__USING_SJLJ_EXCEPTIONS__ on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91705 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp

index 91b747d691e94f157e64266487fd5f964e6e1d88..63a71c7a22c5ff19c883efc5fd4bd36a2f2cab92 100644 (file)
@@ -1194,13 +1194,11 @@ public:
   ARMTargetInfo(const std::string &TripleStr)
     : TargetInfo(TripleStr), ABI("aapcs-linux"), CPU("arm1136j-s")
   {
-    llvm::Triple Triple(TripleStr);
-
     SizeType = UnsignedInt;
     PtrDiffType = SignedInt;
 
     // FIXME: Should we just treat this as a feature?
-    IsThumb = Triple.getArchName().startswith("thumb");
+    IsThumb = getTriple().getArchName().startswith("thumb");
     if (IsThumb) {
       DescriptionString = ("e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-"
                            "i64:64:64-f32:32:32-f64:64:64-"
@@ -1308,7 +1306,7 @@ public:
     if (IsThumb) {
       Define(Defs, "__THUMBEL__");
       Define(Defs, "__thumb__");
-      if (CPUArch.startswith("7"))
+      if (CPUArch == "6T2" || CPUArch.startswith("7"))
         Define(Defs, "__thumb2__");
     }
 
@@ -1317,7 +1315,8 @@ public:
     // FIXME: This should be conditional on VFP instruction support.
     Define(Defs, "__VFP_FP__");
 
-    Define(Defs, "__USING_SJLJ_EXCEPTIONS__");
+    if (getTriple().getOS() == llvm::Triple::Darwin)
+      Define(Defs, "__USING_SJLJ_EXCEPTIONS__");
   }
   virtual void getTargetBuiltins(const Builtin::Info *&Records,
                                  unsigned &NumRecords) const {