Index: llvm/trunk/test/tools/dsymutil/cmdline.test
===================================================================
--- llvm/trunk/test/tools/dsymutil/cmdline.test
+++ llvm/trunk/test/tools/dsymutil/cmdline.test
@@ -1,21 +1,19 @@
RUN: dsymutil -help 2>&1 | FileCheck --check-prefix=HELP %s
HELP: OVERVIEW: manipulate archived DWARF debug symbol files.
-HELP: USAGE: dsymutil{{[^ ]*}} [options]
+HELP: USAGE: {{.*}}dsymutil{{[^ ]*}} [options]
HELP-NOT: -reverse-iterate
-HELP: Color Options
-HELP: -color
-HELP: Specific Options:
+HELP: Dsymutil Options:
HELP: -accelerator
-HELP: -arch=
+HELP: -arch
HELP: -dump-debug-map
HELP: -flat
HELP: -minimize
HELP: -no-odr
HELP: -no-output
HELP: -no-swiftmodule-timestamp
-HELP: -num-threads=
-HELP: -o=
-HELP: -oso-prepend-path=
+HELP: -num-threads
+HELP: -oso-prepend-path
+HELP: -o
HELP: -papertrail
HELP: -symbol-map
HELP: -symtab
Index: llvm/trunk/tools/dsymutil/CMakeLists.txt
===================================================================
--- llvm/trunk/tools/dsymutil/CMakeLists.txt
+++ llvm/trunk/tools/dsymutil/CMakeLists.txt
@@ -1,3 +1,7 @@
+set(LLVM_TARGET_DEFINITIONS Options.td)
+tablegen(LLVM Options.inc -gen-opt-parser-defs)
+add_public_tablegen_target(DsymutilTableGen)
+
set(LLVM_LINK_COMPONENTS
AllTargetsAsmPrinters
AllTargetsCodeGens
@@ -7,6 +11,7 @@
DebugInfoDWARF
MC
Object
+ Option
Support
Target
)
@@ -27,6 +32,7 @@
DEPENDS
intrinsics_gen
+ ${tablegen_deps}
)
if(APPLE)
Index: llvm/trunk/tools/dsymutil/Options.td
===================================================================
--- llvm/trunk/tools/dsymutil/Options.td
+++ llvm/trunk/tools/dsymutil/Options.td
@@ -0,0 +1,146 @@
+include "llvm/Option/OptParser.td"
+
+class F: Flag<["--", "-"], name>;
+
+def grp_general : OptionGroup<"Dsymutil">, HelpText<"Dsymutil Options">;
+
+def help: F<"help">,
+ HelpText<"Prints this help output.">,
+ Group;
+def: Flag<["-"], "h">,
+ Alias,
+ HelpText<"Alias for --help">,
+ Group;
+
+def version: F<"version">,
+ HelpText<"Prints the dsymutil version.">,
+ Group;
+def: Flag<["-"], "v">,
+ Alias,
+ HelpText<"Alias for --version">,
+ Group;
+
+def verbose: F<"verbose">,
+ HelpText<"Enable verbose mode.">,
+ Group;
+
+def verify: F<"verify">,
+ HelpText<"Run the DWARF verifier on the linked DWARF debug info.">,
+ Group;
+
+def no_output: F<"no-output">,
+ HelpText<"Do the link in memory, but do not emit the result file.">,
+ Group;
+
+def no_swiftmodule_timestamp: F<"no-swiftmodule-timestamp">,
+ HelpText<"Don't check timestamp for swiftmodule files.">,
+ Group;
+
+def no_odr: F<"no-odr">,
+ HelpText<"Do not use ODR (One Definition Rule) for type uniquing.">,
+ Group;
+
+def dump_debug_map: F<"dump-debug-map">,
+ HelpText<"Parse and dump the debug map to standard output. Not DWARF link will take place.">,
+ Group;
+
+def yaml_input: F<"y">,
+ HelpText<"Treat the input file is a YAML debug map rather than a binary.">,
+ Group;
+
+def papertrail: F<"papertrail">,
+ HelpText<"Embed warnings in the linked DWARF debug info.">,
+ Group;
+
+def assembly: F<"S">,
+ HelpText<"Output textual assembly instead of a binary dSYM companion file.">,
+ Group;
+
+def symtab: F<"symtab">,
+ HelpText<"Dumps the symbol table found in executable or object file(s) and exits.">,
+ Group;
+def: Flag<["-"], "s">,
+ Alias,
+ HelpText<"Alias for --symtab">,
+ Group;
+
+def flat: F<"flat">,
+ HelpText<"Produce a flat dSYM file (not a bundle).">,
+ Group;
+def: Flag<["-"], "f">,
+ Alias,
+ HelpText<"Alias for --flat">,
+ Group;
+
+def minimize: F<"minimize">,
+ HelpText<"When used when creating a dSYM file with Apple accelerator tables, "
+ "this option will suppress the emission of the .debug_inlines, "
+ ".debug_pubnames, and .debug_pubtypes sections since dsymutil "
+ "has better equivalents: .apple_names and .apple_types. When used in "
+ "conjunction with --update option, this option will cause redundant "
+ "accelerator tables to be removed.">,
+ Group;
+def: Flag<["-"], "z">,
+ Alias,
+ HelpText<"Alias for --minimize">,
+ Group;
+
+def update: F<"update">,
+ HelpText<"Updates existing dSYM files to contain the latest accelerator tables and other DWARF optimizations.">,
+ Group;
+def: Flag<["-"], "u">,
+ Alias,
+ HelpText<"Alias for --update">,
+ Group;
+
+def output: Separate<["--", "-"], "o">,
+ MetaVarName<"">,
+ HelpText<"Specify the output file. Defaults to .dwarf">,
+ Group;
+def: Separate<["-"], "out">,
+ Alias