diff options
| author | Jordan Rupprecht <rupprecht@google.com> | 2018-11-01 21:38:14 +0000 |
|---|---|---|
| committer | Jordan Rupprecht <rupprecht@google.com> | 2018-11-01 21:38:14 +0000 |
| commit | 56c0ee02aff6f43f935e26a9635776e4f5c18e2a (patch) | |
| tree | 58bb41e5b00ffc3e1bc0bd08a089792235d44331 /llvm/tools | |
| parent | 2ac403e25a7aa23906721ec2130658dbc4d42aa1 (diff) | |
| download | bcm5719-llvm-56c0ee02aff6f43f935e26a9635776e4f5c18e2a.tar.gz bcm5719-llvm-56c0ee02aff6f43f935e26a9635776e4f5c18e2a.zip | |
[llvm-objcopy/strip] [NFC] Clean up tablegen opts (clang-format + reorganizing things).
llvm-svn: 345896
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-objcopy/ObjcopyOpts.td | 155 | ||||
| -rw-r--r-- | llvm/tools/llvm-objcopy/StripOpts.td | 63 |
2 files changed, 108 insertions, 110 deletions
diff --git a/llvm/tools/llvm-objcopy/ObjcopyOpts.td b/llvm/tools/llvm-objcopy/ObjcopyOpts.td index effcca89e4d..285ab9d69db 100644 --- a/llvm/tools/llvm-objcopy/ObjcopyOpts.td +++ b/llvm/tools/llvm-objcopy/ObjcopyOpts.td @@ -1,35 +1,39 @@ include "llvm/Option/OptParser.td" multiclass Eq<string name, string help> { - def NAME: Separate<["--", "-"], name>; - def NAME # _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>, - HelpText<help>; + def NAME : Separate<["--", "-"], name>; + def NAME #_eq : Joined<["--", "-"], name #"=">, + Alias<!cast<Separate>(NAME)>, + HelpText<help>; } def help : Flag<["-", "--"], "help">; + defm binary_architecture : Eq<"binary-architecture", "Used when transforming an architecture-less " "format (such as binary) to another format">; -def B : JoinedOrSeparate<["-"], "B">, - Alias<binary_architecture>; +def B : JoinedOrSeparate<["-"], "B">, Alias<binary_architecture>; + defm target : Eq<"target", "Format of the input and output file">, Values<"binary">; -def F : JoinedOrSeparate<[ "-" ], "F">, Alias<target>; +def F : JoinedOrSeparate<["-"], "F">, Alias<target>; + defm input_target : Eq<"input-target", "Format of the input file">, Values<"binary">; -def I : JoinedOrSeparate<[ "-" ], "I">, Alias<input_target>; +def I : JoinedOrSeparate<["-"], "I">, Alias<input_target>; + defm output_target : Eq<"output-target", "Format of the output file">, Values<"binary">; +def O : JoinedOrSeparate<["-"], "O">, Alias<output_target>; + def compress_debug_sections : Flag<["--", "-"], "compress-debug-sections">; -def compress_debug_sections_eq : Joined<["--", "-"], "compress-debug-sections=">, - MetaVarName<"[ zlib | zlib-gnu ]">, - HelpText<"Compress DWARF debug sections using " - "specified style. Supported styles: " - "'zlib-gnu' and 'zlib'">; +def compress_debug_sections_eq + : Joined<["--", "-"], "compress-debug-sections=">, + MetaVarName<"[ zlib | zlib-gnu ]">, + HelpText<"Compress DWARF debug sections using specified style. Supported " + "styles: 'zlib-gnu' and 'zlib'">; def decompress_debug_sections : Flag<["-", "--"], "decompress-debug-sections">, HelpText<"Decompress DWARF debug sections.">; -def O : JoinedOrSeparate<["-"], "O">, - Alias<output_target>; defm split_dwo : Eq<"split-dwo", "Equivalent to extract-dwo on the input file to " "<dwo-file>, then strip-dwo on the input file">, @@ -51,39 +55,41 @@ def U : Flag<["-"], "U">, Alias<disable_deterministic_archives>, HelpText<"Alias for --disable-deterministic-archives">; -def preserve_dates : Flag<[ "-", "--" ], "preserve-dates">, +def preserve_dates : Flag<["-", "--"], "preserve-dates">, HelpText<"Preserve access and modification timestamps">; +def p : Flag<["-"], "p">, Alias<preserve_dates>; -def p : Flag<[ "-" ], "p">, Alias<preserve_dates>; +defm add_gnu_debuglink + : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">, + MetaVarName<"debug-file">; -defm add_gnu_debuglink : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">, - MetaVarName<"debug-file">; defm remove_section : Eq<"remove-section", "Remove <section>">, MetaVarName<"section">; +def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>; + defm rename_section : Eq<"rename-section", "Renames a section from old to new, optionally with specified flags. " "Flags supported for GNU compatibility: alloc, load, noload, " "readonly, debug, code, data, rom, share, contents, merge, strings.">, MetaVarName<"old=new[,flag1,...]">; -defm redefine_symbol : Eq<"redefine-sym", "Change the name of a symbol old to new">, - MetaVarName<"old=new">; -def R : JoinedOrSeparate<["-"], "R">, - Alias<remove_section>; -defm keep : Eq<"keep", "Keep <section>">, - MetaVarName<"section">; +defm redefine_symbol + : Eq<"redefine-sym", "Change the name of a symbol old to new">, + MetaVarName<"old=new">; +defm keep : Eq<"keep", "Keep <section>">, MetaVarName<"section">; defm only_keep : Eq<"only-keep", "Remove all but <section>">, MetaVarName<"section">; -def j : JoinedOrSeparate<["-"], "j">, - Alias<only_keep>; +def j : JoinedOrSeparate<["-"], "j">, Alias<only_keep>; defm add_section : Eq<"add-section", "Make a section named <section> with the contents of <file>.">, MetaVarName<"section=file">; -def strip_all : Flag<["-", "--"], "strip-all">, - HelpText<"Remove non-allocated sections other than .gnu.warning* sections">; -def S : Flag<["-"], "S">, - Alias<strip_all>; + +def strip_all + : Flag<["-", "--"], "strip-all">, + HelpText< + "Remove non-allocated sections other than .gnu.warning* sections">; +def S : Flag<["-"], "S">, Alias<strip_all>; def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">, HelpText<"Compatible with GNU objcopy's --strip-all">; def strip_debug : Flag<["-", "--"], "strip-debug">, @@ -94,60 +100,67 @@ def strip_sections : Flag<["-", "--"], "strip-sections">, HelpText<"Remove all section headers">; def strip_non_alloc : Flag<["-", "--"], "strip-non-alloc">, HelpText<"Remove all non-allocated sections">; -def extract_dwo : Flag<["-", "--"], "extract-dwo">, - HelpText<"Remove all sections that are not DWARF .dwo sections from file">; -def localize_hidden : Flag<["-", "--"], "localize-hidden">, - HelpText<"Mark all symbols that have hidden or internal visibility as local">; +def strip_unneeded : Flag<["-", "--"], "strip-unneeded">, + HelpText<"Remove all symbols not needed by relocations">; + +def extract_dwo + : Flag<["-", "--"], "extract-dwo">, + HelpText< + "Remove all sections that are not DWARF .dwo sections from file">; + +def localize_hidden + : Flag<["-", "--"], "localize-hidden">, + HelpText< + "Mark all symbols that have hidden or internal visibility as local">; defm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">, MetaVarName<"symbol">; -def L : JoinedOrSeparate<["-"], "L">, - Alias<localize_symbol>; -defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">, - MetaVarName<"symbol">; +def L : JoinedOrSeparate<["-"], "L">, Alias<localize_symbol>; +defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">, + MetaVarName<"symbol">; defm keep_global_symbol - : Eq<"keep-global-symbol", "Convert all symbols except <symbol> to local. May be repeated " - "to convert all except a set of symbols to local.">, + : Eq<"keep-global-symbol", + "Convert all symbols except <symbol> to local. May be repeated to " + "convert all except a set of symbols to local.">, MetaVarName<"symbol">; -def G : JoinedOrSeparate<[ "-" ], "G">, Alias<keep_global_symbol>; +def G : JoinedOrSeparate<["-"], "G">, Alias<keep_global_symbol>; defm keep_global_symbols : Eq<"keep-global-symbols", "Reads a list of symbols from <filename> and runs as if " - "--keep-global-symbol=<symbol> is set for each one. <filename> " - "contains one symbol per line and may contain comments beginning " - "with '#'. Leading and trailing whitespace is stripped from each " - "line. May be repeated to read symbols from many files.">, + "--keep-global-symbol=<symbol> is set for each one. <filename> " + "contains one symbol per line and may contain comments beginning with " + "'#'. Leading and trailing whitespace is stripped from each line. May " + "be repeated to read symbols from many files.">, MetaVarName<"filename">; -def version : Flag<[ "-", "--" ], "version">, - HelpText<"Print the version and exit.">; - defm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">, - MetaVarName<"symbol">; -def W : JoinedOrSeparate<["-"], "W">, - Alias<weaken_symbol>; + MetaVarName<"symbol">; +def W : JoinedOrSeparate<["-"], "W">, Alias<weaken_symbol>; def weaken : Flag<["-", "--"], "weaken">, - HelpText<"Mark all global symbols as weak">; -def discard_all : Flag<["-", "--"], "discard-all">, - HelpText<"Remove all local symbols except file and section symbols">; -def x : Flag<["-"], "x">, - Alias<discard_all>; + HelpText<"Mark all global symbols as weak">; +def discard_all + : Flag<["-", "--"], "discard-all">, + HelpText<"Remove all local symbols except file and section symbols">; +def x : Flag<["-"], "x">, Alias<discard_all>; defm strip_symbol : Eq<"strip-symbol", "Remove symbol <symbol>">, - MetaVarName<"symbol">; -def N : JoinedOrSeparate<["-"], "N">, - Alias<strip_symbol>; + MetaVarName<"symbol">; +def N : JoinedOrSeparate<["-"], "N">, Alias<strip_symbol>; defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">, - MetaVarName<"symbol">; -def K : JoinedOrSeparate<["-"], "K">, - Alias<keep_symbol>; -def only_keep_debug : Flag<["-", "--"], "only-keep-debug">, - HelpText<"Currently ignored. Only for compatibility with GNU objcopy.">; -def strip_unneeded : Flag<["-", "--"], "strip-unneeded">, - HelpText<"Remove all symbols not needed by relocations">; + MetaVarName<"symbol">; +def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>; +def only_keep_debug + : Flag<["-", "--"], "only-keep-debug">, + HelpText<"Currently ignored. Only for compatibility with GNU objcopy.">; def keep_file_symbols : Flag<["-", "--"], "keep-file-symbols">, - HelpText<"Do not remove file symbols">; -defm dump_section : Eq<"dump-section", "Dump contents of section named <section> into file <file>">, - MetaVarName<"section=file">; -defm prefix_symbols : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">, - MetaVarName<"prefix">; + HelpText<"Do not remove file symbols">; +defm dump_section + : Eq<"dump-section", + "Dump contents of section named <section> into file <file>">, + MetaVarName<"section=file">; +defm prefix_symbols + : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">, + MetaVarName<"prefix">; + +def version : Flag<["-", "--"], "version">, + HelpText<"Print the version and exit.">; diff --git a/llvm/tools/llvm-objcopy/StripOpts.td b/llvm/tools/llvm-objcopy/StripOpts.td index 99d5d83914b..3660148f883 100644 --- a/llvm/tools/llvm-objcopy/StripOpts.td +++ b/llvm/tools/llvm-objcopy/StripOpts.td @@ -1,9 +1,10 @@ include "llvm/Option/OptParser.td" multiclass Eq<string name, string help> { - def NAME: Separate<["--", "-"], name>; - def NAME # _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>, - HelpText<help>; + def NAME : Separate<["--", "-"], name>; + def NAME #_eq : Joined<["--", "-"], name #"=">, + Alias<!cast<Separate>(NAME)>, + HelpText<help>; } def help : Flag<["-", "--"], "help">; @@ -24,57 +25,41 @@ def U : Flag<["-"], "U">, Alias<disable_deterministic_archives>, HelpText<"Alias for --disable-deterministic-archives">; -defm output : Eq<"o", "Write output to <file>">, - MetaVarName<"output">; +defm output : Eq<"o", "Write output to <file>">, MetaVarName<"output">; -def preserve_dates : Flag<[ "-", "--" ], "preserve-dates">, +def preserve_dates : Flag<["-", "--"], "preserve-dates">, HelpText<"Preserve access and modification timestamps">; +def p : Flag<["-"], "p">, Alias<preserve_dates>; -def p : Flag<[ "-" ], "p">, Alias<preserve_dates>; - -def strip_all : Flag<["-", "--"], "strip-all">, - HelpText<"Remove non-allocated sections other than .gnu.warning* sections">; - -def s : Flag<["-"], "s">, - Alias<strip_all>; +def strip_all + : Flag<["-", "--"], "strip-all">, + HelpText< + "Remove non-allocated sections other than .gnu.warning* sections">; +def s : Flag<["-"], "s">, Alias<strip_all>; def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">, HelpText<"Compatible with GNU strip's --strip-all">; - def strip_debug : Flag<["-", "--"], "strip-debug">, HelpText<"Remove debugging symbols only">; - -def d : Flag<["-"], "d">, - Alias<strip_debug>; - -def g : Flag<["-"], "g">, - Alias<strip_debug>; - -def S : Flag<["-"], "S">, - Alias<strip_debug>; +def d : Flag<["-"], "d">, Alias<strip_debug>; +def g : Flag<["-"], "g">, Alias<strip_debug>; +def S : Flag<["-"], "S">, Alias<strip_debug>; +def strip_unneeded : Flag<["-", "--"], "strip-unneeded">, + HelpText<"Remove all symbols not needed by relocations">; defm remove_section : Eq<"remove-section", "Remove <section>">, MetaVarName<"section">; - -def R : JoinedOrSeparate<["-"], "R">, - Alias<remove_section>; +def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>; defm keep : Eq<"keep", "Keep <section>">, MetaVarName<"section">; - defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">, MetaVarName<"symbol">; +def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>; -def K : JoinedOrSeparate<["-"], "K">, - Alias<keep_symbol>; - -def discard_all : Flag<["-", "--"], "discard-all">, - HelpText<"Remove all local symbols except file and section symbols">; +def discard_all + : Flag<["-", "--"], "discard-all">, + HelpText<"Remove all local symbols except file and section symbols">; +def x : Flag<["-"], "x">, Alias<discard_all>; -def version : Flag<[ "-", "--" ], "version">, +def version : Flag<["-", "--"], "version">, HelpText<"Print the version and exit.">; - -def x : Flag<["-"], "x">, - Alias<discard_all>; - -def strip_unneeded : Flag<["-", "--"], "strip-unneeded">, - HelpText<"Remove all symbols not needed by relocations">; |

