/// Select a basic block (by index) to insert instructions into, indexed off of self.modules.functions[self.selected_function].blocks[idx], or unselect if None
Select a basic block (by index) to insert instructions into, indexed off of self.modules.functions[self.selected_function].blocks[idx], or unselect if None
Select a basic block ( by index ) to insert instructions into indexed off of self . modules . functions [ self . selected_function ] . blocks [ idx ] or unselect if None
pub fn select_block(&mut self, idx: Option<usize>) -> BuildResult<()> {
        match idx {
            Some(idx) => {
                let selected_function = match self.selected_function {
                    Some(f) => f,
                    None => return Err(Error::DetachedBlock),
                };
                if idx < self.module.functions[selected_function].blocks.len() {
                    self.selected_block = Some(idx);
                    Ok(())
                } else {
                    Err(Error::BlockNotFound)
                }
            }
            None => {
                self.selected_block = None;
                Ok(())
            }
        }
    }
pub fn select_block ( & mut self , idx : Option < usize > ) -> BuildResult < ( ) > { match idx { Some ( idx ) => { let selected_function = match self . selected_function { Some ( f ) => f , None => return Err ( Error :: DetachedBlock ) , } ; if idx < self . module . functions [ selected_function ] . blocks . len ( ) { self . selected_block = Some ( idx ) ; Ok ( ( ) ) } else { Err ( Error :: BlockNotFound ) } } None => { self . selected_block = None ; Ok ( ( ) ) } } }
Select a basic block (by index) to insert instructions into, indexed off of self.modules.functions[self.selected_function].blocks[idx], or unselect if None
Select a basic block ( by index ) to insert instructions into indexed off of self . modules . functions [ self . selected_function ] . blocks [ idx ] or unselect if None
&mut self
idx
Option<usize>