Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for NonNil (0.11 sec)

  1. 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)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 21:55:14 UTC 2023
    - 16.2K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/staticinit/sched.go

    		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
    		}
    		staticdata.InitConst(l, loff, r, int(typ.Size()))
    		return true
    
    	case ir.OADDR:
    		r := r.(*ir.AddrExpr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 17:16:14 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/walk/complit.go

    		}
    		return true
    	case ir.OLITERAL, ir.ONIL:
    		return true
    	case ir.OCONVIFACE:
    		// See staticassign's OCONVIFACE case for comments.
    		n := n.(*ir.ConvExpr)
    		val := ir.Node(n)
    		for val.Op() == ir.OCONVIFACE {
    			val = val.(*ir.ConvExpr).X
    		}
    		if val.Type().IsInterface() {
    			return val.Op() == ir.ONIL
    		}
    		if types.IsDirectIface(val.Type()) && val.Op() == ir.ONIL {
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  4. src/internal/reflectlite/all_test.go

    	// These implement IsNil.
    	// Wrap in extra struct to hide interface type.
    	doNil := []any{
    		struct{ x *int }{},
    		struct{ x any }{},
    		struct{ x map[string]int }{},
    		struct{ x func() bool }{},
    		struct{ x chan int }{},
    		struct{ x []string }{},
    		struct{ x unsafe.Pointer }{},
    	}
    	for _, ts := range doNil {
    		ty := TField(TypeOf(ts), 0)
    		v := Zero(ty)
    		v.IsNil() // panics if not okay to call
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 16 19:26:08 UTC 2023
    - 24.2K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/expr.go

    		ir.Dump("walk", n)
    		base.Fatalf("walkExpr: switch 1 unknown op %+v", n.Op())
    		panic("unreachable")
    
    	case ir.OGETG, ir.OGETCALLERPC, ir.OGETCALLERSP:
    		return n
    
    	case ir.OTYPE, ir.ONAME, ir.OLITERAL, ir.ONIL, ir.OLINKSYMOFFSET:
    		// TODO(mdempsky): Just return n; see discussion on CL 38655.
    		// Perhaps refactor to use Node.mayBeShared for these instead.
    		// If these return early, make sure to still call
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/walk/walk.go

    		case ir.OMIN, ir.OMAX:
    			// string or float requires runtime call, see (*ssagen.state).minmax method.
    			return n.Type().IsString() || n.Type().IsFloat()
    
    		case ir.OLITERAL, ir.ONIL, ir.ONAME, ir.OLINKSYMOFFSET, ir.OMETHEXPR,
    			ir.OAND, ir.OANDNOT, ir.OLSH, ir.OOR, ir.ORSH, ir.OXOR, ir.OCOMPLEX, ir.OMAKEFACE,
    			ir.OADDR, ir.OBITNOT, ir.ONOT, ir.OPLUS,
    			ir.OCAP, ir.OIMAG, ir.OLEN, ir.OREAL,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 20:56:00 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/staticdata/data.go

    func InitConst(n *ir.Name, noff int64, c ir.Node, wid int) {
    	if n.Op() != ir.ONAME {
    		base.Fatalf("InitConst n op %v", n.Op())
    	}
    	if n.Sym() == nil {
    		base.Fatalf("InitConst nil n sym")
    	}
    	if c.Op() == ir.ONIL {
    		return
    	}
    	if c.Op() != ir.OLITERAL {
    		base.Fatalf("InitConst c op %v", c.Op())
    	}
    	s := n.Linksym()
    	switch u := c.Val(); u.Kind() {
    	case constant.Bool:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:08:50 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/typecheck/const.go

    		return n
    	}
    	if !n.Type().IsUntyped() {
    		// Already typed; nothing to do.
    		return n
    	}
    
    	// Nil is technically not a constant, so handle it specially.
    	if n.Type().Kind() == types.TNIL {
    		if n.Op() != ir.ONIL {
    			base.Fatalf("unexpected op: %v (%v)", n, n.Op())
    		}
    		n = ir.Copy(n)
    		if t == nil {
    			base.Fatalf("use of untyped nil")
    		}
    
    		if !t.HasNil() {
    			// Leave for caller to handle.
    			return n
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 10.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/ir/fmt.go

    	OMAKESLICE:        8,
    	OMAKESLICECOPY:    8,
    	OMAKE:             8,
    	OMAPLIT:           8,
    	OMAX:              8,
    	OMIN:              8,
    	ONAME:             8,
    	ONEW:              8,
    	ONIL:              8,
    	ONONAME:           8,
    	OPANIC:            8,
    	OPAREN:            8,
    	OPRINTLN:          8,
    	OPRINT:            8,
    	ORUNESTR:          8,
    	OSLICE2ARR:        8,
    	OSLICE2ARRPTR:     8,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/order.go

    // and then returns tmp.
    func (o *orderState) cheapExpr(n ir.Node) ir.Node {
    	if n == nil {
    		return nil
    	}
    
    	switch n.Op() {
    	case ir.ONAME, ir.OLITERAL, ir.ONIL:
    		return n
    	case ir.OLEN, ir.OCAP:
    		n := n.(*ir.UnaryExpr)
    		l := o.cheapExpr(n.X)
    		if l == n.X {
    			return n
    		}
    		a := ir.Copy(n).(*ir.UnaryExpr)
    		a.X = l
    		return typecheck.Expr(a)
    	}
    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