github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/noder/helpers.go (about)

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package noder
     6  
     7  import (
     8  	"github.com/shogo82148/std/go/constant"
     9  
    10  	"github.com/shogo82148/std/cmd/compile/internal/ir"
    11  	"github.com/shogo82148/std/cmd/compile/internal/types"
    12  	"github.com/shogo82148/std/cmd/internal/src"
    13  )
    14  
    15  type ImplicitNode interface {
    16  	ir.Node
    17  	SetImplicit(x bool)
    18  }
    19  
    20  // Implicit returns n after marking it as Implicit.
    21  func Implicit(n ImplicitNode) ImplicitNode
    22  
    23  // FixValue returns val after converting and truncating it as
    24  // appropriate for typ.
    25  func FixValue(typ *types.Type, val constant.Value) constant.Value
    26  
    27  func Addr(pos src.XPos, x ir.Node) *ir.AddrExpr
    28  
    29  func Deref(pos src.XPos, typ *types.Type, x ir.Node) *ir.StarExpr