]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj: make Rconv a global function
authorRob Pike <r@golang.org>
Fri, 27 Feb 2015 01:09:16 +0000 (17:09 -0800)
committerRob Pike <r@golang.org>
Fri, 27 Feb 2015 03:51:33 +0000 (03:51 +0000)
commitdaddeb26865e55432be7d82641e835911828feca
tree70dcc751f69b18bd1f535dff10dac676b96d9587
parent95bf77bc68dec4423dec3599398e08d99c637d9b
cmd/internal/obj: make Rconv a global function

Clean up the obj API by making Rconv (register pretty printer) a top-level
function. This means that Dconv (operand pretty printer) doesn't need
an Rconv argument.

To do this, we make the register numbers, which are arbitrary inside an
operand (obj.Addr), disjoint sets for each architecture. Each architecture
registers (ha) a piece of the space and then the global Rconv knows which
architecture-specific printer to use.

Clean up all the code that uses Dconv.

Now register numbers are large, so a couple of fields in Addr need to go
from int8 to int16 because they sometimes hold register numbers. Clean
up their uses, which meant regenerating the yacc grammars for the
assemblers. There are changes in this CL triggered by earlier changes
to yacc, which had not been run in this directory.

There is still cleanup to do in Addr, but we're getting closer to that being
easy to do.

Change-Id: I9290ebee013b62f7d24e886743ea5a6b232990ab
Reviewed-on: https://go-review.googlesource.com/6220
Reviewed-by: Russ Cox <rsc@golang.org>
36 files changed:
src/cmd/5a/y.go
src/cmd/5g/gsubr.go
src/cmd/6a/a.y
src/cmd/6a/lex.go
src/cmd/6a/y.go
src/cmd/6g/cgen.go
src/cmd/6g/gsubr.go
src/cmd/8a/a.y
src/cmd/8a/lex.go
src/cmd/8a/y.go
src/cmd/8g/cgen.go
src/cmd/8g/gsubr.go
src/cmd/9a/a.y
src/cmd/9a/y.go
src/cmd/9g/ggen.go
src/cmd/9g/gsubr.go
src/cmd/asm/internal/arch/arch.go
src/cmd/asm/internal/asm/asm.go
src/cmd/asm/internal/asm/operand_test.go
src/cmd/asm/internal/asm/parse.go
src/cmd/internal/gc/fmt.go
src/cmd/internal/gc/reg.go
src/cmd/internal/obj/arm/5.out.go
src/cmd/internal/obj/arm/asm5.go
src/cmd/internal/obj/arm/list5.go
src/cmd/internal/obj/i386/8.out.go
src/cmd/internal/obj/i386/asm8.go
src/cmd/internal/obj/i386/list8.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/ppc64/9.out.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/ppc64/list9.go
src/cmd/internal/obj/util.go
src/cmd/internal/obj/x86/6.out.go
src/cmd/internal/obj/x86/asm6.go
src/cmd/internal/obj/x86/list6.go