pub fn build(self) -> Block {
        let mut block = BlockPayload {
            arguments: Vec::new(),
            instructions: Vec::new(),
        };

        let name = self.context.get_name("");

        let function = &mut self.context.functions[self.function.0];

        for argument_type in self.argument_types {
            let argument = self.context.values.insert(ValuePayload::Argument(Argument {
                name,
                ty: argument_type,
            }));
            block.arguments.push(Value(argument));
        }

        let block = Block(self.context.blocks.insert(block));

        function.blocks.push(block);

        block
    }
/// Finalize and build the block.
///
/// # 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_builder = function.create_block(&mut context);
/// let block = block_builder.build();
/// ```
Finalize and build the block.
Finalize and build the block .
pub fn build(self) -> Block {
        let mut block = BlockPayload {
            arguments: Vec::new(),
            instructions: Vec::new(),
        };
        let name = self.context.get_name("");
        let function = &mut self.context.functions[self.function.0];
        for argument_type in self.argument_types {
            let argument = self.context.values.insert(ValuePayload::Argument(Argument {
                name,
                ty: argument_type,
            }));
            block.arguments.push(Value(argument));
        }
        let block = Block(self.context.blocks.insert(block));
        function.blocks.push(block);
        block
    }
pub fn build ( self ) -> Block { let mut block = BlockPayload { arguments : Vec :: new ( ) , instructions : Vec :: new ( ) , } ; let name = self . context . get_name ( " " ) ; let function = & mut self . context . functions [ self . function . 0 ] ; for argument_type in self . argument_types { let argument = self . context . values . insert ( ValuePayload :: Argument ( Argument { name , ty : argument_type , } ) ) ; block . arguments . push ( Value ( argument ) ) ; } let block = Block ( self . context . blocks . insert ( block ) ) ; function . blocks . push ( block ) ; block }
Finalize and build the block.
Finalize and build the block .
self
self
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_builder = function.create_block(&mut context);
let block = block_builder.build();
```
let block = block_builder . build () ; ` ` `