diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-07 15:46:26 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-07 15:46:26 +0000 |
commit | bb80a8e8887c1ec74ee135d4ad9455eafedf1508 (patch) | |
tree | 21da60bab3977bb855eeb7a5dd0d4a8a876625b9 /lib/Frontend/PCHReaderDecl.cpp | |
parent | 4aedb1cab1a731bfa5c82459669320a72b0d6e66 (diff) |
Delay passing InterestingDecls to the Consumer until when we know we are not in recursive loading and the
declarations are fully initialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r-- | lib/Frontend/PCHReaderDecl.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index 6b441e1c0d..0233886abe 100644 --- a/lib/Frontend/PCHReaderDecl.cpp +++ b/lib/Frontend/PCHReaderDecl.cpp @@ -1474,16 +1474,11 @@ Decl *PCHReader::ReadDeclRecord(uint64_t Offset, unsigned Index) { assert(Idx == Record.size()); // If we have deserialized a declaration that has a definition the - // AST consumer might need to know about, notify the consumer - // about that definition now or queue it for later. - if (isConsumerInterestedIn(D)) { - if (Consumer) { - DeclGroupRef DG(D); - Consumer->HandleTopLevelDecl(DG); - } else { - InterestingDecls.push_back(D); - } - } + // AST consumer might need to know about, queue it. + // We don't pass it to the consumer immediately because we may be in recursive + // loading, and some declarations may still be initializing. + if (isConsumerInterestedIn(D)) + InterestingDecls.push_back(D); return D; } |