MCPcopy Create free account
hub / github.com/CodeSentryAI/lockbud / visit_assign

Method visit_assign

src/analysis/datadep/mod.rs:60–79  ·  view source on GitHub ↗
(&mut self, place: &Place<'tcx>, rvalue: &Rvalue<'tcx>, location: Location)

Source from the content-addressed store, hash-verified

58
59impl<'tcx> Visitor<'tcx> for DataDeps {
60 fn visit_assign(&mut self, place: &Place<'tcx>, rvalue: &Rvalue<'tcx>, location: Location) {
61 let lhs = place.local;
62 match rvalue {
63 Rvalue::Use(operand) | Rvalue::Cast(_, operand, _) | Rvalue::UnaryOp(_, operand) => {
64 if let Some(rhs) = operand.place() {
65 self.immediate_deps[rhs.local][lhs] = true;
66 }
67 }
68 Rvalue::BinaryOp(_, box (rhs0, rhs1)) => {
69 if let Some(rhs0) = rhs0.place() {
70 self.immediate_deps[rhs0.local][lhs] = true;
71 }
72 if let Some(rhs1) = rhs1.place() {
73 self.immediate_deps[rhs1.local][lhs] = true;
74 }
75 }
76 _ => {}
77 }
78 self.super_assign(place, rvalue, location);
79 }
80}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected