[llvm-symbolizer] Remove one-dash long options
authorFangrui Song <i@maskray.me>
Fri, 23 Jul 2021 15:35:45 +0000 (08:35 -0700)
committerFangrui Song <i@maskray.me>
Fri, 23 Jul 2021 15:35:45 +0000 (08:35 -0700)
Most modern tools only accept two-dash long options. Remove one-dash
long options which are not recognized by GNU style `getopt_long`.
This ensures long options cannot collide with grouped short options.

Note: llvm-symbolizer has `-demangle={true,false}` for pprof compatibility
(for a while). They are kept.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D106377

llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
llvm/test/tools/llvm-symbolizer/pdb/pdb-columns.test
llvm/tools/llvm-symbolizer/Opts.td

index c6caea1..7efadb3 100644 (file)
@@ -1,4 +1,4 @@
-RUN: llvm-symbolizer 0x401000 0x401001 -obj="%p/Inputs/missing_pdb.exe" 2>%t.err \
+RUN: llvm-symbolizer 0x401000 0x401001 --obj="%p/Inputs/missing_pdb.exe" 2>%t.err \
 RUN:    | FileCheck %s
 RUN: FileCheck -DMSG=%errc_ENOENT --check-prefix=ERROR %s < %t.err
 
index a564847..24e5b70 100644 (file)
@@ -6,7 +6,7 @@ RUN: echo 0x140006C20 >> %t.input
 RUN: echo 0x140006C30 >> %t.input
 RUN: echo 0x140006C40 >> %t.input
 RUN: echo 0x140006C70 >> %t.input
-RUN:    llvm-symbolizer -obj="%p/Inputs/test-columns.exe" < %t.input \
+RUN:    llvm-symbolizer --obj="%p/Inputs/test-columns.exe" < %t.input \
 RUN:    | FileCheck %s
 
 This tests that the symbolizer outputs column info when it is present in the pdb.
index c4b94dc..6026e24 100644 (file)
@@ -1,17 +1,17 @@
 include "llvm/Option/OptParser.td"
 
 multiclass B<string name, string help1, string help2> {
-  def NAME: Flag<["--", "-"], name>, HelpText<help1>;
-  def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>;
+  def NAME: Flag<["--"], name>, HelpText<help1>;
+  def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
 }
 
 multiclass Eq<string name, string help> {
-  def NAME #_EQ : Joined<["--", "-"], name #"=">,
+  def NAME #_EQ : Joined<["--"], name #"=">,
                   HelpText<help>;
-  def : Separate<["--", "-"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
+  def : Separate<["--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
 }
 
-class F<string name, string help>: Flag<["--", "-"], name>, HelpText<help>;
+class F<string name, string help>: Flag<["--"], name>, HelpText<help>;
 
 def grp_mach_o : OptionGroup<"kind">,
                  HelpText<"llvm-symbolizer Mach-O Specific Options">;