Previously, when user tries to delete a BasicBlock without applying updates under Eager UpdateStrategy (typically before recalculation),
DomTreeUpdater DTU(DT, ...::Eager); ... // Decide to remove BB DTU.deleteBB(BB); // Call DT.eraseNode(BB) and find BB is not a leaf node. *Asserts* DTU.recalculate(F);
When we need this code pattern to be compatible with both Eager and Lazy Strategy instances of DTU, we cannot just replace DTU.deleteBB(BB) into BB->eraseFromParent() because DTU.recalculate() under Lazy Strategy checks whether there is any pending updates/DelBB to proceed.
Under Lazy Strategy, things won't be affected because deleteBB always goes after applying updates or automatically disables DT node removal during recalculation.
Thus, a new parameter is added to bypass this removal under only Eager UpdateStrategy in this special scenario (trying to delete a BasicBlock without applying any update under Eager UpdateStrategy).
DTU.deleteBB(BB, /*DisableNodeErasing*/ true); DTU.recalculate(F);
It would be a good idea to add the reason why you need this flag, not just what it does. The comments at the top of this ticket would be a good start to add here.
The reason it's necessary is a subtle one and may not be obvious to users of your API.