r258894 - Revert "Change of UserLabelPrefix default value from "_" to """
James Y Knight via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 26 17:04:52 PST 2016
Author: jyknight
Date: Tue Jan 26 19:04:51 2016
New Revision: 258894
URL: http://llvm.org/viewvc/llvm-project?rev=258894&view=rev
Log:
Revert "Change of UserLabelPrefix default value from "_" to """
This reverts commit r258504.
This commit breaks (at least) sparc-rtems -- the OS (RTEMS) used to
override UserLabelPrefix to "", despite the arch (SPARC) having set it
to "_". Now, the OS doesn't override anymore, but the arch sets it to
"_", resulting in the wrong value. I expect this probably breaks other
OSes that overrode to "" before, as well. (Clearly we have some missing
test cases, here...)
Modified:
cfe/trunk/lib/Basic/TargetInfo.cpp
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=258894&r1=258893&r2=258894&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/lib/Basic/TargetInfo.cpp Tue Jan 26 19:04:51 2016
@@ -72,7 +72,7 @@ TargetInfo::TargetInfo(const llvm::Tripl
DoubleFormat = &llvm::APFloat::IEEEdouble;
LongDoubleFormat = &llvm::APFloat::IEEEdouble;
DataLayoutString = nullptr;
- UserLabelPrefix = "";
+ UserLabelPrefix = "_";
MCountName = "mcount";
RegParmMax = 0;
SSERegParmMax = 0;
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=258894&r1=258893&r2=258894&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Jan 26 19:04:51 2016
@@ -102,7 +102,9 @@ protected:
public:
CloudABITargetInfo(const llvm::Triple &Triple)
- : OSTargetInfo<Target>(Triple) {}
+ : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
+ }
};
static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
@@ -240,7 +242,6 @@ public:
this->TLSSupported = !Triple.isOSVersionLT(2);
this->MCountName = "\01mcount";
- this->UserLabelPrefix = "_";
}
std::string isValidSectionSpecifier(StringRef SR) const override {
@@ -283,6 +284,8 @@ protected:
public:
DragonFlyBSDTargetInfo(const llvm::Triple &Triple)
: OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
+
switch (Triple.getArch()) {
default:
case llvm::Triple::x86:
@@ -324,6 +327,8 @@ protected:
}
public:
FreeBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
+
switch (Triple.getArch()) {
default:
case llvm::Triple::x86:
@@ -363,7 +368,9 @@ protected:
}
public:
KFreeBSDTargetInfo(const llvm::Triple &Triple)
- : OSTargetInfo<Target>(Triple) {}
+ : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
+ }
};
// Minix Target
@@ -385,7 +392,9 @@ protected:
DefineStd(Builder, "unix", Opts);
}
public:
- MinixTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {}
+ MinixTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
+ }
};
// Linux target
@@ -458,6 +467,7 @@ protected:
}
public:
NetBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
this->MCountName = "_mcount";
}
};
@@ -478,6 +488,7 @@ protected:
}
public:
OpenBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
this->TLSSupported = false;
switch (Triple.getArch()) {
@@ -525,6 +536,7 @@ protected:
}
public:
BitrigTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
this->MCountName = "__mcount";
}
};
@@ -542,7 +554,9 @@ protected:
Builder.defineMacro("__ELF__");
}
public:
- PSPTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {}
+ PSPTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
+ }
};
// PS3 PPU Target
@@ -562,6 +576,7 @@ 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;
@@ -589,6 +604,7 @@ public:
// On PS4, TLS variable cannot be aligned to more than 32 bytes (256 bits).
this->MaxTLSAlign = 256;
+ this->UserLabelPrefix = "";
switch (Triple.getArch()) {
default:
@@ -708,6 +724,7 @@ protected:
public:
NaClTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
this->LongAlign = 32;
this->LongWidth = 32;
this->PointerAlign = 32;
@@ -761,6 +778,7 @@ public:
explicit WebAssemblyOSTargetInfo(const llvm::Triple &Triple)
: OSTargetInfo<Target>(Triple) {
this->MCountName = "__mcount";
+ this->UserLabelPrefix = "";
this->TheCXXABI.set(TargetCXXABI::WebAssembly);
}
};
@@ -798,7 +816,6 @@ public:
SimdDefaultAlign = 128;
LongDoubleWidth = LongDoubleAlign = 128;
LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble;
- UserLabelPrefix = "_";
}
/// \brief Flags for architecture specific defines.
@@ -1614,7 +1631,6 @@ public:
NoAsmVariants = true;
// Set the default GPU to sm20
GPU = GK_SM20;
- UserLabelPrefix = "_";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
@@ -3655,8 +3671,6 @@ public:
// FIXME: Check that we actually have cmpxchg8b before setting
// MaxAtomicInlineWidth. (cmpxchg8b is an i586 instruction.)
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
-
- UserLabelPrefix = "_";
}
BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::CharPtrBuiltinVaList;
@@ -3868,6 +3882,7 @@ public:
IntPtrType = SignedLong;
PtrDiffType = SignedLong;
ProcessIDType = SignedLong;
+ this->UserLabelPrefix = "";
this->TLSSupported = false;
}
void getTargetDefines(const LangOptions &Opts,
@@ -3914,6 +3929,8 @@ protected:
public:
RTEMSTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
+ this->UserLabelPrefix = "";
+
switch (Triple.getArch()) {
default:
case llvm::Triple::x86:
@@ -3940,6 +3957,7 @@ public:
SizeType = UnsignedLong;
IntPtrType = SignedLong;
PtrDiffType = SignedLong;
+ this->UserLabelPrefix = "";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
@@ -3987,8 +4005,6 @@ public:
// x86-64 has atomics up to 16 bytes.
MaxAtomicPromoteWidth = 128;
MaxAtomicInlineWidth = 128;
-
- UserLabelPrefix = "_";
}
BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::X86_64ABIBuiltinVaList;
@@ -4044,6 +4060,7 @@ public:
SizeType = UnsignedLongLong;
PtrDiffType = SignedLongLong;
IntPtrType = SignedLongLong;
+ this->UserLabelPrefix = "";
}
void getTargetDefines(const LangOptions &Opts,
@@ -4526,8 +4543,6 @@ public:
// that follows it, `bar', `bar' will be aligned as the type of the
// zero length bitfield.
UseZeroLengthBitfieldAlignment = true;
-
- UserLabelPrefix = "_";
}
StringRef getABI() const override { return ABI; }
@@ -5105,6 +5120,7 @@ public:
TLSSupported = false;
WCharType = UnsignedShort;
SizeType = UnsignedInt;
+ UserLabelPrefix = "";
}
void getVisualStudioDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
@@ -5304,8 +5320,6 @@ public:
// AArch64 targets default to using the ARM C++ ABI.
TheCXXABI.set(TargetCXXABI::GenericAArch64);
-
- UserLabelPrefix = "_";
}
StringRef getABI() const override { return ABI; }
@@ -5830,9 +5844,7 @@ class SparcTargetInfo : public TargetInf
bool SoftFloat;
public:
SparcTargetInfo(const llvm::Triple &Triple)
- : TargetInfo(Triple), SoftFloat(false) {
- UserLabelPrefix = "_";
- }
+ : TargetInfo(Triple), SoftFloat(false) {}
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override {
@@ -6133,7 +6145,6 @@ public:
MinGlobalAlign = 16;
DataLayoutString = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64";
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
- UserLabelPrefix = "_";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
@@ -6293,7 +6304,6 @@ public:
PtrDiffType = SignedInt;
SigAtomicType = SignedLong;
DataLayoutString = "e-m:e-p:16:16-i32:16:32-a:16-n8:16";
- UserLabelPrefix = "_";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
@@ -6390,7 +6400,6 @@ public:
"-f64:32-v64:32-v128:32-a:0:32-n32";
AddrSpaceMap = &TCEOpenCLAddrSpaceMap;
UseAddrSpaceMapMangling = true;
- UserLabelPrefix = "_";
}
void getTargetDefines(const LangOptions &Opts,
@@ -6493,7 +6502,6 @@ public:
IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat),
DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {
TheCXXABI.set(TargetCXXABI::GenericMIPS);
- UserLabelPrefix = "_";
}
bool isNaN2008Default() const {
@@ -7070,6 +7078,7 @@ class PNaClTargetInfo : public TargetInf
public:
PNaClTargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) {
BigEndian = false;
+ this->UserLabelPrefix = "";
this->LongAlign = 32;
this->LongWidth = 32;
this->PointerAlign = 32;
More information about the cfe-commits
mailing list