Adopt llvm::function_ref for callbacks that aren't persisted.

...removing a few other constructs that were doing the same thing
(mostly from me).

No functionality change.

Swift SVN r23294
This commit is contained in:
Jordan Rose
2014-11-13 00:19:03 +00:00
parent 1bbe784d51
commit 5ad871ecd6
6 changed files with 39 additions and 73 deletions

View File

@@ -1328,13 +1328,13 @@ static bool forAllImportedModules(Module *topLevel,
bool Module::forAllVisibleModules(AccessPathTy thisPath,
bool includePrivateTopLevelImports,
std::function<bool(ImportedModule)> fn) {
llvm::function_ref<bool(ImportedModule)> fn) {
return forAllImportedModules<true>(this, thisPath,
includePrivateTopLevelImports, fn);
}
bool
FileUnit::forAllVisibleModules(std::function<bool(Module::ImportedModule)> fn) {
bool FileUnit::forAllVisibleModules(
llvm::function_ref<bool(Module::ImportedModule)> fn) {
if (!getParentModule()->forAllVisibleModules(Module::AccessPathTy(), fn))
return false;