[mypyc] Add a simple irchecking analysis system (#11283)
* Introduce basic ir analysis checks
Adds a new module for performing analysis checks on ir as several bugs
in mypy had underlying issues in which the ir produced by mypy was
invalid and guaranteed to have issues at runtime.
For now the checks are relatively simple - the only two supported are
some validity on basic blocks: that they terminate and that control
ops reference a basic block within the same function.
Error reporting is non-existent and instead we are just testing that
the resulting error datatypes are what we expect. In the future we will
need to incorporate the errors into the pretty-printer so that we can
produce an ir dump that references where the error actually is.
In addition it would be useful if we had an ir parser so we could have a
test framework similar to other parts of mypyc in which we simply write
the IR in text format instead of constructing the IR ast from within
python.
* Integrate ircheck analysis into ir tests