[PATCH] D131339: [Triple] Add llvm::Triple::isRISCV{32,64}

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 13 18:51:53 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb2f31cac28c8: [Triple] Add llvm::Triple::isRISCV{32,64} (authored by smd, committed by MaskRay).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131339

Files:
  llvm/include/llvm/ADT/Triple.h


Index: llvm/include/llvm/ADT/Triple.h
===================================================================
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -859,10 +859,14 @@
     return getArch() == Triple::ppc64 || getArch() == Triple::ppc64le;
   }
 
+  /// Tests whether the target is 32-bit RISC-V.
+  bool isRISCV32() const { return getArch() == Triple::riscv32; }
+
+  /// Tests whether the target is 64-bit RISC-V.
+  bool isRISCV64() const { return getArch() == Triple::riscv64; }
+
   /// Tests whether the target is RISC-V (32- and 64-bit).
-  bool isRISCV() const {
-    return getArch() == Triple::riscv32 || getArch() == Triple::riscv64;
-  }
+  bool isRISCV() const { return isRISCV32() || isRISCV64(); }
 
   /// Tests whether the target is 32-bit SPARC (little and big endian).
   bool isSPARC32() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131339.452467.patch
Type: text/x-patch
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220814/1cc0ba11/attachment.bin>


More information about the llvm-commits mailing list