Rollup merge of #66991 - Nashenas88:body_cache_cleanup, r=eddyb

Cleanup BodyCache

After this PR:

- `BodyCache` is renamed to `BodyAndCache`
- `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache`
- `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in #65947)

cc @eddyb @oli-obk
This commit is contained in:
Mazdak Farrokhzad 2019-12-08 03:39:45 +01:00 committed by GitHub
commit 56c0bea390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 226 additions and 224 deletions

View file

@ -153,7 +153,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
// a loop.
fn maybe_sideeffect<Bx: BuilderMethods<'a, 'tcx>>(
&self,
mir: mir::ReadOnlyBodyCache<'tcx, 'tcx>,
mir: mir::ReadOnlyBodyAndCache<'tcx, 'tcx>,
bx: &mut Bx,
targets: &[mir::BasicBlock],
) {

View file

@ -21,7 +21,7 @@ use self::operand::{OperandRef, OperandValue};
pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
instance: Instance<'tcx>,
mir: mir::ReadOnlyBodyCache<'tcx, 'tcx>,
mir: mir::ReadOnlyBodyAndCache<'tcx, 'tcx>,
debug_context: Option<FunctionDebugContext<Bx::DIScope>>,
@ -159,7 +159,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
}).collect();
let (landing_pads, funclets) = create_funclets(&mir, &mut bx, &cleanup_kinds, &block_bxs);
let mir_body: &mir::Body<'_> = mir.body();
let mir_body: &mir::Body<'_> = *mir;
let mut fx = FunctionCx {
instance,
mir,