examples/sha1: single block
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/mmcloughlin/avo"
|
||||
"github.com/mmcloughlin/avo/gotypes"
|
||||
"github.com/mmcloughlin/avo/operand"
|
||||
"github.com/mmcloughlin/avo/reg"
|
||||
"golang.org/x/tools/go/packages"
|
||||
)
|
||||
@@ -69,6 +70,10 @@ func (c *Context) types() *types.Package {
|
||||
return c.pkg.Types
|
||||
}
|
||||
|
||||
func (c *Context) AllocLocal(size int) operand.Mem {
|
||||
return c.activefunc().AllocLocal(size)
|
||||
}
|
||||
|
||||
func (c *Context) Instruction(i *avo.Instruction) {
|
||||
c.activefunc().AddNode(i)
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/mmcloughlin/avo/gotypes"
|
||||
"github.com/mmcloughlin/avo/operand"
|
||||
|
||||
"github.com/mmcloughlin/avo/reg"
|
||||
|
||||
@@ -47,3 +48,5 @@ func ReturnIndex(i int) gotypes.Component { return ctx.ReturnIndex(i) }
|
||||
|
||||
func Load(src gotypes.Component, dst reg.Register) reg.Register { return ctx.Load(src, dst) }
|
||||
func Store(src reg.Register, dst gotypes.Component) { ctx.Store(src, dst) }
|
||||
|
||||
func AllocLocal(size int) operand.Mem { return ctx.AllocLocal(size) }
|
||||
|
||||
Reference in New Issue
Block a user