Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for newConst (0.13 sec)

  1. src/cmd/compile/internal/ssa/sccp.go

    	//
    	//  res := lattice{constant, nil}
    	// 	switch op {
    	// 	case OpAdd16:
    	//		res.val = newConst(argLt1.val.AuxInt16() + argLt2.val.AuxInt16())
    	// 	case OpAdd32:
    	// 		res.val = newConst(argLt1.val.AuxInt32() + argLt2.val.AuxInt32())
    	//	case OpDiv8:
    	//		if !isDivideByZero(argLt2.val.AuxInt8()) {
    	//			res.val = newConst(argLt1.val.AuxInt8() / argLt2.val.AuxInt8())
    	//		}
    	//  ...
    	// 	}
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:54:50 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/universe.go

    	{"false", UntypedBool, constant.MakeBool(false)},
    	{"iota", UntypedInt, constant.MakeInt64(0)},
    }
    
    func defPredeclaredConsts() {
    	for _, c := range predeclaredConsts {
    		def(NewConst(nopos, nil, c.name, Typ[c.kind], c.val))
    	}
    }
    
    func defPredeclaredNil() {
    	def(&Nil{object{name: "nil", typ: Typ[UntypedNil], color_: black}})
    }
    
    // A builtinId is the id of a builtin function.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  3. src/go/types/universe.go

    	{"false", UntypedBool, constant.MakeBool(false)},
    	{"iota", UntypedInt, constant.MakeInt64(0)},
    }
    
    func defPredeclaredConsts() {
    	for _, c := range predeclaredConsts {
    		def(NewConst(nopos, nil, c.name, Typ[c.kind], c.val))
    	}
    }
    
    func defPredeclaredNil() {
    	def(&Nil{object{name: "nil", typ: Typ[UntypedNil], color_: black}})
    }
    
    // A builtinId is the id of a builtin function.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/object.go

    // A Const represents a declared constant.
    type Const struct {
    	object
    	val constant.Value
    }
    
    // NewConst returns a new constant with value val.
    // The remaining arguments set the attributes found with all Objects.
    func NewConst(pos syntax.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const {
    	return &Const{object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}, val}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  5. src/go/types/object.go

    // A Const represents a declared constant.
    type Const struct {
    	object
    	val constant.Value
    }
    
    // NewConst returns a new constant with value val.
    // The remaining arguments set the attributes found with all Objects.
    func NewConst(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const {
    	return &Const{object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}, val}
    }
    
    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/cmd/compile/internal/ssa/poset.go

    	if !f && n.isGenericIntConst() {
    		po.newconst(n)
    		i, f = po.values[n.ID]
    	}
    	return i, f
    }
    
    // newconst creates a node for a constant. It links it to other constants, so
    // that n<=5 is detected true when n<=3 is known to be true.
    // TODO: this is O(N), fix it.
    func (po *poset) newconst(n *Value) {
    	if !n.isGenericIntConst() {
    		panic("newconst on non-constant")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 04 17:23:05 UTC 2023
    - 37.2K bytes
    - Viewed (0)
  7. src/go/internal/gcimporter/iimport.go

    	pos := r.pos()
    
    	switch tag {
    	case 'A':
    		typ := r.typ()
    
    		r.declare(types.NewTypeName(pos, r.currPkg, name, typ))
    
    	case 'C':
    		typ, val := r.value()
    
    		r.declare(types.NewConst(pos, r.currPkg, name, typ, val))
    
    	case 'F', 'G':
    		var tparams []*types.TypeParam
    		if tag == 'G' {
    			tparams = r.tparamList()
    		}
    		sig := r.signature(nil, nil, tparams)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  8. src/go/internal/gcimporter/ureader.go

    			pos := r.pos()
    			typ := r.typ()
    			declare(newAliasTypeName(pos, objPkg, objName, typ))
    
    		case pkgbits.ObjConst:
    			pos := r.pos()
    			typ := r.typ()
    			val := r.Value()
    			declare(types.NewConst(pos, objPkg, objName, typ, val))
    
    		case pkgbits.ObjFunc:
    			pos := r.pos()
    			tparams := r.typeParamNames()
    			sig := r.signature(nil, nil, tparams)
    			declare(types.NewFunc(pos, objPkg, objName, sig))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/decl.go

    				inherited = false
    			}
    
    			// declare all constants
    			lhs := make([]*Const, len(s.NameList))
    			values := syntax.UnpackListExpr(last.Values)
    			for i, name := range s.NameList {
    				obj := NewConst(name.Pos(), pkg, name.Value, nil, iota)
    				lhs[i] = obj
    
    				var init syntax.Expr
    				if i < len(values) {
    					init = values[i]
    				}
    
    				check.constDecl(obj, last.Type, init, inherited)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/resolver.go

    					inherited = false
    				}
    
    				// declare all constants
    				values := syntax.UnpackListExpr(last.Values)
    				for i, name := range s.NameList {
    					obj := NewConst(name.Pos(), pkg, name.Value, nil, iota)
    
    					var init syntax.Expr
    					if i < len(values) {
    						init = values[i]
    					}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
Back to top