17330f729Sjoerginclude "llvm/Option/OptParser.td" 27330f729Sjoerg 37330f729Sjoergmulticlass Eq<string name, string help> { 47330f729Sjoerg def NAME : Separate<["--"], name>; 57330f729Sjoerg def NAME #_eq : Joined<["--"], name #"=">, 67330f729Sjoerg Alias<!cast<Separate>(NAME)>, 77330f729Sjoerg HelpText<help>; 87330f729Sjoerg} 97330f729Sjoerg 107330f729Sjoergdef help : Flag<["--"], "help">; 117330f729Sjoergdef h : Flag<["-"], "h">, Alias<help>; 127330f729Sjoerg 137330f729Sjoergdef allow_broken_links 147330f729Sjoerg : Flag<["--"], "allow-broken-links">, 157330f729Sjoerg HelpText<"Allow the tool to remove sections even if it would leave " 167330f729Sjoerg "invalid section references. The appropriate sh_link fields " 177330f729Sjoerg "will be set to zero.">; 187330f729Sjoerg 197330f729Sjoergdef enable_deterministic_archives 207330f729Sjoerg : Flag<["--"], "enable-deterministic-archives">, 217330f729Sjoerg HelpText<"Enable deterministic mode when operating on archives (use " 227330f729Sjoerg "zero for UIDs, GIDs, and timestamps).">; 237330f729Sjoergdef D : Flag<["-"], "D">, 247330f729Sjoerg Alias<enable_deterministic_archives>, 257330f729Sjoerg HelpText<"Alias for --enable-deterministic-archives">; 267330f729Sjoerg 277330f729Sjoergdef disable_deterministic_archives 287330f729Sjoerg : Flag<["--"], "disable-deterministic-archives">, 297330f729Sjoerg HelpText<"Disable deterministic mode when operating on archives (use " 307330f729Sjoerg "real values for UIDs, GIDs, and timestamps).">; 317330f729Sjoergdef U : Flag<["-"], "U">, 327330f729Sjoerg Alias<disable_deterministic_archives>, 337330f729Sjoerg HelpText<"Alias for --disable-deterministic-archives">; 347330f729Sjoerg 357330f729Sjoergdef preserve_dates : Flag<["--"], "preserve-dates">, 367330f729Sjoerg HelpText<"Preserve access and modification timestamps">; 377330f729Sjoergdef p : Flag<["-"], "p">, 387330f729Sjoerg Alias<preserve_dates>, 397330f729Sjoerg HelpText<"Alias for --preserve-dates">; 407330f729Sjoerg 417330f729Sjoergdef strip_all : Flag<["--"], "strip-all">, 427330f729Sjoerg HelpText<"Remove non-allocated sections outside segments. " 43*82d56013Sjoerg ".gnu.warning* and .ARM.attribute sections are not " 44*82d56013Sjoerg "removed">; 457330f729Sjoerg 467330f729Sjoergdef strip_all_gnu 477330f729Sjoerg : Flag<["--"], "strip-all-gnu">, 487330f729Sjoerg HelpText<"Compatible with GNU's --strip-all">; 497330f729Sjoerg 507330f729Sjoergdef strip_debug : Flag<["--"], "strip-debug">, 517330f729Sjoerg HelpText<"Remove all debug sections">; 527330f729Sjoergdef g : Flag<["-"], "g">, 537330f729Sjoerg Alias<strip_debug>, 547330f729Sjoerg HelpText<"Alias for --strip-debug">; 557330f729Sjoerg 567330f729Sjoergdef strip_unneeded : Flag<["--"], "strip-unneeded">, 577330f729Sjoerg HelpText<"Remove all symbols not needed by relocations">; 587330f729Sjoerg 597330f729Sjoergdefm remove_section : Eq<"remove-section", "Remove <section>">, 607330f729Sjoerg MetaVarName<"section">; 617330f729Sjoergdef R : JoinedOrSeparate<["-"], "R">, 627330f729Sjoerg Alias<remove_section>, 637330f729Sjoerg HelpText<"Alias for --remove-section">; 647330f729Sjoerg 657330f729Sjoergdef strip_sections 667330f729Sjoerg : Flag<["--"], "strip-sections">, 677330f729Sjoerg HelpText<"Remove all section headers and all sections not in segments">; 687330f729Sjoerg 697330f729Sjoergdefm strip_symbol : Eq<"strip-symbol", "Strip <symbol>">, 707330f729Sjoerg MetaVarName<"symbol">; 717330f729Sjoergdef N : JoinedOrSeparate<["-"], "N">, 727330f729Sjoerg Alias<strip_symbol>, 737330f729Sjoerg HelpText<"Alias for --strip-symbol">; 747330f729Sjoerg 757330f729Sjoergdefm keep_section : Eq<"keep-section", "Keep <section>">, 767330f729Sjoerg MetaVarName<"section">; 777330f729Sjoerg 787330f729Sjoergdefm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">, 797330f729Sjoerg MetaVarName<"symbol">; 807330f729Sjoergdef K : JoinedOrSeparate<["-"], "K">, 817330f729Sjoerg Alias<keep_symbol>, 827330f729Sjoerg HelpText<"Alias for --keep-symbol">; 837330f729Sjoerg 847330f729Sjoergdef keep_file_symbols : Flag<["--"], "keep-file-symbols">, 857330f729Sjoerg HelpText<"Do not remove file symbols">; 867330f729Sjoerg 87*82d56013Sjoergdef keep_undefined : Flag<["--"], "keep-undefined">, 88*82d56013Sjoerg HelpText<"Do not remove undefined symbols">; 89*82d56013Sjoerg 907330f729Sjoergdef only_keep_debug 917330f729Sjoerg : Flag<["--"], "only-keep-debug">, 92*82d56013Sjoerg HelpText< 93*82d56013Sjoerg "Produce a debug file as the output that only preserves contents of " 94*82d56013Sjoerg "sections useful for debugging purposes">; 957330f729Sjoerg 967330f729Sjoergdef discard_locals : Flag<["--"], "discard-locals">, 977330f729Sjoerg HelpText<"Remove compiler-generated local symbols, (e.g. " 987330f729Sjoerg "symbols starting with .L)">; 997330f729Sjoergdef X : Flag<["-"], "X">, 1007330f729Sjoerg Alias<discard_locals>, 1017330f729Sjoerg HelpText<"Alias for --discard-locals">; 1027330f729Sjoerg 1037330f729Sjoergdef discard_all 1047330f729Sjoerg : Flag<["--"], "discard-all">, 105*82d56013Sjoerg HelpText<"Remove all local symbols except file and section symbols. Also " 106*82d56013Sjoerg "remove all debug sections">; 1077330f729Sjoergdef x : Flag<["-"], "x">, 1087330f729Sjoerg Alias<discard_all>, 1097330f729Sjoerg HelpText<"Alias for --discard-all">; 1107330f729Sjoerg 1117330f729Sjoergdef regex 1127330f729Sjoerg : Flag<["--"], "regex">, 1137330f729Sjoerg HelpText<"Permit regular expressions in name comparison">; 1147330f729Sjoerg 1157330f729Sjoergdef version : Flag<["--"], "version">, 1167330f729Sjoerg HelpText<"Print the version and exit.">; 1177330f729Sjoergdef V : Flag<["-"], "V">, 1187330f729Sjoerg Alias<version>, 1197330f729Sjoerg HelpText<"Alias for --version">; 1207330f729Sjoerg 1217330f729Sjoergdef wildcard 1227330f729Sjoerg : Flag<["--"], "wildcard">, 1237330f729Sjoerg HelpText<"Allow wildcard syntax for symbol-related flags. Incompatible " 1247330f729Sjoerg "with --regex. Allows using '*' to match any number of " 1257330f729Sjoerg "characters, '?' to match any single character, '\' to escape " 1267330f729Sjoerg "special characters, and '[]' to define character classes. " 1277330f729Sjoerg "Wildcards beginning with '!' will prevent a match, for example " 1287330f729Sjoerg "\"-N '*' -N '!x'\" will strip all symbols except for \"x\".">; 1297330f729Sjoergdef w : Flag<["-"], "w">, Alias<wildcard>, HelpText<"Alias for --wildcard">; 130