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
diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp
index 9f1aec3..735adce 100644
--- a/lib/Target/ELFTargetAsmInfo.cpp
+++ b/lib/Target/ELFTargetAsmInfo.cpp
@@ -90,13 +90,15 @@
       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 {