Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 43 for callExpr (0.15 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go

    // HasSideEffects reports whether evaluation of e has side effects.
    func HasSideEffects(info *types.Info, e ast.Expr) bool {
    	safe := true
    	ast.Inspect(e, func(node ast.Node) bool {
    		switch n := node.(type) {
    		case *ast.CallExpr:
    			typVal := info.Types[n.Fun]
    			switch {
    			case typVal.IsType():
    				// Type conversion, which is safe.
    			case typVal.IsBuiltin():
    				// Builtin func, conservatively assumed to not
    				// be safe for now.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unusedresult/unusedresult.go

    		}
    	}
    
    	nodeFilter := []ast.Node{
    		(*ast.ExprStmt)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		call, ok := astutil.Unparen(n.(*ast.ExprStmt).X).(*ast.CallExpr)
    		if !ok {
    			return // not a call statement
    		}
    
    		// Call to function or method?
    		fn, ok := typeutil.Callee(pass.TypesInfo, call).(*types.Func)
    		if !ok {
    			return // e.g. var or builtin
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  3. src/go/types/exprstring.go

    				WriteExpr(buf, x.Max)
    			}
    		}
    		buf.WriteByte(']')
    
    	case *ast.TypeAssertExpr:
    		WriteExpr(buf, x.X)
    		buf.WriteString(".(")
    		WriteExpr(buf, x.Type)
    		buf.WriteByte(')')
    
    	case *ast.CallExpr:
    		WriteExpr(buf, x.Fun)
    		buf.WriteByte('(')
    		writeExprList(buf, x.Args)
    		if hasDots(x) {
    			buf.WriteString("...")
    		}
    		buf.WriteByte(')')
    
    	case *ast.StarExpr:
    		buf.WriteByte('*')
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 19:31:44 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssagen/nowb.go

    		}
    		ir.Visit(n, c.findExtraCalls)
    	}
    	c.curfn = nil
    	return c
    }
    
    func (c *nowritebarrierrecChecker) findExtraCalls(nn ir.Node) {
    	if nn.Op() != ir.OCALLFUNC {
    		return
    	}
    	n := nn.(*ir.CallExpr)
    	if n.Fun == nil || n.Fun.Op() != ir.ONAME {
    		return
    	}
    	fn := n.Fun.(*ir.Name)
    	if fn.Class != ir.PFUNC || fn.Defn == nil {
    		return
    	}
    	if types.RuntimeSymName(fn.Sym()) != "systemstack" {
    		return
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 17:29:46 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  5. src/cmd/gofmt/simplify.go

    		if n.Max != nil {
    			// - 3-index slices always require the 2nd and 3rd index
    			break
    		}
    		if s, _ := n.X.(*ast.Ident); s != nil {
    			// the array/slice object is a single identifier
    			if call, _ := n.High.(*ast.CallExpr); call != nil && len(call.Args) == 1 && !call.Ellipsis.IsValid() {
    				// the high expression is a function call with a single argument
    				if fun, _ := call.Fun.(*ast.Ident); fun != nil && fun.Name == "len" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:06:14 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  6. src/go/ast/example_test.go

    	//     24  .  .  .  Body: *ast.BlockStmt {
    	//     25  .  .  .  .  Lbrace: 3:13
    	//     26  .  .  .  .  List: []ast.Stmt (len = 1) {
    	//     27  .  .  .  .  .  0: *ast.ExprStmt {
    	//     28  .  .  .  .  .  .  X: *ast.CallExpr {
    	//     29  .  .  .  .  .  .  .  Fun: *ast.Ident {
    	//     30  .  .  .  .  .  .  .  .  NamePos: 4:2
    	//     31  .  .  .  .  .  .  .  .  Name: "println"
    	//     32  .  .  .  .  .  .  .  }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/closure.go

    //	func(a int) {
    //		println(byval)
    //		byref++
    //	}(42)
    //
    // becomes:
    //
    //	func(byval int, &byref *int, a int) {
    //		println(byval)
    //		(*&byref)++
    //	}(byval, &byref, 42)
    func directClosureCall(n *ir.CallExpr) {
    	clo := n.Fun.(*ir.ClosureExpr)
    	clofn := clo.Func
    
    	if ir.IsTrivialClosure(clo) {
    		return // leave for walkClosure to handle
    	}
    
    	// We are going to insert captured variables before input args.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 15:56:08 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  8. src/runtime/align_test.go

    type Visitor struct {
    	fset    *token.FileSet
    	types   map[ast.Expr]types.TypeAndValue
    	checked map[string]bool
    	t       *testing.T
    }
    
    func (v *Visitor) Visit(n ast.Node) ast.Visitor {
    	c, ok := n.(*ast.CallExpr)
    	if !ok {
    		return v
    	}
    	f, ok := c.Fun.(*ast.SelectorExpr)
    	if !ok {
    		return v
    	}
    	p, ok := f.X.(*ast.Ident)
    	if !ok {
    		return v
    	}
    	if p.Name != "atomic" {
    		return v
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 08 14:52:12 UTC 2023
    - 5.4K bytes
    - Viewed (0)
  9. src/go/ast/walk.go

    		if n.High != nil {
    			Walk(v, n.High)
    		}
    		if n.Max != nil {
    			Walk(v, n.Max)
    		}
    
    	case *TypeAssertExpr:
    		Walk(v, n.X)
    		if n.Type != nil {
    			Walk(v, n.Type)
    		}
    
    	case *CallExpr:
    		Walk(v, n.Fun)
    		walkList(v, n.Args)
    
    	case *StarExpr:
    		Walk(v, n.X)
    
    	case *UnaryExpr:
    		Walk(v, n.X)
    
    	case *BinaryExpr:
    		Walk(v, n.X)
    		Walk(v, n.Y)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/syntax/walk.go

    		w.node(n.Type)
    
    	case *TypeSwitchGuard:
    		if n.Lhs != nil {
    			w.node(n.Lhs)
    		}
    		w.node(n.X)
    
    	case *Operation:
    		w.node(n.X)
    		if n.Y != nil {
    			w.node(n.Y)
    		}
    
    	case *CallExpr:
    		w.node(n.Fun)
    		w.exprList(n.ArgList)
    
    	case *ListExpr:
    		w.exprList(n.ElemList)
    
    	// types
    	case *ArrayType:
    		if n.Len != nil {
    			w.node(n.Len)
    		}
    		w.node(n.Elem)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
Back to top