Returns [`ControlStackFrame`] for an if.
(
sig: BlockSig,
masm: &mut M,
context: &mut CodeGenContext<Emission>,
)
| 258 | impl ControlStackFrame { |
| 259 | /// Returns [`ControlStackFrame`] for an if. |
| 260 | pub fn r#if<M: MacroAssembler>( |
| 261 | sig: BlockSig, |
| 262 | masm: &mut M, |
| 263 | context: &mut CodeGenContext<Emission>, |
| 264 | ) -> Result<Self> { |
| 265 | let mut control = Self::If { |
| 266 | cont: masm.get_label()?, |
| 267 | exit: masm.get_label()?, |
| 268 | sig, |
| 269 | reachable: context.reachable, |
| 270 | stack_state: Default::default(), |
| 271 | }; |
| 272 | |
| 273 | control.emit(masm, context)?; |
| 274 | Ok(control) |
| 275 | } |
| 276 | |
| 277 | /// Returns [`ControlStackFrame`] for a block. |
| 278 | pub fn block<M: MacroAssembler>( |