aboutsummaryrefslogtreecommitdiff
path: root/include-fixer
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2017-01-11 07:20:46 +0000
committerManuel Klimek <klimek@google.com>2017-01-11 07:20:46 +0000
commitf8b47d336c409c90c8acc96d7d46990946e2fa36 (patch)
tree16e94a24244dc189cedaf70fff4c1475543247e9 /include-fixer
parentc697bdf87d95c6bae3487659b59f884066f331a3 (diff)
downloadclang-tools-extra-f8b47d336c409c90c8acc96d7d46990946e2fa36.tar.gz
Only launch asynchronously if threading is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@291653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include-fixer')
-rw-r--r--include-fixer/SymbolIndexManager.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include-fixer/SymbolIndexManager.h b/include-fixer/SymbolIndexManager.h
index 6f6a5862..6a1d22cc 100644
--- a/include-fixer/SymbolIndexManager.h
+++ b/include-fixer/SymbolIndexManager.h
@@ -23,7 +23,12 @@ namespace include_fixer {
class SymbolIndexManager {
public:
void addSymbolIndex(std::function<std::unique_ptr<SymbolIndex>()> F) {
- SymbolIndices.push_back(std::async(std::launch::async, F));
+#if LLVM_ENABLE_THREADS
+ auto Strategy = std::launch::async;
+#else
+ auto Strategy = std::launch::deferred;
+#endif
+ SymbolIndices.push_back(std::async(Strategy, F));
}
/// Search for header files to be included for an identifier.