rust/compiler/rustc_mir_dataflow/src
bors bdaa901049 Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obk
Add a MIR pass manager (Taylor's Version)

The final draft of #91386 and #77665.

While the compile-time constraints in #91386 are cool, I decided on a more minimal approach for now. I want to explore phase constraints and maybe relative-ordering constraints in the future, though. This should preserve existing behavior **exactly** (please let me know if it doesn't) while making the following changes to the way we organize things today:

- Each `MirPhase` now corresponds to a single MIR pass. `run_passes` is not responsible for listing the correct MIR phase.
- `run_passes` no longer silently skips passes if the declared MIR phase is greater than or equal to the body's. This has bitten me multiple times. If you want this behavior, you can always branch on `body.phase` yourself.
- If your pass is solely to emit errors, you can use the `MirLint` interface instead, which gets a shared reference to `Body` instead of a mutable one. By differentiating the two, I hope to make it clearer in the short term where lints belong in the pipeline. In the long term perhaps we could enforce this at compile-time?
- MIR is no longer dumped for passes that aren't enabled, or for lints.

I tried to check that `-Zvalidate` still works correctly, since the MIR phase is now updated as soon as the associated pass is done, instead of at the end of all the passes in `run_passes`. However, it looks like `-Zvalidate` is broken with current nightlies anyways 😢 (it spits out a bunch of errors).

cc `@oli-obk` `@wesleywiser`

r? rust-lang/wg-mir-opt
2021-12-05 03:41:18 +00:00
..
framework Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
impls Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
move_paths Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
drop_flag_effects.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
elaborate_drops.rs Use associated_item_def_ids more 2021-11-11 23:15:57 +00:00
lib.rs Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
rustc_peek.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
storage.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00