- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for safeExpr (0.74 sec)
-
src/cmd/compile/internal/walk/expr.go
// result is assignable if n is. func safeExpr(n ir.Node, init *ir.Nodes) ir.Node { if n == nil { return nil } if len(n.Init()) != 0 { walkStmtList(n.Init()) init.Append(ir.TakeInit(n)...) } switch n.Op() { case ir.ONAME, ir.OLITERAL, ir.ONIL, ir.OLINKSYMOFFSET: return n case ir.OLEN, ir.OCAP: n := n.(*ir.UnaryExpr) l := safeExpr(n.X, init) if l == n.X { return n
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:01 UTC 2024 - 27.6K bytes - Viewed (0) -
src/cmd/compile/internal/walk/builtin.go
res := typecheck.Expr(ir.NewUnaryExpr(n.Pos(), ir.OSPTR, slice)) res.SetType(n.Type()) return walkExpr(res, init) } func walkUnsafeSlice(n *ir.BinaryExpr, init *ir.Nodes) ir.Node { ptr := safeExpr(n.X, init) len := safeExpr(n.Y, init) sliceType := n.Type() lenType := types.Types[types.TINT64] unsafePtr := typecheck.Conv(ptr, types.Types[types.TUNSAFEPTR])
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/order.go
return o.copyExpr(n) } // safeExpr returns a safe version of n. // The definition of safe is that n can appear multiple times // without violating the semantics of the original program, // and that assigning to the safe version has the same effect // as assigning to the original n. // // The intended use is to apply to x when rewriting x += y into x = x + y. func (o *orderState) safeExpr(n ir.Node) ir.Node { switch n.Op() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 02:00:33 UTC 2024 - 42.7K bytes - Viewed (0) -
src/cmd/compile/internal/walk/convert.go
arg = ir.NewStarExpr(pos, addr) arg.SetType(argType) } args = []ir.Node{arg} } call := ir.NewCallExpr(base.Pos, ir.OCALL, fn, nil) call.Args = args return safeExpr(walkExpr(typecheck.Expr(call), init), init) } // walkBytesRunesToString walks an OBYTES2STR or ORUNES2STR node. func walkBytesRunesToString(n *ir.ConvExpr, init *ir.Nodes) ir.Node { a := typecheck.NodNil()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 09 17:28:22 UTC 2023 - 18.2K bytes - Viewed (0) -
src/cmd/compile/internal/walk/assign.go
mapAppend = right.(*ir.CallExpr) if !ir.SameSafeExpr(left, mapAppend.Args[0]) { base.Fatalf("not same expressions: %v != %v", left, mapAppend.Args[0]) } } left = walkExpr(left, init) left = safeExpr(left, init) if mapAppend != nil { mapAppend.Args[0] = left } if n.Op() == ir.OASOP { // Rewrite x op= y into x = x op y.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 08 17:09:06 UTC 2024 - 20.3K bytes - Viewed (0)