Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for IsPtrShaped (0.21 sec)

  1. src/cmd/compile/internal/ssa/_gen/dec.rules

    // the pre-rewrite input to the ArraySelect is a struct, not a pointer.
    (StructSelect [0] x) && x.Type.IsPtrShaped()  => x
    (ArraySelect [0] x) && x.Type.IsPtrShaped()  => x
    
    // These, too.  Bits is bits.
    (ArrayMake1 x) && x.Type.IsPtrShaped() => x
    (StructMake1 x) && x.Type.IsPtrShaped() => x
    
    (Store dst (StructMake1 <t> f0) mem) =>
      (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 00:48:31 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ssa/rewritedec.go

    	v_0 := v.Args[0]
    	// match: (ArrayMake1 x)
    	// cond: x.Type.IsPtrShaped()
    	// result: x
    	for {
    		x := v_0
    		if !(x.Type.IsPtrShaped()) {
    			break
    		}
    		v.copyOf(x)
    		return true
    	}
    	return false
    }
    func rewriteValuedec_OpArraySelect(v *Value) bool {
    	v_0 := v.Args[0]
    	b := v.Block
    	// match: (ArraySelect [0] x)
    	// cond: x.Type.IsPtrShaped()
    	// result: x
    	for {
    		if auxIntToInt64(v.AuxInt) != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 00:48:31 UTC 2023
    - 24.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ssa/check.go

    					}
    					if !v.Type.IsVoid() {
    						f.Fatalf("nilcheck must have void type %s", v.Type.String())
    					}
    				} else {
    					if !v.Type.IsPtrShaped() && !v.Type.IsUintptr() {
    						f.Fatalf("nilcheck must have pointer type %s", v.Type.String())
    					}
    				}
    				if !v.Args[0].Type.IsPtrShaped() && !v.Args[0].Type.IsUintptr() {
    					f.Fatalf("nilcheck must have argument of pointer type %s", v.Args[0].Type.String())
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 16:41:23 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/walk/convert.go

    		var arg ir.Node
    		switch {
    		case fromType == argType:
    			// already in the right type, nothing to do
    			arg = n
    		case fromType.Kind() == argType.Kind(),
    			fromType.IsPtrShaped() && argType.IsPtrShaped():
    			// can directly convert (e.g. named type to underlying type, or one pointer to another)
    			// TODO: never happens because pointers are directIface?
    			arg = ir.NewConvExpr(pos, ir.OCONVNOP, argType, n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 17:28:22 UTC 2023
    - 18.2K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/ssa/branchelim.go

    			return false
    		}
    	}
    	// For now, stick to simple scalars that fit in registers
    	switch {
    	case v.Type.Size() > v.Block.Func.Config.RegSize:
    		return false
    	case v.Type.IsPtrShaped():
    		return true
    	case v.Type.IsInteger():
    		if arch == "amd64" && v.Type.Size() < 2 {
    			// amd64 doesn't support CMOV with byte registers
    			return false
    		}
    		return true
    	default:
    		return false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 30 17:46:51 UTC 2022
    - 12.7K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/typecheck/stmt.go

    func plural(n int) string {
    	if n == 1 {
    		return ""
    	}
    	return "s"
    }
    
    // tcCheckNil typechecks an OCHECKNIL node.
    func tcCheckNil(n *ir.UnaryExpr) ir.Node {
    	n.X = Expr(n.X)
    	if !n.X.Type().IsPtrShaped() {
    		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)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 15:10:54 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/order.go

    		kt = types.Types[types.TUNSAFEPTR]
    	case mapfaststr:
    		kt = types.Types[types.TSTRING]
    	}
    	nt := n.Type()
    	switch {
    	case nt == kt:
    		return n
    	case nt.Kind() == kt.Kind(), nt.IsPtrShaped() && kt.IsPtrShaped():
    		// can directly convert (e.g. named type to underlying type, or one pointer to another)
    		return typecheck.Expr(ir.NewConvExpr(pos, ir.OCONVNOP, kt, n))
    	case nt.IsInteger() && kt.IsInteger():
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types/type.go

    	return t.kind == TUINTPTR
    }
    
    // IsPtrShaped reports whether t is represented by a single machine pointer.
    // In addition to regular Go pointer types, this includes map, channel, and
    // function types and unsafe.Pointer. It does not include array or struct types
    // that consist of a single pointer shaped type.
    // TODO(mdempsky): Should it? See golang.org/issue/15028.
    func (t *Type) IsPtrShaped() bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/ssagen/ssa.go

    		// as not-pointers or vice-versa because of copy
    		// elision.
    		if to.IsPtrShaped() != from.IsPtrShaped() {
    			return s.newValue2(ssa.OpConvert, to, x, s.mem())
    		}
    
    		v := s.newValue1(ssa.OpCopy, to, x) // ensure that v has the right type
    
    		// CONVNOP closure
    		if to.Kind() == types.TFUNC && from.IsPtrShaped() {
    			return v
    		}
    
    		// named <--> unnamed type or typed <--> untyped const
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 19:44:43 UTC 2024
    - 284.9K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/ssa/rewrite.go

    func is16BitInt(t *types.Type) bool {
    	return t.Size() == 2 && t.IsInteger()
    }
    
    func is8BitInt(t *types.Type) bool {
    	return t.Size() == 1 && t.IsInteger()
    }
    
    func isPtr(t *types.Type) bool {
    	return t.IsPtrShaped()
    }
    
    // mergeSym merges two symbolic offsets. There is no real merging of
    // offsets, we just pick the non-nil one.
    func mergeSym(x, y Sym) Sym {
    	if x == nil {
    		return y
    	}
    	if y == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 19:02:52 UTC 2024
    - 64.2K bytes
    - Viewed (0)
Back to top