Get MCSymbol out of the mangling business, and move all the logic

to Mangler.  Now MCSymbol just decides whether to slap quotes around
a symbol when printing it.

This also fixes some weirdness where two MCSymbols could be created
for the same symbol, if one needed to be mangled and got mangled to
the other one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-01-17 19:23:46 +00:00
parent c7aa48da3f
commit acd03ae679
6 changed files with 115 additions and 83 deletions

View File

@ -579,18 +579,11 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
// into a 'uniqued' section name, create and return the section now.
if (GV->isWeakForLinker()) {
const char *Prefix = getSectionPrefixForUniqueGlobal(Kind);
SmallString<128> Name, MangledName;
SmallString<128> Name;
Name.append(Prefix, Prefix+strlen(Prefix));
Mang->getNameWithPrefix(Name, GV, false);
raw_svector_ostream OS(MangledName);
MCSymbol::printMangledName(Name, OS, 0);
OS.flush();
return getELFSection(MangledName.str(),
getELFSectionType(MangledName.str(), Kind),
getELFSectionFlags(Kind),
Kind);
return getELFSection(Name.str(), getELFSectionType(Name.str(), Kind),
getELFSectionFlags(Kind), Kind);
}
if (Kind.isText()) return TextSection;