pub fn build(self) -> Value {
        debug_assert!(!self.name.is_empty(), "name must be non-0 in length");

        let global_type = self.context.get_pointer_type(self.ty, self.domain);

        let global = Global {
            name: self.context.get_name(self.name),
            ty: self.ty,
            ptr_ty: global_type,
            attributes: self.attributes,
            location: self.location,
        };

        let index = Value(self.context.values.insert(ValuePayload::Global(global)));

        self.context.modules[self.module.0].globals.push(index);

        index
    }
/// Finalize and build the global.
///
/// # Examples
///
/// ```
/// # use yair::*;
/// # let mut context = Context::new();
/// # let module = context.create_module().build();
/// # let builder = module.create_global(&mut context).with_name("var");
/// let global = builder.build();
/// ```
Finalize and build the global.
Finalize and build the global .
pub fn build(self) -> Value {
        debug_assert!(!self.name.is_empty(), "name must be non-0 in length");
        let global_type = self.context.get_pointer_type(self.ty, self.domain);
        let global = Global {
            name: self.context.get_name(self.name),
            ty: self.ty,
            ptr_ty: global_type,
            attributes: self.attributes,
            location: self.location,
        };
        let index = Value(self.context.values.insert(ValuePayload::Global(global)));
        self.context.modules[self.module.0].globals.push(index);
        index
    }
pub fn build ( self ) -> Value { debug_assert ! ( self name is_empty ( ) " " ) ; let global_type = self . context . get_pointer_type ( self . ty , self . domain ) ; let global = Global { name : self . context . get_name ( self . name ) , ty : self . ty , ptr_ty : global_type , attributes : self . attributes , location : self . location , } ; let index = Value ( self . context . values . insert ( ValuePayload :: Global ( global ) ) ) ; self . context . modules [ self . module . 0 ] . globals . push ( index ) ; index }
Finalize and build the global.
Finalize and build the global .
self
self
examples
None
use yair::*;
None
let mut context = context::new();
None
let module = context.create_module().build();
None
let builder = module.create_global(&mut context).with_name("var");
let global = builder.build();
```
let global = builder . build () ; ` ` `