diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-23 00:27:18 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-23 00:27:18 +0000 |
commit | 04d05b5fa7fd19ae79ec9e9b9dd9ec7a5a68d879 (patch) | |
tree | b481d7fe81caf3341d137495defdfd5847c7370a /clang/lib/Serialization/ASTReader.cpp | |
parent | 957a2944dfce0672e349516dc5ae3b6474fb71db (diff) | |
download | bcm5719-llvm-04d05b5fa7fd19ae79ec9e9b9dd9ec7a5a68d879.tar.gz bcm5719-llvm-04d05b5fa7fd19ae79ec9e9b9dd9ec7a5a68d879.zip |
If an update record makes a declaration interesting, pass it to the consumer.
llvm-svn: 204550
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index abb6c9cc399..fc8c030833e 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2892,6 +2892,7 @@ bool ASTReader::ReadASTBlock(ModuleFile &F) { Error("invalid DECL_UPDATE_OFFSETS block in AST file"); return true; } + // FIXME: If we've already loaded the decl, perform the updates now. for (unsigned I = 0, N = Record.size(); I != N; I += 2) DeclUpdateOffsets[getGlobalDeclID(F, Record[I])] .push_back(std::make_pair(&F, Record[I+1])); @@ -6313,6 +6314,15 @@ static void PassObjCImplDeclToConsumer(ObjCImplDecl *ImplD, void ASTReader::PassInterestingDeclsToConsumer() { assert(Consumer); + + if (PassingDeclsToConsumer) + return; + + // Guard variable to avoid recursively redoing the process of passing + // decls to consumer. + SaveAndRestore<bool> GuardPassingDeclsToConsumer(PassingDeclsToConsumer, + true); + while (!InterestingDecls.empty()) { Decl *D = InterestingDecls.front(); InterestingDecls.pop_front(); @@ -7922,20 +7932,10 @@ void ASTReader::FinishedDeserializing() { } --NumCurrentElementsDeserializing; - if (NumCurrentElementsDeserializing == 0 && - Consumer && !PassingDeclsToConsumer) { - // Guard variable to avoid recursively redoing the process of passing - // decls to consumer. - SaveAndRestore<bool> GuardPassingDeclsToConsumer(PassingDeclsToConsumer, - true); - - while (!InterestingDecls.empty()) { - // We are not in recursive loading, so it's safe to pass the "interesting" - // decls to the consumer. - Decl *D = InterestingDecls.front(); - InterestingDecls.pop_front(); - PassInterestingDeclToConsumer(D); - } + if (NumCurrentElementsDeserializing == 0 && Consumer) { + // We are not in recursive loading, so it's safe to pass the "interesting" + // decls to the consumer. + PassInterestingDeclsToConsumer(); } } |