Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 43 for callExpr (0.33 sec)

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

    	cancelvars := make(map[*types.Var]ast.Node)
    
    	// TODO(adonovan): opt: refactor to make a single pass
    	// over the AST using inspect.WithStack and node types
    	// {FuncDecl,FuncLit,CallExpr,SelectorExpr}.
    
    	// Find the set of cancel vars to analyze.
    	stack := make([]ast.Node, 0, 32)
    	ast.Inspect(node, func(n ast.Node) bool {
    		switch n.(type) {
    		case *ast.FuncLit:
    			if len(stack) > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 9K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/stmt.go

    // a go or defer statement; that is, whether it's a regular function
    // call without arguments or results.
    func validGoDeferCall(call ir.Node) bool {
    	if call, ok := call.(*ir.CallExpr); ok && call.Op() == ir.OCALLFUNC && len(call.KeepAlive) == 0 {
    		sig := call.Fun.Type()
    		return sig.NumParams()+sig.NumResults() == 0
    	}
    	return false
    }
    
    // walkGoDefer walks an OGO or ODEFER node.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 15:42:30 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/errorcalls_test.go

    func TestErrorCalls(t *testing.T) {
    	files, err := pkgFiles(".")
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	for _, file := range files {
    		syntax.Inspect(file, func(n syntax.Node) bool {
    			call, _ := n.(*syntax.CallExpr)
    			if call == nil {
    				return true
    			}
    			selx, _ := call.Fun.(*syntax.SelectorExpr)
    			if selx == nil {
    				return true
    			}
    			if !(isName(selx.X, "check") && isName(selx.Sel, "errorf")) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 21:57:36 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/positions.go

    			m = n.X
    		case *TypeSwitchGuard:
    			if n.Lhs != nil {
    				m = n.Lhs
    				continue
    			}
    			m = n.X
    		case *Operation:
    			if n.Y != nil {
    				m = n.X
    				continue
    			}
    			return n.Pos()
    		case *CallExpr:
    			m = n.Fun
    		case *ListExpr:
    			if len(n.ElemList) > 0 {
    				m = n.ElemList[0]
    				continue
    			}
    			return n.Pos()
    		// types
    		// case *ArrayType:
    		// case *SliceType:
    		// case *DotsType:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/reflectdata/helpers.go

    }
    
    // AppendElemRType asserts that n is an "append" operation, and
    // returns an expression that yields the *runtime._type value
    // representing the result slice type's element type.
    func AppendElemRType(pos src.XPos, n *ir.CallExpr) ir.Node {
    	assertOp(n, ir.OAPPEND)
    	if hasRType(n, n.RType, "RType") {
    		return n.RType
    	}
    	return sliceElemRType(pos, n.Type())
    }
    
    // CompareRType asserts that n is a comparison (== or !=) operation
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 04:50:32 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  6. src/cmd/internal/dwarf/putvarabbrevgen_test.go

    			start = n
    			end = n
    		} else {
    			end.then = n
    			end = n
    		}
    	}
    	for _, stmt := range body {
    		switch stmt := stmt.(type) {
    		case *ast.ExprStmt:
    			if x, _ := stmt.X.(*ast.CallExpr); x != nil {
    				funstr := exprToString(x.Fun)
    				if funstr == "putattr" {
    					form, _ := x.Args[3].(*ast.Ident)
    					if form == nil {
    						t.Fatalf("%s invalid use of putattr", fset.Position(x.Pos()))
    					}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:45:07 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/cfg/cfg.go

    // do not return, so the builder can remove infeasible graph edges
    // following such calls.  The builder calls mayReturn only for a
    // CallExpr beneath an ExprStmt.
    func New(body *ast.BlockStmt, mayReturn func(*ast.CallExpr) bool) *CFG {
    	b := builder{
    		mayReturn: mayReturn,
    		cfg:       new(CFG),
    	}
    	b.current = b.newBlock(KindBody, body)
    	b.stmt(body)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    		return 1 << nBasicLit
    	case *ast.BinaryExpr:
    		return 1 << nBinaryExpr
    	case *ast.BlockStmt:
    		return 1 << nBlockStmt
    	case *ast.BranchStmt:
    		return 1 << nBranchStmt
    	case *ast.CallExpr:
    		return 1 << nCallExpr
    	case *ast.CaseClause:
    		return 1 << nCaseClause
    	case *ast.ChanType:
    		return 1 << nChanType
    	case *ast.CommClause:
    		return 1 << nCommClause
    	case *ast.Comment:
    		return 1 << nComment
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/return.go

    		return check.isTerminating(s.Stmt, s.Label.Value)
    
    	case *syntax.ExprStmt:
    		// calling the predeclared (possibly parenthesized) panic() function is terminating
    		if call, ok := syntax.Unparen(s.X).(*syntax.CallExpr); ok && check.isPanic[call] {
    			return true
    		}
    
    	case *syntax.ReturnStmt:
    		return true
    
    	case *syntax.BranchStmt:
    		if s.Tok == syntax.Goto || s.Tok == syntax.Fallthrough {
    			return true
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  10. src/go/types/return.go

    	case *ast.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Name)
    
    	case *ast.ExprStmt:
    		// calling the predeclared (possibly parenthesized) panic() function is terminating
    		if call, ok := ast.Unparen(s.X).(*ast.CallExpr); ok && check.isPanic[call] {
    			return true
    		}
    
    	case *ast.ReturnStmt:
    		return true
    
    	case *ast.BranchStmt:
    		if s.Tok == token.GOTO || s.Tok == token.FALLTHROUGH {
    			return true
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top