From aa1433ab47cecc14faff1cee7c678c219ce79839 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Tue, 11 Mar 2008 21:41:14 +0000 Subject: [PATCH] Honour aliases visibility during asm emission llvm-svn: 48249 --- lib/CodeGen/AsmPrinter.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 80965020d0d..34394608807 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -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