blob: d63f90675d5262db6a441d07d69d8524077c1275 [file] [log] [blame]
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +00001include "llvm/Option/OptParser.td"
2
3multiclass Eq<string name> {
4 def NAME: Separate<["--", "-"], name>;
5 def NAME # _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>;
6}
7
8def help : Flag<["-", "--"], "help">;
9defm binary_architecture : Eq<"binary-architecture">,
10 HelpText<"Used when transforming an architecture-less format (such as binary) to another format">;
11def B : JoinedOrSeparate<["-"], "B">,
12 Alias<binary_architecture>;
13defm input_target : Eq<"input-target">,
14 HelpText<"Format of the input file">,
15 Values<"binary">;
16defm output_target : Eq<"output-target">,
17 HelpText<"Format of the output file">,
18 Values<"binary">;
19def O : JoinedOrSeparate<["-"], "O">,
20 Alias<output_target>;
21defm split_dwo : Eq<"split-dwo">,
22 MetaVarName<"dwo-file">,
23 HelpText<"Equivalent to extract-dwo on the input file to <dwo-file>, then strip-dwo on the input file">;
24defm add_gnu_debuglink : Eq<"add-gnu-debuglink">,
25 MetaVarName<"debug-file">,
26 HelpText<"adds a .gnu_debuglink for <debug-file>">;
27defm remove_section : Eq<"remove-section">,
28 MetaVarName<"section">,
29 HelpText<"Remove <section>">;
30def R : JoinedOrSeparate<["-"], "R">,
31 Alias<remove_section>;
32defm keep : Eq<"keep">,
33 MetaVarName<"section">,
34 HelpText<"Keep <section>">;
35defm only_keep : Eq<"only-keep">,
36 MetaVarName<"section">,
37 HelpText<"Remove all but <section>">;
38def j : JoinedOrSeparate<["-"], "j">,
39 Alias<only_keep>;
40defm add_section : Eq<"add-section">,
41 MetaVarName<"section=file">,
42 HelpText<"Make a section named <section> with the contents of <file>.">;
43def strip_all : Flag<["-", "--"], "strip-all">,
44 HelpText<"Removes non-allocated sections other than .gnu.warning* sections">;
45def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
46 HelpText<"Compaitable with GNU objcopy's --strip-all">;
47def strip_debug : Flag<["-", "--"], "strip-debug">,
48 HelpText<"Removes all debug information">;
49def strip_dwo : Flag<["-", "--"], "strip-dwo">,
50 HelpText<"Remove all DWARF .dwo sections from file">;
51def strip_sections : Flag<["-", "--"], "strip-sections">,
52 HelpText<"Remove all section headers">;
53def strip_non_alloc : Flag<["-", "--"], "strip-non-alloc">,
54 HelpText<"Remove all non-allocated sections">;
55def extract_dwo : Flag<["-", "--"], "extract-dwo">,
56 HelpText<"Remove all sections that are not DWARF .dwo sections from file">;
57def localize_hidden : Flag<["-", "--"], "localize-hidden">,
58 HelpText<"Mark all symbols that have hidden or internal visibility as local">;