visit_place_base is just visit_local

This commit is contained in:
Santiago Pastorino 2020-04-21 17:11:00 -03:00
parent 45d050cde2
commit 15ecfe65a8
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
5 changed files with 10 additions and 25 deletions

View File

@ -204,7 +204,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
};
}
self.visit_place_base(&place_ref.local, context, location);
self.visit_local(&place_ref.local, context, location);
self.visit_projection(place_ref.local, place_ref.projection, context, location);
}
}

View File

@ -163,13 +163,6 @@ macro_rules! make_mir_visitor {
self.super_place(place, context, location);
}
fn visit_place_base(&mut self,
local: & $($mutability)? Local,
context: PlaceContext,
location: Location) {
self.super_place_base(local, context, location);
}
visit_place_fns!($($mutability)?);
fn visit_constant(&mut self,
@ -710,13 +703,6 @@ macro_rules! make_mir_visitor {
);
}
fn super_place_base(&mut self,
local: & $($mutability)? Local,
context: PlaceContext,
location: Location) {
self.visit_local(local, context, location);
}
fn super_local_decl(&mut self,
local: Local,
local_decl: & $($mutability)? LocalDecl<'tcx>) {
@ -847,7 +833,7 @@ macro_rules! visit_place_fns {
context: PlaceContext,
location: Location,
) {
self.visit_place_base(&mut place.local, context, location);
self.visit_local(&mut place.local, context, location);
if let Some(new_projection) = self.process_projection(&place.projection, location) {
place.projection = self.tcx().intern_place_elems(&new_projection);
@ -936,7 +922,7 @@ macro_rules! visit_place_fns {
};
}
self.visit_place_base(&place.local, context, location);
self.visit_local(&place.local, context, location);
self.visit_projection(place.local, &place.projection, context, location);
}

View File

@ -648,7 +648,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
self.super_terminator_kind(kind, location);
}
fn visit_place_base(
fn visit_local(
&mut self,
_place_local: &Local,
_context: mir::visit::PlaceContext,

View File

@ -276,7 +276,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
PlaceContext::MutatingUse(MutatingUseContext::Borrow)
}
};
self.visit_place_base(&place.local, ctx, location);
self.visit_local(&place.local, ctx, location);
self.visit_projection(place.local, reborrowed_proj, ctx, location);
return;
}
@ -289,7 +289,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
}
Mutability::Mut => PlaceContext::MutatingUse(MutatingUseContext::AddressOf),
};
self.visit_place_base(&place.local, ctx, location);
self.visit_local(&place.local, ctx, location);
self.visit_projection(place.local, reborrowed_proj, ctx, location);
return;
}
@ -386,14 +386,13 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
}
}
fn visit_place_base(&mut self, place_local: &Local, context: PlaceContext, location: Location) {
fn visit_local(&mut self, place_local: &Local, context: PlaceContext, location: Location) {
trace!(
"visit_place_base: place_local={:?} context={:?} location={:?}",
"visit_local: place_local={:?} context={:?} location={:?}",
place_local,
context,
location,
);
self.super_place_base(place_local, context, location);
}
fn visit_operand(&mut self, op: &Operand<'tcx>, location: Location) {

View File

@ -115,7 +115,7 @@ impl<'tcx> MutVisitor<'tcx> for DerefArgVisitor<'tcx> {
self.tcx,
);
} else {
self.visit_place_base(&mut place.local, context, location);
self.visit_local(&mut place.local, context, location);
for elem in place.projection.iter() {
if let PlaceElem::Index(local) = elem {
@ -154,7 +154,7 @@ impl<'tcx> MutVisitor<'tcx> for PinArgVisitor<'tcx> {
self.tcx,
);
} else {
self.visit_place_base(&mut place.local, context, location);
self.visit_local(&mut place.local, context, location);
for elem in place.projection.iter() {
if let PlaceElem::Index(local) = elem {