From 443f81d771042b019379ae4bfcd0a591cb47c88a Mon Sep 17 00:00:00 2001 From: Luke Champine Date: Mon, 3 Aug 2020 17:51:36 -0400 Subject: [PATCH] build: expose Instruction method on global context (#155) --- build/global.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/global.go b/build/global.go index 4095f81..162ca7e 100644 --- a/build/global.go +++ b/build/global.go @@ -7,6 +7,7 @@ import ( "github.com/mmcloughlin/avo/attr" "github.com/mmcloughlin/avo/buildtags" "github.com/mmcloughlin/avo/gotypes" + "github.com/mmcloughlin/avo/ir" "github.com/mmcloughlin/avo/operand" "github.com/mmcloughlin/avo/reg" @@ -149,3 +150,6 @@ func Commentf(format string, a ...interface{}) { ctx.Commentf(format, a...) } // ConstData builds a static data section containing just the given constant. func ConstData(name string, v operand.Constant) operand.Mem { return ctx.ConstData(name, v) } + +// Instruction adds an instruction to the active function. +func Instruction(i *ir.Instruction) { ctx.Instruction(i) }