Opts.td 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 debug_file_directory : Eq<"debug-file-directory", "Path to directory where to look for debug files">, MetaVarName<"<dir>">;
  20. defm default_arch
  21. : Eq<"default-arch", "Default architecture (for multi-arch objects)">,
  22. Group<grp_mach_o>;
  23. defm demangle : B<"demangle", "Demangle function names", "Don't demangle function names">;
  24. def functions : F<"functions", "Print function name for a given address">;
  25. def functions_EQ : Joined<["--"], "functions=">, HelpText<"Print function name for a given address">, Values<"none,short,linkage">;
  26. def help : F<"help", "Display this help">;
  27. defm dwp : Eq<"dwp", "Path to DWP file to be use for any split CUs">, MetaVarName<"<file>">;
  28. defm dsym_hint
  29. : Eq<"dsym-hint",
  30. "Path to .dSYM bundles to search for debug info for the object files">,
  31. MetaVarName<"<dir>">,
  32. Group<grp_mach_o>;
  33. defm fallback_debug_path : Eq<"fallback-debug-path", "Fallback path for debug binaries">, MetaVarName<"<dir>">;
  34. defm inlines : B<"inlines", "Print all inlined frames for a given address",
  35. "Do not print inlined frames">;
  36. defm obj
  37. : Eq<"obj", "Path to object file to be symbolized (if not provided, "
  38. "object file should be specified for each input line)">, MetaVarName<"<file>">;
  39. defm output_style
  40. : Eq<"output-style", "Specify print style. Supported styles: LLVM, GNU, JSON">,
  41. MetaVarName<"style">,
  42. Values<"LLVM,GNU,JSON">;
  43. def pretty_print : F<"pretty-print", "Make the output more human friendly">;
  44. defm print_source_context_lines : Eq<"print-source-context-lines", "Print N lines of source file context">;
  45. def relative_address : F<"relative-address", "Interpret addresses as addresses relative to the image base">;
  46. def relativenames : F<"relativenames", "Strip the compilation directory from paths">;
  47. defm untag_addresses : B<"untag-addresses", "", "Remove memory tags from addresses before symbolization">;
  48. def use_dia: F<"dia", "Use the DIA library to access symbols (Windows only)">;
  49. def verbose : F<"verbose", "Print verbose line info">;
  50. def version : F<"version", "Display the version">;
  51. def : Flag<["-"], "a">, Alias<addresses>, HelpText<"Alias for --addresses">;
  52. def : F<"print-address", "Alias for --addresses">, Alias<addresses>;
  53. def : Flag<["-"], "C">, Alias<demangle>, HelpText<"Alias for --demangle">;
  54. def : Joined<["--"], "exe=">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  55. def : Separate<["--"], "exe">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  56. def : JoinedOrSeparate<["-"], "e">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  57. def : Joined<["-"], "e=">, Alias<obj_EQ>, HelpText<"Alias for --obj">, MetaVarName<"<file>">;
  58. def : Flag<["-"], "f">, Alias<functions>, HelpText<"Alias for --functions">;
  59. def : Joined<["-"], "f=">, Alias<functions_EQ>, HelpText<"Alias for --functions=">;
  60. def : Flag<["-"], "h">, Alias<help>;
  61. def : Flag<["-"], "i">, Alias<inlines>, HelpText<"Alias for --inlines">;
  62. def : F<"inlining", "Alias for --inlines">, Alias<inlines>;
  63. def : Flag<["-"], "p">, Alias<pretty_print>, HelpText<"Alias for --pretty-print">;
  64. def : Flag<["-"], "s">, Alias<basenames>, HelpText<"Alias for --basenames">;
  65. def : Flag<["-"], "v">, Alias<version>, HelpText<"Alias for --version">;
  66. // Compatibility aliases for old asan_symbolize.py and sanitizer binaries (before 2020-08).
  67. def : Flag<["--"], "inlining=true">, Alias<inlines>, HelpText<"Alias for --inlines">;
  68. def : Flag<["--"], "inlining=false">, Alias<no_inlines>, HelpText<"Alias for --no-inlines">;
  69. // Compatibility aliases for pprof's symbolizer.
  70. def : Flag<["-"], "demangle=true">, Alias<demangle>, HelpText<"Alias for --demangle">;
  71. def : Flag<["-"], "demangle=false">, Alias<no_demangle>, HelpText<"Alias for --no-demangle">;
  72. // Compatibility no-op options.
  73. def : Flag<["--"], "use-symbol-table=true">;