]> granicus.if.org Git - clang/commitdiff
Slight tweak to vtable linkage.
authorEli Friedman <eli.friedman@gmail.com>
Tue, 8 Dec 2009 04:09:14 +0000 (04:09 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 8 Dec 2009 04:09:14 +0000 (04:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90832 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp
test/CodeGenCXX/key-function-vtable.cpp

index 7efa88b8e144082d2352838ce98a0941d7344ea6..ef680d927d5be2b1120394594159945c072794a5 100644 (file)
@@ -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;
index ac88067a78e1a1414d9ebc530d58d77264706b46..e61f33a4cfc3afc1cec86781a4be12d103f68564 100644 (file)
@@ -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