]> granicus.if.org Git - clang/commitdiff
eliminate ComputeWCharInfo.
authorChris Lattner <sabre@nondot.org>
Sat, 8 Mar 2008 08:07:34 +0000 (08:07 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 8 Mar 2008 08:07:34 +0000 (08:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48048 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 1f0becee3413c9becef43a046b29b278b24ef6cc..16dad1cc2887184f6155562af075bf5306163540 100644 (file)
@@ -50,6 +50,14 @@ void TargetInfo::getLongDoubleInfo(uint64_t &Size, unsigned &Align,
 
 //===----------------------------------------------------------------------===//
 
+TargetInfo::TargetInfo(const TargetInfoImpl *TII) {
+  Target = TII;
+  
+  // Initialize Cache values to uncomputed.
+  TII->getWCharInfo(WCharWidth, WCharAlign);
+}
+
+
 TargetInfo::~TargetInfo() {
   delete Target;
 }
@@ -68,13 +76,6 @@ void TargetInfo::getTargetDefines(std::vector<char> &Buffer) {
   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
index 2febe6e7daf5d55e908ad89cf8d0b2433c213053..557a7160bb17d6bb0bd006b364a05ba25586a87a 100644 (file)
@@ -42,13 +42,8 @@ class TargetInfo {
   //                  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 @@ public:
   /// 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 @@ public:
     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();
 };