mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
Rename from ast.IOBind to ast.IOManip
This commit is contained in:
1 parent
28a54baa19
commit
f73f95b698
9 files changed
+37
-53
No files matched your search
@@ -200,8 +200,8 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
maxIOBinds = 100
|
||||
maxTemp = 10000
|
||||
maxIOManips = 100
|
||||
maxTemp = 10000
|
||||
)
|
||||
|
||||
type status struct {
|
||||
|
||||
@@ -40,7 +40,7 @@ type funk struct {
|
||||
derivedVars map[t.ID]struct{}
|
||||
jumpTargets map[a.Loop]string
|
||||
coroSuspPoint uint32
|
||||
ioBinds uint32
|
||||
ioManips uint32
|
||||
tempW uint32
|
||||
tempR uint32
|
||||
usesEmptyIOBuffer bool
|
||||
|
||||
@@ -185,8 +185,8 @@ loop:
|
||||
return err
|
||||
}
|
||||
|
||||
case a.KIOBind:
|
||||
if err := h.doIOBind(r, o.AsIOBind(), depth); err != nil {
|
||||
case a.KIOManip:
|
||||
if err := h.doIOManip(r, o.AsIOManip(), depth); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ func (h *livenessHelper) doExpr1(r livenesses, n *a.Expr, allToStrong bool, dept
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *livenessHelper) doIOBind(r livenesses, n *a.IOBind, depth uint32) error {
|
||||
func (h *livenessHelper) doIOManip(r livenesses, n *a.IOManip, depth uint32) error {
|
||||
if err := h.doExpr(r, n.IO()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
|
||||
return g.writeStatementAssign(b, n.Operator(), n.LHS(), n.RHS(), depth)
|
||||
case a.KChoose:
|
||||
return g.writeStatementChoose(b, n.AsChoose(), depth)
|
||||
case a.KIOBind:
|
||||
return g.writeStatementIOBind(b, n.AsIOBind(), depth)
|
||||
case a.KIOManip:
|
||||
return g.writeStatementIOManip(b, n.AsIOManip(), depth)
|
||||
case a.KIf:
|
||||
return g.writeStatementIf(b, n.AsIf(), depth)
|
||||
case a.KIterate:
|
||||
@@ -293,12 +293,12 @@ func cpuArchCNames(asserts []*a.Node) (caMacro string, caName string, caAttribut
|
||||
return caMacro, caName, caAttribute, nil
|
||||
}
|
||||
|
||||
func (g *gen) writeStatementIOBind(b *buffer, n *a.IOBind, depth uint32) error {
|
||||
if g.currFunk.ioBinds > maxIOBinds {
|
||||
func (g *gen) writeStatementIOManip(b *buffer, n *a.IOManip, depth uint32) error {
|
||||
if g.currFunk.ioManips > maxIOManips {
|
||||
return fmt.Errorf("too many temporary variables required")
|
||||
}
|
||||
ioBindNum := g.currFunk.ioBinds
|
||||
g.currFunk.ioBinds++
|
||||
ioBindNum := g.currFunk.ioManips
|
||||
g.currFunk.ioManips++
|
||||
|
||||
e := n.IO()
|
||||
prefix := vPrefix
|
||||
|
||||
@@ -64,8 +64,8 @@ func (g *gen) needDerivedVar(name t.ID) bool {
|
||||
}
|
||||
}
|
||||
|
||||
case a.KIOBind:
|
||||
if p.AsIOBind().IO().IsArgsDotFoo() == name {
|
||||
case a.KIOManip:
|
||||
if p.AsIOManip().IO().IsArgsDotFoo() == name {
|
||||
return errNeedDerivedVar
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user