From 88ef839433ac0cf58c2a29f369d0268a22b5ae0e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 19 Jul 2019 16:01:15 -0700 Subject: Simpify PassRunner.add() and automatically parallelize parallel functions (#2242) Main change here is in pass.h, everything else is changes to work with the new API. The add("name") remains as before, while the weird variadic add(..) which constructed the pass now just gets a std::unique_ptr of a pass. This also makes the memory management internally fully automatic. And it makes it trivial to parallelize WalkerPass::run on parallel passes. As a benefit, this allows removing a lot of code since in many cases there is no need to create a new pass runner, and running a pass can be just a single line. --- src/wasm/wasm-validator.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/wasm/wasm-validator.cpp') diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 8ada2af70..24f301110 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1919,9 +1919,7 @@ bool WasmValidator::validate(Module& module, Flags flags) { info.quiet = (flags & Quiet) != 0; // parallel wasm logic validation PassRunner runner(&module); - runner.add(&info); - runner.setIsNested(true); - runner.run(); + FunctionValidator(&info).run(&runner, &module); // validate globally if (info.validateGlobally) { validateImports(module, info); -- cgit v1.2.3