[PATCH] D146054: [RISCV] Add -print-supported-marchs and -march=help support

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 26 20:27:12 PDT 2023


craig.topper added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:4346
   MarshallingInfoFlag<FrontendOpts<"PrintSupportedCPUs">>;
+def print_supported_marchs : Flag<["-", "--"], "print-supported-marchs">,
+  Group<CompileOnly_Group>, Flags<[CC1Option, CoreOption]>,
----------------
Maybe this should be -print-supported-extensions to match RISC-V terminology?


================
Comment at: clang/include/clang/Driver/Options.td:4349
+  HelpText<"Print supported marchs for the given target (if target is not specified,"
+           " it will print the supported marchs for the default target)">,
+  MarshallingInfoFlag<FrontendOpts<"PrintSupportedMarchs">>;
----------------
There's no default target behavior. It's always RISC-V.


================
Comment at: clang/lib/Driver/Driver.cpp:4232
+    if (!C.getDefaultToolChain().getTriple().isRISCV()) {
+      llvm::errs() << "The -march=help only supports for RISC-V target.\n";
+      return;
----------------
"-march=help is only supported for RISC-V"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146054/new/

https://reviews.llvm.org/D146054



More information about the cfe-commits mailing list