r226325 - Also put vtables in a comdat when rtti is disabled.
Rafael Espindola
rafael.espindola at gmail.com
Fri Jan 16 13:41:44 PST 2015
Author: rafael
Date: Fri Jan 16 15:41:44 2015
New Revision: 226325
URL: http://llvm.org/viewvc/llvm-project?rev=226325&view=rev
Log:
Also put vtables in a comdat when rtti is disabled.
Modified:
cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
cfe/trunk/test/CodeGenCXX/microsoft-no-rtti-data.cpp
Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=226325&r1=226324&r2=226325&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Fri Jan 16 15:41:44 2015
@@ -1420,6 +1420,10 @@ llvm::GlobalVariable *MicrosoftCXXABI::g
} else {
llvm_unreachable("unexpected linkage for vftable!");
}
+ } else {
+ if (llvm::GlobalValue::isWeakForLinker(VFTableLinkage))
+ VTable->setComdat(
+ CGM.getModule().getOrInsertComdat(VTable->getName()));
}
VFTable->setLinkage(VFTableLinkage);
CGM.setGlobalVisibility(VFTable, RD);
Modified: cfe/trunk/test/CodeGenCXX/microsoft-no-rtti-data.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-no-rtti-data.cpp?rev=226325&r1=226324&r2=226325&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-no-rtti-data.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-no-rtti-data.cpp Fri Jan 16 15:41:44 2015
@@ -2,7 +2,7 @@
// vftable shouldn't have RTTI data in it.
// CHECK-NOT: @"\01??_R4S@@6B@"
-// CHECK: @"\01??_7S@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI at Z" to i8*)]
+// CHECK: @"\01??_7S@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI at Z" to i8*)], comdat
struct type_info;
namespace std { using ::type_info; }
More information about the cfe-commits
mailing list