]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/llvm-objcopy/StripOpts.td
Merge llvm trunk r338150, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / llvm-objcopy / StripOpts.td
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
10 defm output : Eq<"o">,
11               MetaVarName<"output">,
12               HelpText<"Write output to <file>">;
13
14 def strip_all : Flag<["-", "--"], "strip-all">,
15                 HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
16
17 def strip_debug : Flag<["-", "--"], "strip-debug">,
18                   HelpText<"Remove debugging symbols only">;
19
20 def d : Flag<["-"], "d">,
21         Alias<strip_debug>;
22
23 def g : Flag<["-"], "g">,
24         Alias<strip_debug>;
25
26 def S : Flag<["-"], "S">,
27         Alias<strip_debug>;
28
29 defm remove_section : Eq<"remove-section">,
30                       MetaVarName<"section">,
31                       HelpText<"Remove <section>">;
32
33 def R : JoinedOrSeparate<["-"], "R">,
34         Alias<remove_section>;
35
36 defm keep_symbol : Eq<"keep-symbol">,
37                    MetaVarName<"symbol">,
38                    HelpText<"Do not remove symbol <symbol>">;
39
40 def K : JoinedOrSeparate<["-"], "K">,
41         Alias<keep_symbol>;
42
43 def discard_all : Flag<["-", "--"], "discard-all">,
44                   HelpText<"Remove all local symbols except file and section symbols">;
45 def x : Flag<["-"], "x">,
46         Alias<discard_all>;
47
48 def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
49                       HelpText<"Remove all symbols not needed by relocations">;