diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/include/llvm/ADT/Triple.h @@ -859,10 +859,14 @@ return getArch() == Triple::ppc64 || getArch() == Triple::ppc64le; } + /// Tests whether the target is RISC-V 32-bit. + bool isRISCV32() const { return getArch() == Triple::riscv32; } + + /// Tests whether the target is RISC-V 64-bit. + 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 {