[llvm] r360323 - [SPIR] Simplified target checking.
Anastasia Stulova via llvm-commits
llvm-commits at lists.llvm.org
Thu May 9 03:16:33 PDT 2019
Author: stulova
Date: Thu May 9 03:16:33 2019
New Revision: 360323
URL: http://llvm.org/viewvc/llvm-project?rev=360323&view=rev
Log:
[SPIR] Simplified target checking.
Added Triple::isSPIR() helper to simplify code.
Patch by kpet (Kevin Petit)!
Differential revision: https://reviews.llvm.org/D61639
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=360323&r1=360322&r2=360323&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Thu May 9 03:16:33 2019
@@ -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;
More information about the llvm-commits
mailing list