xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-size/Opts.td (revision 2008043f386721d58158e37e0d7e50df8095942d)
1include "llvm/Option/OptParser.td"
2
3class F<string letter, string help> : Flag<["-"], letter>, HelpText<help>;
4class FF<string name, string help> : Flag<["--"], name>, HelpText<help>;
5
6multiclass Eq<string name, string help> {
7  def NAME #_EQ : Joined<["--"], name #"=">,
8                  HelpText<help>;
9  def : Separate<["--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
10}
11
12def common : FF<"common", "Print common symbols in the ELF file. When using Berkeley format, this is added to bss">;
13defm format : Eq<"format", "Specify output format">;
14def help : FF<"help", "Display this help">;
15defm radix : Eq<"radix", "Print size in radix">;
16def totals : FF<"totals", "Print totals of all objects - Berkeley format only">;
17def version : FF<"version", "Display the version">;
18
19// Mach-O specific options.
20def grp_mach_o : OptionGroup<"kind">, HelpText<"OPTIONS (Mach-O specific)">;
21def arch_EQ : Joined<["--"], "arch=">, HelpText<"architecture(s) from a Mach-O file to dump">, Group<grp_mach_o>;
22def : Separate<["--", "-"], "arch">, Alias<arch_EQ>;
23def l : F<"l", "When format is darwin, use long format to include addresses and offsets">, Group<grp_mach_o>;
24
25def : F<"A", "Alias for --format">, Alias<format_EQ>, AliasArgs<["sysv"]>;
26def : F<"B", "Alias for --format">, Alias<format_EQ>, AliasArgs<["berkeley"]>;
27def : F<"d", "Alias for --radix=10">, Alias<radix_EQ>, AliasArgs<["10"]>;
28def : F<"h", "Alias for --help">, Alias<help>;
29def : F<"m", "Alias for --format">, Alias<format_EQ>, AliasArgs<["darwin"]>;
30def : F<"o", "Alias for --radix=8">, Alias<radix_EQ>, AliasArgs<["8"]>;
31def : F<"t", "Alias for --totals">, Alias<totals>;
32def : F<"x", "Alias for --radix=16">, Alias<radix_EQ>, AliasArgs<["16"]>;
33