Skip to content

Commit be5fb7b

Browse files
committed
added option for max threads
1 parent 53f2718 commit be5fb7b

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));
@@ -916,7 +917,11 @@ int main(int argc, char **argv) {
916917

917918
bool Success = true;
918919
if (Verify) {
919-
parallel::strategy = hardware_concurrency(VerifyNumThreads);
920+
if (!VerifyNumThreads)
921+
parallel::strategy =
922+
hardware_concurrency(hardware_concurrency().compute_thread_count());
923+
else
924+
parallel::strategy = hardware_concurrency(VerifyNumThreads);
920925
for (StringRef Object : Objects)
921926
Success &= handleFile(Object, verifyObjectFile, OutputFile.os());
922927
} else if (Statistics) {

0 commit comments

Comments
 (0)