Skip to content

Commit c08384a

Browse files
committed
[WebAssembly] Add an isWasm target triple predicate.
This simplies code which needs to apply the same logic to both wasm32 and wasm64. This patch is part of https://reviews.llvm.org/D70700.
1 parent 080890a commit c08384a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/include/llvm/ADT/Triple.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,11 @@ class Triple {
741741
return getArch() == Triple::ve;
742742
}
743743

744+
/// Tests whether the target is wasm (32- and 64-bit).
745+
bool isWasm() const {
746+
return getArch() == Triple::wasm32 || getArch() == Triple::wasm64;
747+
}
748+
744749
/// Tests whether the target supports comdat
745750
bool supportsCOMDAT() const {
746751
return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());

0 commit comments

Comments
 (0)