Closed
Description
Writing some kinds of MIR passes that care about values
and targets
on switchInt
can be a bit messy (for example, passes that remove dead branches). @oli-obk has the idea:
oli: I like it. The actual elimination is a bit convoluted, but I see no way around it. Maybe the values and targets fields of the SwitchInt variant could be merged into a single list, then one could use retain on the list
oli: the otherwise branch would then need a custom field, but that would be fine I think
oli: not sure how much other could would be affected by that (I think there's some code that just wants to know about all targets, but that could be helped by creating an accessor function returning an iterator)