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>">; |
Alexander Shaposhnikov | 40e9bdf | 2018-04-26 18:28:17 +0000 | [diff] [blame] | 30 | defm redefine_symbol : Eq<"redefine-sym">, |
| 31 | MetaVarName<"old=new">, |
| 32 | HelpText<"Change the name of a symbol old to new">; |
Alexander Shaposhnikov | d688479 | 2018-04-24 05:43:32 +0000 | [diff] [blame] | 33 | def R : JoinedOrSeparate<["-"], "R">, |
| 34 | Alias<remove_section>; |
| 35 | defm keep : Eq<"keep">, |
| 36 | MetaVarName<"section">, |
| 37 | HelpText<"Keep <section>">; |
| 38 | defm only_keep : Eq<"only-keep">, |
| 39 | MetaVarName<"section">, |
| 40 | HelpText<"Remove all but <section>">; |
| 41 | def j : JoinedOrSeparate<["-"], "j">, |
| 42 | Alias<only_keep>; |
| 43 | defm add_section : Eq<"add-section">, |
| 44 | MetaVarName<"section=file">, |
| 45 | HelpText<"Make a section named <section> with the contents of <file>.">; |
| 46 | def strip_all : Flag<["-", "--"], "strip-all">, |
Alexander Shaposhnikov | b3bfd3b | 2018-04-24 21:44:13 +0000 | [diff] [blame] | 47 | HelpText<"Remove non-allocated sections other than .gnu.warning* sections">; |
Alexander Shaposhnikov | d688479 | 2018-04-24 05:43:32 +0000 | [diff] [blame] | 48 | def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">, |
| 49 | HelpText<"Compaitable with GNU objcopy's --strip-all">; |
| 50 | def strip_debug : Flag<["-", "--"], "strip-debug">, |
Alexander Shaposhnikov | b3bfd3b | 2018-04-24 21:44:13 +0000 | [diff] [blame] | 51 | HelpText<"Remove all debug information">; |
Alexander Shaposhnikov | d688479 | 2018-04-24 05:43:32 +0000 | [diff] [blame] | 52 | def strip_dwo : Flag<["-", "--"], "strip-dwo">, |
| 53 | HelpText<"Remove all DWARF .dwo sections from file">; |
| 54 | def strip_sections : Flag<["-", "--"], "strip-sections">, |
| 55 | HelpText<"Remove all section headers">; |
| 56 | def strip_non_alloc : Flag<["-", "--"], "strip-non-alloc">, |
| 57 | HelpText<"Remove all non-allocated sections">; |
| 58 | def extract_dwo : Flag<["-", "--"], "extract-dwo">, |
| 59 | HelpText<"Remove all sections that are not DWARF .dwo sections from file">; |
| 60 | def localize_hidden : Flag<["-", "--"], "localize-hidden">, |
| 61 | HelpText<"Mark all symbols that have hidden or internal visibility as local">; |
Paul Semel | b492494 | 2018-04-26 17:44:43 +0000 | [diff] [blame] | 62 | defm localize_symbol : Eq<"localize-symbol">, |
Alexander Shaposhnikov | 40e9bdf | 2018-04-26 18:28:17 +0000 | [diff] [blame] | 63 | MetaVarName<"symbol">, |
| 64 | HelpText<"Mark <symbol> as local">; |
Paul Semel | b492494 | 2018-04-26 17:44:43 +0000 | [diff] [blame] | 65 | def L : JoinedOrSeparate<["-"], "L">, |
| 66 | Alias<localize_symbol>; |
Paul Semel | ee5be79 | 2018-04-27 19:09:44 +0000 | [diff] [blame] | 67 | defm globalize_symbol : Eq<"globalize-symbol">, |
| 68 | MetaVarName<"symbol">, |
| 69 | HelpText<"Mark <symbol> as global">; |
Paul Semel | 3a8a56b | 2018-04-27 19:16:27 +0000 | [diff] [blame^] | 70 | defm weaken_symbol : Eq<"weaken-symbol">, |
| 71 | MetaVarName<"symbol">, |
| 72 | HelpText<"Mark <symbol> as weak">; |
| 73 | def W : JoinedOrSeparate<["-"], "W">, |
| 74 | Alias<weaken_symbol>; |