Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for makeExpr (0.48 sec)

  1. src/cmd/compile/internal/reflectdata/helpers.go

    }
    
    // MakeChanRType asserts that n is a "make" operation for a channel
    // type, and returns an expression that yields the *runtime._type
    // value representing that channel type.
    func MakeChanRType(pos src.XPos, n *ir.MakeExpr) ir.Node {
    	assertOp(n, ir.OMAKECHAN)
    	if hasRType(n, n.RType, "RType") {
    		return n.RType
    	}
    	return chanRType(pos, n.Type())
    }
    
    // MakeMapRType asserts that n is a "make" operation for a map type,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 04:50:32 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/expr.go

    		return walkClose(n, init)
    
    	case ir.OMAKECHAN:
    		n := n.(*ir.MakeExpr)
    		return walkMakeChan(n, init)
    
    	case ir.OMAKEMAP:
    		n := n.(*ir.MakeExpr)
    		return walkMakeMap(n, init)
    
    	case ir.OMAKESLICE:
    		n := n.(*ir.MakeExpr)
    		return walkMakeSlice(n, init)
    
    	case ir.OMAKESLICECOPY:
    		n := n.(*ir.MakeExpr)
    		return walkMakeSliceCopy(n, init)
    
    	case ir.ORUNESTR:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/walk/builtin.go

    		safeExpr(n.X, init)
    		con := ir.NewConstExpr(constant.MakeInt64(t.NumElem()), n)
    		con.SetTypecheck(1)
    		return con
    	}
    	return n
    }
    
    // walkMakeChan walks an OMAKECHAN node.
    func walkMakeChan(n *ir.MakeExpr, init *ir.Nodes) ir.Node {
    	// When size fits into int, use makechan instead of
    	// makechan64, which is faster and shorter on 32 bit platforms.
    	size := n.Len
    	fnname := "makechan64"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/walk/assign.go

    	if n.Op() != ir.OAPPEND {
    		return false
    	}
    	call := n.(*ir.CallExpr)
    	if !call.IsDDD || len(call.Args) != 2 || call.Args[1].Op() != ir.OMAKESLICE {
    		return false
    	}
    
    	mk := call.Args[1].(*ir.MakeExpr)
    	if mk.Cap != nil {
    		return false
    	}
    
    	// y must be either an integer constant or the largest possible positive value
    	// of variable y needs to fit into a uint.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  5. src/go/printer/testdata/parser.go

    		n := len(p.targetStack) - 1
    		p.targetStack[n] = append(p.targetStack[n], label)
    	}
    	p.expectSemi()
    
    	return &ast.BranchStmt{pos, tok, label}
    }
    
    func (p *parser) makeExpr(s ast.Stmt) ast.Expr {
    	if s == nil {
    		return nil
    	}
    	if es, isExpr := s.(*ast.ExprStmt); isExpr {
    		return p.checkExpr(es.X)
    	}
    	p.error(s.Pos(), "expected condition, found simple statement")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/ir/fmt.go

    	case OMAKEMAP, OMAKECHAN, OMAKESLICE:
    		n := n.(*MakeExpr)
    		if n.Cap != nil {
    			fmt.Fprintf(s, "make(%v, %v, %v)", n.Type(), n.Len, n.Cap)
    			return
    		}
    		if n.Len != nil && (n.Op() == OMAKESLICE || !n.Len.Type().IsUntyped()) {
    			fmt.Fprintf(s, "make(%v, %v)", n.Type(), n.Len)
    			return
    		}
    		fmt.Fprintf(s, "make(%v)", n.Type())
    
    	case OMAKESLICECOPY:
    		n := n.(*MakeExpr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/order.go

    		// we want as.X and cp.X to be the same name,
    		// but we want the initial data to be coming from a different name.
    		return
    	}
    
    	mk := as.Y.(*ir.MakeExpr)
    	if mk.Esc() == ir.EscNone || mk.Len == nil || mk.Cap != nil {
    		return
    	}
    	mk.SetOp(ir.OMAKESLICECOPY)
    	mk.Cap = cp.Y
    	// Set bounded when m = OMAKESLICE([]T, len(s)); OCOPY(m, s)
    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/go/parser/parser.go

    	if tok != token.FALLTHROUGH && p.tok == token.IDENT {
    		label = p.parseIdent()
    	}
    	p.expectSemi()
    
    	return &ast.BranchStmt{TokPos: pos, Tok: tok, Label: label}
    }
    
    func (p *parser) makeExpr(s ast.Stmt, want string) ast.Expr {
    	if s == nil {
    		return nil
    	}
    	if es, isExpr := s.(*ast.ExprStmt); isExpr {
    		return es.X
    	}
    	found := "simple statement"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/complit.go

    	// make the map var
    	args := []ir.Node{ir.TypeNode(n.Type()), ir.NewInt(base.Pos, n.Len+int64(len(n.List)))}
    	a := typecheck.Expr(ir.NewCallExpr(base.Pos, ir.OMAKE, nil, args)).(*ir.MakeExpr)
    	a.RType = n.RType
    	a.SetEsc(n.Esc())
    	appendWalkStmt(init, ir.NewAssignStmt(base.Pos, m, a))
    
    	entries := n.List
    
    	// The order pass already removed any dynamic (runtime-computed) entries.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/typecheck/func.go

    		base.Errorf("too many arguments to make(%v)", t)
    		n.SetType(nil)
    		return n
    	}
    
    	nn.SetType(t)
    	return nn
    }
    
    // tcMakeSliceCopy typechecks an OMAKESLICECOPY node.
    func tcMakeSliceCopy(n *ir.MakeExpr) ir.Node {
    	// Errors here are Fatalf instead of Errorf because only the compiler
    	// can construct an OMAKESLICECOPY node.
    	// Components used in OMAKESCLICECOPY that are supplied by parsed source code
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
Back to top