aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/util.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-01-21 21:45:29 -0500
committerRuss Cox <rsc@golang.org>2015-01-22 03:22:04 +0000
commit67e7ded029034cc3cd510303f7b06faf690d4bc3 (patch)
treec541e11c3961bdb4aa677af7a1a61d04d6fcfd6c /src/cmd/internal/obj/util.go
parentebaf8db4f62af36c7215735891f014dc4bb4e2ba (diff)
downloadgo-67e7ded029034cc3cd510303f7b06faf690d4bc3.tar.xz
[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 <r@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/util.go')
-rw-r--r--src/cmd/internal/obj/util.go6
1 files changed, 6 insertions, 0 deletions
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
+}