This patch add the possibilities to create out-of-tree MIR passes. This is based on how IR out-of-tree passes work.
If this is something that could be upstreamed, I could factorize the code between the two system, as they are very similar!
As a side remark, I have tested this with an out of tree MIR pass that dump MIR, and it works well. Should I add this test within the test suite? I didn't find such test for the current out-of-tree IR system (but chances are I missed it!).