From 2e51491a15914c5ba7eff9afeaaee8f998e82ede Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 27 Oct 2017 09:20:01 -0700 Subject: 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). --- src/tools/wasm-as.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/wasm-as.cpp') diff --git a/src/tools/wasm-as.cpp b/src/tools/wasm-as.cpp index 956ad213f..d456f43fd 100644 --- a/src/tools/wasm-as.cpp +++ b/src/tools/wasm-as.cpp @@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) { if (options.extra["validate"] != "none") { if (options.debug) std::cerr << "Validating..." << std::endl; - if (!wasm::WasmValidator().validate(wasm, + if (!wasm::WasmValidator().validate(wasm, Feature::All, WasmValidator::Globally | (options.extra["validate"] == "web" ? WasmValidator::Web : 0))) { Fatal() << "Error: input module is not valid.\n"; } -- cgit v1.2.3