Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visit_place_base is just visit_local #71401

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/mir/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
18 changes: 2 additions & 16 deletions src/librustc_middle/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/monomorphize/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions src/librustc_mir/transform/check_consts/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/transform/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down