- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for defaultlit2 (0.18 sec)
-
src/cmd/compile/internal/typecheck/const.go
} // DefaultLit on both nodes simultaneously; // if they're both ideal going in they better // get the same type going out. // force means must assign concrete (non-ideal) type. // The results of defaultlit2 MUST be assigned back to l and r, e.g. // // n.Left, n.Right = defaultlit2(n.Left, n.Right, force) func defaultlit2(l ir.Node, r ir.Node, force bool) (ir.Node, ir.Node) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 05 15:20:28 UTC 2023 - 10.5K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/expr.go
} if n.Ptr == nil || n.Ptr.Type() == nil || !n.Ptr.Type().IsUnsafePtr() { base.Fatalf("need unsafe.Pointer for OSLICEHEADER") } n.Ptr = Expr(n.Ptr) n.Len = DefaultLit(Expr(n.Len), types.Types[types.TINT]) n.Cap = DefaultLit(Expr(n.Cap), types.Types[types.TINT]) if ir.IsConst(n.Len, constant.Int) && ir.Int64Val(n.Len) < 0 { base.Fatalf("len for OSLICEHEADER must be non-negative") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 04 14:29:45 UTC 2024 - 23.1K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/func.go
} n.SetType(t) return n } // tcCopy typechecks an OCOPY node. func tcCopy(n *ir.BinaryExpr) ir.Node { n.SetType(types.Types[types.TINT]) n.X = Expr(n.X) n.X = DefaultLit(n.X, nil) n.Y = Expr(n.Y) n.Y = DefaultLit(n.Y, nil) if n.X.Type() == nil || n.Y.Type() == nil { n.SetType(nil) return n } // copy([]byte, string) if n.X.Type().IsSlice() && n.Y.Type().IsString() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 06 15:23:18 UTC 2024 - 21.1K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/typecheck.go
// array/slice indexes. It is almost equivalent to DefaultLit // but also accepts untyped numeric values representable as // value of type int (see also checkmake for comparison). // The result of indexlit MUST be assigned back to n, e.g. // // n.Left = indexlit(n.Left) func indexlit(n ir.Node) ir.Node { if n != nil && n.Type() != nil && n.Type().Kind() == types.TIDEAL { return DefaultLit(n, types.Types[types.TINT]) } return n }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 20 19:08:34 UTC 2024 - 30.5K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/stmt.go
base.FatalfAt(n.Pos(), "%L is not pointer shaped", n.X) } return n } // tcFor typechecks an OFOR node. func tcFor(n *ir.ForStmt) ir.Node { Stmts(n.Init()) n.Cond = Expr(n.Cond) n.Cond = DefaultLit(n.Cond, nil) if n.Cond != nil { t := n.Cond.Type() if t != nil && !t.IsBoolean() { base.Errorf("non-bool %L used as for condition", n.Cond) } } n.Post = Stmt(n.Post) Stmts(n.Body)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 20 15:10:54 UTC 2023 - 17.8K bytes - Viewed (0) -
src/cmd/compile/internal/walk/switch.go
nif.Cond = typecheck.Expr(nif.Cond) nif.Cond = typecheck.DefaultLit(nif.Cond, nil) out.Append(nif) out = &nif.Else } return } half := lo + n/2 nif := ir.NewIfStmt(base.Pos, nil, nil, nil) nif.Cond = less(half) base.Pos = base.Pos.WithNotStmt() nif.Cond = typecheck.Expr(nif.Cond) nif.Cond = typecheck.DefaultLit(nif.Cond, nil) do(lo, half, &nif.Body) do(half, hi, &nif.Else)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:01 UTC 2024 - 30.1K bytes - Viewed (0) -
src/cmd/compile/internal/walk/builtin.go
for i, n := range nn.Args { if n.Op() == ir.OLITERAL { if n.Type() == types.UntypedRune { n = typecheck.DefaultLit(n, types.RuneType) } switch n.Val().Kind() { case constant.Int: n = typecheck.DefaultLit(n, types.Types[types.TINT64]) case constant.Float: n = typecheck.DefaultLit(n, types.Types[types.TFLOAT64]) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 22:35:22 UTC 2024 - 31.2K bytes - Viewed (0) -
src/cmd/compile/internal/walk/range.go
} } } typecheck.Stmts(init) nfor.PtrInit().Append(init...) typecheck.Stmts(nfor.Cond.Init()) nfor.Cond = typecheck.Expr(nfor.Cond) nfor.Cond = typecheck.DefaultLit(nfor.Cond, nil) nfor.Post = typecheck.Stmt(nfor.Post) typecheck.Stmts(body) nfor.Body.Append(body...) nfor.Body.Append(nrange.Body...) var n ir.Node = nfor n = walkStmt(n)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Sep 20 14:52:33 UTC 2023 - 17.6K bytes - Viewed (0) -
src/cmd/compile/internal/walk/walk.go
} n.SetTypecheck(1) if n.X == nil || n.Y == nil { return n } lt := n.X.Type() rt := n.Y.Type() if lt == nil || rt == nil { return n } if ir.IsBlank(n.X) { n.Y = typecheck.DefaultLit(n.Y, nil) return n } if !types.Identical(lt, rt) { n.Y = typecheck.AssignConv(n.Y, lt, "assignment") n.Y = walkExpr(n.Y, init) } types.CalcSize(n.Y.Type()) return n }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Feb 27 20:56:00 UTC 2024 - 10.4K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/subr.go
case types.TPTR, types.TFUNC, types.TMAP, types.TCHAN, types.TINTER, types.TSLICE: return ir.OCONVNOP, "" } } // 6. rule about untyped constants - already converted by DefaultLit. // 7. Any typed value can be assigned to the blank identifier. if dst.Kind() == types.TBLANK { return ir.OCONVNOP, "" } return ir.OXXX, "" }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 05 19:45:58 UTC 2023 - 20.2K bytes - Viewed (0)