rustc-dev-guide/src/mir
Nicholas Nethercote ed695f4484 Separate `Analysis` and `Results`.
`Results` contains and `Analysis` and an `EntryStates`. The unfortunate
thing about this is that the analysis needs to be mutable everywhere
(`&mut Analysis`) which forces the `Results` to be mutable everywhere,
even though `EntryStates` is immutable everywhere.

To fix this, this commit renames `Results` as `AnalysisAndResults`,
renames `EntryStates` as `Results`, and separates the analysis and
results as much as possible. (`AnalysisAndResults` doesn't get much use,
it's mostly there to facilitate method chaining of
`iterate_to_fixpoint`.)

`Results` is immutable everywhere, which:
- is a bit clearer on how the data is used,
- avoids an unnecessary clone of entry states in
  `locals_live_across_suspend_points`, and
- moves the results outside the `RefCell` in Formatter.

The commit also reformulates `ResultsHandle` as the generic `CowMut`,
which is simpler than `ResultsHandle` because it doesn't need the
`'tcx` lifetime and the trait bounds. It also which sits nicely
alongside the new use of `Cow` in `ResultsCursor`.
2025-04-24 11:36:07 +10:00
..
construction.md Fix conditions lowering text for enums with no fields (#2066) 2024-09-18 08:45:24 +08:00
dataflow.md Separate `Analysis` and `Results`. 2025-04-24 11:36:07 +10:00
debugging.md Remove outdated references to `-Z dump-mir-spanview` 2024-01-16 10:28:45 +02:00
drop-elaboration.md Fix a link and create an implied internal link (#2051) 2024-09-09 00:15:41 +08:00
index.md intern valtrees 2025-02-13 00:38:17 +01:00
mir_cfg.svg Mention unpretty=mir-cfg for debugging MIR 2021-04-23 16:25:11 -04:00
mir_detailed.dot Add graphs that I forgot to push in the original PR 2018-12-14 17:29:38 -06:00
mir_detailed.svg Add graphs that I forgot to push in the original PR 2018-12-14 17:29:38 -06:00
mir_overview.dot Add graphs that I forgot to push in the original PR 2018-12-14 17:29:38 -06:00
mir_overview.svg Add graphs that I forgot to push in the original PR 2018-12-14 17:29:38 -06:00
optimizations.md Remove -Zfuel. (#2032) 2024-11-27 18:31:58 +08:00
passes.md Fix rustc-related links that are 404 right now (#2112) 2024-11-02 20:53:31 +08:00
visitor.md linkcheck: fix reported broken links (part 1) (#2022) 2024-07-24 20:01:25 +08:00