Skip to content

Commit 8cf1642

Browse files
MaskRaymemfrob
authored andcommitted
[llvm-readelf/llvm-readobj] Remove one-dash long options
llvm-readelf is a user-facing tool which emulates GNU readelf. 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: the documentation (D63719)/help messages have recommended the double-dash forms since LLVM 9.0.0. llvm-readobj is intended as an internal tool which has some flexibility. llvm-readelf/llvm-readobj use the same option parsing code and llvm-readobj's one-dash long options aren't used after test migration. Differential Revision: https://reviews.llvm.org/D106037
1 parent 329c908 commit 8cf1642

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/tools/llvm-readobj/Opts.td

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
include "llvm/Option/OptParser.td"
22

33
class F<string letter, string help> : Flag<["-"], letter>, HelpText<help>;
4-
class FF<string name, string help> : Flag<["--", "-"], name>, HelpText<help>;
4+
class FF<string name, string help> : Flag<["--"], name>, HelpText<help>;
55

66
multiclass BB<string name, string help1, string help2> {
7-
def NAME: Flag<["--", "-"], name>, HelpText<help1>;
8-
def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>;
7+
def NAME: Flag<["--"], name>, HelpText<help1>;
8+
def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
99
}
1010

1111
multiclass Eq<string name, string help> {
12-
def NAME #_EQ : Joined<["--", "-"], name #"=">,
13-
HelpText<help>;
14-
def : Separate<["--", "-"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
12+
def NAME #_EQ : Joined<["--"], name #"=">, HelpText<help>;
13+
def : Separate<["--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
1514
}
1615

1716
def addrsig : FF<"addrsig", "Display address-significance table">;

0 commit comments

Comments
 (0)