diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-05 22:41:45 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-05 22:41:45 +0000 |
commit | b5cef75c82aa309ac594c31b33259ffa680fc95d (patch) | |
tree | 4aafc265de502c86eec4af9552b7cfd0ea0130fe /lib/Frontend/ChainedIncludesSource.cpp | |
parent | 41544940b472981544a015d97dabce53dc5cb99c (diff) |
function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove its
useless return value. Switch to using it directly when completing the
redeclaration chain for an anonymous declaration, and reduce the set of
declarations that we load in the process to just those of the right kind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ChainedIncludesSource.cpp')
-rw-r--r-- | lib/Frontend/ChainedIncludesSource.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp index cc0504ba8b..5a5d2d55ed 100644 --- a/lib/Frontend/ChainedIncludesSource.cpp +++ b/lib/Frontend/ChainedIncludesSource.cpp @@ -47,9 +47,9 @@ protected: CXXBaseSpecifier *GetExternalCXXBaseSpecifiers(uint64_t Offset) override; bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) override; - ExternalLoadResult + void FindExternalLexicalDecls(const DeclContext *DC, - bool (*isKindWeWant)(Decl::Kind), + llvm::function_ref<bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl<Decl *> &Result) override; void CompleteType(TagDecl *Tag) override; void CompleteType(ObjCInterfaceDecl *Class) override; @@ -246,11 +246,10 @@ ChainedIncludesSource::FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) { return getFinalReader().FindExternalVisibleDeclsByName(DC, Name); } -ExternalLoadResult -ChainedIncludesSource::FindExternalLexicalDecls(const DeclContext *DC, - bool (*isKindWeWant)(Decl::Kind), - SmallVectorImpl<Decl*> &Result) { - return getFinalReader().FindExternalLexicalDecls(DC, isKindWeWant, Result); +void ChainedIncludesSource::FindExternalLexicalDecls( + const DeclContext *DC, llvm::function_ref<bool(Decl::Kind)> IsKindWeWant, + SmallVectorImpl<Decl *> &Result) { + return getFinalReader().FindExternalLexicalDecls(DC, IsKindWeWant, Result); } void ChainedIncludesSource::CompleteType(TagDecl *Tag) { return getFinalReader().CompleteType(Tag); |