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