}
// The `super_xxx` methods comprise the default behavior and are
- // not meant to be overidden.
+ // not meant to be overridden.
fn super_mir(&mut self,
mir: & $($mutability)* Mir<'tcx>) {
ref $($mutability)* rvalue) => {
self.visit_assign(block, lvalue, rvalue);
}
- StatementKind::Drop(ref $($mutability)* lvalue) => {
- self.visit_lvalue(lvalue, LvalueContext::Drop);
- }
}
}
Terminator::Return => {
}
+ Terminator::Drop { ref $($mutability)* value, target, unwind } => {
+ self.visit_lvalue(value, LvalueContext::Drop);
+ self.visit_branch(block, target);
+ unwind.map(|t| self.visit_branch(block, t));
+ }
+
Terminator::Call { ref $($mutability)* func,
ref $($mutability)* args,
- ref $($mutability)* kind } => {
+ ref $($mutability)* destination,
+ cleanup } => {
self.visit_operand(func);
for arg in args {
self.visit_operand(arg);
}
- match *kind {
- CallKind::Converging {
- ref $($mutability)* destination,
- ..
- } |
- CallKind::ConvergingCleanup {
- ref $($mutability)* destination,
- ..
- } => {
- self.visit_lvalue(destination, LvalueContext::Store);
- }
- CallKind::Diverging |
- CallKind::DivergingCleanup(_) => {}
- }
- for &target in kind.successors() {
+ if let Some((ref $($mutability)* destination, target)) = *destination {
+ self.visit_lvalue(destination, LvalueContext::Store);
self.visit_branch(block, target);
}
+ cleanup.map(|t| self.visit_branch(block, t));
}
}
}
});
}
- Rvalue::InlineAsm(_) => {
+ Rvalue::InlineAsm { ref $($mutability)* outputs,
+ ref $($mutability)* inputs, .. } => {
+ for output in & $($mutability)* outputs[..] {
+ self.visit_lvalue(output, LvalueContext::Store);
+ }
+ for input in & $($mutability)* inputs[..] {
+ self.visit_operand(input);
+ }
}
}
}