From 956d2d89d530012885c1f88c87bf8b872c187b70 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 25 Apr 2024 14:55:12 -0700 Subject: [Parser] Enable the new text parser by default (#6371) The new text parser is faster and more standards compliant than the old text parser. Enable it by default in wasm-opt and update the tests to reflect the slightly different results it produces. Besides following the spec, the new parser differs from the old parser in that it: - Does not synthesize `loop` and `try` labels unnecessarily - Synthesizes different block names in some cases - Parses exports in a different order - Parses `nop`s instead of empty blocks for empty control flow arms - Does not support parsing Poppy IR - Produces different error messages - Cannot parse `pop` except as the first instruction inside a `catch` --- src/parser/wat-parser.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/parser/wat-parser.cpp') diff --git a/src/parser/wat-parser.cpp b/src/parser/wat-parser.cpp index cc7d87540..fd18fbbe0 100644 --- a/src/parser/wat-parser.cpp +++ b/src/parser/wat-parser.cpp @@ -96,6 +96,8 @@ void propagateDebugLocations(Module& wasm) { // do not already have their own debug locations. PassRunner runner(&wasm); runner.add("propagate-debug-locs"); + // The parser should not be responsible for validation. + runner.setIsNested(true); runner.run(); } -- cgit v1.2.3