Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NewTypeAssertExpr (0.27 sec)

  1. src/cmd/compile/internal/walk/convert.go

    	var rhs ir.Node
    	if n.TypeWord == nil || n.TypeWord.Op() == ir.OADDR && n.TypeWord.(*ir.AddrExpr).X.Op() == ir.OLINKSYMOFFSET {
    		// Fixed (not loaded from a dictionary) type.
    		ta := ir.NewTypeAssertExpr(base.Pos, c, toType)
    		ta.SetOp(ir.ODOTTYPE2)
    		// Allocate a descriptor for this conversion to pass to the runtime.
    		ta.Descriptor = makeTypeAssertDescriptor(toType, true)
    		rhs = ta
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 17:28:22 UTC 2023
    - 18.2K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/expr.go

    	n.ITab = walkExpr(n.ITab, init)
    	// Convert to non-dynamic if we can.
    	if n.RType != nil && n.RType.Op() == ir.OADDR {
    		addr := n.RType.(*ir.AddrExpr)
    		if addr.X.Op() == ir.OLINKSYMOFFSET {
    			r := ir.NewTypeAssertExpr(n.Pos(), n.X, n.Type())
    			if n.Op() == ir.ODYNAMICDOTTYPE2 {
    				r.SetOp(ir.ODOTTYPE2)
    			}
    			r.SetType(n.Type())
    			r.SetTypecheck(1)
    			return walkExpr(r, init)
    		}
    	}
    	return n
    }
    
    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/switch.go

    			var clauses []typeClause
    			for _, c := range concreteCases {
    				as := ir.NewAssignListStmt(c.pos, ir.OAS2,
    					[]ir.Node{ir.BlankNode, s.okName},                               // _, ok =
    					[]ir.Node{ir.NewTypeAssertExpr(c.pos, s.srcName, c.typ.Type())}) // iface.(type)
    				nif := ir.NewIfStmt(c.pos, s.okName, []ir.Node{c.jmp}, nil)
    				clauses = append(clauses, typeClause{
    					hash: types.TypeHash(c.typ.Type()),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
Back to top