diff options
Diffstat (limited to 'src/wasm-features.h')
-rw-r--r-- | src/wasm-features.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wasm-features.h b/src/wasm-features.h index d1789a67a..a645c93a8 100644 --- a/src/wasm-features.h +++ b/src/wasm-features.h @@ -33,7 +33,8 @@ struct FeatureSet { SignExt = 1 << 5, ExceptionHandling = 1 << 6, TailCall = 1 << 7, - All = (1 << 8) - 1 + ReferenceTypes = 1 << 8, + All = (1 << 9) - 1 }; static std::string toString(Feature f) { @@ -54,6 +55,8 @@ struct FeatureSet { return "exception-handling"; case TailCall: return "tail-call"; + case ReferenceTypes: + return "reference-types"; default: WASM_UNREACHABLE(); } @@ -72,6 +75,7 @@ struct FeatureSet { bool hasSignExt() const { return features & SignExt; } bool hasExceptionHandling() const { return features & ExceptionHandling; } bool hasTailCall() const { return features & TailCall; } + bool hasReferenceTypes() const { return features & ReferenceTypes; } bool hasAll() const { return features & All; } void makeMVP() { features = MVP; } @@ -86,6 +90,7 @@ struct FeatureSet { void setSignExt(bool v = true) { set(SignExt, v); } void setExceptionHandling(bool v = true) { set(ExceptionHandling, v); } void setTailCall(bool v = true) { set(TailCall, v); } + void setReferenceTypes(bool v = true) { set(ReferenceTypes, v); } void setAll(bool v = true) { features = v ? All : MVP; } void enable(const FeatureSet& other) { features |= other.features; } @@ -118,6 +123,9 @@ struct FeatureSet { if (hasTailCall()) { f(TailCall); } + if (hasReferenceTypes()) { + f(ReferenceTypes); + } } bool operator<=(const FeatureSet& other) const { |