summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-07 15:46:26 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-07 15:46:26 +0000
commit903ccd61219659d769b4f12b75ac998ffd474465 (patch)
treee5395c6a2d9abfd7229cb51cfeaefddd71358370 /clang/lib/Frontend/PCHReaderDecl.cpp
parentc54936c1090ec31c80f039b360f0cd70fd3093a1 (diff)
downloadbcm5719-llvm-903ccd61219659d769b4f12b75ac998ffd474465.tar.gz
bcm5719-llvm-903ccd61219659d769b4f12b75ac998ffd474465.zip
Delay passing InterestingDecls to the Consumer until when we know we are not in recursive loading and the
declarations are fully initialized. llvm-svn: 107783
Diffstat (limited to 'clang/lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r--clang/lib/Frontend/PCHReaderDecl.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp
index 6b441e1c0d7..0233886abe7 100644
--- a/clang/lib/Frontend/PCHReaderDecl.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud