diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-05-09 10:16:33 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-05-09 10:16:33 +0000 |
commit | 3cdf8981054bf7b607aed1b6c921341516a94174 (patch) | |
tree | 73b04b604be85e9681f0fa50a3724541f88022eb | |
parent | ad9c7e0789eb5696d0afa59a1377b09bc6f0e867 (diff) | |
download | bcm5719-llvm-3cdf8981054bf7b607aed1b6c921341516a94174.tar.gz bcm5719-llvm-3cdf8981054bf7b607aed1b6c921341516a94174.zip |
[SPIR] Simplified target checking.
Added Triple::isSPIR() helper to simplify code.
Patch by kpet (Kevin Petit)!
Differential revision: https://reviews.llvm.org/D61639
llvm-svn: 360323
-rw-r--r-- | llvm/include/llvm/ADT/Triple.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h index f2e7a2ab3c8..3a7497cd00e 100644 --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/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; |