blob: a4d864a7c5b5aeec3765e5e4c87f61ad1c5fa8d4 [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">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000026 HelpText<"Add a .gnu_debuglink for <debug-file>">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000027defm 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">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000044 HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000045def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
46 HelpText<"Compaitable with GNU objcopy's --strip-all">;
47def strip_debug : Flag<["-", "--"], "strip-debug">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000048 HelpText<"Remove all debug information">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000049def 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">;
Paul Semelb4924942018-04-26 17:44:43 +000059defm localize_symbol : Eq<"localize-symbol">,
60 MetaVarName<"symbol">,
61 HelpText<"Mark <symbol> as local">;
62def L : JoinedOrSeparate<["-"], "L">,
63 Alias<localize_symbol>;