From: Anastasia Stulova Date: Thu, 9 May 2019 10:16:33 +0000 (+0000) Subject: [SPIR] Simplified target checking. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9739cbce56fe60573561edefc0638efb295cc7f;p=llvm [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 --- 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;