binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Use IRBuilder in the binary reader

Open tlively opened this issue 1 year ago • 0 comments

The new wat parser is based on the IRBuilder utility, which maintains all the state necessary to turn a linear sequence of instructions and delimiters into Binaryen IR. The binary reader has its own similar functionality, so we could reduce duplication and improve the quality of the parsed IR if we had it use IRBuilder instead.

Using IRBuilder in both the text and binary parsers will also let us implement new IR building functionality just once in the future. For example, we could support lowering multivalue block input (#6407) to scratch locals just once in IRBuilder rather than having to do it separately for the text and binary parsers.

tlively avatar May 20 '24 23:05 tlively