]> granicus.if.org Git - clang/commitdiff
Add 'e' to the SPIR data layout - SPIR is little endian for now.
authorGuy Benyei <guy.benyei@intel.com>
Thu, 7 Mar 2013 13:06:10 +0000 (13:06 +0000)
committerGuy Benyei <guy.benyei@intel.com>
Thu, 7 Mar 2013 13:06:10 +0000 (13:06 +0000)
Add 32/64 bit specific target defines for SPIR.

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

lib/Basic/Targets.cpp

index 5a15145d2e1c571ee7a1849bef93c58c7ee6f6d4..d1485287491a7f690ad237e5a92d25d80a09b260 100644 (file)
@@ -4932,11 +4932,15 @@ namespace {
       SizeType     = TargetInfo::UnsignedInt;
       PtrDiffType = IntPtrType = TargetInfo::SignedInt;
       DescriptionString
-        = "p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
+        = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
           "f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-"
           "v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-"
           "v512:512:512-v1024:1024:1024";
-  }
+    }
+    virtual void getTargetDefines(const LangOptions &Opts,
+                                  MacroBuilder &Builder) const {
+      DefineStd(Builder, "SPIR32", Opts);
+    }
   };
 
   class SPIR64TargetInfo : public SPIRTargetInfo {
@@ -4946,11 +4950,15 @@ namespace {
       SizeType     = TargetInfo::UnsignedLong;
       PtrDiffType = IntPtrType = TargetInfo::SignedLong;
       DescriptionString
-        = "p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
+        = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
           "f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-"
           "v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-"
           "v512:512:512-v1024:1024:1024";
-  }
+    }
+    virtual void getTargetDefines(const LangOptions &Opts,
+                                  MacroBuilder &Builder) const {
+      DefineStd(Builder, "SPIR64", Opts);
+    }
   };
 }