Address review comments

This commit is contained in:
bjorn3 2018-10-21 16:16:23 +02:00
parent c32cf25689
commit b178553e55

View File

@ -572,12 +572,15 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
} }
/// This is used by [priroda](https://github.com/oli-obk/priroda) to get an OpTy from a local /// This is used by [priroda](https://github.com/oli-obk/priroda) to get an OpTy from a local
///
/// When you know the layout of the local in advance, you can pass it as last argument
pub fn access_local( pub fn access_local(
&self, &self,
frame: &super::Frame<'mir, 'tcx, M::PointerTag>, frame: &super::Frame<'mir, 'tcx, M::PointerTag>,
local: mir::Local, local: mir::Local,
layout: Option<TyLayout<'tcx>>, layout: Option<TyLayout<'tcx>>,
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> { ) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
assert_ne!(local, mir::RETURN_PLACE);
let op = *frame.locals[local].access()?; let op = *frame.locals[local].access()?;
let layout = from_known_layout(layout, let layout = from_known_layout(layout,
|| self.layout_of_local(frame, local))?; || self.layout_of_local(frame, local))?;