]> granicus.if.org Git - llvm/commitdiff
[dsymutil][NFC} Rename thread related command line options
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 1 Nov 2017 17:15:29 +0000 (17:15 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 1 Nov 2017 17:15:29 +0000 (17:15 +0000)
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

test/tools/dsymutil/cmdline.test
tools/dsymutil/dsymutil.cpp

index 959074290f05f083714fc20a0da12682889e703c..dea28cf3d9089c90bd87e8747ab7ecd097b8b8e4 100644 (file)
@@ -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
index 5f224b6bb8a116ccfd2527fac7c72936a1a03738..ef21677e895c2d1740314b1a8b17b81103511d51 100644 (file)
@@ -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);