Struct cranelift_wasm::FuncTranslationState
source · pub struct FuncTranslationState { /* private fields */ }
Expand description
Contains information passed along during a function’s translation and that records:
- The current value and control stacks.
- The depth of the two unreachable control blocks stacks, that are manipulated when translating unreachable code;
Implementations§
source§impl FuncTranslationState
impl FuncTranslationState
sourcepub fn reachable(&self) -> bool
pub fn reachable(&self) -> bool
True if the current translation state expresses reachable code, false if it is unreachable.
Examples found in repository?
src/environ/dummy.rs (line 358)
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
fn before_translate_operator(
&mut self,
_op: &Operator,
_builder: &mut FunctionBuilder,
state: &FuncTranslationState,
) -> WasmResult<()> {
if let Some(ref mut r) = &mut self.expected_reachability {
r.check_before(state.reachable());
}
Ok(())
}
fn after_translate_operator(
&mut self,
_op: &Operator,
_builder: &mut FunctionBuilder,
state: &FuncTranslationState,
) -> WasmResult<()> {
if let Some(ref mut r) = &mut self.expected_reachability {
r.check_after(state.reachable());
}
Ok(())
}