OSDN Git Service

Honour aliases visibility during asm emission
authorAnton Korobeynikov <asl@math.spbu.ru>
Tue, 11 Mar 2008 21:41:14 +0000 (21:41 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Tue, 11 Mar 2008 21:41:14 +0000 (21:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48249 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp

index 8096502..3439460 100644 (file)
@@ -161,7 +161,15 @@ bool AsmPrinter::doFinalization(Module &M) {
         O << TAI->getWeakRefDirective() << Name << "\n";
       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";
+      }
+
       O << TAI->getSetDirective() << ' ' << Name << ", " << Target << "\n";
 
       // If the aliasee has external weak linkage it can be referenced only by