This tidies up the code a bit:
- Eliminate the ctx member, which doesn't need to be stored.
- Rename verify(Operation) to make it more clear that it is doing more than verifyOperation and that the dominance check isn't being done multiple times.
- Rename mayNotHaveTerminator which was confusing about whether it wasn't known whether it had a terminator, when it is really about whether it is legal to have a terminator.
- Some minor optimizations: don't check for RegionKindInterface if there are no regions. Don't do two passes over the operations in a block in OperationVerifier::verifyDominance when one will do.
The optimizations are actually a measurable (but minor) win in some
CIRCT cases.