diff options
author | Derek Schuff <dschuff@chromium.org> | 2017-10-27 09:20:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-27 09:20:01 -0700 |
commit | 2e51491a15914c5ba7eff9afeaaee8f998e82ede (patch) | |
tree | 23116b52d6cfaaa35ef97ccb94752b8abf9f289e /src/passes/pass.cpp | |
parent | 9d409e10f5fc6188e4b774e6b757ab25dfabefed (diff) | |
download | binaryen-2e51491a15914c5ba7eff9afeaaee8f998e82ede.tar.gz binaryen-2e51491a15914c5ba7eff9afeaaee8f998e82ede.tar.bz2 binaryen-2e51491a15914c5ba7eff9afeaaee8f998e82ede.zip |
Add Features enum to IR (#1250)
This enum describes which wasm features the IR is expected to include. The
validator should reject operations which require excluded features, and passes
should avoid producing IR which requires excluded features.
This makes it easier to catch possible errors in Binaryen producers (e.g.
emscripten). Asm2wasm has a flag to enable or disable atomics. Other
tools currently just accept all features (as, dis and opt are just for
inspecting or modifying existing modules, so it would be annoying to have to use
flags with those tools and I expect the risk of accidentally introducing
atomics to be low).
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r-- | src/passes/pass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index 4e105f71d..d92a4a80c 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -231,7 +231,7 @@ void PassRunner::run() { totalTime += diff; // validate, ignoring the time std::cerr << "[PassRunner] (validating)\n"; - if (!WasmValidator().validate(*wasm, validationFlags)) { + if (!WasmValidator().validate(*wasm, options.features, validationFlags)) { if (passDebug >= 2) { std::cerr << "Last pass (" << pass->name << ") broke validation. Here is the module before: \n" << moduleBefore.str() << "\n"; } else { @@ -246,7 +246,7 @@ void PassRunner::run() { std::cerr << "[PassRunner] passes took " << totalTime.count() << " seconds." << std::endl; // validate std::cerr << "[PassRunner] (final validation)\n"; - if (!WasmValidator().validate(*wasm, validationFlags)) { + if (!WasmValidator().validate(*wasm, options.features, validationFlags)) { std::cerr << "final module does not validate\n"; abort(); } |