Skip to content

Commit

Permalink
Eliminate this intermediate vec
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed May 31, 2024
1 parent 7af26f2 commit 2b3eac5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/flowistry_pdg_construction/src/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,19 +794,18 @@ impl<'tcx> GraphConstructor<'tcx> {
) -> Vec<(Place<'tcx>, DepNode<'tcx>)> {
// **POINTER-SENSITIVITY:**
// If `mutated` involves indirection via dereferences, then resolve it to the direct places it could point to.
let aliases = self.aliases(mutated).collect_vec();
let aliases = self.aliases(mutated);

// **FIELD-SENSITIVITY:** we do NOT deal with fields on *writes* (in this function),
// only on *reads* (in `add_input_to_op`).

// For each mutated `dst`:
aliases
.iter()
.map(|dst| {
// Create a destination node for (DST @ CURRENT_LOC).
(
*dst,
DepNode::new(*dst, self.make_call_string(location), self.tcx, &self.body),
dst,
DepNode::new(dst, self.make_call_string(location), self.tcx, &self.body),
)
})
.collect()
Expand Down

0 comments on commit 2b3eac5

Please sign in to comment.