From d170d844c4b2ba3c1890113dbf61b6056ce4a577 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sun, 24 Oct 2010 17:26:50 +0000 Subject: Start fleshing out ASTMutationListener; notify when a tag definition is completed. In that case a chained PCH will record the updates to the DefinitionData pointer of forward references. If a forward reference mutated into a definition re-write it into the chained PCH, this is too big of a change. llvm-svn: 117239 --- clang/lib/Serialization/ASTReaderDecl.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp') diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 45d729a2fc7..f4568a7e70e 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -1588,5 +1588,17 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) { } void ASTDeclReader::UpdateDecl(Decl *D, const RecordData &Record) { - // No update is tracked yet. + unsigned Idx = 0; + while (Idx < Record.size()) { + switch ((DeclUpdateKind)Record[Idx++]) { + case UPD_CXX_SET_DEFINITIONDATA: { + CXXRecordDecl *RD = cast(D); + CXXRecordDecl * + DefinitionDecl = cast(Reader.GetDecl(Record[Idx++])); + assert(!RD->DefinitionData && "DefinitionData is already set!"); + InitializeCXXDefinitionData(RD, DefinitionDecl, Record, Idx); + break; + } + } + } } -- cgit v1.2.3