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 | ba6ffaf21e465c0926d7fc5fa294ea52f8d45faf (patch) | |
tree | 53890f852d30d567969cd756066860f4bd095d1a /lib/AST/DeclBase.cpp | |
parent | cea2e3d7ea9cdc763f7a98937c09769cd4d1f582 (diff) |
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/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 7d146572bf..b2806f092c 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -839,12 +839,17 @@ DeclContext::LoadLexicalDeclsFromExternalStorage() const { // Notify that we have a DeclContext that is initializing. ExternalASTSource::Deserializing ADeclContext(Source); + // Load the external declarations, if any. llvm::SmallVector<Decl*, 64> Decls; - if (Source->FindExternalLexicalDecls(this, Decls)) - return; - - // There is no longer any lexical storage in this context ExternalLexicalStorage = false; + switch (Source->FindExternalLexicalDecls(this, Decls)) { + case ELR_Success: + break; + + case ELR_Failure: + case ELR_AlreadyLoaded: + return; + } if (Decls.empty()) return; |