@@ -18,10 +18,10 @@ use crate::output::Output;
18
18
use datafrog:: { Iteration , Relation , RelationLeaper } ;
19
19
use facts:: { AllFacts , Atom } ;
20
20
21
- pub ( super ) fn compute < Region : Atom , Loan : Atom , Point : Atom , Variable : Atom , MovePath : Atom > (
21
+ pub ( super ) fn compute < Origin : Atom , Loan : Atom , Point : Atom , Variable : Atom , MovePath : Atom > (
22
22
dump_enabled : bool ,
23
- all_facts : AllFacts < Region , Loan , Point , Variable , MovePath > ,
24
- ) -> Output < Region , Loan , Point , Variable , MovePath > {
23
+ all_facts : AllFacts < Origin , Loan , Point , Variable , MovePath > ,
24
+ ) -> Output < Origin , Loan , Point , Variable , MovePath > {
25
25
let mut result = Output :: new ( dump_enabled) ;
26
26
27
27
let var_maybe_initialized_on_exit = initialization:: init_var_maybe_initialized_on_exit (
@@ -62,22 +62,22 @@ pub(super) fn compute<Region: Atom, Loan: Atom, Point: Atom, Variable: Atom, Mov
62
62
63
63
// we need `region_live_at` in both variable and relation forms.
64
64
// (respectively, for join and antijoin).
65
- let region_live_at_rel: Relation < ( Region , Point ) > = region_live_at. into ( ) ;
66
- let region_live_at_var = iteration. variable :: < ( ( Region , Point ) , ( ) ) > ( "region_live_at" ) ;
65
+ let region_live_at_rel: Relation < ( Origin , Point ) > = region_live_at. into ( ) ;
66
+ let region_live_at_var = iteration. variable :: < ( ( Origin , Point ) , ( ) ) > ( "region_live_at" ) ;
67
67
68
68
// `borrow_region` input but organized for join
69
- let borrow_region_rp = iteration. variable :: < ( ( Region , Point ) , Loan ) > ( "borrow_region_rp" ) ;
69
+ let borrow_region_rp = iteration. variable :: < ( ( Origin , Point ) , Loan ) > ( "borrow_region_rp" ) ;
70
70
71
71
// .decl subset(R1, R2, P)
72
72
//
73
73
// Indicates that `R1: R2` at the point `P`.
74
- let subset_r1p = iteration. variable :: < ( ( Region , Point ) , Region ) > ( "subset_r1p" ) ;
74
+ let subset_r1p = iteration. variable :: < ( ( Origin , Point ) , Origin ) > ( "subset_r1p" ) ;
75
75
76
76
// .decl requires(R, B, P)
77
77
//
78
- // At the point, things with region R may depend on data from
78
+ // At the point, things with origin R may depend on data from
79
79
// borrow B
80
- let requires_rp = iteration. variable :: < ( ( Region , Point ) , Loan ) > ( "requires_rp" ) ;
80
+ let requires_rp = iteration. variable :: < ( ( Origin , Point ) , Loan ) > ( "requires_rp" ) ;
81
81
82
82
// .decl borrow_live_at(B, P) -- true if the restrictions of the borrow B
83
83
// need to be enforced at the point P
@@ -95,55 +95,55 @@ pub(super) fn compute<Region: Atom, Loan: Atom, Point: Atom, Variable: Atom, Mov
95
95
// live things reachable from `R2` to `R1`.
96
96
//
97
97
let live_to_dying_regions_r2pq =
98
- iteration. variable :: < ( ( Region , Point , Point ) , Region ) > ( "live_to_dying_regions_r2pq" ) ;
98
+ iteration. variable :: < ( ( Origin , Point , Point ) , Origin ) > ( "live_to_dying_regions_r2pq" ) ;
99
99
100
100
// .decl dying_region_requires((R, P, Q), B)
101
101
//
102
- // The region `R` requires the borrow `B`, but the
103
- // region `R` goes dead along the edge `P -> Q`
102
+ // The origin `R` requires the borrow `B`, but the
103
+ // origin `R` goes dead along the edge `P -> Q`
104
104
let dying_region_requires =
105
- iteration. variable :: < ( ( Region , Point , Point ) , Loan ) > ( "dying_region_requires" ) ;
105
+ iteration. variable :: < ( ( Origin , Point , Point ) , Loan ) > ( "dying_region_requires" ) ;
106
106
107
107
// .decl dying_can_reach_origins(R, P, Q)
108
108
//
109
109
// Contains dead regions where we are interested
110
110
// in computing the transitive closure of things they
111
111
// can reach.
112
112
let dying_can_reach_origins =
113
- iteration. variable :: < ( ( Region , Point ) , Point ) > ( "dying_can_reach_origins" ) ;
113
+ iteration. variable :: < ( ( Origin , Point ) , Point ) > ( "dying_can_reach_origins" ) ;
114
114
115
115
// .decl dying_can_reach(R1, R2, P, Q)
116
116
//
117
- // Indicates that the region `R1`, which is dead
118
- // in `Q`, can reach the region `R2` in P.
117
+ // Indicates that the origin `R1`, which is dead
118
+ // in `Q`, can reach the origin `R2` in P.
119
119
//
120
120
// This is effectively the transitive subset
121
121
// relation, but we try to limit it to regions
122
122
// that are dying on the edge P -> Q.
123
123
let dying_can_reach_r2q =
124
- iteration. variable :: < ( ( Region , Point ) , ( Region , Point ) ) > ( "dying_can_reach" ) ;
124
+ iteration. variable :: < ( ( Origin , Point ) , ( Origin , Point ) ) > ( "dying_can_reach" ) ;
125
125
let dying_can_reach_1 = iteration. variable_indistinct ( "dying_can_reach_1" ) ;
126
126
127
127
// .decl dying_can_reach_live(R1, R2, P, Q)
128
128
//
129
129
// Indicates that, along the edge `P -> Q`, the dead (in Q)
130
- // region R1 can reach the live (in Q) region R2 via a subset
130
+ // origin R1 can reach the live (in Q) origin R2 via a subset
131
131
// relation. This is a subset of the full `dying_can_reach`
132
132
// relation where we filter down to those cases where R2 is
133
133
// live in Q.
134
134
let dying_can_reach_live =
135
- iteration. variable :: < ( ( Region , Point , Point ) , Region ) > ( "dying_can_reach_live" ) ;
135
+ iteration. variable :: < ( ( Origin , Point , Point ) , Origin ) > ( "dying_can_reach_live" ) ;
136
136
137
137
// .decl dead_borrow_region_can_reach_root((R, P), B)
138
138
//
139
139
// Indicates a "borrow region" R at P which is not live on
140
140
// entry to P.
141
141
let dead_borrow_region_can_reach_root =
142
- iteration. variable :: < ( ( Region , Point ) , Loan ) > ( "dead_borrow_region_can_reach_root" ) ;
142
+ iteration. variable :: < ( ( Origin , Point ) , Loan ) > ( "dead_borrow_region_can_reach_root" ) ;
143
143
144
144
// .decl dead_borrow_region_can_reach_dead((R2, P), B)
145
145
let dead_borrow_region_can_reach_dead =
146
- iteration. variable :: < ( ( Region , Point ) , Loan ) > ( "dead_borrow_region_can_reach_dead" ) ;
146
+ iteration. variable :: < ( ( Origin , Point ) , Loan ) > ( "dead_borrow_region_can_reach_dead" ) ;
147
147
let dead_borrow_region_can_reach_dead_1 =
148
148
iteration. variable_indistinct ( "dead_borrow_region_can_reach_dead_1" ) ;
149
149
@@ -234,7 +234,7 @@ pub(super) fn compute<Region: Atom, Loan: Atom, Point: Atom, Variable: Atom, Mov
234
234
//
235
235
// This is the "transitive closure" rule, but
236
236
// note that we only apply it with the
237
- // "intermediate" region R2 is dead at Q.
237
+ // "intermediate" origin R2 is dead at Q.
238
238
dying_can_reach_1. from_antijoin (
239
239
& dying_can_reach_r2q,
240
240
& region_live_at_rel,
@@ -288,7 +288,7 @@ pub(super) fn compute<Region: Atom, Loan: Atom, Point: Atom, Variable: Atom, Mov
288
288
//
289
289
// Communicate a `R1 requires B` relation across
290
290
// an edge `P -> Q` where `R1` is dead in Q; in
291
- // that case, for each region `R2` live in `Q`
291
+ // that case, for each origin `R2` live in `Q`
292
292
// where `R1 <= R2` in P, we add `R2 requires B`
293
293
// to `Q`.
294
294
requires_rp. from_join (
@@ -366,12 +366,12 @@ pub(super) fn compute<Region: Atom, Loan: Atom, Point: Atom, Variable: Atom, Mov
366
366
}
367
367
368
368
if dump_enabled {
369
- for ( region , location) in & region_live_at_rel. elements {
369
+ for ( origin , location) in & region_live_at_rel. elements {
370
370
result
371
371
. region_live_at
372
372
. entry ( * location)
373
373
. or_insert ( vec ! [ ] )
374
- . push ( * region ) ;
374
+ . push ( * origin ) ;
375
375
}
376
376
377
377
let subset_r1p = subset_r1p. complete ( ) ;
@@ -390,12 +390,12 @@ pub(super) fn compute<Region: Atom, Loan: Atom, Point: Atom, Variable: Atom, Mov
390
390
}
391
391
392
392
let requires_rp = requires_rp. complete ( ) ;
393
- for ( ( region , location) , borrow) in & requires_rp. elements {
393
+ for ( ( origin , location) , borrow) in & requires_rp. elements {
394
394
result
395
395
. restricts
396
396
. entry ( * location)
397
397
. or_insert ( BTreeMap :: new ( ) )
398
- . entry ( * region )
398
+ . entry ( * origin )
399
399
. or_insert ( BTreeSet :: new ( ) )
400
400
. insert ( * borrow) ;
401
401
}
0 commit comments