[include-fixer] Load symbol index asynchronously.
We don't actually need the index until parse time, so fetch it in the
background and start parsing. By the time it is actually needed it's
likely that the loading phase has completed in the background.
llvm-svn: 291446
diff --git a/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp b/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp
index c7737c8..9402c28 100644
--- a/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp
+++ b/clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp
@@ -85,8 +85,9 @@
1, {}),
};
auto SymbolIndexMgr = llvm::make_unique<include_fixer::SymbolIndexManager>();
- SymbolIndexMgr->addSymbolIndex(
- llvm::make_unique<include_fixer::InMemorySymbolIndex>(Symbols));
+ SymbolIndexMgr->addSymbolIndex([=]() {
+ return llvm::make_unique<include_fixer::InMemorySymbolIndex>(Symbols);
+ });
std::vector<IncludeFixerContext> FixerContexts;
IncludeFixerActionFactory Factory(*SymbolIndexMgr, FixerContexts, "llvm");