From 87f9dac127b387715d8d96ac7ec8fd469d8c2dab Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 3 Dec 2024 11:20:36 -0800 Subject: [NFC] Encapsulate source map reader state (#7132) Move all state relevant to reading source maps out of WasmBinaryReader and into a new utility, SourceMapReader. This is a prerequisite for parallelizing the parsing of function bodies, since the source map reader state is different at the beginning of each function. Also take the opportunity to simplify the way we read source maps, for example by deferring the reading of anything but the position of a debug location until it will be used and by using `std::optional` instead of singleton `std::set`s to store function prologue and epilogue debug locations. --- src/wasm/parsing.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/wasm/parsing.cpp') diff --git a/src/wasm/parsing.cpp b/src/wasm/parsing.cpp index 1606a2dd1..5d34da78e 100644 --- a/src/wasm/parsing.cpp +++ b/src/wasm/parsing.cpp @@ -36,18 +36,6 @@ void ParseException::dump(std::ostream& o) const { Colors::normal(o); } -void MapParseException::dump(std::ostream& o) const { - Colors::magenta(o); - o << "["; - Colors::red(o); - o << "map parse exception: "; - Colors::green(o); - o << text; - Colors::magenta(o); - o << "]"; - Colors::normal(o); -} - // UniqueNameMapper Name UniqueNameMapper::getPrefixedName(Name prefix) { -- cgit v1.2.3