1 include "llvm/Option/OptParser.td"
3 multiclass Eq<string name, string help> {
4 def NAME : Separate<["--", "-"], name>;
5 def NAME #_eq : Joined<["--", "-"], name #"=">,
6 Alias<!cast<Separate>(NAME)>,
10 def help : Flag<["-", "--"], "help">;
12 def enable_deterministic_archives
13 : Flag<["-", "--"], "enable-deterministic-archives">,
14 HelpText<"Enable deterministic mode when stripping archives (use zero "
15 "for UIDs, GIDs, and timestamps).">;
16 def D : Flag<["-"], "D">,
17 Alias<enable_deterministic_archives>,
18 HelpText<"Alias for --enable-deterministic-archives">;
20 def disable_deterministic_archives
21 : Flag<["-", "--"], "disable-deterministic-archives">,
22 HelpText<"Disable deterministic mode when stripping archives (use real "
23 "values for UIDs, GIDs, and timestamps).">;
24 def U : Flag<["-"], "U">,
25 Alias<disable_deterministic_archives>,
26 HelpText<"Alias for --disable-deterministic-archives">;
28 defm output : Eq<"o", "Write output to <file>">, MetaVarName<"output">;
30 def preserve_dates : Flag<["-", "--"], "preserve-dates">,
31 HelpText<"Preserve access and modification timestamps">;
32 def p : Flag<["-"], "p">, Alias<preserve_dates>;
35 : Flag<["-", "--"], "strip-all">,
37 "Remove non-allocated sections other than .gnu.warning* sections">;
38 def s : Flag<["-"], "s">, Alias<strip_all>;
40 def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
41 HelpText<"Compatible with GNU strip's --strip-all">;
42 def strip_debug : Flag<["-", "--"], "strip-debug">,
43 HelpText<"Remove debugging symbols only">;
44 def d : Flag<["-"], "d">, Alias<strip_debug>;
45 def g : Flag<["-"], "g">, Alias<strip_debug>;
46 def S : Flag<["-"], "S">, Alias<strip_debug>;
47 def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
48 HelpText<"Remove all symbols not needed by relocations">;
50 defm remove_section : Eq<"remove-section", "Remove <section>">,
51 MetaVarName<"section">;
52 def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>;
54 defm keep_section : Eq<"keep-section", "Keep <section>">,
55 MetaVarName<"section">;
56 defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">,
57 MetaVarName<"symbol">;
58 def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>;
61 : Flag<["-", "--"], "discard-all">,
62 HelpText<"Remove all local symbols except file and section symbols">;
63 def x : Flag<["-"], "x">, Alias<discard_all>;
65 def version : Flag<["-", "--"], "version">,
66 HelpText<"Print the version and exit.">;
67 def V : Flag<["-"], "V">, Alias<version>;