Opts.td 1.1 KB

12345678910111213141516171819202122232425262728
  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 #"=">,
  10. HelpText<help>;
  11. def : Separate<["--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
  12. }
  13. def help : FF<"help", "Display this help">;
  14. defm strip_underscore : BB<"strip-underscore", "Strip the leading underscore", "Don't strip the leading underscore">;
  15. def types : FF<"types", "">;
  16. def version : FF<"version", "Display the version">;
  17. defm : Eq<"format", "Specify mangling format. Currently ignored because only 'gnu' is supported">;
  18. def : F<"s", "Alias for --format">;
  19. def : F<"_", "Alias for --strip-underscore">, Alias<strip_underscore>;
  20. def : F<"h", "Alias for --help">, Alias<help>;
  21. def : F<"n", "Alias for --no-strip-underscore">, Alias<no_strip_underscore>;
  22. def : F<"t", "Alias for --types">, Alias<types>;