cmd/compile/internal/ir: add typ parameter to NewNameAt

Start making progress towards constructing IR with proper types.

Change-Id: Iad32c1cf60f30ceb8e07c31c8871b115570ac3bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/520263
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
Matthew Dempsky 2023-08-16 17:23:52 -07:00 committed by Gopher Robot
parent d63652b7c6
commit e453971005
20 changed files with 96 additions and 138 deletions

View file

@ -59,7 +59,7 @@ func (c *Conf) Frontend() Frontend {
f.Nname = ir.NewNameAt(f.Pos(), &types.Sym{
Pkg: types.NewPkg("my/import/path", "path"),
Name: "function",
})
}, nil)
f.LSym = &obj.LSym{Name: "my/import/path.function"}
c.fe = TestFrontend{
@ -83,8 +83,7 @@ func (TestFrontend) StringData(s string) *obj.LSym {
return nil
}
func (TestFrontend) Auto(pos src.XPos, t *types.Type) *ir.Name {
n := ir.NewNameAt(pos, &types.Sym{Name: "aFakeAuto"})
n.SetType(t)
n := ir.NewNameAt(pos, &types.Sym{Name: "aFakeAuto"}, t)
n.Class = ir.PAUTO
return n
}