Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 23 for IsSlice3 (0.3 sec)

  1. test/escape_reflect.go

    // Unfortunate: x doesn't need to escape to heap, just to result.
    func slice2(x string) string { // ERROR "leaking param: x$"
    	v := reflect.ValueOf(x) // ERROR "x escapes to heap"
    	return v.Slice(1, 2).String()
    }
    
    func slice3(x [10]byte) []byte {
    	v := reflect.ValueOf(x) // ERROR "x escapes to heap"
    	return v.Slice(1, 2).Bytes()
    }
    
    func elem1(x *int) int { // ERROR "x does not escape"
    	v := reflect.ValueOf(x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 13.1K bytes
    - Viewed (0)
  2. src/go/parser/parser.go

    				args = append(args, p.parseType())
    			}
    		}
    	}
    
    	p.exprLev--
    	rbrack := p.expect(token.RBRACK)
    
    	if ncolons > 0 {
    		// slice expression
    		slice3 := false
    		if ncolons == 2 {
    			slice3 = true
    			// Check presence of middle and final index here rather than during type-checking
    			// to prevent erroneous programs from passing through gofmt (was go.dev/issue/7305).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  3. src/text/template/funcs.go

    		return item.Slice(idx[0], idx[1]), nil
    	}
    	// given item[i:j:k], make sure i <= j <= k.
    	if idx[1] > idx[2] {
    		return reflect.Value{}, fmt.Errorf("invalid slice index: %d > %d", idx[1], idx[2])
    	}
    	return item.Slice3(idx[0], idx[1], idx[2]), nil
    }
    
    // Length
    
    // length returns the length of the item, with an error if it has no defined length.
    func length(item reflect.Value) (int, error) {
    	item, isNil := indirect(item)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 20.9K bytes
    - Viewed (0)
  4. src/reflect/value.go

    	fl := v.flag.ro() | flagIndir | flag(Slice)
    	return Value{typ.Common(), unsafe.Pointer(&x), fl}
    }
    
    // Slice3 is the 3-index form of the slice operation: it returns v[i:j:k].
    // It panics if v's Kind is not [Array] or [Slice], or if v is an unaddressable array,
    // or if the indexes are out of bounds.
    func (v Value) Slice3(i, j, k int) Value {
    	var (
    		cap  int
    		typ  *sliceType
    		base unsafe.Pointer
    	)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  5. src/go/parser/parser_test.go

    	{name: "dot", format: "package main; var x = «x.»x"},
    	{name: "index", format: "package main; var x = x«[1]»"},
    	{name: "slice", format: "package main; var x = x«[1:2]»"},
    	{name: "slice3", format: "package main; var x = x«[1:2:3]»"},
    	{name: "dottype", format: "package main; var x = x«.(any)»"},
    	{name: "callseq", format: "package main; var x = x«()»"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/typecheck/typecheck.go

    	case ir.OSTRINGHEADER:
    		n := n.(*ir.StringHeaderExpr)
    		return tcStringHeader(n)
    
    	case ir.OMAKESLICECOPY:
    		n := n.(*ir.MakeExpr)
    		return tcMakeSliceCopy(n)
    
    	case ir.OSLICE, ir.OSLICE3:
    		n := n.(*ir.SliceExpr)
    		return tcSlice(n)
    
    	// call and call like
    	case ir.OCALL:
    		n := n.(*ir.CallExpr)
    		return tcCall(n, top)
    
    	case ir.OCAP, ir.OLEN:
    		n := n.(*ir.UnaryExpr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  7. src/go/ast/ast.go

    		Lbrack token.Pos // position of "["
    		Low    Expr      // begin of slice range; or nil
    		High   Expr      // end of slice range; or nil
    		Max    Expr      // maximum capacity of slice; or nil
    		Slice3 bool      // true if 3-index slice (2 colons present)
    		Rbrack token.Pos // position of "]"
    	}
    
    	// A TypeAssertExpr node represents an expression followed by a
    	// type assertion.
    	//
    	TypeAssertExpr struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/tests/lower_tf.mlir

      // CHECK:      %[[SLICE3:.*]] = "tf.Slice"(%[[CONCAT]], %[[CST5]], %[[CST6]]) : (tensor<3x8x4xi32>, tensor<3xi64>, tensor<3xi64>) -> tensor<3x6x4xi32>
      // CHECK:      %[[CONCAT1:.*]] = "tf.ConcatV2"(%[[SLICE2]], %[[SLICE3]], %[[CST7]]) : (tensor<3x2x4xi32>, tensor<3x6x4xi32>, tensor<i32>) -> tensor<3x8x4xi32>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Jan 05 18:35:42 UTC 2024
    - 92K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/order.go

    			o.exprList(n.Args)
    		}
    
    		if lhs == nil || lhs.Op() != ir.ONAME && !ir.SameSafeExpr(lhs, n.Args[0]) {
    			return o.copyExpr(n)
    		}
    		return n
    
    	case ir.OSLICE, ir.OSLICEARR, ir.OSLICESTR, ir.OSLICE3, ir.OSLICE3ARR:
    		n := n.(*ir.SliceExpr)
    		n.X = o.expr(n.X, nil)
    		n.Low = o.cheapExpr(o.expr(n.Low, nil))
    		n.High = o.cheapExpr(o.expr(n.High, nil))
    		n.Max = o.cheapExpr(o.expr(n.Max, nil))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tf2xla/tests/legalize-tf.mlir

      // CHECK: %[[SLICE3:.*]] = "mhlo.slice"(%{{.*}}) <{limit_indices = dense<[4, 3, 6]> : tensor<3xi64>, start_indices = dense<[0, 2, 0]> : tensor<3xi64>, strides = dense<1> : tensor<3xi64>}> : (tensor<4x3x6xf32>) -> tensor<4x1x6xf32>
      // CHECK: %[[RES3:.*]] = mhlo.reshape %[[SLICE3]] : (tensor<4x1x6xf32>) -> tensor<4x6xf32>
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 06 18:46:23 UTC 2024
    - 335.5K bytes
    - Viewed (0)
Back to top