diff options
author | James Y Knight <jyknight@google.com> | 2016-03-04 19:00:41 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2016-03-04 19:00:41 +0000 |
commit | b214cbc7852fa1719c5d0bd3ccb9615481e03c55 (patch) | |
tree | e5fe189f5192242789a8887dcf64d3af79258831 /clang/lib/Basic/Targets.cpp | |
parent | 31f251f1f0acae8864d08a07be4b190cea2ed4b5 (diff) | |
download | bcm5719-llvm-b214cbc7852fa1719c5d0bd3ccb9615481e03c55.tar.gz bcm5719-llvm-b214cbc7852fa1719c5d0bd3ccb9615481e03c55.zip |
Make TargetInfo store an actual DataLayout instead of a string.
Use it to calculate UserLabelPrefix, instead of specifying it (often
incorrectly).
Note that the *actual* user label prefix has always come from the
DataLayout, and is handled within LLVM. The main thing clang's
TargetInfo::UserLabelPrefix did was to set the #define value. Having
these be different from each-other is just silly.
Differential Revision: http://reviews.llvm.org/D17183
llvm-svn: 262737
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 222 |
1 files changed, 95 insertions, 127 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index db86b93f088..4a9b6dc4d5b 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -102,9 +102,7 @@ protected: public: CloudABITargetInfo(const llvm::Triple &Triple) - : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; - } + : OSTargetInfo<Target>(Triple) {} }; static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, @@ -284,8 +282,6 @@ protected: public: DragonFlyBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; - switch (Triple.getArch()) { default: case llvm::Triple::x86: @@ -327,8 +323,6 @@ protected: } public: FreeBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; - switch (Triple.getArch()) { default: case llvm::Triple::x86: @@ -368,9 +362,7 @@ protected: } public: KFreeBSDTargetInfo(const llvm::Triple &Triple) - : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; - } + : OSTargetInfo<Target>(Triple) {} }; // Minix Target @@ -392,9 +384,7 @@ protected: DefineStd(Builder, "unix", Opts); } public: - MinixTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; - } + MinixTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {} }; // Linux target @@ -422,7 +412,6 @@ protected: } public: LinuxTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; this->WIntType = TargetInfo::UnsignedInt; switch (Triple.getArch()) { @@ -467,7 +456,6 @@ protected: } public: NetBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; this->MCountName = "_mcount"; } }; @@ -488,7 +476,6 @@ protected: } public: OpenBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; this->TLSSupported = false; switch (Triple.getArch()) { @@ -536,7 +523,6 @@ protected: } public: BitrigTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; this->MCountName = "__mcount"; } }; @@ -554,9 +540,7 @@ protected: Builder.defineMacro("__ELF__"); } public: - PSPTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; - } + PSPTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {} }; // PS3 PPU Target @@ -576,13 +560,12 @@ protected: } public: PS3PPUTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; this->LongWidth = this->LongAlign = 32; this->PointerWidth = this->PointerAlign = 32; this->IntMaxType = TargetInfo::SignedLongLong; this->Int64Type = TargetInfo::SignedLongLong; this->SizeType = TargetInfo::UnsignedInt; - this->DataLayoutString = "E-m:e-p:32:32-i64:64-n32:64"; + this->resetDataLayout("E-m:e-p:32:32-i64:64-n32:64"); } }; @@ -604,7 +587,6 @@ public: // On PS4, TLS variable cannot be aligned to more than 32 bytes (256 bits). this->MaxTLSAlign = 256; - this->UserLabelPrefix = ""; // On PS4, do not honor explicit bit field alignment, // as in "__attribute__((aligned(2))) int b : 1;". @@ -647,7 +629,6 @@ protected: } public: SolarisTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; this->WCharType = this->SignedInt; // FIXME: WIntType should be SignedLong } @@ -728,7 +709,6 @@ protected: public: NaClTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; this->LongAlign = 32; this->LongWidth = 32; this->PointerAlign = 32; @@ -748,14 +728,14 @@ public: if (Triple.getArch() == llvm::Triple::arm) { // Handled in ARM's setABI(). } else if (Triple.getArch() == llvm::Triple::x86) { - this->DataLayoutString = "e-m:e-p:32:32-i64:64-n8:16:32-S128"; + this->resetDataLayout("e-m:e-p:32:32-i64:64-n8:16:32-S128"); } else if (Triple.getArch() == llvm::Triple::x86_64) { - this->DataLayoutString = "e-m:e-p:32:32-i64:64-n8:16:32:64-S128"; + this->resetDataLayout("e-m:e-p:32:32-i64:64-n8:16:32:64-S128"); } else if (Triple.getArch() == llvm::Triple::mipsel) { - // Handled on mips' setDataLayoutString. + // Handled on mips' setDataLayout. } else { assert(Triple.getArch() == llvm::Triple::le32); - this->DataLayoutString = "e-p:32:32-i64:64"; + this->resetDataLayout("e-p:32:32-i64:64"); } } }; @@ -782,7 +762,6 @@ public: explicit WebAssemblyOSTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { this->MCountName = "__mcount"; - this->UserLabelPrefix = ""; this->TheCXXABI.set(TargetCXXABI::WebAssembly); } }; @@ -1495,7 +1474,7 @@ ArrayRef<TargetInfo::GCCRegAlias> PPCTargetInfo::getGCCRegAliases() const { class PPC32TargetInfo : public PPCTargetInfo { public: PPC32TargetInfo(const llvm::Triple &Triple) : PPCTargetInfo(Triple) { - DataLayoutString = "E-m:e-p:32:32-i64:64-n32"; + resetDataLayout("E-m:e-p:32:32-i64:64-n32"); switch (getTriple().getOS()) { case llvm::Triple::Linux: @@ -1534,10 +1513,10 @@ public: Int64Type = SignedLong; if ((Triple.getArch() == llvm::Triple::ppc64le)) { - DataLayoutString = "e-m:e-i64:64-n32:64"; + resetDataLayout("e-m:e-i64:64-n32:64"); ABI = "elfv2"; } else { - DataLayoutString = "E-m:e-i64:64-n32:64"; + resetDataLayout("E-m:e-i64:64-n32:64"); ABI = "elfv1"; } @@ -1580,7 +1559,7 @@ public: PtrDiffType = SignedInt; // for http://llvm.org/bugs/show_bug.cgi?id=15726 LongLongAlign = 32; SuitableAlign = 128; - DataLayoutString = "E-m:o-p:32:32-f64:32:64-n32"; + resetDataLayout("E-m:o-p:32:32-f64:32:64-n32"); } BuiltinVaListKind getBuiltinVaListKind() const override { return TargetInfo::CharPtrBuiltinVaList; @@ -1594,7 +1573,7 @@ public: : DarwinTargetInfo<PPC64TargetInfo>(Triple) { HasAlignMac68kSupport = true; SuitableAlign = 128; - DataLayoutString = "E-m:o-i64:64-n32:64"; + resetDataLayout("E-m:o-i64:64-n32:64"); } }; @@ -1736,7 +1715,7 @@ public: SizeType = TargetInfo::UnsignedInt; PtrDiffType = TargetInfo::SignedInt; IntPtrType = TargetInfo::SignedInt; - DataLayoutString = "e-p:32:32-i64:64-v16:16-v32:32-n16:32:64"; + resetDataLayout("e-p:32:32-i64:64-v16:16-v32:32-n16:32:64"); } }; @@ -1747,7 +1726,7 @@ public: SizeType = TargetInfo::UnsignedLong; PtrDiffType = TargetInfo::SignedLong; IntPtrType = TargetInfo::SignedLong; - DataLayoutString = "e-i64:64-v16:16-v32:32-n16:32:64"; + resetDataLayout("e-i64:64-v16:16-v32:32-n16:32:64"); } }; @@ -1806,13 +1785,13 @@ public: : TargetInfo(Triple) { if (Triple.getArch() == llvm::Triple::amdgcn) { - DataLayoutString = DataLayoutStringSI; + resetDataLayout(DataLayoutStringSI); GPU = GK_SOUTHERN_ISLANDS; hasFP64 = true; hasFMAF = true; hasLDEXPF = true; } else { - DataLayoutString = DataLayoutStringR600; + resetDataLayout(DataLayoutStringR600); GPU = GK_R600; hasFP64 = false; hasFMAF = false; @@ -1946,7 +1925,7 @@ public: case GK_R700: case GK_EVERGREEN: case GK_NORTHERN_ISLANDS: - DataLayoutString = DataLayoutStringR600; + resetDataLayout(DataLayoutStringR600); hasFP64 = false; hasFMAF = false; hasLDEXPF = false; @@ -1955,7 +1934,7 @@ public: case GK_R700_DOUBLE_OPS: case GK_EVERGREEN_DOUBLE_OPS: case GK_CAYMAN: - DataLayoutString = DataLayoutStringR600DoubleOps; + resetDataLayout(DataLayoutStringR600DoubleOps); hasFP64 = true; hasFMAF = true; hasLDEXPF = false; @@ -1963,7 +1942,7 @@ public: case GK_SOUTHERN_ISLANDS: case GK_SEA_ISLANDS: case GK_VOLCANIC_ISLANDS: - DataLayoutString = DataLayoutStringSI; + resetDataLayout(DataLayoutStringSI); hasFP64 = true; hasFMAF = true; hasLDEXPF = true; @@ -3749,7 +3728,7 @@ public: LongDoubleWidth = 96; LongDoubleAlign = 32; SuitableAlign = 128; - DataLayoutString = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"; + resetDataLayout("e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"); SizeType = UnsignedInt; PtrDiffType = SignedInt; IntPtrType = SignedInt; @@ -3846,7 +3825,7 @@ public: UseSignedCharForObjCBool = false; SizeType = UnsignedLong; IntPtrType = SignedLong; - DataLayoutString = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"; + resetDataLayout("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"); HasAlignMac68kSupport = true; } @@ -3871,9 +3850,9 @@ public: DoubleAlign = LongLongAlign = 64; bool IsWinCOFF = getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF(); - DataLayoutString = IsWinCOFF - ? "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" - : "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"; + resetDataLayout(IsWinCOFF + ? "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" + : "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -3952,7 +3931,7 @@ public: : X86_32TargetInfo(Triple) { WCharType = UnsignedShort; DoubleAlign = LongLongAlign = 64; - DataLayoutString = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"; + resetDataLayout("e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -3975,7 +3954,6 @@ public: IntPtrType = SignedLong; PtrDiffType = SignedLong; ProcessIDType = SignedLong; - this->UserLabelPrefix = ""; this->TLSSupported = false; } void getTargetDefines(const LangOptions &Opts, @@ -3992,9 +3970,7 @@ public: MCUX86_32TargetInfo(const llvm::Triple &Triple) : X86_32TargetInfo(Triple) { LongDoubleWidth = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble; - DataLayoutString = - "e-m:e-p:32:32-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32"; - UserLabelPrefix = ""; + resetDataLayout("e-m:e-p:32:32-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32"); WIntType = UnsignedInt; } @@ -4029,8 +4005,6 @@ protected: public: RTEMSTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) { - this->UserLabelPrefix = ""; - switch (Triple.getArch()) { default: case llvm::Triple::x86: @@ -4057,7 +4031,6 @@ public: SizeType = UnsignedLong; IntPtrType = SignedLong; PtrDiffType = SignedLong; - this->UserLabelPrefix = ""; } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -4088,10 +4061,10 @@ public: RegParmMax = 6; // Pointers are 32-bit in x32. - DataLayoutString = IsX32 ? "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128" - : IsWinCOFF - ? "e-m:w-i64:64-f80:128-n8:16:32:64-S128" - : "e-m:e-i64:64-f80:128-n8:16:32:64-S128"; + resetDataLayout(IsX32 + ? "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128" + : IsWinCOFF ? "e-m:w-i64:64-f80:128-n8:16:32:64-S128" + : "e-m:e-i64:64-f80:128-n8:16:32:64-S128"); // Use fpret only for long double. RealTypeUsesObjCFPRet = (1 << TargetInfo::LongDouble); @@ -4168,7 +4141,6 @@ public: SizeType = UnsignedLongLong; PtrDiffType = SignedLongLong; IntPtrType = SignedLongLong; - this->UserLabelPrefix = ""; } void getTargetDefines(const LangOptions &Opts, @@ -4246,7 +4218,6 @@ public: : X86_64TargetInfo(Triple) { TLSSupported = false; WCharType = UnsignedShort; - UserLabelPrefix = ""; } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -4274,7 +4245,7 @@ public: llvm::Triple T = llvm::Triple(Triple); if (T.isiOS()) UseSignedCharForObjCBool = false; - DataLayoutString = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"; + resetDataLayout("e-m:o-i64:64-f80:128-n8:16:32:64-S128"); } bool handleTargetFeatures(std::vector<std::string> &Features, @@ -4413,26 +4384,26 @@ class ARMTargetInfo : public TargetInfo { // Thumb1 add sp, #imm requires the immediate value be multiple of 4, // so set preferred for small types to 32. if (T.isOSBinFormatMachO()) { - DataLayoutString = - BigEndian ? "E-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" - : "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"; + resetDataLayout(BigEndian + ? "E-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" + : "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"); } else if (T.isOSWindows()) { assert(!BigEndian && "Windows on ARM does not support big endian"); - DataLayoutString = "e" - "-m:w" - "-p:32:32" - "-i64:64" - "-v128:64:128" - "-a:0:32" - "-n32" - "-S64"; + resetDataLayout("e" + "-m:w" + "-p:32:32" + "-i64:64" + "-v128:64:128" + "-a:0:32" + "-n32" + "-S64"); } else if (T.isOSNaCl()) { assert(!BigEndian && "NaCl on ARM does not support big endian"); - DataLayoutString = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S128"; + resetDataLayout("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S128"); } else { - DataLayoutString = - BigEndian ? "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" - : "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"; + resetDataLayout(BigEndian + ? "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" + : "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"); } // FIXME: Enumerated types are variable width in straight AAPCS. @@ -4468,17 +4439,17 @@ class ARMTargetInfo : public TargetInfo { if (T.isOSBinFormatMachO() && IsAAPCS16) { assert(!BigEndian && "AAPCS16 does not support big-endian"); - DataLayoutString = "e-m:o-p:32:32-i64:64-a:0:32-n32-S128"; + resetDataLayout("e-m:o-p:32:32-i64:64-a:0:32-n32-S128"); } else if (T.isOSBinFormatMachO()) - DataLayoutString = + resetDataLayout( BigEndian ? "E-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" - : "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"; + : "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"); else - DataLayoutString = + resetDataLayout( BigEndian ? "E-m:e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" - : "e-m:e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"; + : "e-m:e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"); // FIXME: Override "preferred align" for double and long long. } @@ -5243,7 +5214,6 @@ public: : WindowsTargetInfo<ARMleTargetInfo>(Triple), Triple(Triple) { WCharType = UnsignedShort; SizeType = UnsignedInt; - UserLabelPrefix = ""; } void getVisualStudioDefines(const LangOptions &Opts, MacroBuilder &Builder) const { @@ -5339,7 +5309,7 @@ public: TLSSupported = false; WCharType = UnsignedShort; DoubleAlign = LongLongAlign = 64; - DataLayoutString = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"; + resetDataLayout("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -5386,7 +5356,7 @@ public: }; class AArch64TargetInfo : public TargetInfo { - virtual void setDataLayoutString() = 0; + virtual void setDataLayout() = 0; static const TargetInfo::GCCRegAlias GCCRegAliases[]; static const char *const GCCRegNames[]; @@ -5567,7 +5537,7 @@ public: V8_1A = 1; } - setDataLayoutString(); + setDataLayout(); return true; } @@ -5727,11 +5697,11 @@ const Builtin::Info AArch64TargetInfo::BuiltinInfo[] = { }; class AArch64leTargetInfo : public AArch64TargetInfo { - void setDataLayoutString() override { + void setDataLayout() override { if (getTriple().isOSBinFormatMachO()) - DataLayoutString = "e-m:o-i64:64-i128:128-n32:64-S128"; + resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128"); else - DataLayoutString = "e-m:e-i64:64-i128:128-n32:64-S128"; + resetDataLayout("e-m:e-i64:64-i128:128-n32:64-S128"); } public: @@ -5747,9 +5717,9 @@ public: }; class AArch64beTargetInfo : public AArch64TargetInfo { - void setDataLayoutString() override { + void setDataLayout() override { assert(!getTriple().isOSBinFormatMachO()); - DataLayoutString = "E-m:e-i64:64-i128:128-n32:64-S128"; + resetDataLayout("E-m:e-i64:64-i128:128-n32:64-S128"); } public: @@ -5811,9 +5781,9 @@ public: // Specify the vector alignment explicitly. For v512x1, the calculated // alignment would be 512*alignment(i1), which is 512 bytes, instead of // the required minimum of 64 bytes. - DataLayoutString = "e-m:e-p:32:32:32-a:0-n16:32-" + resetDataLayout("e-m:e-p:32:32:32-a:0-n16:32-" "i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-" - "v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"; + "v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"); SizeType = UnsignedInt; PtrDiffType = SignedInt; IntPtrType = SignedInt; @@ -6168,7 +6138,7 @@ ArrayRef<TargetInfo::GCCRegAlias> SparcTargetInfo::getGCCRegAliases() const { class SparcV8TargetInfo : public SparcTargetInfo { public: SparcV8TargetInfo(const llvm::Triple &Triple) : SparcTargetInfo(Triple) { - DataLayoutString = "E-m:e-p:32:32-i64:64-f128:64-n32-S64"; + resetDataLayout("E-m:e-p:32:32-i64:64-f128:64-n32-S64"); // NetBSD / OpenBSD use long (same as llvm default); everyone else uses int. switch (getTriple().getOS()) { default: @@ -6209,7 +6179,7 @@ public: class SparcV8elTargetInfo : public SparcV8TargetInfo { public: SparcV8elTargetInfo(const llvm::Triple &Triple) : SparcV8TargetInfo(Triple) { - DataLayoutString = "e-m:e-p:32:32-i64:64-f128:64-n32-S64"; + resetDataLayout("e-m:e-p:32:32-i64:64-f128:64-n32-S64"); BigEndian = false; } }; @@ -6219,7 +6189,7 @@ class SparcV9TargetInfo : public SparcTargetInfo { public: SparcV9TargetInfo(const llvm::Triple &Triple) : SparcTargetInfo(Triple) { // FIXME: Support Sparc quad-precision long double? - DataLayoutString = "E-m:e-i64:64-n32:64-S128"; + resetDataLayout("E-m:e-i64:64-n32:64-S128"); // This is an LP64 platform. LongWidth = LongAlign = PointerWidth = PointerAlign = 64; @@ -6280,7 +6250,7 @@ public: LongDoubleFormat = &llvm::APFloat::IEEEquad; DefaultAlignForAttributeAligned = 64; MinGlobalAlign = 16; - DataLayoutString = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"; + resetDataLayout("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"); MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; } void getTargetDefines(const LangOptions &Opts, @@ -6355,8 +6325,8 @@ public: // If we use the vector ABI, vector types are 64-bit aligned. if (HasVector) { MaxVectorAlign = 64; - DataLayoutString = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64" - "-v128:64-a:8:16-n32:64"; + resetDataLayout("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64" + "-v128:64-a:8:16-n32:64"); } return true; } @@ -6446,7 +6416,7 @@ public: IntPtrType = SignedInt; PtrDiffType = SignedInt; SigAtomicType = SignedLong; - DataLayoutString = "e-m:e-p:16:16-i32:16:32-a:16-n8:16"; + resetDataLayout("e-m:e-p:16:16-i32:16:32-a:16-n8:16"); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -6539,8 +6509,8 @@ public: FloatFormat = &llvm::APFloat::IEEEsingle; DoubleFormat = &llvm::APFloat::IEEEsingle; LongDoubleFormat = &llvm::APFloat::IEEEsingle; - DataLayoutString = "E-p:32:32-i8:8:32-i16:16:32-i64:32" - "-f64:32-v64:32-v128:32-a:0:32-n32"; + resetDataLayout("E-p:32:32-i8:8:32-i16:16:32-i64:32" + "-f64:32-v64:32-v128:32-a:0:32-n32"); AddrSpaceMap = &TCEOpenCLAddrSpaceMap; UseAddrSpaceMapMangling = true; } @@ -6580,10 +6550,10 @@ public: RegParmMax = 5; if (Triple.getArch() == llvm::Triple::bpfeb) { BigEndian = true; - DataLayoutString = "E-m:e-p:64:64-i64:64-n32:64-S128"; + resetDataLayout("E-m:e-p:64:64-i64:64-n32:64-S128"); } else { BigEndian = false; - DataLayoutString = "e-m:e-p:64:64-i64:64-n32:64-S128"; + resetDataLayout("e-m:e-p:64:64-i64:64-n32:64-S128"); } MaxAtomicPromoteWidth = 64; MaxAtomicInlineWidth = 64; @@ -6618,7 +6588,7 @@ public: }; class MipsTargetInfoBase : public TargetInfo { - virtual void setDataLayoutString() = 0; + virtual void setDataLayout() = 0; static const Builtin::Info BuiltinInfo[]; std::string CPU; @@ -6914,7 +6884,7 @@ public: IsNan2008 = false; } - setDataLayoutString(); + setDataLayout(); return true; } @@ -7021,8 +6991,8 @@ public: }; class Mips32EBTargetInfo : public Mips32TargetInfoBase { - void setDataLayoutString() override { - DataLayoutString = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"; + void setDataLayout() override { + resetDataLayout("E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"); } public: @@ -7038,8 +7008,8 @@ public: }; class Mips32ELTargetInfo : public Mips32TargetInfoBase { - void setDataLayoutString() override { - DataLayoutString = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"; + void setDataLayout() override { + resetDataLayout("e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"); } public: @@ -7179,12 +7149,11 @@ public: }; class Mips64EBTargetInfo : public Mips64TargetInfoBase { - void setDataLayoutString() override { + void setDataLayout() override { if (ABI == "n32") - DataLayoutString = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128"; + resetDataLayout("E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128"); else - DataLayoutString = "E-m:m-i8:8:32-i16:16:32-i64:64-n32:64-S128"; - + resetDataLayout("E-m:m-i8:8:32-i16:16:32-i64:64-n32:64-S128"); } public: @@ -7199,11 +7168,11 @@ public: }; class Mips64ELTargetInfo : public Mips64TargetInfoBase { - void setDataLayoutString() override { + void setDataLayout() override { if (ABI == "n32") - DataLayoutString = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128"; + resetDataLayout("e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128"); else - DataLayoutString = "e-m:m-i8:8:32-i16:16:32-i64:64-n32:64-S128"; + resetDataLayout("e-m:m-i8:8:32-i16:16:32-i64:64-n32:64-S128"); } public: Mips64ELTargetInfo(const llvm::Triple &Triple) @@ -7223,7 +7192,6 @@ class PNaClTargetInfo : public TargetInfo { public: PNaClTargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) { BigEndian = false; - this->UserLabelPrefix = ""; this->LongAlign = 32; this->LongWidth = 32; this->PointerAlign = 32; @@ -7295,7 +7263,7 @@ public: NoAsmVariants = true; LongWidth = LongAlign = PointerWidth = PointerAlign = 64; MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; - DataLayoutString = "e-m:e-v128:32-v16:16-v32:32-v96:32-n8:16:32:64-S128"; + resetDataLayout("e-m:e-v128:32-v16:16-v32:32-v96:32-n8:16:32:64-S128"); } void getTargetDefines(const LangOptions &Opts, @@ -7444,7 +7412,7 @@ public: explicit WebAssembly32TargetInfo(const llvm::Triple &T) : WebAssemblyTargetInfo(T) { MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; - DataLayoutString = "e-m:e-p:32:32-i64:64-n32:64-S128"; + resetDataLayout("e-m:e-p:32:32-i64:64-n32:64-S128"); } protected: @@ -7462,7 +7430,7 @@ public: LongAlign = LongWidth = 64; PointerAlign = PointerWidth = 64; MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; - DataLayoutString = "e-m:e-p:64:64-i64:64-n32:64-S128"; + resetDataLayout("e-m:e-p:64:64-i64:64-n32:64-S128"); } protected: @@ -7542,8 +7510,8 @@ public: PointerWidth = PointerAlign = 32; SizeType = TargetInfo::UnsignedInt; PtrDiffType = IntPtrType = TargetInfo::SignedInt; - DataLayoutString = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-" - "v96:128-v192:256-v256:256-v512:512-v1024:1024"; + resetDataLayout("e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-" + "v96:128-v192:256-v256:256-v512:512-v1024:1024"); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -7557,8 +7525,8 @@ public: PointerWidth = PointerAlign = 64; SizeType = TargetInfo::UnsignedLong; PtrDiffType = IntPtrType = TargetInfo::SignedLong; - DataLayoutString = "e-i64:64-v16:16-v24:32-v32:32-v48:64-" - "v96:128-v192:256-v256:256-v512:512-v1024:1024"; + resetDataLayout("e-i64:64-v16:16-v24:32-v32:32-v48:64-" + "v96:128-v192:256-v256:256-v512:512-v1024:1024"); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -7581,8 +7549,8 @@ public: WCharType = UnsignedChar; WIntType = UnsignedInt; UseZeroLengthBitfieldAlignment = true; - DataLayoutString = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32" - "-f64:32-a:0:32-n32"; + resetDataLayout("e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32" + "-f64:32-a:0:32-n32"); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { |