MC: Allow targets to stop symbol name quoting

Currently symbol names are printed in quotes if it contains something
outside of the arbitrary set of characters that isAcceptableChar tests
for. On somem targets, it is never OK to print a symbol name in quotes
so allow targets to opt out of this behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235670 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault
2015-04-23 23:34:05 +00:00
parent 589d8fd65d
commit 6ec2992aca
5 changed files with 17 additions and 5 deletions

View File

@@ -125,7 +125,8 @@ MCSymbol *MCContext::getOrCreateSectionSymbol(const MCSectionELF &Section) {
}
auto NameIter = UsedNames.insert(std::make_pair(Name, true)).first;
Sym = new (*this) MCSymbol(NameIter->getKey(), /*isTemporary*/ false);
Sym = new (*this) MCSymbol(NameIter->getKey(), /*isTemporary*/ false,
MAI->noSymbolNameQuoting());
if (!OldSym)
OldSym = Sym;
@@ -163,7 +164,8 @@ 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);
new (*this) MCSymbol(NameEntry.first->getKey(), IsTemporary,
MAI->noSymbolNameQuoting());
return Result;
}
assert(IsTemporary && "Cannot rename non-temporary symbols");