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

Brandon Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 2 17:13:51 PDT 2023


4vtomat added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:110
 
+extern void RISCVMarchHelp();
+
----------------
craig.topper wrote:
> Can we declare this in RISCVISAInfo.h and include that here?
Yes, we can.


================
Comment at: clang/tools/driver/cc1_main.cpp:187-188
+/// Print supported extensions of the given target.
+static int PrintSupportedExtensions(std::string TargetStr) {
+  llvm::riscvMarchHelp();
+
----------------
kito-cheng wrote:
> Plz make sure only RISC-V print that, x86 or other target print RISC-V's ext is really weird. 
The check is in clang/lib/Driver/Driver.cpp:4225~


================
Comment at: clang/tools/driver/cc1_main.cpp:189
+  std::string Error;
+  const llvm::Target *TheTarget =
+      llvm::TargetRegistry::lookupTarget(TargetStr, Error);
----------------
craig.topper wrote:
> Why do we need to lookup the TargetRegistry?
I forgot to remove lol~


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