[PATCH] D39496: [dsymutil][NFC} Rename thread related command line options
Jonas Devlieghere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 1 09:34:07 PDT 2017
JDevlieghere created this revision.
This makes the command line options consistent with llvm-cov and
llvm-profdata, which both use `-num-threads` and `-j`.
This also addresses the conflict reported after landing https://reviews.llvm.org/D39355.
Repository:
rL LLVM
https://reviews.llvm.org/D39496
Files:
test/tools/dsymutil/cmdline.test
tools/dsymutil/dsymutil.cpp
Index: tools/dsymutil/dsymutil.cpp
===================================================================
--- tools/dsymutil/dsymutil.cpp
+++ tools/dsymutil/dsymutil.cpp
@@ -62,12 +62,13 @@
init(false), cat(DsymCategory));
static alias FlatOutA("f", desc("Alias for --flat"), aliasopt(FlatOut));
-static opt<unsigned> Threads(
- "threads",
+static opt<unsigned> NumThreads(
+ "num-threads",
desc("Specifies the maximum number (n) of simultaneous threads to use\n"
"when linking multiple architectures."),
value_desc("n"), init(0), cat(DsymCategory));
-static alias ThreadsA("t", desc("Alias for --threads"), aliasopt(Threads));
+static alias NumThreadsA("j", desc("Alias for --num-threads"),
+ aliasopt(NumThreads));
static opt<bool> Verbose("verbose", desc("Verbosity level"), init(false),
cat(DsymCategory));
@@ -324,12 +325,11 @@
exitDsymutil(1);
}
- unsigned NumThreads = Threads;
- if (!NumThreads)
+ if (NumThreads == 0)
NumThreads = llvm::thread::hardware_concurrency();
if (DumpDebugMap || Verbose)
NumThreads = 1;
- NumThreads = std::min(NumThreads, (unsigned)DebugMapPtrsOrErr->size());
+ NumThreads = std::min<unsigned>(NumThreads, DebugMapPtrsOrErr->size());
llvm::ThreadPool Threads(NumThreads);
Index: test/tools/dsymutil/cmdline.test
===================================================================
--- test/tools/dsymutil/cmdline.test
+++ test/tools/dsymutil/cmdline.test
@@ -9,10 +9,10 @@
HELP: -no-odr
HELP: -no-output
HELP: -no-swiftmodule-timestamp
+HELP: -num-threads=<n>
HELP: -o=<filename>
HELP: -oso-prepend-path=<path>
HELP: -symtab
-HELP: -threads=<n>
HELP: -verbose
HELP: -y
HELP-NOT: -reverse-iterate
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39496.121143.patch
Type: text/x-patch
Size: 1803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171101/77a2042a/attachment.bin>
More information about the llvm-commits
mailing list