diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-06-14 23:41:45 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-06-14 23:41:45 +0000 |
| commit | 4f6e8deec4cbf0f80158d6d1f535093315f289cc (patch) | |
| tree | 90803d287d4df43054adb8a83ce9b8bfacf09cc4 | |
| parent | 1726d1517e98da838cfd1a91b4e6d90e5b5a4495 (diff) | |
| download | bcm5719-llvm-4f6e8deec4cbf0f80158d6d1f535093315f289cc.tar.gz bcm5719-llvm-4f6e8deec4cbf0f80158d6d1f535093315f289cc.zip | |
Make sure to set the visible on a vtable; VTTs and typeinfo already
handle visibility properly. Fixes <rdar://problem/8091955>.
llvm-svn: 105977
| -rw-r--r-- | clang/lib/CodeGen/CGVTables.cpp | 3 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/visibility.cpp | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp index 9d8ab5adb04..6abac2609f5 100644 --- a/clang/lib/CodeGen/CGVTables.cpp +++ b/clang/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/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp index 5edd27b8b27..ee3c1795fbb 100644 --- a/clang/test/CodeGenCXX/visibility.cpp +++ b/clang/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() {} +} |

