Skip to content

Commit 77773a2

Browse files
committed
added option for max threads
1 parent 86af96b commit 77773a2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ static opt<bool> Verify("verify", desc("Verify the DWARF debug info."),
289289
static opt<unsigned> VerifyNumThreads(
290290
"verify-num-threads", init(1),
291291
desc("Number of threads to use for --verify. Single threaded verification "
292-
"is the default unless this option is specified. This can cause the "
292+
"is the default unless this option is specified. If 0 is specified, "
293+
"maximum hardware threads will be used. This can cause the "
293294
"output to be non determinisitic, but can speed up verification and "
294295
"is useful when running with the summary only or JSON summary modes."),
295296
cat(DwarfDumpCategory));
@@ -912,7 +913,11 @@ int main(int argc, char **argv) {
912913

913914
bool Success = true;
914915
if (Verify) {
915-
parallel::strategy = hardware_concurrency(VerifyNumThreads);
916+
if (!VerifyNumThreads)
917+
parallel::strategy =
918+
hardware_concurrency(hardware_concurrency().compute_thread_count());
919+
else
920+
parallel::strategy = hardware_concurrency(VerifyNumThreads);
916921
for (StringRef Object : Objects)
917922
Success &= handleFile(Object, verifyObjectFile, OutputFile.os());
918923
} else if (Statistics) {

0 commit comments

Comments
 (0)