summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2016-01-27 01:04:51 +0000
committerJames Y Knight <jyknight@google.com>2016-01-27 01:04:51 +0000
commita3518ad0b7d42cce67e07e7a45206335866c37b8 (patch)
tree38453270d1436d231a7a1970beb2c0fef22f6f1e /clang/lib/Basic/Targets.cpp
parent4de5f98699e3166e07d92f3deb8406f1e6a217de (diff)
downloadbcm5719-llvm-a3518ad0b7d42cce67e07e7a45206335866c37b8.tar.gz
bcm5719-llvm-a3518ad0b7d42cce67e07e7a45206335866c37b8.zip
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...) llvm-svn: 258894
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp53
1 files changed, 31 insertions, 22 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 2f19b88e21e..4bb77a01ec5 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -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 TargetInfo {
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 TargetInfo {
public:
PNaClTargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) {
BigEndian = false;
+ this->UserLabelPrefix = "";
this->LongAlign = 32;
this->LongWidth = 32;
this->PointerAlign = 32;
OpenPOWER on IntegriCloud