Files
clang-p2996/llvm/tools/llvm-dwarfutil/Options.td
Alexey Lapshin 4539b44148 [Reland][Debuginfo][llvm-dwarfutil] llvm-dwarfutil dsymutil-like tool for ELF.
This patch implements proposal https://lists.llvm.org/pipermail/llvm-dev/2020-August/144579.html
llvm-dwarfutil - is a tool that is used for processing debug info(DWARF) located in built binary files to improve debug info quality, reduce debug info size. The patch currently implements smaller set of command-line options(comparing to the proposal):

```
./llvm-dwarfutil [options] <input file> <output file>

  --garbage-collection    Do garbage collection for debug info(default)
  -j <value>              Alias for --num-threads
  --no-garbage-collection Don`t do garbage collection for debug info
  --no-odr-deduplication  Don`t do ODR deduplication for debug types
  --no-odr                Alias for --no-odr-deduplication
  --no-separate-debug-file
                          Create single output file, containing debug tables(default)
  --num-threads <threads> Number of available threads for multi-threaded execution. Defaults to the number of cores on the current machine
  --odr-deduplication     Do ODR deduplication for debug types(default)
  --odr                   Alias for --odr-deduplication
  --separate-debug-file   Create two output files: file w/o debug tables and file with debug tables
  --tombstone [bfd,maxpc,exec,universal]
                          Tombstone value used as a marker of invalid address(default: universal)
    =bfd - Zero for all addresses and [1,1] for DWARF v4 (or less) address ranges and exec
    =maxpc - Minus 1 for all addresses and minus 2 for DWARF v4 (or less) address ranges
    =exec - Match with address ranges of executable sections
    =universal - Both: bfd and maxpc
```

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D86539
2022-07-19 15:11:36 +03:00

66 lines
2.2 KiB
TableGen

include "llvm/Option/OptParser.td"
multiclass BB<string name, string help1, string help2> {
def NAME: Flag<["--"], name>, HelpText<help1>;
def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
}
def help : Flag<["--"], "help">,
HelpText<"Prints this help output">;
def h : Flag<["-"], "h">,
Alias<help>,
HelpText<"Alias for --help">;
defm odr_deduplication : BB<"odr-deduplication",
"Do ODR deduplication for debug types(default)",
"Don`t do ODR deduplication for debug types">;
def odr : Flag<["--"], "odr">,
Alias<odr_deduplication>,
HelpText<"Alias for --odr-deduplication">;
def no_odr : Flag<["--"], "no-odr">,
Alias<no_odr_deduplication>,
HelpText<"Alias for --no-odr-deduplication">;
defm garbage_collection : BB<"garbage-collection",
"Do garbage collection for debug info(default)",
"Don`t do garbage collection for debug info">;
defm separate_debug_file : BB<"separate-debug-file",
"Create two output files: file w/o debug tables and file with debug tables",
"Create single output file, containing debug tables(default)">;
def tombstone: Separate<["--", "-"], "tombstone">,
MetaVarName<"[bfd,maxpc,exec,universal]">,
HelpText<"Tombstone value used as a marker of invalid address(default: universal)\n"
" =bfd - Zero for all addresses and [1,1] for DWARF v4 (or less) address ranges and exec\n"
" =maxpc - Minus 1 for all addresses and minus 2 for DWARF v4 (or less) address ranges\n"
" =exec - Match with address ranges of executable sections\n"
" =universal - Both: bfd and maxpc"
>;
def: Joined<["--", "-"], "tombstone=">, Alias<tombstone>;
def threads: Separate<["--", "-"], "num-threads">,
MetaVarName<"<threads>">,
HelpText<"Number of available threads for multi-threaded execution. "
"Defaults to the number of cores on the current machine">;
def: Separate<["-"], "j">,
Alias<threads>,
HelpText<"Alias for --num-threads">;
def verbose : Flag<["--"], "verbose">,
HelpText<"Enable verbose logging">;
def verify : Flag<["--"], "verify">,
HelpText<"Run the DWARF verifier on the resulting debug info">;
def version : Flag<["--"], "version">,
HelpText<"Print the version and exit">;
def V : Flag<["-"], "V">,
Alias<version>,
HelpText<"Alias for --version">;