diff options
| author | Russ Cox <rsc@golang.org> | 2015-01-21 21:45:29 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-01-22 03:22:04 +0000 |
| commit | 67e7ded029034cc3cd510303f7b06faf690d4bc3 (patch) | |
| tree | c541e11c3961bdb4aa677af7a1a61d04d6fcfd6c /src/cmd/internal/obj/arm | |
| parent | ebaf8db4f62af36c7215735891f014dc4bb4e2ba (diff) | |
| download | go-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/arm')
| -rw-r--r-- | src/cmd/internal/obj/arm/asm5.go | 12 | ||||
| -rw-r--r-- | src/cmd/internal/obj/arm/obj5.go | 15 |
2 files changed, 12 insertions, 15 deletions
diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go index 466e30bc3c..54155c98f0 100644 --- a/src/cmd/internal/obj/arm/asm5.go +++ b/src/cmd/internal/obj/arm/asm5.go @@ -463,7 +463,7 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3 // split it into two instructions: // ADD $-100004, R13 // MOVW R14, 0(R13) - q = ctxt.Arch.Prg() + q = ctxt.NewProg() p.Scond &^= C_WBIT *q = *p @@ -546,7 +546,7 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3 ctxt.Diag("unsupported instruction (.P/.W): %v", p) } - q = ctxt.Arch.Prg() + q = ctxt.NewProg() *q = *p if p.To.Type == D_OREG { a2 = &q.To @@ -894,7 +894,7 @@ func flushpool(ctxt *obj.Link, p *obj.Prog, skip int, force int) int { if false && skip == 1 { fmt.Printf("note: flush literal pool at %x: len=%d ref=%x\n", uint64(p.Pc+4), pool.size, pool.start) } - q = ctxt.Arch.Prg() + q = ctxt.NewProg() q.As = AB q.To.Type = D_BRANCH q.Pcond = p.Link @@ -906,7 +906,7 @@ func flushpool(ctxt *obj.Link, p *obj.Prog, skip int, force int) int { } if ctxt.Headtype == obj.Hnacl && pool.size%16 != 0 { // if pool is not multiple of 16 bytes, add an alignment marker - q = ctxt.Arch.Prg() + q = ctxt.NewProg() q.As = ADATABUNDLEEND ctxt.Elitrl.Link = q @@ -983,7 +983,7 @@ func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { if ctxt.Headtype == obj.Hnacl && pool.size%16 == 0 { // start a new data bundle - q = ctxt.Arch.Prg() + q = ctxt.NewProg() *q = zprg q.As = ADATABUNDLE @@ -1000,7 +1000,7 @@ func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { ctxt.Elitrl = q } - q = ctxt.Arch.Prg() + q = ctxt.NewProg() *q = t q.Pc = int64(pool.size) diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go index e8d4a5fc67..d59c9df0e4 100644 --- a/src/cmd/internal/obj/arm/obj5.go +++ b/src/cmd/internal/obj/arm/obj5.go @@ -219,11 +219,8 @@ func progedit(ctxt *obj.Link, p *obj.Prog) { } func prg() *obj.Prog { - var p *obj.Prog - - p = new(obj.Prog) - *p = zprg5 - return p + p := zprg + return &p } // Prog.mark @@ -789,7 +786,7 @@ func softfloat(ctxt *obj.Link, cursym *obj.LSym) { soft: if !(wasfloat != 0) || (p.Mark&LABEL != 0) { - next = ctxt.Arch.Prg() + next = ctxt.NewProg() *next = *p // BL _sfloat(SB) @@ -954,7 +951,7 @@ func follow(ctxt *obj.Link, s *obj.LSym) { ctxt.Cursym = s - firstp = ctxt.Arch.Prg() + firstp = ctxt.NewProg() lastp = firstp xfol(ctxt, s.Text, &lastp) lastp.Link = nil @@ -1048,7 +1045,7 @@ loop: copy: for { - r = ctxt.Arch.Prg() + r = ctxt.NewProg() *r = *p if !(r.Mark&FOLL != 0) { fmt.Printf("can't happen 1\n") @@ -1083,7 +1080,7 @@ loop: } a = AB - q = ctxt.Arch.Prg() + q = ctxt.NewProg() q.As = int16(a) q.Lineno = p.Lineno q.To.Type = D_BRANCH |
