Add a constant flag to enable and disable execution trac printouts.
This commit is contained in:
parent
c7244afea1
commit
f674aeba97
1 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,8 @@ use syntax::attr::AttrMetaMethods;
|
|||
|
||||
use std::iter;
|
||||
|
||||
const TRACE_EXECUTION: bool = false;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
enum Value {
|
||||
Uninit,
|
||||
|
@ -78,6 +80,8 @@ impl<'a, 'tcx> Interpreter<'a, 'tcx> {
|
|||
for stmt in &block_data.statements {
|
||||
use rustc_mir::repr::StatementKind::*;
|
||||
|
||||
if TRACE_EXECUTION { println!("{:?}", stmt); }
|
||||
|
||||
match stmt.kind {
|
||||
Assign(ref lvalue, ref rvalue) => {
|
||||
let index = self.eval_lvalue(lvalue);
|
||||
|
@ -91,6 +95,8 @@ impl<'a, 'tcx> Interpreter<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
if TRACE_EXECUTION { println!("{:?}", block_data.terminator); }
|
||||
|
||||
match block_data.terminator {
|
||||
Return => break,
|
||||
Goto { target } => block = target,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue