Ejemplo n.º 1
0
func (c *compiler) compVar(v *ir.Var) string {
	switch t := v.Scope().Lookup(v.Name()).(type) {
	case *ir.Define:
		return c.compDefine(t)
	case *ir.Param:
		return fmt.Sprintf("%s%d", t.Name(), t.ID())
	}
	panic("unreachable")
}
Ejemplo n.º 2
0
func (c *compiler) compIdent(i *ir.Var) string {
	return fmt.Sprintf("%s%d", i.Name(), i.Scope().Lookup(i.Name()).ID())
}