binaryen
binaryen copied to clipboard
[Outlining] Consider replacing state enum with a single `IRBuilder* currBuilder` field
Just realized that it would be possible to replace this state enum with a single `IRBuilder* currBuilder` field that is either `&outlinedBuilder`, `&existingBuilder`, or `nullptr`. `getCurrentState` would simply set `currBuilder` to the correct value and we wouldn't need to worry about separately computing the right `IRBuilder` to use.
Up to you whether you want to do this, since the explicit state enum is slightly more self-documenting.
Originally posted by @tlively in https://github.com/WebAssembly/binaryen/pull/6110#discussion_r1390595556