From: Jonas Devlieghere Date: Wed, 1 Nov 2017 17:15:29 +0000 (+0000) Subject: [dsymutil][NFC} Rename thread related command line options X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef7a206359ccfcda0ae72410266d97be2e3c172d;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317104 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/dsymutil/cmdline.test b/test/tools/dsymutil/cmdline.test index 959074290f0..dea28cf3d90 100644 --- a/test/tools/dsymutil/cmdline.test +++ b/test/tools/dsymutil/cmdline.test @@ -9,10 +9,10 @@ HELP: -flat HELP: -no-odr HELP: -no-output HELP: -no-swiftmodule-timestamp +HELP: -num-threads= HELP: -o= HELP: -oso-prepend-path= HELP: -symtab -HELP: -threads= HELP: -verbose HELP: -y HELP-NOT: -reverse-iterate diff --git a/tools/dsymutil/dsymutil.cpp b/tools/dsymutil/dsymutil.cpp index 5f224b6bb8a..ef21677e895 100644 --- a/tools/dsymutil/dsymutil.cpp +++ b/tools/dsymutil/dsymutil.cpp @@ -62,12 +62,13 @@ static opt FlatOut("flat", init(false), cat(DsymCategory)); static alias FlatOutA("f", desc("Alias for --flat"), aliasopt(FlatOut)); -static opt Threads( - "threads", +static opt 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 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(NumThreads, DebugMapPtrsOrErr->size()); llvm::ThreadPool Threads(NumThreads);