pub fn has_terminator(&self, context: &Context) -> bool {
        let block = &context.blocks[self.0];

        if let Some(instruction) = block.instructions.last() {
            matches!(
                instruction.get_inst(context),
                Instruction::Branch(_, _, _)
                    | Instruction::ConditionalBranch(_, _, _, _, _, _)
                    | Instruction::Return(_)
                    | Instruction::ReturnValue(_, _, _)
            )
        } else {
            false
        }
    }
/// Does the block have a terminator.
///
/// # Examples
///
/// ```
/// # use yair::*;
/// # let mut context = Context::new();
/// # let module = context.create_module().build();
/// # let function = module.create_function(&mut context).with_name("func").build();
/// # let block = function.create_block(&mut context).build();
/// let has_terminator = block.has_terminator(&context);
/// # assert!(!has_terminator);
/// ```
Does the block have a terminator.
Does the block have a terminator .
pub fn has_terminator(&self, context: &Context) -> bool {
        let block = &context.blocks[self.0];
        if let Some(instruction) = block.instructions.last() {
            matches!(
                instruction.get_inst(context),
                Instruction::Branch(_, _, _)
                    | Instruction::ConditionalBranch(_, _, _, _, _, _)
                    | Instruction::Return(_)
                    | Instruction::ReturnValue(_, _, _)
            )
        } else {
            false
        }
    }
pub fn has_terminator ( & self , context : & Context ) -> bool { let block = & context . blocks [ self . 0 ] ; if let Some ( instruction ) = block . instructions . last ( ) { matches ! ( instruction get_inst ( context ) Instruction Branch ( ) Instruction ConditionalBranch ( ) Instruction Return ( ) Instruction ReturnValue ( ) ) } else { false } }
Does the block have a terminator.
Does the block have a terminator .
&self
context
&Context
&self
context
&Context
examples
None
use yair::*;
None
let mut context = context::new();
None
let module = context.create_module().build();
None
let function = module.create_function(&mut context).with_name("func").build();
None
let block = function.create_block(&mut context).build();
let has_terminator = block.has_terminator(&context).
let has_terminator = block . has_terminator ( &context ) .
assert!(!has_terminator);
None