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

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 30 21:48:21 PDT 2023


MaskRay added a comment.

Created a GCC feature request: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109349

The subject and summary should be fixed and `-march=help` references should be removed.



================
Comment at: clang/lib/Driver/Driver.cpp:4236
+
+    // Use the -march=help flag as the dummy input to cc1.
+    Actions.clear();
----------------
Why is the code needed? Can --print-supported-extensions reuse the approach of `OPT_print_supported_cpus`?


================
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;
----------------
craig.topper wrote:
> "-march=help is only supported for RISC-V"
The convention is to use `Diag(...)`.


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