Print the visibility of available_externally functions.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 13 Jul 2015 13:55:18 +0000 (13:55 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 13 Jul 2015 13:55:18 +0000 (13:55 +0000)
We were already printing it for declarations, but not available_externally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242027 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
test/CodeGen/X86/visibility.ll

index b574a51251cd34cf5effe037215f948a364b9b0b..125047e7bbb5a7998f2074f93bf1c54d3c63a5d0 100644 (file)
@@ -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)
index 580c3dc9266d6b7d21062d3a29c5f2a05c9b8a9f..be7fd96f2dd995eee1b3bb2a4262d41646f125b3 100644 (file)
@@ -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