mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj: add Func type to replace "curfn any"
This adds a modicum of type safety to these APIs, which are otherwise quite confusing to follow. Change-Id: I268a9a1a99a47dcfef6dc1e9e5be13673af3fb85 Reviewed-on: https://go-review.googlesource.com/c/go/+/523396 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
98c26afa8c
commit
ad74bc4a92
4 changed files with 18 additions and 15 deletions
|
|
@ -23,7 +23,7 @@ import (
|
|||
"cmd/internal/src"
|
||||
)
|
||||
|
||||
func Info(fnsym *obj.LSym, infosym *obj.LSym, curfn interface{}) (scopes []dwarf.Scope, inlcalls dwarf.InlCalls, startPos src.XPos) {
|
||||
func Info(fnsym *obj.LSym, infosym *obj.LSym, curfn obj.Func) (scopes []dwarf.Scope, inlcalls dwarf.InlCalls) {
|
||||
fn := curfn.(*ir.Func)
|
||||
|
||||
if fn.Nname != nil {
|
||||
|
|
@ -128,7 +128,7 @@ func Info(fnsym *obj.LSym, infosym *obj.LSym, curfn interface{}) (scopes []dwarf
|
|||
if base.Flag.GenDwarfInl > 0 {
|
||||
inlcalls = assembleInlines(fnsym, dwarfVars)
|
||||
}
|
||||
return scopes, inlcalls, fn.Pos()
|
||||
return scopes, inlcalls
|
||||
}
|
||||
|
||||
func declPos(decl *ir.Name) src.XPos {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue