github.com/llir/llvm@v0.3.6/ir/module_func.go (about) 1 package ir 2 3 import "github.com/llir/llvm/ir/types" 4 5 // --- [ Functions ] ----------------------------------------------------------- 6 7 // NewFunc appends a new function to the module based on the given function 8 // name, return type and function parameters. 9 // 10 // The Parent field of the function is set to m. 11 func (m *Module) NewFunc(name string, retType types.Type, params ...*Param) *Func { 12 f := NewFunc(name, retType, params...) 13 f.Parent = m 14 m.Funcs = append(m.Funcs, f) 15 return f 16 }