Revert "In preparation for removing getNameWithPrefix off of
TargetMachine," as it's causing sanitizer/memory issues until I
can track down this set.

This reverts commit r284203

llvm-svn: 284252
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index b8339ee..edaa778 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -301,7 +301,7 @@
 
   if (EmitUniqueSection && UniqueSectionNames) {
     Name.push_back('.');
-    Mang.getNameWithPrefix(Name, GV, false);
+    TM.getNameWithPrefix(Name, GV, Mang, true);
   }
   unsigned UniqueID = MCContext::GenericSectionID;
   if (EmitUniqueSection && !UniqueSectionNames) {
@@ -817,13 +817,6 @@
 void TargetLoweringObjectFileMachO::getNameWithPrefix(
     SmallVectorImpl<char> &OutName, const GlobalValue *GV,
     const TargetMachine &TM) const {
-  if (!GV->hasPrivateLinkage()) {
-    // Simple case: If GV is not private, it is not important to find out if
-    // private labels are legal in this case or not.
-    getMangler().getNameWithPrefix(OutName, GV, false);
-    return;
-  }
-
   SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);
   const MCSection *TheSection = SectionForGlobal(GV, GVKind, TM);
   bool CannotUsePrivateLabel =