[cfe-commits] r54914 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/TargetInfo.cpp lib/Basic/Targets.cpp

Sanjiv Gupta sanjiv.gupta at microchip.com
Mon Aug 18 03:05:23 PDT 2008


Author: sgupta
Date: Mon Aug 18 05:05:22 2008
New Revision: 54914

URL: http://llvm.org/viewvc/llvm-project?rev=54914&view=rev
Log:
Allow targets to override description string.

Modified:
    cfe/trunk/include/clang/Basic/TargetInfo.h
    cfe/trunk/lib/Basic/TargetInfo.cpp
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=54914&r1=54913&r2=54914&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Mon Aug 18 05:05:22 2008
@@ -43,6 +43,7 @@
   unsigned char LongDoubleWidth, LongDoubleAlign;
   unsigned char LongWidth, LongAlign;
   unsigned char LongLongWidth, LongLongAlign;
+  char *DescriptionString;
   
   const llvm::fltSemantics *FloatFormat, *DoubleFormat, *LongDoubleFormat;
 
@@ -197,10 +198,7 @@
   }
   
   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 {

Modified: cfe/trunk/lib/Basic/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=54914&r1=54913&r2=54914&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/lib/Basic/TargetInfo.cpp Mon Aug 18 05:05:22 2008
@@ -37,6 +37,8 @@
   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.

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=54914&r1=54913&r2=54914&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Mon Aug 18 05:05:22 2008
@@ -873,6 +873,7 @@
       // 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; }





More information about the cfe-commits mailing list