[llvm] r317104 - [dsymutil][NFC} Rename thread related command line options
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 1 10:15:29 PDT 2017
Author: jdevlieghere
Date: Wed Nov 1 10:15:29 2017
New Revision: 317104
URL: http://llvm.org/viewvc/llvm-project?rev=317104&view=rev
Log:
[dsymutil][NFC} Rename thread related command line options
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 D39355.
Differential revision: https://reviews.llvm.org/D39496
Modified:
llvm/trunk/test/tools/dsymutil/cmdline.test
llvm/trunk/tools/dsymutil/dsymutil.cpp
Modified: llvm/trunk/test/tools/dsymutil/cmdline.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/cmdline.test?rev=317104&r1=317103&r2=317104&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/cmdline.test (original)
+++ llvm/trunk/test/tools/dsymutil/cmdline.test Wed Nov 1 10:15:29 2017
@@ -9,10 +9,10 @@ HELP: -flat
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
Modified: llvm/trunk/tools/dsymutil/dsymutil.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/dsymutil.cpp?rev=317104&r1=317103&r2=317104&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/dsymutil.cpp (original)
+++ llvm/trunk/tools/dsymutil/dsymutil.cpp Wed Nov 1 10:15:29 2017
@@ -62,12 +62,13 @@ static opt<bool> FlatOut("flat",
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 @@ int main(int argc, char **argv) {
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);
More information about the llvm-commits
mailing list