func cheapComputableIndex(width int64) bool { … } // walkRange transforms various forms of ORANGE into // simpler forms. The result must be assigned back to n. // Node n may also be modified in place, and may also be // the returned node. func walkRange(nrange *ir.RangeStmt) ir.Node { … } // rangeAssign returns "n.Key = key". func rangeAssign(n *ir.RangeStmt, key ir.Node) ir.Node { … } // rangeAssign2 returns "n.Key, n.Value = key, value". func rangeAssign2(n *ir.RangeStmt, key, value ir.Node) ir.Node { … } // rangeConvert returns src, converted to dst if necessary. If a // conversion is necessary, then typeWord and srcRType are copied to // their respective ConvExpr fields. func rangeConvert(nrange *ir.RangeStmt, dst *types.Type, src, typeWord, srcRType ir.Node) ir.Node { … } // isMapClear checks if n is of the form: // // for k := range m { // delete(m, k) // } // // where == for keys of map m is reflexive. func isMapClear(n *ir.RangeStmt) bool { … } // mapRangeClear constructs a call to runtime.mapclear for the map range idiom. func mapRangeClear(nrange *ir.RangeStmt) ir.Node { … } // mapClear constructs a call to runtime.mapclear for the map m. func mapClear(m, rtyp ir.Node) ir.Node { … } // Lower n into runtime·memclr if possible, for // fast zeroing of slices and arrays (issue 5373). // Look for instances of // // for i := range a { // a[i] = zero // } // // in which the evaluation of a is side-effect-free. // // Parameters are as in walkRange: "for v1, v2 = range a". func arrayRangeClear(loop *ir.RangeStmt, v1, v2, a ir.Node) ir.Node { … } // arrayClear constructs a call to runtime.memclr for fast zeroing of slices and arrays. func arrayClear(wbPos src.XPos, a ir.Node, nrange *ir.RangeStmt) ir.Node { … }