diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-08 08:07:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-08 08:07:34 +0000 |
commit | 390161183919169c493916efac4c1e1b3828fea6 (patch) | |
tree | 11b756bc9b6d1f932adc1f2e866cfa56b4ebbe6d | |
parent | dfbc9579d7777d1acbfd34828f523b18ce4c326d (diff) |
eliminate ComputeWCharInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48048 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Basic/TargetInfo.cpp | 15 | ||||
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 12 |
2 files changed, 10 insertions, 17 deletions
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<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 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(); }; |