Skip to content

Commit

Permalink
[SPIR] Simplified target checking.
Browse files Browse the repository at this point in the history
Added Triple::isSPIR() helper to simplify code.

Patch by kpet (Kevin Petit)!

Differential revision: https://reviews.llvm.org/D61639

llvm-svn: 360323
  • Loading branch information
Anastasia Stulova authored and MrSidims committed May 24, 2019
1 parent 74153a1 commit 49be222
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/include/llvm/ADT/Triple.h
Expand Up @@ -676,6 +676,11 @@ class Triple {
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;
Expand Down

0 comments on commit 49be222

Please sign in to comment.