Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536package core
import ( "git.urbach.dev/cli/q/src/asm" "git.urbach.dev/cli/q/src/codegen" "git.urbach.dev/cli/q/src/fs" "git.urbach.dev/cli/q/src/ssa")
// NewFunction creates a new function.func NewFunction(name string, pkg string, file *fs.File) *Function { fullName := pkg + "." + name
return &Function{ functionIdentity: functionIdentity{ name: name, pkg: pkg, File: file, }, IR: ssa.IR{ Blocks: []*ssa.Block{ { Label: fullName, Instructions: make([]ssa.Value, 0, 8), }, }, }, Function: codegen.Function{ FullName: fullName, IsExit: fullName == "run.init" || fullName == "run.crash" || fullName == "run.exit", Assembler: asm.Assembler{ Instructions: make([]asm.Instruction, 0, 8), }, }, }}