Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for NewAssignStmt (0.22 sec)

  1. src/cmd/compile/internal/walk/assign.go

    	slice := ir.NewSliceExpr(base.Pos, ir.OSLICE, s, nil, newLen, nil)
    	slice.SetBounded(true)
    	nif.Body = []ir.Node{ir.NewAssignStmt(base.Pos, s, slice)}
    
    	// else { s = growslice(oldPtr, newLen, oldCap, num, T) }
    	call := walkGrowslice(s, nif.PtrInit(), oldPtr, newLen, oldCap, num)
    	nif.Else = []ir.Node{ir.NewAssignStmt(base.Pos, s, call)}
    
    	nodes.Append(nif)
    
    	// Index to start copying into s.
    	//   idx = newLen - len(l2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/builtin.go

    	var l []ir.Node
    	l = append(l, ir.NewAssignStmt(base.Pos, nl, n.X))
    	l = append(l, ir.NewAssignStmt(base.Pos, nr, n.Y))
    
    	nfrm := ir.NewUnaryExpr(base.Pos, ir.OSPTR, nr)
    	nto := ir.NewUnaryExpr(base.Pos, ir.OSPTR, nl)
    
    	nlen := typecheck.TempAt(base.Pos, ir.CurFunc, types.Types[types.TINT])
    
    	// n = len(to)
    	l = append(l, ir.NewAssignStmt(base.Pos, nlen, ir.NewUnaryExpr(base.Pos, ir.OLEN, nl)))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/walk/temp.go

    func initStackTemp(init *ir.Nodes, tmp *ir.Name, val ir.Node) *ir.AddrExpr {
    	if val != nil && !types.Identical(tmp.Type(), val.Type()) {
    		base.Fatalf("bad initial value for %L: %L", tmp, val)
    	}
    	appendWalkStmt(init, ir.NewAssignStmt(base.Pos, tmp, val))
    	return typecheck.Expr(typecheck.NodAddr(tmp)).(*ir.AddrExpr)
    }
    
    // stackTempAddr returns the expression &tmp, where tmp is a newly
    // allocated temporary variable of the given type. Statements to
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 16:41:23 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/walk/order.go

    		// Evaluate left-hand side.
    		lhs := o.expr(n.X, nil)
    		o.out = append(o.out, typecheck.Stmt(ir.NewAssignStmt(base.Pos, r, lhs)))
    
    		// Evaluate right-hand side, save generated code.
    		saveout := o.out
    		o.out = nil
    		t := o.markTemp()
    		o.edge()
    		rhs := o.expr(n.Y, nil)
    		o.out = append(o.out, typecheck.Stmt(ir.NewAssignStmt(base.Pos, r, rhs)))
    		o.popTemp(t)
    		gen := o.out
    		o.out = saveout
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/coverage/cover.go

    	callx := typecheck.Call(pos, fn, []ir.Node{mdauspx, lenx, hashx,
    		pkPathNode, pkIdNode, cmodeNode, cgranNode}, false)
    	assign := callx
    	if pkid == coverage.NotHardCoded {
    		assign = typecheck.Stmt(ir.NewAssignStmt(pos, cnames.PkgIdVar, callx))
    	}
    
    	// Tack the call onto the start of our init function. We do this
    	// early in the init since it's possible that instrumented function
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 21:55:46 UTC 2024
    - 6K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/staticinit/sched.go

    		// use conv to ensure r is assignable to l (#13263).
    		dst := ir.Node(l)
    		if loff != 0 || !types.Identical(typ, l.Type()) {
    			dst = ir.NewNameOffsetExpr(base.Pos, l, loff, typ)
    		}
    		s.append(ir.NewAssignStmt(base.Pos, dst, typecheck.Conv(r, typ)))
    		return true
    
    	case ir.ONIL:
    		return true
    
    	case ir.OLITERAL:
    		if ir.IsZero(r) {
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 17:16:14 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/syntax/parser.go

    		// expr
    		pos := p.pos()
    		switch p.tok {
    		case _AssignOp:
    			// lhs op= rhs
    			op := p.op
    			p.next()
    			return p.newAssignStmt(pos, op, lhs, p.expr())
    
    		case _IncOp:
    			// lhs++ or lhs--
    			op := p.op
    			p.next()
    			return p.newAssignStmt(pos, op, lhs, nil)
    
    		case _Arrow:
    			// lhs <- rhs
    			s := new(SendStmt)
    			s.pos = pos
    			p.next()
    			s.Chan = lhs
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/walk/expr.go

    	}
    	return cheapExpr(n, init)
    }
    
    func copyExpr(n ir.Node, t *types.Type, init *ir.Nodes) ir.Node {
    	l := typecheck.TempAt(base.Pos, ir.CurFunc, t)
    	appendWalkStmt(init, ir.NewAssignStmt(base.Pos, l, n))
    	return l
    }
    
    func walkAddString(n *ir.AddStringExpr, init *ir.Nodes) ir.Node {
    	c := len(n.List)
    
    	if c < 2 {
    		base.Fatalf("walkAddString count %d too small", c)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/switch.go

    					base.Fatalf("unhandled type switch case %v", ncase.List[0])
    				}
    				val.SetType(caseVar.Type())
    				val.SetTypecheck(1)
    			}
    			l := []ir.Node{
    				ir.NewDecl(ncase.Pos(), ir.ODCL, caseVar),
    				ir.NewAssignStmt(ncase.Pos(), caseVar, val),
    			}
    			typecheck.Stmts(l)
    			sw.Compiled.Append(l...)
    		}
    		sw.Compiled.Append(ncase.Body...)
    		sw.Compiled.Append(br)
    	}
    
    	walkStmtList(sw.Compiled)
    	sw.Tag = nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/typecheck/typecheck.go

    	if !ir.Any(*np, func(n ir.Node) bool { return n.Op() != ir.ONEW && callOrChan(n) }) {
    		return
    	}
    
    	tmp := TempAt(base.Pos, ir.CurFunc, (*np).Type())
    	as := ir.NewAssignStmt(base.Pos, tmp, *np)
    	as.PtrInit().Append(Stmt(ir.NewDecl(n.Pos(), ir.ODCL, tmp)))
    	*np = tmp
    
    	n.PtrInit().Append(Stmt(as))
    }
    
    // RewriteMultiValueCall rewrites multi-valued f() to use temporaries,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
Back to top