[cfe-commits] r90832 - in /cfe/trunk: lib/CodeGen/CGVtable.cpp test/CodeGenCXX/key-function-vtable.cpp

Eli Friedman eli.friedman at gmail.com
Mon Dec 7 20:09:15 PST 2009


Author: efriedma
Date: Mon Dec  7 22:09:14 2009
New Revision: 90832

URL: http://llvm.org/viewvc/llvm-project?rev=90832&view=rev
Log:
Slight tweak to vtable linkage.


Modified:
    cfe/trunk/lib/CodeGen/CGVtable.cpp
    cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp

Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=90832&r1=90831&r2=90832&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Mon Dec  7 22:09:14 2009
@@ -1462,7 +1462,7 @@
   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;

Modified: cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp?rev=90832&r1=90831&r2=90832&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/key-function-vtable.cpp Mon Dec  7 22:09:14 2009
@@ -35,7 +35,7 @@
 // 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





More information about the cfe-commits mailing list