gotypes,build: pointer dereference (#61)

Provides a method on `gotypes.Component` to allow pointer dereference. This will enable `gotypes` helpers to be used with struct pointer arguments, for example.

Updates #53 
Fixes #54
This commit is contained in:
Michael McLoughlin
2019-01-27 19:22:21 -08:00
committed by GitHub
parent eb225e9d2c
commit 9eb409b935
9 changed files with 137 additions and 29 deletions

View File

@@ -112,6 +112,9 @@ func Load(src gotypes.Component, dst reg.Register) reg.Register { return ctx.Loa
// attempt to select the right MOV instruction based on the types involved.
func Store(src reg.Register, dst gotypes.Component) { ctx.Store(src, dst) }
// Dereference loads a pointer and returns its element type.
func Dereference(ptr gotypes.Component) gotypes.Component { return ctx.Dereference(ptr) }
// Doc sets documentation comment lines for the currently active function.
func Doc(lines ...string) { ctx.Doc(lines...) }