examples/sha1: single block

This commit is contained in:
Michael McLoughlin
2018-12-21 00:30:59 -08:00
parent 224cccd2b1
commit f464082484
8 changed files with 1525 additions and 11 deletions

View File

@@ -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)
}

View File

@@ -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) }