func (p *VariablePool) AddInstance(varnode *parser.Node) { strvalue := varnode.Source() if !p.Exists(strvalue) { nw := NewVariableMeta() nw.name = strvalue p._map[strvalue] = &nw } p._map[strvalue].locations = append(p._map[strvalue].locations, varnode.Tok) }
func reserve_variable(r *Routine, node *parser.Node) error { varname := node.Source() variable := r.vmap._map[varname] variable.Allocate() variable.register = r.registers.ReserveRegister() if variable.register == nil { return errorCannotReserveRegister(r, varname, node) } return nil }
func log_variable_trace(routine_name string, node *parser.Node) { if !*flag_vvv { return } log.Printf("VTrace:%s: %s @ %d", routine_name, node.Source(), node.Tok.Begin()) }
func log_function_call_saved(routine_name string, node *parser.Node) { if !*flag_vvv { return } log.Printf("Excluded %s:%s from variable positions (is function call).", routine_name, node.Source()) }