[llvm] 31677c6 - [llvm-symbolizer] Remove one-dash long options
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 23 08:35:50 PDT 2021
Author: Fangrui Song
Date: 2021-07-23T08:35:45-07:00
New Revision: 31677c6481a5ceac1eec10c8e9fbe6694bf551ba
URL: https://github.com/llvm/llvm-project/commit/31677c6481a5ceac1eec10c8e9fbe6694bf551ba
DIFF: https://github.com/llvm/llvm-project/commit/31677c6481a5ceac1eec10c8e9fbe6694bf551ba.diff
LOG: [llvm-symbolizer] Remove one-dash long options
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
Added:
Modified:
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
llvm/test/tools/llvm-symbolizer/pdb/pdb-columns.test
llvm/tools/llvm-symbolizer/Opts.td
Removed:
################################################################################
diff --git a/llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test b/llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
index c6caea1e72b5a..7efadb3f21076 100644
--- a/llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
+++ b/llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
@@ -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
diff --git a/llvm/test/tools/llvm-symbolizer/pdb/pdb-columns.test b/llvm/test/tools/llvm-symbolizer/pdb/pdb-columns.test
index a564847ef94ed..24e5b70c03eec 100644
--- a/llvm/test/tools/llvm-symbolizer/pdb/pdb-columns.test
+++ b/llvm/test/tools/llvm-symbolizer/pdb/pdb-columns.test
@@ -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.
diff --git a/llvm/tools/llvm-symbolizer/Opts.td b/llvm/tools/llvm-symbolizer/Opts.td
index c4b94dc9b2f8a..6026e24d6ffa6 100644
--- a/llvm/tools/llvm-symbolizer/Opts.td
+++ b/llvm/tools/llvm-symbolizer/Opts.td
@@ -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">;
More information about the llvm-commits
mailing list