Index: cfe/trunk/lib/Basic/TargetInfo.cpp =================================================================== --- cfe/trunk/lib/Basic/TargetInfo.cpp +++ cfe/trunk/lib/Basic/TargetInfo.cpp @@ -72,7 +72,7 @@ DoubleFormat = &llvm::APFloat::IEEEdouble; LongDoubleFormat = &llvm::APFloat::IEEEdouble; DataLayoutString = nullptr; - UserLabelPrefix = "_"; + UserLabelPrefix = ""; MCountName = "mcount"; RegParmMax = 0; SSERegParmMax = 0; Index: cfe/trunk/lib/Basic/Targets.cpp =================================================================== --- cfe/trunk/lib/Basic/Targets.cpp +++ cfe/trunk/lib/Basic/Targets.cpp @@ -102,9 +102,7 @@ public: CloudABITargetInfo(const llvm::Triple &Triple) - : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; - } + : OSTargetInfo(Triple) {} }; static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, @@ -242,6 +240,7 @@ this->TLSSupported = !Triple.isOSVersionLT(2); this->MCountName = "\01mcount"; + this->UserLabelPrefix = "_"; } std::string isValidSectionSpecifier(StringRef SR) const override { @@ -284,8 +283,6 @@ public: DragonFlyBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; - switch (Triple.getArch()) { default: case llvm::Triple::x86: @@ -327,8 +324,6 @@ } public: FreeBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; - switch (Triple.getArch()) { default: case llvm::Triple::x86: @@ -368,9 +363,7 @@ } public: KFreeBSDTargetInfo(const llvm::Triple &Triple) - : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; - } + : OSTargetInfo(Triple) {} }; // Minix Target @@ -392,9 +385,7 @@ DefineStd(Builder, "unix", Opts); } public: - MinixTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; - } + MinixTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) {} }; // Linux target @@ -467,7 +458,6 @@ } public: NetBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; this->MCountName = "_mcount"; } }; @@ -488,7 +478,6 @@ } public: OpenBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; this->TLSSupported = false; switch (Triple.getArch()) { @@ -536,7 +525,6 @@ } public: BitrigTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; this->MCountName = "__mcount"; } }; @@ -554,9 +542,7 @@ Builder.defineMacro("__ELF__"); } public: - PSPTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; - } + PSPTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) {} }; // PS3 PPU Target @@ -576,7 +562,6 @@ } public: PS3PPUTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; this->LongWidth = this->LongAlign = 32; this->PointerWidth = this->PointerAlign = 32; this->IntMaxType = TargetInfo::SignedLongLong; @@ -604,7 +589,6 @@ // On PS4, TLS variable cannot be aligned to more than 32 bytes (256 bits). this->MaxTLSAlign = 256; - this->UserLabelPrefix = ""; switch (Triple.getArch()) { default: @@ -724,7 +708,6 @@ public: NaClTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; this->LongAlign = 32; this->LongWidth = 32; this->PointerAlign = 32; @@ -778,7 +761,6 @@ explicit WebAssemblyOSTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { this->MCountName = "__mcount"; - this->UserLabelPrefix = ""; this->TheCXXABI.set(TargetCXXABI::WebAssembly); } }; @@ -816,6 +798,7 @@ SimdDefaultAlign = 128; LongDoubleWidth = LongDoubleAlign = 128; LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble; + UserLabelPrefix = "_"; } /// \brief Flags for architecture specific defines. @@ -1631,6 +1614,7 @@ NoAsmVariants = true; // Set the default GPU to sm20 GPU = GK_SM20; + UserLabelPrefix = "_"; } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -3671,6 +3655,8 @@ // 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; @@ -3882,7 +3868,6 @@ IntPtrType = SignedLong; PtrDiffType = SignedLong; ProcessIDType = SignedLong; - this->UserLabelPrefix = ""; this->TLSSupported = false; } void getTargetDefines(const LangOptions &Opts, @@ -3929,8 +3914,6 @@ public: RTEMSTargetInfo(const llvm::Triple &Triple) : OSTargetInfo(Triple) { - this->UserLabelPrefix = ""; - switch (Triple.getArch()) { default: case llvm::Triple::x86: @@ -3957,7 +3940,6 @@ SizeType = UnsignedLong; IntPtrType = SignedLong; PtrDiffType = SignedLong; - this->UserLabelPrefix = ""; } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -4005,6 +3987,8 @@ // x86-64 has atomics up to 16 bytes. MaxAtomicPromoteWidth = 128; MaxAtomicInlineWidth = 128; + + UserLabelPrefix = "_"; } BuiltinVaListKind getBuiltinVaListKind() const override { return TargetInfo::X86_64ABIBuiltinVaList; @@ -4060,7 +4044,6 @@ SizeType = UnsignedLongLong; PtrDiffType = SignedLongLong; IntPtrType = SignedLongLong; - this->UserLabelPrefix = ""; } void getTargetDefines(const LangOptions &Opts, @@ -4543,6 +4526,8 @@ // 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; } @@ -5120,7 +5105,6 @@ TLSSupported = false; WCharType = UnsignedShort; SizeType = UnsignedInt; - UserLabelPrefix = ""; } void getVisualStudioDefines(const LangOptions &Opts, MacroBuilder &Builder) const { @@ -5320,6 +5304,8 @@ // AArch64 targets default to using the ARM C++ ABI. TheCXXABI.set(TargetCXXABI::GenericAArch64); + + UserLabelPrefix = "_"; } StringRef getABI() const override { return ABI; } @@ -5844,7 +5830,9 @@ bool SoftFloat; public: SparcTargetInfo(const llvm::Triple &Triple) - : TargetInfo(Triple), SoftFloat(false) {} + : TargetInfo(Triple), SoftFloat(false) { + UserLabelPrefix = "_"; + } bool handleTargetFeatures(std::vector &Features, DiagnosticsEngine &Diags) override { @@ -6145,6 +6133,7 @@ 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 { @@ -6304,6 +6293,7 @@ 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 { @@ -6400,6 +6390,7 @@ "-f64:32-v64:32-v128:32-a:0:32-n32"; AddrSpaceMap = &TCEOpenCLAddrSpaceMap; UseAddrSpaceMapMangling = true; + UserLabelPrefix = "_"; } void getTargetDefines(const LangOptions &Opts, @@ -6502,6 +6493,7 @@ IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat), DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) { TheCXXABI.set(TargetCXXABI::GenericMIPS); + UserLabelPrefix = "_"; } bool isNaN2008Default() const { @@ -7078,7 +7070,6 @@ public: PNaClTargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) { BigEndian = false; - this->UserLabelPrefix = ""; this->LongAlign = 32; this->LongWidth = 32; this->PointerAlign = 32;