summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-08 04:09:14 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-08 04:09:14 +0000
commit48c6b0d14fc9b88a7a1bfa7e12252c6ad12de4c8 (patch)
tree79cc897a4771a327ca19d1869e3ee6ef5bdaf50e
parentf2c79b6b9ca75424ceeb246c91916728ee3a26fd (diff)
downloadbcm5719-llvm-48c6b0d14fc9b88a7a1bfa7e12252c6ad12de4c8.tar.gz
bcm5719-llvm-48c6b0d14fc9b88a7a1bfa7e12252c6ad12de4c8.zip
Slight tweak to vtable linkage.
llvm-svn: 90832
-rw-r--r--clang/lib/CodeGen/CGVtable.cpp2
-rw-r--r--clang/test/CodeGenCXX/key-function-vtable.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp
index 7efa88b8e14..ef680d927d5 100644
--- a/clang/lib/CodeGen/CGVtable.cpp
+++ b/clang/lib/CodeGen/CGVtable.cpp
@@ -1462,7 +1462,7 @@ void CGVtableInfo::MaybeEmitVtable(GlobalDecl GD) {
llvm::GlobalVariable::LinkageTypes Linkage;
if (RD->isInAnonymousNamespace())
Linkage = llvm::GlobalVariable::InternalLinkage;
- else if (KeyFunction)
+ else if (KeyFunction && !MD->isInlined())
Linkage = llvm::GlobalVariable::ExternalLinkage;
else
Linkage = llvm::GlobalVariable::WeakODRLinkage;
diff --git a/clang/test/CodeGenCXX/key-function-vtable.cpp b/clang/test/CodeGenCXX/key-function-vtable.cpp
index ac88067a78e..e61f33a4cfc 100644
--- a/clang/test/CodeGenCXX/key-function-vtable.cpp
+++ b/clang/test/CodeGenCXX/key-function-vtable.cpp
@@ -35,7 +35,7 @@ testg *testgvar = new testg;
// FIXME: The checks are extremely difficult to get right when the globals
// aren't alphabetized
// CHECK: @_ZTV5testa = constant [3 x i8*] [i8* null
-// CHECK: @_ZTV5testc = constant [3 x i8*] [i8* null
+// CHECK: @_ZTV5testc = weak_odr constant [3 x i8*] [i8* null
// CHECK: @_ZTVN12_GLOBAL__N_15testgE = internal constant [3 x i8*] [i8* null
// CHECK: @_ZTV5teste = weak_odr constant [3 x i8*] [i8* null
// CHECK: @_ZTV5testb = weak_odr constant [3 x i8*] [i8* null
OpenPOWER on IntegriCloud