Lazy dominator tree construction in borrowck
Motivated by the observation that sometimes constructed dominator tree was never queried.
This commit is contained in:
parent
159ba8a92c
commit
7fe68571fa
3 changed files with 12 additions and 12 deletions
|
@ -2193,7 +2193,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
let mut back_edge_stack = Vec::new();
|
||||
|
||||
predecessor_locations(self.body, location).for_each(|predecessor| {
|
||||
if location.dominates(predecessor, &self.dominators) {
|
||||
if location.dominates(predecessor, self.dominators()) {
|
||||
back_edge_stack.push(predecessor)
|
||||
} else {
|
||||
stack.push(predecessor);
|
||||
|
@ -2305,7 +2305,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
|
||||
let mut has_predecessor = false;
|
||||
predecessor_locations(self.body, location).for_each(|predecessor| {
|
||||
if location.dominates(predecessor, &self.dominators) {
|
||||
if location.dominates(predecessor, self.dominators()) {
|
||||
back_edge_stack.push(predecessor)
|
||||
} else {
|
||||
stack.push(predecessor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue