[PATCH] D146054: [RISCV] Add --print-supported-extensions support

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 14 11:57:16 PDT 2023


MaskRay added a comment.

I think the best place to test `RISCVISAInfo.cpp` is `llvm/unittests/Support/RISCVISAInfoTest.cpp`.

`clang/test/Driver/print-supported-extensions.c` can test just a few lines, so that changes to RISC-V extensions will generally not require updates to `clang/test/Driver/print-supported-extensions.c`



================
Comment at: clang/test/Driver/print-supported-extensions.c:6
+// RUN: %clang --target=riscv64 --print-supported-extensions 2>&1 | \
+// RUN:   FileCheck --implicit-check-not=warning: --strict-whitespace --match-full-lines %s
+
----------------
Now that D156363 is stable, we can replace `FileCheck --implicit-check-not=warning:` with `%clang -Werror`.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:217
+  for (const auto &E : SupportedExtensions)
+    ExtMap[E.Name] = { E.Version.Major, E.Version.Minor };
+  for (const auto &E : ExtMap)
----------------
MaskRay wrote:
> clang-format will remove the space after `{`
Not done.


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