Use helper
authorAnton Korobeynikov <asl@math.spbu.ru>
Wed, 24 Sep 2008 22:21:04 +0000 (22:21 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Wed, 24 Sep 2008 22:21:04 +0000 (22:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56584 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index 9ee3b5fb3aae591f60020827e5982a8c742fb498..ef1fca0ea3d984a4a6590f677a7cff92ce6b70f8 100644 (file)
@@ -185,7 +185,7 @@ bool AsmPrinter::doFinalization(Module &M) {
 
       const GlobalValue *GV = cast<GlobalValue>(I->getAliasedGlobal());
       Target = Mang->getValueName(GV);
-      
+
       if (I->hasExternalLinkage() || !TAI->getWeakRefDirective())
         O << "\t.globl\t" << Name << '\n';
       else if (I->hasWeakLinkage())
@@ -193,13 +193,7 @@ bool AsmPrinter::doFinalization(Module &M) {
       else if (!I->hasInternalLinkage())
         assert(0 && "Invalid alias linkage");
 
-      if (I->hasHiddenVisibility()) {
-        if (const char *Directive = TAI->getHiddenDirective())
-          O << Directive << Name << '\n';
-      } else if (I->hasProtectedVisibility()) {
-        if (const char *Directive = TAI->getProtectedDirective())
-          O << Directive << Name << '\n';
-      }
+      printVisibility(Name, I->getVisibility());
 
       O << TAI->getSetDirective() << ' ' << Name << ", " << Target << '\n';