Replace UniqueSectionForGlobal with getSectionPrefixForUniqueGlobal.

The later doesn't depend on any crazy LLVM IR stuff, and this
pulls the concatenation of prefix with GV name (the root problem behind
PR4584) out one level.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-07-24 04:49:34 +00:00
parent 837f332372
commit 55acc6807f
7 changed files with 49 additions and 67 deletions

View File

@@ -90,13 +90,15 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
case Function::WeakODRLinkage:
case Function::LinkOnceAnyLinkage:
case Function::LinkOnceODRLinkage:
std::string Name = UniqueSectionForGlobal(GV, Kind);
// FIXME: Use mangler interface (PR4584).
std::string Name = getSectionPrefixForUniqueGlobal(Kind)+GV->getName();
unsigned Flags = SectionFlagsForGlobal(GV, Name.c_str());
return getNamedSection(Name.c_str(), Flags);
}
} else if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
if (GVar->isWeakForLinker()) {
std::string Name = UniqueSectionForGlobal(GVar, Kind);
// FIXME: Use mangler interface (PR4584).
std::string Name = getSectionPrefixForUniqueGlobal(Kind)+GV->getName();
unsigned Flags = SectionFlagsForGlobal(GVar, Name.c_str());
return getNamedSection(Name.c_str(), Flags);
} else {