Get "t0" temporary vars out of cgen's writeExpr

This commit is contained in:
Nigel Tao committed 2018-12-27 16:27:30 +11:00
1 parent 67acce83c7
commit eddeebeb37
2 files changed
+8 -12

No files matched your search

-9
View File
@@ -27,15 +27,6 @@ func (g *gen) writeExpr(b *buffer, n *a.Expr, depth uint32) error {
}
depth++
if n.Effect().Coroutine() {
if g.currFunk.tempR >= g.currFunk.tempW {
return fmt.Errorf("internal error: temporary variable count out of sync")
}
b.printf("%s%d", tPrefix, g.currFunk.tempR)
g.currFunk.tempR++
return nil
}
if cv := n.ConstValue(); cv != nil {
if typ := n.MType(); typ.IsNumTypeOrIdeal() {
b.writes(cv.String())