Opts.td 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. include "llvm/Option/OptParser.td"
  2. class F<string letter, string help> : Flag<["-"], letter>, HelpText<help>;
  3. class FF<string name, string help> : Flag<["--"], name>, HelpText<help>;
  4. multiclass BB<string name, string help1, string help2> {
  5. def NAME: Flag<["--"], name>, HelpText<help1>;
  6. def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
  7. }
  8. multiclass Eq<string name, string help> {
  9. def NAME #_EQ : Joined<["--"], name #"=">, HelpText<help>;
  10. def : Separate<["--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
  11. }
  12. def X : JoinedOrSeparate<["-"], "X">, HelpText<"Specifies the type of ELF, XCOFF, or IR object file to examine. The value must be one of: 32, 64, 32_64, any (default)">;
  13. def debug_syms : FF<"debug-syms", "Show all symbols, even debugger only">;
  14. def defined_only : FF<"defined-only", "Show only defined symbols">;
  15. defm demangle : BB<"demangle", "Demangle C++ symbol names", "Don't demangle symbol names">;
  16. def dynamic : FF<"dynamic", "Display dynamic symbols instead of normal symbols">;
  17. def export_symbols : FF<"export-symbols", "Export symbol list for all inputs">;
  18. def extern_only : FF<"extern-only", "Show only external symbols">;
  19. defm format : Eq<"format", "Specify output format: bsd (default), posix, sysv, darwin, just-symbols">, MetaVarName<"<format>">;
  20. def help : FF<"help", "Display this help">;
  21. def no_llvm_bc : FF<"no-llvm-bc", "Disable LLVM bitcode reader">;
  22. def no_sort : FF<"no-sort", "Show symbols in order encountered">;
  23. def no_weak : FF<"no-weak", "Show only non-weak symbols">;
  24. def numeric_sort : FF<"numeric-sort", "Sort symbols by address">;
  25. def print_armap : FF<"print-armap", "Print the archive map">;
  26. def print_file_name : FF<"print-file-name", "Precede each symbol with the object file it came from">;
  27. def print_size : FF<"print-size", "Show symbol size as well as address">;
  28. def quiet : FF<"quiet", "Suppress 'no symbols' diagnostic">;
  29. defm radix : Eq<"radix", "Radix (o/d/x) for printing symbol Values">, MetaVarName<"<radix>">;
  30. def reverse_sort : FF<"reverse-sort", "Sort in reverse order">;
  31. def size_sort : FF<"size-sort", "Sort symbols by size">;
  32. def special_syms : FF<"special-syms", "Do not filter special symbols from the output">;
  33. def undefined_only : FF<"undefined-only", "Show only undefined symbols">;
  34. def version : FF<"version", "Display the version">;
  35. def without_aliases : FF<"without-aliases", "Exclude aliases from output">, Flags<[HelpHidden]>;
  36. // Mach-O specific options.
  37. def grp_mach_o : OptionGroup<"kind">, HelpText<"llvm-nm Mach-O Specific Options">;
  38. def add_dyldinfo : FF<"add-dyldinfo", "Add symbols from the dyldinfo not already in the symbol table">, Group<grp_mach_o>;
  39. def add_inlinedinfo : FF<"add-inlinedinfo", "Add symbols from the inlined libraries, TBD only">, Group<grp_mach_o>;
  40. def arch_EQ : Joined<["--"], "arch=">, HelpText<"architecture(s) from a Mach-O file to dump">, Group<grp_mach_o>;
  41. def : Separate<["--", "-"], "arch">, Alias<arch_EQ>;
  42. def dyldinfo_only : FF<"dyldinfo-only", "Show only symbols from the dyldinfo">, Group<grp_mach_o>;
  43. def no_dyldinfo : FF<"no-dyldinfo", "Don't add any symbols from the dyldinfo">, Group<grp_mach_o>;
  44. def s : F<"s", "Dump only symbols from this segment and section name">, Group<grp_mach_o>;
  45. def x : F<"x", "Print symbol entry in hex">, Group<grp_mach_o>;
  46. // XCOFF specific options.
  47. def grp_xcoff_o : OptionGroup<"kind">, HelpText<"llvm-nm XCOFF Specific Options">;
  48. def no_rsrc : FF<"no-rsrc", "Exclude resource file symbols (__rsrc) from the export symbol list.">, Group<grp_xcoff_o>;
  49. def : FF<"just-symbol-name", "Alias for --format=just-symbols">, Alias<format_EQ>, AliasArgs<["just-symbols"]>, Flags<[HelpHidden]>;
  50. def : FF<"portability", "Alias for --format=posix">, Alias<format_EQ>, AliasArgs<["posix"]>;
  51. def : F<"a", "Alias for --debug-syms">, Alias<debug_syms>;
  52. def : F<"A", "Alias for --print-file-name">, Alias<print_file_name>;
  53. def : F<"B", "Alias for --format=bsd">, Alias<format_EQ>, AliasArgs<["bsd"]>;
  54. def : F<"C", "Alias for --demangle">, Alias<demangle>;
  55. def : F<"D", "Alias for --dynamic">, Alias<dynamic>;
  56. def : JoinedOrSeparate<["-"], "f">, HelpText<"Alias for --format">, Alias<format_EQ>, MetaVarName<"<format>">;
  57. def : F<"h", "Alias for --help">, Alias<help>;
  58. def : F<"g", "Alias for --extern-only">, Alias<extern_only>;
  59. def : F<"j", "Alias for --format=just-symbols">, Alias<format_EQ>, AliasArgs<["just-symbols"]>;
  60. def : F<"m", "Alias for --format=darwin">, Alias<format_EQ>, AliasArgs<["darwin"]>;
  61. def : F<"M", "Deprecated alias for --print-armap">, Alias<print_armap>, Flags<[HelpHidden]>;
  62. def : F<"n", "Alias for --numeric-sort">, Alias<numeric_sort>;
  63. def : F<"o", "Alias for --print-file-name">, Alias<print_file_name>;
  64. def : F<"p", "Alias for --no-sort">, Alias<no_sort>;
  65. def : F<"P", "Alias for --format=posix">, Alias<format_EQ>, AliasArgs<["posix"]>;
  66. def : F<"r", "Alias for --reverse-sort">, Alias<reverse_sort>;
  67. def : F<"S", "Alias for --print-size">, Alias<print_size>;
  68. def : JoinedOrSeparate<["-"], "t">, HelpText<"Alias for --radix">, Alias<radix_EQ>, MetaVarName<"<radix>">;
  69. def : F<"u", "Alias for --undefined-only">, Alias<undefined_only>;
  70. def : F<"U", "Alias for --defined-only">, Alias<defined_only>;
  71. def : F<"v", "Alias for --numeric-sort">, Alias<numeric_sort>;
  72. def : F<"V", "Alias for --version">, Alias<version>;
  73. def : F<"W", "Alias for --no-weak">, Alias<no_weak>;