diff options
author | Heejin Ahn <aheejin@gmail.com> | 2024-11-04 16:13:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-04 16:13:15 -0800 |
commit | 884261afa7ff6d0158f3a1882e0247568c8d6cda (patch) | |
tree | ebcd6d1efa89e2943db93c1b440aca4fa0022ec5 /src | |
parent | d71161aedb8ae1d6650111a0de0c2bdf53ec127b (diff) | |
download | binaryen-884261afa7ff6d0158f3a1882e0247568c8d6cda.tar.gz binaryen-884261afa7ff6d0158f3a1882e0247568c8d6cda.tar.bz2 binaryen-884261afa7ff6d0158f3a1882e0247568c8d6cda.zip |
Remove FeaturePrefix::FeatureRequired (NFC) (#7034)
This has not been emitted in LLVM since
https://github.com/llvm/llvm-project/commit/3f34e1b883351c7d98426b084386a7aa762aa366.
The corresponding proposed tool-conventions change:
https://github.com/WebAssembly/tool-conventions/pull/236
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-binary.h | 6 | ||||
-rw-r--r-- | src/wasm/wasm-binary.cpp | 8 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 3c59ed3aa..ca14bd41f 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -1156,11 +1156,7 @@ enum MemoryAccess { enum MemoryFlags { HasMaximum = 1 << 0, IsShared = 1 << 1, Is64 = 1 << 2 }; -enum FeaturePrefix { - FeatureUsed = '+', - FeatureRequired = '=', - FeatureDisallowed = '-' -}; +enum FeaturePrefix { FeatureUsed = '+', FeatureDisallowed = '-' }; } // namespace BinaryConsts diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index bc7ec8ac8..173a89163 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -3816,15 +3816,11 @@ void WasmBinaryReader::readFeatures(size_t payloadLen) { uint8_t prefix = getInt8(); bool disallowed = prefix == BinaryConsts::FeatureDisallowed; - bool required = prefix == BinaryConsts::FeatureRequired; bool used = prefix == BinaryConsts::FeatureUsed; - if (!disallowed && !required && !used) { + if (!disallowed && !used) { throwError("Unrecognized feature policy prefix"); } - if (required) { - std::cerr << "warning: required features in feature section are ignored"; - } Name name = getInlineString(); if (pos > sectionPos + payloadLen) { @@ -3881,7 +3877,7 @@ void WasmBinaryReader::readFeatures(size_t payloadLen) { << "warning: feature " << feature.toString() << " was enabled by the user, but disallowed in the features section."; } - if (required || used) { + if (used) { wasm.features.enable(feature); } } |