- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for defaultlit2 (0.2 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/pkginit/initAsanGlobals.go
// Assign globals[i].size. g := n.(*ir.Name) size := g.Type().Size() c = typecheck.DefaultLit(ir.NewInt(base.Pos, size), types.Types[types.TUINTPTR]) setField("size", c, i) // Assign globals[i].sizeWithRedzone. rzSize := GetRedzoneSizeForGlobal(size) sizeWithRz := rzSize + size c = typecheck.DefaultLit(ir.NewInt(base.Pos, sizeWithRz), types.Types[types.TUINTPTR]) setField("sizeWithRedzone", c, i)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Aug 17 19:36:24 UTC 2023 - 8.7K 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/select.go
} } list.Append(cas.Body.Take()...) list.Append(ir.NewBranchStmt(base.Pos, ir.OBREAK, nil)) var r ir.Node if cond != nil { cond = typecheck.Expr(cond) cond = typecheck.DefaultLit(cond, nil) r = ir.NewIfStmt(base.Pos, cond, list, nil) } else { r = ir.NewBlockStmt(base.Pos, list) } init = append(init, r) } if dflt != nil { ir.SetPos(dflt)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 22 01:53:41 UTC 2023 - 7.8K bytes - Viewed (0)