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

Chris Lattner sabre at nondot.org
Sat Mar 8 00:07:35 PST 2008


Author: lattner
Date: Sat Mar  8 02:07:34 2008
New Revision: 48048

URL: http://llvm.org/viewvc/llvm-project?rev=48048&view=rev
Log:
eliminate ComputeWCharInfo.

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

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

==============================================================================
--- cfe/trunk/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/Basic/TargetInfo.cpp Sat Mar  8 02:07:34 2008
@@ -50,6 +50,14 @@
 
 //===----------------------------------------------------------------------===//
 
+TargetInfo::TargetInfo(const TargetInfoImpl *TII) {
+  Target = TII;
+  
+  // Initialize Cache values to uncomputed.
+  TII->getWCharInfo(WCharWidth, WCharAlign);
+}
+
+
 TargetInfo::~TargetInfo() {
   delete Target;
 }
@@ -68,13 +76,6 @@
   Target->getTargetDefines(Buffer);
 }
 
-/// ComputeWCharWidth - Determine the width of the wchar_t type for the primary
-/// target, diagnosing whether this is non-portable across the secondary
-/// targets.
-void TargetInfo::ComputeWCharInfo() {
-  Target->getWCharInfo(WCharWidth, WCharAlign);
-}
-
 
 /// getTargetBuiltins - Return information about target-specific builtins for
 /// the current primary target, and info about which builtins are non-portable

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

==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Sat Mar  8 02:07:34 2008
@@ -42,13 +42,8 @@
   //                  TargetInfo Construction.
   //==----------------------------------------------------------------==/  
   
-  TargetInfo(const TargetInfoImpl *TII) {
-    Target = TII;
-    
-    // Initialize Cache values to uncomputed.
-    WCharWidth = 0;
-  }
-
+  TargetInfo(const TargetInfoImpl *TII);
+  
 public:  
   /// CreateTargetInfo - Return the target info object for the specified target
   /// triple.
@@ -128,7 +123,6 @@
   /// getWCharInfo - Return the size of wchar_t in bits.
   ///
   void getWCharInfo(uint64_t &Size, unsigned &Align) {
-    if (!WCharWidth) ComputeWCharInfo();
     Size = WCharWidth;
     Align = WCharAlign;
   }
@@ -232,8 +226,6 @@
     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";
   }
-private:
-  void ComputeWCharInfo();
 };
 
 





More information about the cfe-commits mailing list