From 3cb15729aff241e28c9854bd09609fb74e7bac37 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 5 Aug 2015 22:41:45 +0000 Subject: 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. llvm-svn: 244161 --- clang/lib/Sema/MultiplexExternalSemaSource.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'clang/lib/Sema/MultiplexExternalSemaSource.cpp') diff --git a/clang/lib/Sema/MultiplexExternalSemaSource.cpp b/clang/lib/Sema/MultiplexExternalSemaSource.cpp index 9ecb5a7..0f93421 100644 --- a/clang/lib/Sema/MultiplexExternalSemaSource.cpp +++ b/clang/lib/Sema/MultiplexExternalSemaSource.cpp @@ -107,15 +107,11 @@ void MultiplexExternalSemaSource::completeVisibleDeclsMap(const DeclContext *DC) Sources[i]->completeVisibleDeclsMap(DC); } -ExternalLoadResult MultiplexExternalSemaSource:: -FindExternalLexicalDecls(const DeclContext *DC, - bool (*isKindWeWant)(Decl::Kind), - SmallVectorImpl &Result) { +void MultiplexExternalSemaSource::FindExternalLexicalDecls( + const DeclContext *DC, llvm::function_ref IsKindWeWant, + SmallVectorImpl &Result) { for(size_t i = 0; i < Sources.size(); ++i) - // FIXME: The semantics of the return result is unclear to me... - Sources[i]->FindExternalLexicalDecls(DC, isKindWeWant, Result); - - return ELR_Success; + Sources[i]->FindExternalLexicalDecls(DC, IsKindWeWant, Result); } void MultiplexExternalSemaSource::FindFileRegionDecls(FileID File, -- cgit v1.1