remove the string form of printVisibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93609 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 16eec0c..577d173 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -178,21 +178,30 @@
     O << '\n';
     for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
          I != E; ++I) {
-      std::string Name = Mang->getMangledName(I);
+      MCSymbol *Name = GetGlobalValueSymbol(I);
 
       const GlobalValue *GV = cast<GlobalValue>(I->getAliasedGlobal());
-      std::string Target = Mang->getMangledName(GV);
+      MCSymbol *Target = GetGlobalValueSymbol(GV);
 
-      if (I->hasExternalLinkage() || !MAI->getWeakRefDirective())
-        O << "\t.globl\t" << Name << '\n';
-      else if (I->hasWeakLinkage())
-        O << MAI->getWeakRefDirective() << Name << '\n';
-      else if (!I->hasLocalLinkage())
-        llvm_unreachable("Invalid alias linkage");
+      if (I->hasExternalLinkage() || !MAI->getWeakRefDirective()) {
+        O << "\t.globl\t";
+        Name->print(O, MAI);
+        O << '\n';
+      } else if (I->hasWeakLinkage()) {
+        O << MAI->getWeakRefDirective();
+        Name->print(O, MAI);
+        O << '\n';
+      } else {
+        assert(!I->hasLocalLinkage() && "Invalid alias linkage");
+      }
 
       printVisibility(Name, I->getVisibility());
 
-      O << MAI->getSetDirective() << ' ' << Name << ", " << Target << '\n';
+      O << MAI->getSetDirective() << ' ';
+      Name->print(O, MAI);
+      O << ", ";
+      Target->print(O, MAI);
+      O << '\n';
     }
   }
 
@@ -1846,17 +1855,6 @@
   }
 }
 
-void AsmPrinter::printVisibility(const std::string& Name,
-                                 unsigned Visibility) const {
-  if (Visibility == GlobalValue::HiddenVisibility) {
-    if (const char *Directive = MAI->getHiddenDirective())
-      O << Directive << Name << '\n';
-  } else if (Visibility == GlobalValue::ProtectedVisibility) {
-    if (const char *Directive = MAI->getProtectedDirective())
-      O << Directive << Name << '\n';
-  }
-}
-
 void AsmPrinter::printVisibility(const MCSymbol *Sym,
                                  unsigned Visibility) const {
   if (Visibility == GlobalValue::HiddenVisibility) {