Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 28 for NewVar (0.12 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go

    		}
    
    	case asmArray:
    		tu := t.Underlying().(*types.Array)
    		elem := tu.Elem()
    		// Calculate offset of each element array.
    		fields := []*types.Var{
    			types.NewVar(token.NoPos, nil, "fake0", elem),
    			types.NewVar(token.NoPos, nil, "fake1", elem),
    		}
    		offsets := arch.sizes.Offsetsof(fields)
    		elemoff := int(offsets[1])
    		for i := 0; i < int(tu.Len()); i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 22.8K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/stmt.go

    				// declare new variable
    				name := identName(ident)
    				obj = NewVar(ident.Pos(), check.pkg, name, nil)
    				check.recordDef(ident, obj)
    				// _ variables don't count as new variables
    				if name != "_" {
    					vars = append(vars, obj)
    				}
    			} else {
    				check.errorf(lhs, InvalidSyntaxTree, "cannot declare %s", lhs)
    				obj = NewVar(lhs.Pos(), check.pkg, "_", nil) // dummy variable
    			}
    			assert(obj.typ == nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  3. src/go/types/object.go

    	isField  bool // var is struct field
    	used     bool // set if the variable was used
    	origin   *Var // if non-nil, the Var from which this one was instantiated
    }
    
    // NewVar returns a new variable.
    // The arguments set the attributes found with all Objects.
    func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var {
    	return &Var{object: object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/rangefunc/rewrite.go

    	return x
    }
    
    func (r *rewriter) stateVar(pos syntax.Pos) (*types2.Var, *syntax.VarDecl) {
    	r.stateVarCount++
    
    	name := fmt.Sprintf("#state%d", r.stateVarCount)
    	typ := r.int.Type()
    	obj := types2.NewVar(pos, r.pkg, name, typ)
    	n := syntax.NewName(pos, name)
    	setValueType(n, typ)
    	r.info.Defs[n] = obj
    
    	return obj, &syntax.VarDecl{NameList: []*syntax.Name{n}, Values: r.stateConst(abi.RF_READY)}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/object.go

    	isField  bool // var is struct field
    	used     bool // set if the variable was used
    	origin   *Var // if non-nil, the Var from which this one was instantiated
    }
    
    // NewVar returns a new variable.
    // The arguments set the attributes found with all Objects.
    func NewVar(pos syntax.Pos, pkg *Package, name string, typ Type) *Var {
    	return &Var{object: object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  6. src/go/types/check.go

    	if m := check.Types; m != nil {
    		for {
    			tv := m[x]
    			assert(tv.Type != nil) // should have been recorded already
    			pos := x.Pos()
    			tv.Type = NewTuple(
    				NewVar(pos, check.pkg, "", t0),
    				NewVar(pos, check.pkg, "", t1),
    			)
    			m[x] = tv
    			// if x is a parenthesized expression (p.X), update p.X
    			p, _ := x.(*ast.ParenExpr)
    			if p == nil {
    				break
    			}
    			x = p.X
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  7. src/go/types/builtins.go

    func makeSig(res Type, args ...Type) *Signature {
    	list := make([]*Var, len(args))
    	for i, param := range args {
    		list[i] = NewVar(nopos, nil, "", Default(param))
    	}
    	params := NewTuple(list...)
    	var result *Tuple
    	if res != nil {
    		assert(!isUntyped(res))
    		result = NewTuple(NewVar(nopos, nil, "", res))
    	}
    	return &Signature{params: params, results: result}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/builtins.go

    func makeSig(res Type, args ...Type) *Signature {
    	list := make([]*Var, len(args))
    	for i, param := range args {
    		list[i] = NewVar(nopos, nil, "", Default(param))
    	}
    	params := NewTuple(list...)
    	var result *Tuple
    	if res != nil {
    		assert(!isUntyped(res))
    		result = NewTuple(NewVar(nopos, nil, "", res))
    	}
    	return &Signature{params: params, results: result}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/call.go

    				} else {
    					check.versionErrorf(instErrPos, go1_21, "implicitly instantiated function in assignment")
    				}
    			}
    			gsig := NewSignatureType(nil, nil, nil, sig.params, sig.results, sig.variadic)
    			params = []*Var{NewVar(x.Pos(), check.pkg, "", gsig)}
    			// The type of the argument operand is tsig, which is the type of the LHS in an assignment
    			// or the result type in a return statement. Create a pseudo-expression for that operand
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31.5K bytes
    - Viewed (0)
  10. src/go/types/call.go

    				} else {
    					check.versionErrorf(instErrPos, go1_21, "implicitly instantiated function in assignment")
    				}
    			}
    			gsig := NewSignatureType(nil, nil, nil, sig.params, sig.results, sig.variadic)
    			params = []*Var{NewVar(x.Pos(), check.pkg, "", gsig)}
    			// The type of the argument operand is tsig, which is the type of the LHS in an assignment
    			// or the result type in a return statement. Create a pseudo-expression for that operand
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 33.5K bytes
    - Viewed (0)
Back to top