projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
080890a
)
[WebAssembly] Add an `isWasm` target triple predicate.
author
Dan Gohman
<sunfish@mozilla.com>
Thu, 27 Feb 2020 15:49:56 +0000
(07:49 -0800)
committer
Dan Gohman
<sunfish@mozilla.com>
Thu, 27 Feb 2020 15:55:01 +0000
(07:55 -0800)
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.
llvm/include/llvm/ADT/Triple.h
patch
|
blob
|
history
diff --git
a/llvm/include/llvm/ADT/Triple.h
b/llvm/include/llvm/ADT/Triple.h
index
64ba8d7
..
c136469
100644
(file)
--- a/
llvm/include/llvm/ADT/Triple.h
+++ b/
llvm/include/llvm/ADT/Triple.h
@@
-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());