[llvm-branch-commits] [cfe-branch] r245387 - Merge r244266 to the 3.7 release branch
Reid Kleckner via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 18 16:16:47 PDT 2015
Author: rnk
Date: Tue Aug 18 18:16:47 2015
New Revision: 245387
URL: http://llvm.org/viewvc/llvm-project?rev=245387&view=rev
Log:
Merge r244266 to the 3.7 release branch
It's actually probably a no-op, since the 3.7 branch will not generate
available externally vtables.
Modified:
cfe/branches/release_37/ (props changed)
cfe/branches/release_37/lib/CodeGen/ItaniumCXXABI.cpp
cfe/branches/release_37/test/CodeGenCXX/dllimport-rtti.cpp
Propchange: cfe/branches/release_37/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 18 18:16:47 2015
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242600,242660,242662,242667,242678,242766,242854,242905,242973,243018,243048,243085,243098,243101,243105,243133,243144,243153,243196,243206,243277,243280,243285,243289,243343,243417,243463,243538,243594,243642-243644,243851,243945-243950,243964,244000,244193,244468,244502,244719,244794,245041,245259
+/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242600,242660,242662,242667,242678,242766,242854,242905,242973,243018,243048,243085,243098,243101,243105,243133,243144,243153,243196,243206,243277,243280,243285,243289,243343,243417,243463,243538,243594,243642-243644,243851,243945-243950,243964,244000,244193,244266,244468,244502,244719,244794,245041,245259
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_37/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/lib/CodeGen/ItaniumCXXABI.cpp?rev=245387&r1=245386&r2=245387&view=diff
==============================================================================
--- cfe/branches/release_37/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/branches/release_37/lib/CodeGen/ItaniumCXXABI.cpp Tue Aug 18 18:16:47 2015
@@ -2420,10 +2420,13 @@ static bool ShouldUseExternalRTTIDescrip
// FIXME: this may need to be reconsidered if the key function
// changes.
+ // N.B. We must always emit the RTTI data ourselves if there exists a key
+ // function.
+ bool IsDLLImport = RD->hasAttr<DLLImportAttr>();
if (CGM.getVTables().isVTableExternal(RD))
- return true;
+ return IsDLLImport ? false : true;
- if (RD->hasAttr<DLLImportAttr>())
+ if (IsDLLImport)
return true;
}
@@ -2653,8 +2656,15 @@ static llvm::GlobalVariable::LinkageType
const CXXRecordDecl *RD = cast<CXXRecordDecl>(Record->getDecl());
if (RD->hasAttr<WeakAttr>())
return llvm::GlobalValue::WeakODRLinkage;
- if (RD->isDynamicClass())
- return CGM.getVTableLinkage(RD);
+ if (RD->isDynamicClass()) {
+ llvm::GlobalValue::LinkageTypes LT = CGM.getVTableLinkage(RD);
+ // MinGW won't export the RTTI information when there is a key function.
+ // Make sure we emit our own copy instead of attempting to dllimport it.
+ if (RD->hasAttr<DLLImportAttr>() &&
+ llvm::GlobalValue::isAvailableExternallyLinkage(LT))
+ LT = llvm::GlobalValue::LinkOnceODRLinkage;
+ return LT;
+ }
}
return llvm::GlobalValue::LinkOnceODRLinkage;
Modified: cfe/branches/release_37/test/CodeGenCXX/dllimport-rtti.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/test/CodeGenCXX/dllimport-rtti.cpp?rev=245387&r1=245386&r2=245387&view=diff
==============================================================================
--- cfe/branches/release_37/test/CodeGenCXX/dllimport-rtti.cpp (original)
+++ cfe/branches/release_37/test/CodeGenCXX/dllimport-rtti.cpp Tue Aug 18 18:16:47 2015
@@ -15,3 +15,8 @@ struct __declspec(dllimport) S {
struct U : S {
} u;
+
+struct __declspec(dllimport) V {
+ virtual void f();
+} v;
+// GNU-DAG: @_ZTV1V = external dllimport
More information about the llvm-branch-commits
mailing list