Make sure to set the visible on a vtable; VTTs and typeinfo already

handle visibility properly. Fixes <rdar://problem/8091955>. 

llvm-svn: 105977
This commit is contained in:
Douglas Gregor 2010-06-14 23:41:45 +00:00
parent 1726d1517e
commit 4f6e8deec4
2 changed files with 22 additions and 1 deletions

View File

@ -2926,6 +2926,9 @@ CodeGenVTables::EmitVTableDefinition(llvm::GlobalVariable *VTable,
// Set the correct linkage.
VTable->setLinkage(Linkage);
// Set the right visibility.
CGM.setGlobalVisibility(VTable, RD);
}
llvm::GlobalVariable *

View File

@ -5,7 +5,7 @@
#define DEFAULT __attribute__((visibility("default")))
// CHECK: @_ZN5Test425VariableInHiddenNamespaceE = hidden global i32 10
// CHECK: @_ZTVN5Test63fooE = weak_odr hidden constant
namespace Test1 {
// CHECK: define hidden void @_ZN5Test11fEv
void HIDDEN f() { }
@ -64,3 +64,21 @@ namespace Test5 {
void g() { }
}
}
// <rdar://problem/8091955>
namespace Test6 {
struct HIDDEN foo {
foo() { }
void bonk();
virtual void bar() = 0;
virtual void zonk() {}
};
struct barc : public foo {
barc();
virtual void bar();
};
barc::barc() {}
}