From: Chris Lattner Date: Sat, 8 Mar 2008 08:07:34 +0000 (+0000) Subject: eliminate ComputeWCharInfo. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=390161183919169c493916efac4c1e1b3828fea6;p=clang eliminate ComputeWCharInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48048 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Basic/TargetInfo.cpp b/Basic/TargetInfo.cpp index 1f0becee34..16dad1cc28 100644 --- a/Basic/TargetInfo.cpp +++ b/Basic/TargetInfo.cpp @@ -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 &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 diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 2febe6e7da..557a7160bb 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -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(); };