OSDN Git Service

821dfa3b277be724a57a0bacf6de61aed5d9af6b
[android-x86/external-llvm.git] / 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 preserve_dates : Flag<[ "-", "--" ], "preserve-dates">,
15                      HelpText<"Preserve access and modification timestamps">;
16
17 def p : Flag<[ "-" ], "p">, Alias<preserve_dates>;
18
19 def strip_all : Flag<["-", "--"], "strip-all">,
20                 HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
21
22 def strip_debug : Flag<["-", "--"], "strip-debug">,
23                   HelpText<"Remove debugging symbols only">;
24
25 def d : Flag<["-"], "d">,
26         Alias<strip_debug>;
27
28 def g : Flag<["-"], "g">,
29         Alias<strip_debug>;
30
31 def S : Flag<["-"], "S">,
32         Alias<strip_debug>;
33
34 defm remove_section : Eq<"remove-section">,
35                       MetaVarName<"section">,
36                       HelpText<"Remove <section>">;
37
38 def R : JoinedOrSeparate<["-"], "R">,
39         Alias<remove_section>;
40
41 defm keep_symbol : Eq<"keep-symbol">,
42                    MetaVarName<"symbol">,
43                    HelpText<"Do not remove symbol <symbol>">;
44
45 def K : JoinedOrSeparate<["-"], "K">,
46         Alias<keep_symbol>;
47
48 def discard_all : Flag<["-", "--"], "discard-all">,
49                   HelpText<"Remove all local symbols except file and section symbols">;
50
51 def version : Flag<[ "-", "--" ], "version">,
52               HelpText<"Print the version and exit.">;
53
54 def x : Flag<["-"], "x">,
55         Alias<discard_all>;
56
57 def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
58                       HelpText<"Remove all symbols not needed by relocations">;