support docstrings

This commit is contained in:
Michael McLoughlin
2018-12-27 23:01:27 -08:00
parent 023324a4ec
commit 9f5277bf8e
6 changed files with 38 additions and 5 deletions

View File

@@ -51,6 +51,10 @@ func (c *Context) Function(name string) {
c.file.AddSection(c.function)
}
func (c *Context) Doc(lines ...string) {
c.activefunc().Doc = lines
}
func (c *Context) Signature(s *gotypes.Signature) {
c.activefunc().SetSignature(s)
}

View File

@@ -57,6 +57,8 @@ 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 Doc(lines ...string) { ctx.Doc(lines...) }
func AllocLocal(size int) operand.Mem { return ctx.AllocLocal(size) }
func ConstData(name string, v operand.Constant) operand.Mem { return ctx.ConstData(name, v) }