From 67e7ded029034cc3cd510303f7b06faf690d4bc3 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 21 Jan 2015 21:45:29 -0500 Subject: [dev.cc] cmd/internal/obj, cmd/new9a: use ctxt.NewProg cmd/internal/obj reconverted using rsc.io/c2go rev 40275b8. All Prog*s need Ctxt field set so that the printer can tell which architecture the Prog belongs to. Use ctxt.NewProg consistently for this. Change-Id: Ic981b3d68f24931ffae74a772e83a3dc2fdf518a Reviewed-on: https://go-review.googlesource.com/3152 Reviewed-by: Rob Pike --- src/cmd/internal/obj/util.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/cmd/internal/obj/util.go') diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go index 2fc910a78f..14f2271cb2 100644 --- a/src/cmd/internal/obj/util.go +++ b/src/cmd/internal/obj/util.go @@ -117,3 +117,9 @@ func (p *Prog) String() string { } return p.Ctxt.Arch.Pconv(p) } + +func (ctxt *Link) NewProg() *Prog { + p := ctxt.Arch.Prg() // should be the only call to this; all others should use ctxt.NewProg + p.Ctxt = ctxt + return p +} -- cgit v1.3-5-g9baa