From 21f97a436b94865cf9afd8a75a52c694e3d5e57e Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Sat, 27 Feb 2016 22:10:10 -0600 Subject: [PATCH] WIP: Rename eval_constant to const_to_ptr. --- src/interpreter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/interpreter.rs b/src/interpreter.rs index 01db533661e..e34aa952c42 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -292,7 +292,7 @@ impl<'a, 'tcx> Interpreter<'a, 'tcx> { // mir::Terminator::SwitchInt { ref discr, ref values, ref targets, .. } => { // let discr_val = self.read_lvalue(discr); - // let index = values.iter().position(|v| discr_val == self.eval_constant(v)) + // let index = values.iter().position(|v| discr_val == self.const_to_ptr(v)) // .expect("discriminant matched no values"); // block = targets[index]; @@ -463,7 +463,7 @@ impl<'a, 'tcx> Interpreter<'a, 'tcx> { mir::Operand::Constant(ref constant) => { match constant.literal { - mir::Literal::Value { ref value } => self.eval_constant(value), + mir::Literal::Value { ref value } => self.const_to_ptr(value), mir::Literal::Item { def_id, kind, .. } => match kind { // mir::ItemKind::Function | mir::ItemKind::Method => Value::Func(def_id), @@ -474,7 +474,7 @@ impl<'a, 'tcx> Interpreter<'a, 'tcx> { } } - fn eval_constant(&mut self, const_val: &const_eval::ConstVal) -> Pointer { + fn const_to_ptr(&mut self, const_val: &const_eval::ConstVal) -> Pointer { match *const_val { const_eval::ConstVal::Float(_f) => unimplemented!(), // const_eval::ConstVal::Int(i) => Value::new_int(i),