]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #71044 - ecstatic-morse:body-predecessor-cache, r=oli-obk
authorbors <bors@rust-lang.org>
Wed, 22 Apr 2020 21:08:28 +0000 (21:08 +0000)
committerbors <bors@rust-lang.org>
Wed, 22 Apr 2020 21:08:28 +0000 (21:08 +0000)
Remove `BodyAndCache`

...returning to the original approach using interior mutability within `Body`. This simplifies the API at the cost of some uncontended mutex locks when the parallel compiler is enabled.

The current API requires you to either have a mutable reference to `Body` (`&mut BodyAndCache`), or to compute the predecessor graph ahead of time by creating a `ReadOnlyBodyAndCache`. This is not a good fit for, e.g., the dataflow framework, which
1. does not mutate the MIR
2. only sometimes needs the predecessor graph (for backward dataflow problems)

1  2 
src/librustc_codegen_ssa/mir/analyze.rs
src/librustc_middle/mir/visit.rs
src/librustc_mir/transform/check_consts/validation.rs
src/librustc_mir/transform/generator.rs

Simple merge