[PATCH] D54215: [Triple] Add test for if triple is RISC-V

Simon Cook via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 10:26:33 PST 2018


simoncook created this revision.
simoncook added a reviewer: asb.
Herald added subscribers: llvm-commits, kristina, PkmX, rkruppe, dexonsmith, rogfer01, shiva0217, kito-cheng.
simoncook added a dependent revision: D54214: [RISCV] Set triple based on -march flag.

This is added as a helper/dependency for https://reviews.llvm.org/D54214, and I imagine other places will want to test for both RISC-V Triple architectures


Repository:
  rL LLVM

https://reviews.llvm.org/D54215

Files:
  include/llvm/ADT/Triple.h


Index: include/llvm/ADT/Triple.h
===================================================================
--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -679,6 +679,11 @@
     return isMIPS32() || isMIPS64();
   }
 
+  /// Tests whether the target is RISC-V (32- and 64-bit).
+  bool isRISCV() const {
+    return getArch() == Triple::riscv32 || getArch() == Triple::riscv64;
+  }
+
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
     return !isOSBinFormatMachO();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54215.172984.patch
Type: text/x-patch
Size: 510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181107/a9549cba/attachment.bin>


More information about the llvm-commits mailing list