summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-24 17:26:50 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-24 17:26:50 +0000
commitd170d844c4b2ba3c1890113dbf61b6056ce4a577 (patch)
treef96d257fd664cdb459ec9c02005654e2b56699dd /clang/lib/Serialization/ASTReaderDecl.cpp
parent3ba70b89cf94c5090aae9962bf633de871c7d32d (diff)
downloadbcm5719-llvm-d170d844c4b2ba3c1890113dbf61b6056ce4a577.tar.gz
bcm5719-llvm-d170d844c4b2ba3c1890113dbf61b6056ce4a577.zip
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
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp14
1 files changed, 13 insertions, 1 deletions
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<CXXRecordDecl>(D);
+ CXXRecordDecl *
+ DefinitionDecl = cast<CXXRecordDecl>(Reader.GetDecl(Record[Idx++]));
+ assert(!RD->DefinitionData && "DefinitionData is already set!");
+ InitializeCXXDefinitionData(RD, DefinitionDecl, Record, Idx);
+ break;
+ }
+ }
+ }
}
OpenPOWER on IntegriCloud