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

[WIP] Take 2: change how MIR represents Place #54426

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
96b641a
introduce new place definition
csmoe Sep 14, 2018
93c5ebb
convert old Place to NeoPlace
csmoe Sep 25, 2018
879f7c1
rewrite methods with NeoPlace in mir/tcx
csmoe Sep 21, 2018
e5abf2a
move from fixme to todo
csmoe Sep 22, 2018
0d71575
impl mir visitor for NeoPlace
csmoe Sep 22, 2018
5766076
introduce NeoPlace in borrow_check/borrow_set
csmoe Sep 23, 2018
7b65fe8
remove inefficient split_projection
csmoe Sep 25, 2018
f8a9a1f
add helper method ty_with_projections for base
csmoe Sep 26, 2018
eab6d54
add helper method to get base of place without projections
csmoe Sep 26, 2018
5779b68
implement construct method for NeoPlace
csmoe Sep 26, 2018
bdcacb3
add prefix method for neoplace
csmoe Sep 26, 2018
dc3ad66
rename bare_place to as_place_base
csmoe Sep 28, 2018
2286719
optimize prefix method
csmoe Sep 28, 2018
64c85e5
introduce neoplace in dataflow/impls
csmoe Oct 10, 2018
003b78c
introduce neoplace in dataflow/impls
csmoe Oct 10, 2018
971d093
clean up old place in place_ext
csmoe Oct 17, 2018
4420fff
impl hash_stable for neo_place
csmoe Oct 18, 2018
8ca7fc6
generate tys of sub-places
csmoe Nov 18, 2018
63167ba
generate prefixes for place
csmoe Nov 19, 2018
7f084ec
rewrite places conflict
csmoe Nov 19, 2018
2d1dce8
rewrite place in move_errs
csmoe Nov 20, 2018
7af3ddd
introduce neo_place in borrowck/path_utils
csmoe Nov 20, 2018
53e604c
rewrite place in used_muts into neo_place
csmoe Nov 22, 2018
6eb57e9
introduce NeoPlaceTree
nikomatsakis Jan 16, 2019
915d277
convert `describe_place` to use `NeoPlace`
nikomatsakis Jan 16, 2019
62a52ed
Implement PlaceExt trait for NeoPlace
spastorino Jan 22, 2019
7d10e8e
Remove PlaceExt impl for Place and use the NeoPlace one
spastorino Jan 23, 2019
ed1411c
Implement IsPrefixOf trait for NeoPlace
spastorino Jan 23, 2019
98a95b8
Remove IsPrefixOf impl for Place and use the NeoPlace one
spastorino Jan 23, 2019
42479d3
Remove Place::ty and use NeoPlace::ty instead
spastorino Jan 25, 2019
66a1800
Remove Place::local & Place::base_local and use NeoPlace::base_local …
spastorino Jan 27, 2019
c278ff9
Make into_tree generate Place instead of PlaceTree
spastorino Jan 29, 2019
cf4da24
implement `RustcDecodable` for `NeoPlace`
nikomatsakis Jan 30, 2019
222abfc
Make StatementKind::Assign carry a NeoPlace instead of a Place
spastorino Feb 1, 2019
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
43 changes: 32 additions & 11 deletions src/librustc/ich/impls_mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,27 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for mir::Place<'gcx> {
}
}

impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for mir::PlaceBase<'gcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
mem::discriminant(self).hash_stable(hcx, hasher);
match self {
mir::PlaceBase::Local(local) => {
local.hash_stable(hcx, hasher);
}
mir::PlaceBase::Static(statik) => {
statik.hash_stable(hcx, hasher);
}
mir::PlaceBase::Promoted(promoted) => {
promoted.hash_stable(hcx, hasher);
}
}
}
}

impl_stable_hash_for!(struct mir::NeoPlace<'tcx> { base, elems });

impl<'a, 'gcx, B, V, T> HashStable<StableHashingContext<'a>>
for mir::Projection<'gcx, B, V, T>
where B: HashStable<StableHashingContext<'a>>,
Expand Down Expand Up @@ -322,45 +343,45 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for mir::Rvalue<'gcx> {
hasher: &mut StableHasher<W>) {
mem::discriminant(self).hash_stable(hcx, hasher);

match *self {
mir::Rvalue::Use(ref operand) => {
match self {
mir::Rvalue::Use(operand) => {
operand.hash_stable(hcx, hasher);
}
mir::Rvalue::Repeat(ref operand, ref val) => {
mir::Rvalue::Repeat(operand, val) => {
operand.hash_stable(hcx, hasher);
val.hash_stable(hcx, hasher);
}
mir::Rvalue::Ref(region, borrow_kind, ref place) => {
mir::Rvalue::Ref(region, borrow_kind, place) => {
region.hash_stable(hcx, hasher);
borrow_kind.hash_stable(hcx, hasher);
place.hash_stable(hcx, hasher);
}
mir::Rvalue::Len(ref place) => {
mir::Rvalue::Len(place) => {
place.hash_stable(hcx, hasher);
}
mir::Rvalue::Cast(cast_kind, ref operand, ty) => {
mir::Rvalue::Cast(cast_kind, operand, ty) => {
cast_kind.hash_stable(hcx, hasher);
operand.hash_stable(hcx, hasher);
ty.hash_stable(hcx, hasher);
}
mir::Rvalue::BinaryOp(op, ref operand1, ref operand2) |
mir::Rvalue::CheckedBinaryOp(op, ref operand1, ref operand2) => {
mir::Rvalue::BinaryOp(op, operand1, operand2) |
mir::Rvalue::CheckedBinaryOp(op, operand1, operand2) => {
op.hash_stable(hcx, hasher);
operand1.hash_stable(hcx, hasher);
operand2.hash_stable(hcx, hasher);
}
mir::Rvalue::UnaryOp(op, ref operand) => {
mir::Rvalue::UnaryOp(op, operand) => {
op.hash_stable(hcx, hasher);
operand.hash_stable(hcx, hasher);
}
mir::Rvalue::Discriminant(ref place) => {
mir::Rvalue::Discriminant(place) => {
place.hash_stable(hcx, hasher);
}
mir::Rvalue::NullaryOp(op, ty) => {
op.hash_stable(hcx, hasher);
ty.hash_stable(hcx, hasher);
}
mir::Rvalue::Aggregate(ref kind, ref operands) => {
mir::Rvalue::Aggregate(kind, operands) => {
kind.hash_stable(hcx, hasher);
operands.hash_stable(hcx, hasher);
}
Expand Down
Loading