This commit is contained in:
Michael McLoughlin
2018-12-06 21:58:51 -08:00
parent 676ec39c51
commit c86ef5ecae
4 changed files with 124 additions and 6 deletions

11
ast.go
View File

@@ -1,6 +1,8 @@
package avo
import (
"go/types"
"github.com/mmcloughlin/avo/operand"
"github.com/mmcloughlin/avo/reg"
)
@@ -109,7 +111,9 @@ func NewFile() *File {
// Function represents an assembly function.
type Function struct {
name string
Name string
Signature *types.Signature
Nodes []Node
// LabelTarget maps from label name to the following instruction.
@@ -121,7 +125,7 @@ type Function struct {
func NewFunction(name string) *Function {
return &Function{
name: name,
Name: name,
}
}
@@ -149,9 +153,6 @@ func (f *Function) Instructions() []*Instruction {
return is
}
// Name returns the function name.
func (f *Function) Name() string { return f.name }
// FrameBytes returns the size of the stack frame in bytes.
func (f *Function) FrameBytes() int {
// TODO(mbm): implement