]> granicus.if.org Git - clang/commitdiff
Allow targets to override description string.
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Mon, 18 Aug 2008 10:05:22 +0000 (10:05 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Mon, 18 Aug 2008 10:05:22 +0000 (10:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54914 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TargetInfo.h
lib/Basic/TargetInfo.cpp
lib/Basic/Targets.cpp

index 083aaf0e68c0c96605db9584034ce2341f4aec30..be81aa0b7028eac19096edf262ef497400f2a526 100644 (file)
@@ -43,6 +43,7 @@ protected:
   unsigned char LongDoubleWidth, LongDoubleAlign;
   unsigned char LongWidth, LongAlign;
   unsigned char LongLongWidth, LongLongAlign;
+  char *DescriptionString;
   
   const llvm::fltSemantics *FloatFormat, *DoubleFormat, *LongDoubleFormat;
 
@@ -197,10 +198,7 @@ public:
   }
   
   const char *getTargetDescription() const {
-    // FIXME !
-    // Hard code darwin-x86 for now.
-    return "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:\
-32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128";
+    return DescriptionString;
   }
 
   struct GCCRegAlias {
index 187e001358b6dc65997f11216e210f47eadaf42a..6247afd58874b8c027ba73958f8e7bea037ffb0d 100644 (file)
@@ -37,6 +37,8 @@ TargetInfo::TargetInfo(const std::string &T) : Triple(T) {
   FloatFormat = &llvm::APFloat::IEEEsingle;
   DoubleFormat = &llvm::APFloat::IEEEdouble;
   LongDoubleFormat = &llvm::APFloat::IEEEdouble;
+  DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:\
+32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128";
 }
 
 // Out of line virtual dtor for TargetInfo.
index d4ec04835c6ab8fd6c11e8e4393d00f4d2f4148c..3147aaa9bfc9596802d9c359e69298c0dbcee0a8 100644 (file)
@@ -873,6 +873,7 @@ namespace {
       // little point on a platform with 8-bit loads.
       IntWidth = IntAlign = LongAlign = LongLongAlign = PointerWidth = 16;
       PointerAlign = 8;
+      DescriptionString = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8";
     }
     virtual uint64_t getPointerWidthV(unsigned AddrSpace) const { return 16; }
     virtual uint64_t getPointerAlignV(unsigned AddrSpace) const { return 8; }