From b9739cbce56fe60573561edefc0638efb295cc7f Mon Sep 17 00:00:00 2001 From: Anastasia Stulova Date: Thu, 9 May 2019 10:16:33 +0000 Subject: [PATCH] [SPIR] Simplified target checking. Added Triple::isSPIR() helper to simplify code. Patch by kpet (Kevin Petit)! Differential revision: https://reviews.llvm.org/D61639 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360323 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/Triple.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index f2e7a2ab3c8..3a7497cd00e 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -671,6 +671,11 @@ public: getEnvironment() == Triple::MuslEABIHF; } + /// Tests whether the target is SPIR (32- or 64-bit). + bool isSPIR() const { + return getArch() == Triple::spir || getArch() == Triple::spir64; + } + /// Tests whether the target is NVPTX (32- or 64-bit). bool isNVPTX() const { return getArch() == Triple::nvptx || getArch() == Triple::nvptx64; -- 2.50.1