]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/llvm-objcopy/StripOpts.td
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / llvm-objcopy / StripOpts.td
1 include "llvm/Option/OptParser.td"
2
3 multiclass Eq<string name, string help> {
4   def NAME : Separate<["--"], name>;
5   def NAME #_eq : Joined<["--"], name #"=">,
6                   Alias<!cast<Separate>(NAME)>,
7                   HelpText<help>;
8 }
9
10 def help : Flag<["--"], "help">;
11 def h : Flag<["-"], "h">, Alias<help>;
12
13 def allow_broken_links
14     : Flag<["--"], "allow-broken-links">,
15       HelpText<"Allow llvm-strip to remove sections even if it would leave "
16                "invalid section references. The appropriate sh_link fields "
17                "will be set to zero.">;
18
19 def enable_deterministic_archives
20     : Flag<["--"], "enable-deterministic-archives">,
21       HelpText<"Enable deterministic mode when stripping archives (use zero "
22                "for UIDs, GIDs, and timestamps).">;
23 def D : Flag<["-"], "D">,
24         Alias<enable_deterministic_archives>,
25         HelpText<"Alias for --enable-deterministic-archives">;
26
27 def disable_deterministic_archives
28     : Flag<["--"], "disable-deterministic-archives">,
29       HelpText<"Disable deterministic mode when stripping archives (use real "
30                "values for UIDs, GIDs, and timestamps).">;
31 def U : Flag<["-"], "U">,
32         Alias<disable_deterministic_archives>,
33         HelpText<"Alias for --disable-deterministic-archives">;
34
35 def output : JoinedOrSeparate<["-"], "o">, HelpText<"Write output to <file>">;
36
37 def preserve_dates : Flag<["--"], "preserve-dates">,
38                      HelpText<"Preserve access and modification timestamps">;
39 def p : Flag<["-"], "p">, Alias<preserve_dates>;
40
41 def strip_all : Flag<["--"], "strip-all">,
42                 HelpText<"Remove non-allocated sections outside segments. "
43                          ".gnu.warning* sections are not removed">;
44 def s : Flag<["-"], "s">, Alias<strip_all>;
45 def no_strip_all : Flag<["--"], "no-strip-all">,
46                    HelpText<"Disable --strip-all">;
47
48 def strip_all_gnu : Flag<["--"], "strip-all-gnu">,
49                     HelpText<"Compatible with GNU strip's --strip-all">;
50 def strip_debug : Flag<["--"], "strip-debug">,
51                   HelpText<"Remove debugging symbols only">;
52 def d : Flag<["-"], "d">, Alias<strip_debug>;
53 def g : Flag<["-"], "g">, Alias<strip_debug>;
54 def S : Flag<["-"], "S">, Alias<strip_debug>;
55 def strip_unneeded : Flag<["--"], "strip-unneeded">,
56                      HelpText<"Remove all symbols not needed by relocations">;
57
58 defm remove_section : Eq<"remove-section", "Remove <section>">,
59                       MetaVarName<"section">;
60 def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>;
61
62 defm strip_symbol : Eq<"strip-symbol", "Strip <symbol>">,
63                     MetaVarName<"symbol">;
64 def N : JoinedOrSeparate<["-"], "N">, Alias<strip_symbol>;
65
66 defm keep_section : Eq<"keep-section", "Keep <section>">,
67                     MetaVarName<"section">;
68 defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">,
69                    MetaVarName<"symbol">;
70 def keep_file_symbols : Flag<["--"], "keep-file-symbols">,
71                         HelpText<"Do not remove file symbols">;
72
73 def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>;
74
75 def only_keep_debug
76     : Flag<["--"], "only-keep-debug">,
77       HelpText<"Clear sections that would not be stripped by --strip-debug. "
78                "Currently only implemented for COFF.">;
79
80 def discard_locals : Flag<["--"], "discard-locals">,
81                      HelpText<"Remove compiler-generated local symbols, (e.g. "
82                               "symbols starting with .L)">;
83 def X : Flag<["-"], "X">, Alias<discard_locals>;
84
85 def discard_all
86     : Flag<["--"], "discard-all">,
87       HelpText<"Remove all local symbols except file and section symbols">;
88 def x : Flag<["-"], "x">, Alias<discard_all>;
89
90 def regex
91     : Flag<["--"], "regex">,
92       HelpText<"Permit regular expressions in name comparison">;
93
94 def version : Flag<["--"], "version">,
95               HelpText<"Print the version and exit.">;
96 def V : Flag<["-"], "V">, Alias<version>;