summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-01-02 13:15:59 -0800
committerGitHub <noreply@github.com>2019-01-02 13:15:59 -0800
commit5ebf2745783417c0cb7d9e3d71849c617a1672ad (patch)
tree9ecb1c772ce3fde4aaaeabb99cbb6feb4cdd9c1d /src/wasm.h
parent18fb2c238f3b4c04e3666d8a0d34492936a6bcc0 (diff)
downloadbinaryen-5ebf2745783417c0cb7d9e3d71849c617a1672ad.tar.gz
binaryen-5ebf2745783417c0cb7d9e3d71849c617a1672ad.tar.bz2
binaryen-5ebf2745783417c0cb7d9e3d71849c617a1672ad.zip
Refactor Features code (#1848)
Add features.h which centralizes all the feature detection code. (I'll need this in another place than the validator which is where it was til now.)
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index bcdc30dab..27a302d3c 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -67,7 +67,11 @@ struct FeatureSet {
void setSIMD(bool v = true) { set(SIMD, v); }
void setAll(bool v = true) { features = v ? All : MVP; }
- private:
+ bool operator<=(const FeatureSet& other) {
+ return !(features & ~other.features);
+ }
+
+private:
uint32_t features;
};