diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-15 21:46:17 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-15 21:46:17 +0000 |
commit | 3d0adb3201ebdaedcec8d7eecc445df5eb649ae6 (patch) | |
tree | 62fc9eef5fb5215fd9ab120dca340f90d44c6f7a /clang/lib/Serialization/ASTReader.cpp | |
parent | ad94608b1f9bd8857f8210a8ab33c1fa0f1aaf8d (diff) | |
download | bcm5719-llvm-3d0adb3201ebdaedcec8d7eecc445df5eb649ae6.tar.gz bcm5719-llvm-3d0adb3201ebdaedcec8d7eecc445df5eb649ae6.zip |
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.
llvm-svn: 135306
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 13933b3eb3f..a4ed5f4da48 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/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 |