The SSAUpdater is already implemented as a template so that we can reuse it for both IR-level and Machine-level updates. This simple change adds a new PhiItT typedef to the traits so that it can also be used for Swift's SIL representation, where phis are separate from other instructions.
Could you add a unit test (with comments describing the use case) so this
isn't accidentally broken later?
Would it be possible to refactor the begin/end as ADL begin/end so they'd
work with range-based for? (Or I guess that doesn't work - iteration over
the basic block's phis is a separate range from iterating over the basic
block's instructions? (so there's no authoritative begin/end to provide))
Perhaps it could be refactored as a range type/functor/function instead?
(not sure if that's better)
I don't see a reasonable way to write a unit test without either creating a stub IR or making the typedef typename Traits::PhiItT public and then just testing the presence.
I think swift users will notice when this breaks and complain.