Sink getSectionPrefixForUniqueGlobal down into the TAI

implementations that need it, rearrange ELFTAI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-07-27 19:14:14 +00:00
parent fa199f3c16
commit 3b07b5214c
6 changed files with 155 additions and 126 deletions

View File

@@ -319,15 +319,6 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
return getOrCreateSection(GV->getSection().c_str(), false, GVKind);
}
// If this global is linkonce/weak and the target handles this by emitting it
// into a 'uniqued' section name, create and return the section now.
if (Kind.isWeak()) {
if (const char *Prefix = getSectionPrefixForUniqueGlobal(Kind)) {
// FIXME: Use mangler interface (PR4584).
std::string Name = Prefix+GV->getNameStr();
return getOrCreateSection(Name.c_str(), false, GVKind);
}
}
// Use default section depending on the 'type' of global
return SelectSectionForGlobal(GV, Kind);