]> git.lizzy.rs Git - rust.git/commit
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)
commitdb9b05aeb52b77d1eb780ee005979b63d093c214
tree7f930a5a6d2a73c3822d99f364d770460d5e460b
parentb2e36e6c2d229126b59e892c9147fbb68115d292
parent4e7469eaeaaa460828f0494de97b6ce4203a44a5
Auto merge of #71044 - ecstatic-morse:body-predecessor-cache, r=oli-obk

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)
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