// RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -flto=thin -flto-jobs=5 2> %t
// RUN: FileCheck -check-prefix=CHECK-LINK-THIN-JOBS2-ACTION < %t %s
//
-// CHECK-LINK-THIN-JOBS2-ACTION: "-mllvm" "-threads=5"
+// CHECK-LINK-THIN-JOBS2-ACTION: "-mllvm" "-threads={{[0-9]+}}"
return MaxThreadCount;
}
-Optional<ThreadPoolStrategy>
-llvm::get_threadpool_strategy(StringRef Num, ThreadPoolStrategy Default) {
- if (Num == "all")
- return llvm::hardware_concurrency();
- if (Num.empty())
- return Default;
- unsigned V;
- if (Num.getAsInteger(10, V))
- return None; // malformed 'Num' value
- if (V == 0)
- return Default;
-
- // Do not take the Default into account. This effectively disables
- // heavyweight_hardware_concurrency() if the user asks for any number of
- // threads on the cmd-line.
- ThreadPoolStrategy S = llvm::hardware_concurrency();
- S.ThreadsRequested = V;
- return S;
-}
-
namespace {
struct SyncThreadInfo {
void (*UserFn)(void *);
}
#endif
+
+Optional<ThreadPoolStrategy>
+llvm::get_threadpool_strategy(StringRef Num, ThreadPoolStrategy Default) {
+ if (Num == "all")
+ return llvm::hardware_concurrency();
+ if (Num.empty())
+ return Default;
+ unsigned V;
+ if (Num.getAsInteger(10, V))
+ return None; // malformed 'Num' value
+ if (V == 0)
+ return Default;
+
+ // Do not take the Default into account. This effectively disables
+ // heavyweight_hardware_concurrency() if the user asks for any number of
+ // threads on the cmd-line.
+ ThreadPoolStrategy S = llvm::hardware_concurrency();
+ S.ThreadsRequested = V;
+ return S;
+}