forked from OSchip/llvm-project
[modules] Add an assert that we properly manage the IsCompleteDefinition flag
on CXXRecordDecls when merging definitions, and make it pass by not trying to save and restore this flag across AST serialization/deserialization. For CXXRecordDecls, we have a separate mechanism to manage this. llvm-svn: 216633
This commit is contained in:
parent
843f14f411
commit
2c38164737
|
@ -8216,8 +8216,11 @@ void ASTReader::finishPendingActions() {
|
|||
}
|
||||
|
||||
if (auto RD = dyn_cast<CXXRecordDecl>(D)) {
|
||||
for (auto R : RD->redecls())
|
||||
for (auto R : RD->redecls()) {
|
||||
assert((R == D) == R->isThisDeclarationADefinition() &&
|
||||
"declaration thinks it's the definition but it isn't");
|
||||
cast<CXXRecordDecl>(R)->DefinitionData = RD->DefinitionData;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
|
|
|
@ -489,7 +489,8 @@ ASTDeclReader::RedeclarableResult ASTDeclReader::VisitTagDecl(TagDecl *TD) {
|
|||
|
||||
TD->IdentifierNamespace = Record[Idx++];
|
||||
TD->setTagKind((TagDecl::TagKind)Record[Idx++]);
|
||||
TD->setCompleteDefinition(Record[Idx++]);
|
||||
if (!isa<CXXRecordDecl>(TD))
|
||||
TD->setCompleteDefinition(Record[Idx++]);
|
||||
TD->setEmbeddedInDeclarator(Record[Idx++]);
|
||||
TD->setFreeStanding(Record[Idx++]);
|
||||
TD->setCompleteDefinitionRequired(Record[Idx++]);
|
||||
|
@ -3426,6 +3427,7 @@ void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile,
|
|||
Reader.ReadDeclContextStorage(ModuleFile, ModuleFile.DeclsCursor,
|
||||
std::make_pair(LexicalOffset, 0),
|
||||
ModuleFile.DeclContextInfos[RD]);
|
||||
Reader.PendingDefinitions.insert(RD);
|
||||
}
|
||||
|
||||
auto TSK = (TemplateSpecializationKind)Record[Idx++];
|
||||
|
|
|
@ -245,7 +245,8 @@ void ASTDeclWriter::VisitTagDecl(TagDecl *D) {
|
|||
VisitTypeDecl(D);
|
||||
Record.push_back(D->getIdentifierNamespace());
|
||||
Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding
|
||||
Record.push_back(D->isCompleteDefinition());
|
||||
if (!isa<CXXRecordDecl>(D))
|
||||
Record.push_back(D->isCompleteDefinition());
|
||||
Record.push_back(D->isEmbeddedInDeclarator());
|
||||
Record.push_back(D->isFreeStanding());
|
||||
Record.push_back(D->isCompleteDefinitionRequired());
|
||||
|
|
Loading…
Reference in New Issue