From 122834dffdac1e0dd2e3dc90d065cc06434e115d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 13 Jul 2015 13:55:18 +0000 Subject: [PATCH] Print the visibility of available_externally functions. We were already printing it for declarations, but not available_externally. llvm-svn: 242027 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 +- test/CodeGen/X86/visibility.ll | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index b574a51251c..125047e7bbb 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1023,7 +1023,7 @@ bool AsmPrinter::doFinalization(Module &M) { // Emit visibility info for declarations for (const Function &F : M) { - if (!F.isDeclaration()) + if (!F.isDeclarationForLinker()) continue; GlobalValue::VisibilityTypes V = F.getVisibility(); if (V == GlobalValue::DefaultVisibility) diff --git a/test/CodeGen/X86/visibility.ll b/test/CodeGen/X86/visibility.ll index 580c3dc9266..be7fd96f2dd 100644 --- a/test/CodeGen/X86/visibility.ll +++ b/test/CodeGen/X86/visibility.ll @@ -2,13 +2,19 @@ @zed = external hidden constant i32 +define available_externally hidden void @baz() { + ret void +} + define hidden void @foo() nounwind { entry: call void @bar(i32* @zed) + call void @baz() ret void } declare hidden void @bar(i32*) ;CHECK: .hidden zed +;CHECK: .hidden baz ;CHECK: .hidden bar