github.com/llir/llvm@v0.3.6/ir/module_type.go (about)

     1  package ir
     2  
     3  import "github.com/llir/llvm/ir/types"
     4  
     5  // --- [ Type definitions ] ----------------------------------------------------
     6  
     7  // NewTypeDef appends a new type definition to the module based on the given
     8  // type name and underlying type.
     9  func (m *Module) NewTypeDef(name string, typ types.Type) types.Type {
    10  	typ.SetName(name)
    11  	m.TypeDefs = append(m.TypeDefs, typ)
    12  	return typ
    13  }