[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.
This commit is contained in:
Dan Gohman 2020-02-27 07:49:56 -08:00
parent 080890a9f3
commit c08384a3ae
1 changed files with 5 additions and 0 deletions

View File

@ -741,6 +741,11 @@ public:
return getArch() == Triple::ve;
}
/// Tests whether the target is wasm (32- and 64-bit).
bool isWasm() const {
return getArch() == Triple::wasm32 || getArch() == Triple::wasm64;
}
/// Tests whether the target supports comdat
bool supportsCOMDAT() const {
return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());