diff options
Diffstat (limited to 'src/wasm-features.h')
-rw-r--r-- | src/wasm-features.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wasm-features.h b/src/wasm-features.h index d2e3f343f..237dc7757 100644 --- a/src/wasm-features.h +++ b/src/wasm-features.h @@ -75,6 +75,21 @@ struct FeatureSet { } } + std::string toString() { + std::string ret; + uint32_t x = 1; + while (x & Feature::All) { + if (features & x) { + if (!ret.empty()) { + ret += ", "; + } + ret += toString(Feature(x)); + } + x <<= 1; + } + return ret; + } + FeatureSet() : features(MVP) {} FeatureSet(uint32_t features) : features(features) {} operator uint32_t() const { return features; } |