From b638e142b4e5ae32087758a37d69c604a26f9dee Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 23 Apr 2015 23:34:51 +0000 Subject: [PATCH] Revert accidentally committed "MC: Allow targets to stop symbol name quoting" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235672 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCAsmInfo.h | 4 ---- include/llvm/MC/MCSymbol.h | 9 ++------- lib/MC/MCAsmInfo.cpp | 1 - lib/MC/MCContext.cpp | 6 ++---- lib/MC/MCSymbol.cpp | 2 +- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h index 5e58320c571..658d77cbddf 100644 --- a/include/llvm/MC/MCAsmInfo.h +++ b/include/llvm/MC/MCAsmInfo.h @@ -155,9 +155,6 @@ protected: /// Defaults to false. bool AllowAtInName; - /// If this is true, symbol names will not attempt to be quoted when printed. - bool NoSymbolNameQuoting; - /// This is true if data region markers should be printed as /// ".data_region/.end_data_region" directives. If false, use "$d/$a" labels /// instead. @@ -455,7 +452,6 @@ public: const char *getCode64Directive() const { return Code64Directive; } unsigned getAssemblerDialect() const { return AssemblerDialect; } bool doesAllowAtInName() const { return AllowAtInName; } - bool noSymbolNameQuoting() const { return NoSymbolNameQuoting; } bool doesSupportDataRegionDirectives() const { return UseDataRegionDirectives; } diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 464fff4fccb..f1c36f54e08 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -55,10 +55,6 @@ namespace llvm { /// "Lfoo" or ".foo". unsigned IsTemporary : 1; - /// True if the name should be quoted if "unacceptable" characters are used - /// in the name. - unsigned NoQuoting : 1; - /// \brief True if this symbol can be redefined. unsigned IsRedefinable : 1; @@ -68,10 +64,9 @@ namespace llvm { private: // MCContext creates and uniques these. friend class MCExpr; friend class MCContext; - MCSymbol(StringRef name, bool isTemporary, bool noQuoting) + MCSymbol(StringRef name, bool isTemporary) : Name(name), Section(nullptr), Value(nullptr), - IsTemporary(isTemporary), NoQuoting(noQuoting), - IsRedefinable(false), IsUsed(false) {} + IsTemporary(isTemporary), IsRedefinable(false), IsUsed(false) {} MCSymbol(const MCSymbol&) = delete; void operator=(const MCSymbol&) = delete; diff --git a/lib/MC/MCAsmInfo.cpp b/lib/MC/MCAsmInfo.cpp index f2d3b2a1855..bad257a961b 100644 --- a/lib/MC/MCAsmInfo.cpp +++ b/lib/MC/MCAsmInfo.cpp @@ -50,7 +50,6 @@ MCAsmInfo::MCAsmInfo() { Code64Directive = ".code64"; AssemblerDialect = 0; AllowAtInName = false; - NoSymbolNameQuoting = false; UseDataRegionDirectives = false; ZeroDirective = "\t.zero\t"; AsciiDirective = "\t.ascii\t"; diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index a43bdc7bfa2..5f8e3c11de3 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -125,8 +125,7 @@ MCSymbol *MCContext::getOrCreateSectionSymbol(const MCSectionELF &Section) { } auto NameIter = UsedNames.insert(std::make_pair(Name, true)).first; - Sym = new (*this) MCSymbol(NameIter->getKey(), /*isTemporary*/ false, - MAI->noSymbolNameQuoting()); + Sym = new (*this) MCSymbol(NameIter->getKey(), /*isTemporary*/ false); if (!OldSym) OldSym = Sym; @@ -164,8 +163,7 @@ MCSymbol *MCContext::CreateSymbol(StringRef Name, bool AlwaysAddSuffix) { // Ok, we found a name. Have the MCSymbol object itself refer to the copy // of the string that is embedded in the UsedNames entry. MCSymbol *Result = - new (*this) MCSymbol(NameEntry.first->getKey(), IsTemporary, - MAI->noSymbolNameQuoting()); + new (*this) MCSymbol(NameEntry.first->getKey(), IsTemporary); return Result; } assert(IsTemporary && "Cannot rename non-temporary symbols"); diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp index 346a9260709..ccb9f8def9e 100644 --- a/lib/MC/MCSymbol.cpp +++ b/lib/MC/MCSymbol.cpp @@ -51,7 +51,7 @@ void MCSymbol::print(raw_ostream &OS) const { // some targets support quoting names with funny characters. If the name // contains a funny character, then print it quoted. StringRef Name = getName(); - if (NoQuoting || !NameNeedsQuoting(Name)) { + if (!NameNeedsQuoting(Name)) { OS << Name; return; } -- 2.34.1