Opts.td 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. include "llvm/Option/OptParser.td"
  2. multiclass B<string name, string help1, string help2> {
  3. def NAME: Flag<["--"], name>, HelpText<help1>;
  4. def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
  5. }
  6. multiclass Eq<string name, string help> {
  7. def NAME #_EQ : Joined<["--"], name #"=">,
  8. HelpText<help>;
  9. def : Separate<["--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
  10. }
  11. class F<string name, string help>: Flag<["--"], name>, HelpText<help>;
  12. def grp_mach_o : OptionGroup<"kind">,
  13. HelpText<"llvm-symbolizer Mach-O Specific Options">;
  14. def addresses : F<"addresses", "Show address before line information">;
  15. defm adjust_vma
  16. : Eq<"adjust-vma", "Add specified offset to object file addresses">,
  17. MetaVarName<"<offset>">;
  18. def basenames : Flag<["--"], "basenames">, HelpText<"Strip directory names from paths">;
  19. defm build_id : Eq<"build-id", "Build ID used to look up the object file">;
  20. defm cache_size : Eq<"cache-size", "Max size in bytes of the in-memory binary cache.">;
  21. def color : F<"color", "Use color when symbolizing log markup.">;
  22. def color_EQ : Joined<["--"], "color=">, HelpText<"Whether to use color when symbolizing log markup: always, auto, never">, Values<"always,auto,never">;
  23. defm debug_file_directory : Eq<"debug-file-directory", "Path to directory where to look for debug files">, MetaVarName<"<dir>">;
  24. defm debuginfod : B<"debuginfod", "Use debuginfod to find debug binaries", "Don't use debuginfod to find debug binaries">;
  25. defm default_arch
  26. : Eq<"default-arch", "Default architecture (for multi-arch objects)">,
  27. Group<grp_mach_o>;
  28. defm demangle : B<"demangle", "Demangle function names", "Don't demangle function names">;
  29. def filter_markup : Flag<["--"], "filter-markup">, HelpText<"Filter symbolizer markup from stdin.">;
  30. def functions : F<"functions", "Print function name for a given address">;
  31. def functions_EQ : Joined<["--"], "functions=">, HelpText<"Print function name for a given address">, Values<"none,short,linkage">;
  32. def help : F<"help", "Display this help">;
  33. defm dwp : Eq<"dwp", "Path to DWP file to be use for any split CUs">, MetaVarName<"<file>">;
  34. defm dsym_hint
  35. : Eq<"dsym-hint",
  36. "Path to .dSYM bundles to search for debug info for the object files">,
  37. MetaVarName<"<dir>">,
  38. Group<grp_mach_o>;
  39. defm fallback_debug_path : Eq<"fallback-debug-path", "Fallback path for debug binaries">, MetaVarName<"<dir>">;
  40. defm inlines : B<"inlines", "Print all inlined frames for a given address",
  41. "Do not print inlined frames">;
  42. defm obj
  43. : Eq<"obj", "Path to object file to be symbolized (if not provided, "
  44. "object file should be specified for each input line)">, MetaVarName<"<file>">;
  45. defm output_style
  46. : Eq<"output-style", "Specify print style. Supported styles: LLVM, GNU, JSON">,
  47. MetaVarName<"style">,
  48. Values<"LLVM,GNU,JSON">;
  49. def pretty_print : F<"pretty-print", "Make the output more human friendly">;
  50. defm print_source_context_lines : Eq<"print-source-context-lines", "Print N lines of source file context">;
  51. def relative_address : F<"relative-address", "Interpret addresses as addresses relative to the image base">;
  52. def relativenames : F<"relativenames", "Strip the compilation directory from paths">;
  53. defm untag_addresses : B<"untag-addresses", "", "Remove memory tags from addresses before symbolization">;
  54. def use_dia: F<"dia", "Use the DIA library to access symbols (Windows only)">;
  55. def verbose : F<"verbose", "Print verbose line info">;
  56. def version : F<"version", "Display the version">;
  57. def : Flag<["-"], "a">, Alias<addresses>, HelpText<"Alias for --addresses">;
  58. def : F<"print-address", "Alias for --addresses">, Alias<addresses>;
  59. def : Flag<["-"], "C">, Alias<demangle>, HelpText<"Alias for --demangle">;
  60. def : Joined<["--"], "exe=">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  61. def : Separate<["--"], "exe">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  62. def : JoinedOrSeparate<["-"], "e">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  63. def : Joined<["-"], "e=">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  64. def : Flag<["-"], "f">, Alias<functions>, HelpText<"Alias for --functions">;
  65. def : Joined<["-"], "f=">, Alias<functions_EQ>, HelpText<"Alias for --functions=">;
  66. def : Flag<["-"], "h">, Alias<help>;
  67. def : Flag<["-"], "i">, Alias<inlines>, HelpText<"Alias for --inlines">;
  68. def : F<"inlining", "Alias for --inlines">, Alias<inlines>;
  69. def : Flag<["-"], "p">, Alias<pretty_print>, HelpText<"Alias for --pretty-print">;
  70. def : Flag<["-"], "s">, Alias<basenames>, HelpText<"Alias for --basenames">;
  71. def : Flag<["-"], "v">, Alias<version>, HelpText<"Alias for --version">;
  72. // Compatibility aliases for old asan_symbolize.py and sanitizer binaries (before 2020-08).
  73. def : Flag<["--"], "inlining=true">, Alias<inlines>, HelpText<"Alias for --inlines">;
  74. def : Flag<["--"], "inlining=false">, Alias<no_inlines>, HelpText<"Alias for --no-inlines">;
  75. // Compatibility aliases for pprof's symbolizer.
  76. def : Flag<["-"], "demangle=true">, Alias<demangle>, HelpText<"Alias for --demangle">;
  77. def : Flag<["-"], "demangle=false">, Alias<no_demangle>, HelpText<"Alias for --no-demangle">;
  78. // Compatibility no-op options.
  79. def : Flag<["--"], "use-symbol-table=true">;