//===----------------------------------------------------------------------===//
+TargetInfo::TargetInfo(const TargetInfoImpl *TII) {
+ Target = TII;
+
+ // Initialize Cache values to uncomputed.
+ TII->getWCharInfo(WCharWidth, WCharAlign);
+}
+
+
TargetInfo::~TargetInfo() {
delete Target;
}
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
// 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.
/// getWCharInfo - Return the size of wchar_t in bits.
///
void getWCharInfo(uint64_t &Size, unsigned &Align) {
- if (!WCharWidth) ComputeWCharInfo();
Size = WCharWidth;
Align = WCharAlign;
}
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();
};