summaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-15 21:46:17 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-15 21:46:17 +0000
commitba6ffaf21e465c0926d7fc5fa294ea52f8d45faf (patch)
tree53890f852d30d567969cd756066860f4bd095d1a /lib/Serialization/ASTReader.cpp
parentcea2e3d7ea9cdc763f7a98937c09769cd4d1f582 (diff)
downloadclang-ba6ffaf21e465c0926d7fc5fa294ea52f8d45faf.tar.gz
clang-ba6ffaf21e465c0926d7fc5fa294ea52f8d45faf.tar.bz2
clang-ba6ffaf21e465c0926d7fc5fa294ea52f8d45faf.tar.xz
Augment the interface of ExternalASTSource::FindExternalLexicalDecls()
to allow clients to specify that they've already (correctly) loaded declarations, and that no further action is needed. Also, make sure that we clear the "has external lexical declarations" bit before calling FindExternalLexicalDecls(), to avoid infinite recursion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReader.cpp')
-rw-r--r--lib/Serialization/ASTReader.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index 13933b3eb3..a4ed5f4da4 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -4008,12 +4008,9 @@ Stmt *ASTReader::GetExternalDeclStmt(uint64_t Offset) {
llvm_unreachable("Broken chain");
}
-bool ASTReader::FindExternalLexicalDecls(const DeclContext *DC,
+ExternalLoadResult ASTReader::FindExternalLexicalDecls(const DeclContext *DC,
bool (*isKindWeWant)(Decl::Kind),
llvm::SmallVectorImpl<Decl*> &Decls) {
- assert(DC->hasExternalLexicalStorage() &&
- "DeclContext has no lexical decls in storage");
-
// There might be lexical decls in multiple parts of the chain, for the TU
// at least.
// DeclContextOffsets might reallocate as we load additional decls below,
@@ -4038,7 +4035,7 @@ bool ASTReader::FindExternalLexicalDecls(const DeclContext *DC,
}
++NumLexicalDeclContextsRead;
- return false;
+ return ELR_Success;
}
DeclContext::lookup_result