Search Options

Results per page
Sort
Preferred Languages
Advance

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

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

    		init = append(init, ir.NewAssignStmt(base.Pos, hv1, nil))
    		init = append(init, ir.NewAssignStmt(base.Pos, hn, a))
    
    		nfor.Cond = ir.NewBinaryExpr(base.Pos, ir.OLT, hv1, hn)
    		nfor.Post = ir.NewAssignStmt(base.Pos, hv1, ir.NewBinaryExpr(base.Pos, ir.OADD, hv1, ir.NewInt(base.Pos, 1)))
    
    		if v1 != nil {
    			body = []ir.Node{rangeAssign(nrange, hv1)}
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:33 UTC 2023
    - 17.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/compare.go

    			tab.SetTypecheck(1)
    			eqtype = ir.NewBinaryExpr(base.Pos, eq, tab, rtyp)
    		} else {
    			nonnil := ir.NewBinaryExpr(base.Pos, brcom(eq), typecheck.NodNil(), tab)
    			match := ir.NewBinaryExpr(base.Pos, eq, itabType(tab), rtyp)
    			eqtype = ir.NewLogicalExpr(base.Pos, andor, nonnil, match)
    		}
    		// Check for data equal.
    		eqdata := ir.NewBinaryExpr(base.Pos, eq, ifaceData(n.Pos(), l, r.Type()), r)
    		// Put it all together.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 21:55:14 UTC 2023
    - 16.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/walk/assign.go

    	nodes.Append(ir.NewAssignStmt(base.Pos, newLen, ir.NewBinaryExpr(base.Pos, ir.OADD, oldLen, num)))
    
    	// if uint(newLen) <= uint(oldCap)
    	nif := ir.NewIfStmt(base.Pos, nil, nil, nil)
    	nuint := typecheck.Conv(newLen, types.Types[types.TUINT])
    	scapuint := typecheck.Conv(oldCap, types.Types[types.TUINT])
    	nif.Cond = ir.NewBinaryExpr(base.Pos, ir.OLE, nuint, scapuint)
    	nif.Likely = true
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/walk/builtin.go

    	newLen := typecheck.TempAt(base.Pos, ir.CurFunc, types.Types[types.TINT])
    	l = append(l, ir.NewAssignStmt(base.Pos, newLen, ir.NewBinaryExpr(base.Pos, ir.OADD, ir.NewUnaryExpr(base.Pos, ir.OLEN, s), num)))
    
    	// if uint(newLen) <= uint(s.cap)
    	nif := ir.NewIfStmt(base.Pos, nil, nil, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/switch.go

    		}
    	}
    	out.Append(jt)
    	return true
    }
    
    func (c *exprClause) test(exprname ir.Node) ir.Node {
    	// Integer range.
    	if c.hi != c.lo {
    		low := ir.NewBinaryExpr(c.pos, ir.OGE, exprname, c.lo)
    		high := ir.NewBinaryExpr(c.pos, ir.OLE, exprname, c.hi)
    		return ir.NewLogicalExpr(c.pos, ir.OANDAND, low, high)
    	}
    
    	// Optimize "switch true { ...}" and "switch false { ... }".
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/walk/convert.go

    		nif := ir.NewIfStmt(base.Pos, typecheck.Expr(ir.NewBinaryExpr(base.Pos, ir.ONE, typeWord, typecheck.NodNil())), nil, nil)
    		nif.Body = []ir.Node{ir.NewAssignStmt(base.Pos, typeWord, itabType(typeWord))}
    		init.Append(nif)
    
    		// Build the result.
    		// e = iface{typeWord, data}
    		e := ir.NewBinaryExpr(base.Pos, ir.OMAKEFACE, typeWord, data)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 17:28:22 UTC 2023
    - 18.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/select.go

    		}
    
    		init = append(init, r)
    	}
    
    	if dflt != nil {
    		ir.SetPos(dflt)
    		dispatch(ir.NewBinaryExpr(base.Pos, ir.OLT, chosen, ir.NewInt(base.Pos, 0)), dflt)
    	}
    	for i, cas := range casorder {
    		ir.SetPos(cas)
    		if i == len(casorder)-1 {
    			dispatch(nil, cas)
    			break
    		}
    		dispatch(ir.NewBinaryExpr(base.Pos, ir.OEQ, chosen, ir.NewInt(base.Pos, int64(i))), cas)
    	}
    
    	return init
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 01:53:41 UTC 2023
    - 7.8K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/walk/complit.go

    		lhs.RType = n.RType
    
    		zero := ir.NewAssignStmt(base.Pos, i, ir.NewInt(base.Pos, 0))
    		cond := ir.NewBinaryExpr(base.Pos, ir.OLT, i, ir.NewInt(base.Pos, tk.NumElem()))
    		incr := ir.NewAssignStmt(base.Pos, i, ir.NewBinaryExpr(base.Pos, ir.OADD, i, ir.NewInt(base.Pos, 1)))
    
    		var body ir.Node = ir.NewAssignStmt(base.Pos, lhs, rhs)
    		body = typecheck.Stmt(body)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/typecheck/func.go

    		case ir.OCOMPLEX, ir.OCOPY, ir.OUNSAFEADD, ir.OUNSAFESLICE, ir.OUNSAFESTRING:
    			typecheckargs(n)
    			arg1, arg2, ok := needTwoArgs(n)
    			if !ok {
    				n.SetType(nil)
    				return n
    			}
    			b := ir.NewBinaryExpr(n.Pos(), l.BuiltinOp, arg1, arg2)
    			return typecheck(ir.InitExpr(n.Init(), b), top) // typecheckargs can add to old.Init
    		}
    		panic("unreachable")
    	}
    
    	n.Fun = DefaultLit(n.Fun, nil)
    	l = n.Fun
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/order.go

    	// freezes the counter when it reaches the value of 255. However, a range
    	// of experiments showed that that decreases overall performance.
    	o.append(ir.NewIfStmt(base.Pos,
    		ir.NewBinaryExpr(base.Pos, ir.OEQ, counter, ir.NewInt(base.Pos, 0xff)),
    		[]ir.Node{ir.NewAssignStmt(base.Pos, counter, ir.NewInt(base.Pos, 1))},
    		[]ir.Node{ir.NewAssignOpStmt(base.Pos, ir.OADD, counter, ir.NewInt(base.Pos, 1))}))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
Back to top