github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/typecheck/dcl.go (about) 1 // Copyright 2009 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 typecheck 6 7 import ( 8 "github.com/shogo82148/std/cmd/compile/internal/ir" 9 "github.com/shogo82148/std/cmd/compile/internal/types" 10 "github.com/shogo82148/std/cmd/internal/src" 11 ) 12 13 // DeclFunc declares the parameters for fn and adds it to 14 // Target.Funcs. 15 // 16 // Before returning, it sets CurFunc to fn. When the caller is done 17 // constructing fn, it must call FinishFuncBody to restore CurFunc. 18 func DeclFunc(fn *ir.Func) 19 20 // FinishFuncBody restores ir.CurFunc to its state before the last 21 // call to DeclFunc. 22 func FinishFuncBody() 23 24 func CheckFuncStack() 25 26 // make a new Node off the books. 27 func TempAt(pos src.XPos, curfn *ir.Func, typ *types.Type) *ir.Name 28 29 // f is method type, with receiver. 30 // return function type, receiver as first argument (or not). 31 func NewMethodType(sig *types.Type, recv *types.Type) *types.Type