binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

[Outlining] Consider replacing state enum with a single `IRBuilder* currBuilder` field

Open ashleynh opened this issue 2 years ago • 0 comments

          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

ashleynh avatar Nov 13 '23 04:11 ashleynh