Updated LLVM/Clang to force the record layout engine
to complete C++ classes before traversing their base classes. llvm-svn: 156570
This commit is contained in:
parent
fc8118bf41
commit
6f3b394bfa
|
@ -0,0 +1,19 @@
|
|||
Index: lib/CodeGen/CodeGenTypes.cpp
|
||||
===================================================================
|
||||
--- lib/CodeGen/CodeGenTypes.cpp (revision 152265)
|
||||
+++ lib/CodeGen/CodeGenTypes.cpp (working copy)
|
||||
@@ -133,6 +133,14 @@
|
||||
// when a class is translated, even though they aren't embedded by-value into
|
||||
// the class.
|
||||
if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD)) {
|
||||
+ if (!CRD->hasDefinition() && CRD->hasExternalLexicalStorage()) {
|
||||
+ ExternalASTSource *EAS = CRD->getASTContext().getExternalSource();
|
||||
+ if (!EAS)
|
||||
+ return false;
|
||||
+ EAS->CompleteType(const_cast<CXXRecordDecl*>(CRD));
|
||||
+ if (!CRD->hasDefinition())
|
||||
+ return false;
|
||||
+ }
|
||||
for (CXXRecordDecl::base_class_const_iterator I = CRD->bases_begin(),
|
||||
E = CRD->bases_end(); I != E; ++I)
|
||||
if (!isSafeToConvert(I->getType()->getAs<RecordType>()->getDecl(),
|
Loading…
Reference in New Issue