aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-14 23:41:45 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-14 23:41:45 +0000
commitc66bcfd32b941d8008284ecae9d16d7d47c96b0b (patch)
tree14bc681e854c4d1008b37a87b66b2414decf26da
parent56079f7dde1d9c9e16207feffa3f1f888a78ab69 (diff)
Make sure to set the visible on a vtable; VTTs and typeinfo already
handle visibility properly. Fixes <rdar://problem/8091955>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105977 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGVTables.cpp3
-rw-r--r--test/CodeGenCXX/visibility.cpp20
2 files changed, 22 insertions, 1 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp
index 9d8ab5adb0..6abac2609f 100644
--- a/lib/CodeGen/CGVTables.cpp
+++ b/lib/CodeGen/CGVTables.cpp
@@ -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 *
diff --git a/test/CodeGenCXX/visibility.cpp b/test/CodeGenCXX/visibility.cpp
index 5edd27b8b2..ee3c1795fb 100644
--- a/test/CodeGenCXX/visibility.cpp
+++ b/test/CodeGenCXX/visibility.cpp
@@ -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() {}
+}