Rename the implicit in variable to args

This commit is contained in:
Nigel Tao committed 2018-07-29 10:26:22 +10:00
1 parent 58ded30954
commit ca06083f8a
19 files changed
+254 -252

No files matched your search

+3 -3
View File
@@ -84,10 +84,10 @@ func (g *gen) writeBuiltinIO(b *buffer, recv *a.Expr, method t.ID, args []*a.Nod
p0, p1 := "", ""
// TODO: don't hard-code these.
switch recv.Str(g.tm) {
case "in.dst":
case "args.dst":
p0 = "iobounds1_dst"
p1 = "ioptr_dst"
case "in.src":
case "args.src":
p0 = "iobounds1_src"
p1 = "ioptr_src"
case "w":
@@ -190,7 +190,7 @@ func (g *gen) writeBuiltinIOWriter(b *buffer, recv *a.Expr, method t.ID, args []
if err := g.writeExpr(b, args[0].AsArg().Value(), rp, depth); err != nil {
return err
}
// TODO: don't assume that the last argument is "in.src".
// TODO: don't assume that the last argument is "args.src".
b.printf(", &ioptr_src, iobounds1_src)")
return nil
+1 -1
View File
@@ -190,7 +190,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, depth u
case t.IDDot:
lhs := n.LHS().AsExpr()
if lhs.Ident() == t.IDIn {
if lhs.Ident() == t.IDArgs {
b.writes(aPrefix)
b.writes(n.Ident().Str(g.tm))
return nil
+5 -5
View File
@@ -44,7 +44,7 @@ func (g *gen) needDerivedVar(name t.ID) bool {
return nil
}
q = q.LHS().AsExpr()
if q.Operator() != 0 || q.Ident() != t.IDIn {
if q.Operator() != 0 || q.Ident() != t.IDArgs {
return nil
}
return errNeedDerivedVar
@@ -81,7 +81,7 @@ func (g *gen) findDerivedVars() {
func (g *gen) writeLoadDerivedVar(b *buffer, hack string, name t.ID, typ *a.TypeExpr, header bool) error {
// TODO: remove this hack. We're picking up the wrong name for "src:r,
// dummy:in.src".
// dummy:args.src".
if name.Str(g.tm) == "dummy" {
name = g.tm.ByName("src")
}
@@ -142,7 +142,7 @@ func (g *gen) writeLoadDerivedVar(b *buffer, hack string, name t.ID, typ *a.Type
func (g *gen) writeSaveDerivedVar(b *buffer, hack string, name t.ID, typ *a.TypeExpr) error {
// TODO: remove this hack. We're picking up the wrong name for "src:r,
// dummy:in.src".
// dummy:args.src".
if name.Str(g.tm) == "dummy" {
name = g.tm.ByName("src")
}
@@ -185,7 +185,7 @@ func (g *gen) writeLoadExprDerivedVars(b *buffer, n *a.Expr) error {
o := o.AsArg()
// TODO: don't hard-code these.
hack := ""
if s := o.Value().Str(g.tm); s != "in.dst" && s != "in.src" && s != "w" {
if s := o.Value().Str(g.tm); s != "args.dst" && s != "args.src" && s != "w" {
continue
} else if s == "w" {
hack = "w"
@@ -208,7 +208,7 @@ func (g *gen) writeSaveExprDerivedVars(b *buffer, n *a.Expr) error {
o := o.AsArg()
// TODO: don't hard-code these.
hack := ""
if s := o.Value().Str(g.tm); s != "in.dst" && s != "in.src" && s != "w" {
if s := o.Value().Str(g.tm); s != "args.dst" && s != "args.src" && s != "w" {
continue
} else if s == "w" {
hack = "w"