mirror of
https://github.com/golang/go
synced 2024-11-19 08:54:47 -07:00
cmd/compile/internal/gc: remove Thearch.Linkarchinit
Change-Id: I8e990204c7a1e65d6b8e4262f6b5b9bd0cb3540c Reviewed-on: https://go-review.googlesource.com/20725 Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
70090654de
commit
cea5d26aa2
@ -11,23 +11,12 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
thestring = "amd64"
|
||||
thelinkarch = &x86.Linkamd64
|
||||
addptr = x86.AADDQ
|
||||
movptr = x86.AMOVQ
|
||||
leaptr = x86.ALEAQ
|
||||
cmpptr = x86.ACMPQ
|
||||
)
|
||||
|
||||
func linkarchinit() {
|
||||
if obj.Getgoarch() == "amd64p32" {
|
||||
thelinkarch = &x86.Linkamd64p32
|
||||
gc.Thearch.Thelinkarch = thelinkarch
|
||||
thestring = "amd64p32"
|
||||
gc.Thearch.Thestring = "amd64p32"
|
||||
}
|
||||
}
|
||||
|
||||
func betypeinit() {
|
||||
gc.Widthptr = 8
|
||||
gc.Widthint = 8
|
||||
@ -54,8 +43,12 @@ func Main() {
|
||||
}
|
||||
|
||||
gc.Thearch.Thechar = '6'
|
||||
gc.Thearch.Thestring = thestring
|
||||
gc.Thearch.Thelinkarch = thelinkarch
|
||||
gc.Thearch.Thestring = "amd64"
|
||||
gc.Thearch.Thelinkarch = &x86.Linkamd64
|
||||
if obj.Getgoarch() == "amd64p32" {
|
||||
gc.Thearch.Thestring = "amd64p32"
|
||||
gc.Thearch.Thelinkarch = &x86.Linkamd64p32
|
||||
}
|
||||
gc.Thearch.REGSP = x86.REGSP
|
||||
gc.Thearch.REGCTXT = x86.REGCTXT
|
||||
gc.Thearch.REGCALLX = x86.REG_BX
|
||||
@ -85,7 +78,6 @@ func Main() {
|
||||
gc.Thearch.Ginscon = ginscon
|
||||
gc.Thearch.Ginsnop = ginsnop
|
||||
gc.Thearch.Gmove = gmove
|
||||
gc.Thearch.Linkarchinit = linkarchinit
|
||||
gc.Thearch.Peep = peep
|
||||
gc.Thearch.Proginfo = proginfo
|
||||
gc.Thearch.Regtyp = regtyp
|
||||
|
@ -9,9 +9,6 @@ import (
|
||||
"cmd/internal/obj/arm"
|
||||
)
|
||||
|
||||
func linkarchinit() {
|
||||
}
|
||||
|
||||
func betypeinit() {
|
||||
gc.Widthptr = 4
|
||||
gc.Widthint = 4
|
||||
@ -50,7 +47,6 @@ func Main() {
|
||||
gc.Thearch.Ginsnop = ginsnop
|
||||
gc.Thearch.Gmove = gmove
|
||||
gc.Thearch.Cgenindex = cgenindex
|
||||
gc.Thearch.Linkarchinit = linkarchinit
|
||||
gc.Thearch.Peep = peep
|
||||
gc.Thearch.Proginfo = proginfo
|
||||
gc.Thearch.Regtyp = regtyp
|
||||
|
@ -9,9 +9,6 @@ import (
|
||||
"cmd/internal/obj/arm64"
|
||||
)
|
||||
|
||||
func linkarchinit() {
|
||||
}
|
||||
|
||||
func betypeinit() {
|
||||
gc.Widthptr = 8
|
||||
gc.Widthint = 8
|
||||
@ -49,7 +46,6 @@ func Main() {
|
||||
gc.Thearch.Ginscon = ginscon
|
||||
gc.Thearch.Ginsnop = ginsnop
|
||||
gc.Thearch.Gmove = gmove
|
||||
gc.Thearch.Linkarchinit = linkarchinit
|
||||
gc.Thearch.Peep = peep
|
||||
gc.Thearch.Proginfo = proginfo
|
||||
gc.Thearch.Regtyp = regtyp
|
||||
|
@ -543,7 +543,6 @@ type Arch struct {
|
||||
Ginsnop func()
|
||||
Gmove func(*Node, *Node)
|
||||
Igenindex func(*Node, *Node, bool) *obj.Prog
|
||||
Linkarchinit func()
|
||||
Peep func(*obj.Prog)
|
||||
Proginfo func(*obj.Prog) // fills in Prog.Info
|
||||
Regtyp func(*obj.Addr) bool
|
||||
|
@ -98,7 +98,6 @@ func Main() {
|
||||
}
|
||||
goarch = p
|
||||
|
||||
Thearch.Linkarchinit()
|
||||
Ctxt = obj.Linknew(Thearch.Thelinkarch)
|
||||
Ctxt.DiagFunc = Yyerror
|
||||
Ctxt.Bso = &bstdout
|
||||
|
@ -10,22 +10,6 @@ import (
|
||||
"cmd/internal/obj/mips"
|
||||
)
|
||||
|
||||
var (
|
||||
thestring = "mips64"
|
||||
thelinkarch *obj.LinkArch
|
||||
)
|
||||
|
||||
func linkarchinit() {
|
||||
thestring = obj.Getgoarch()
|
||||
gc.Thearch.Thestring = thestring
|
||||
if thestring == "mips64le" {
|
||||
thelinkarch = &mips.Linkmips64le
|
||||
} else {
|
||||
thelinkarch = &mips.Linkmips64
|
||||
}
|
||||
gc.Thearch.Thelinkarch = thelinkarch
|
||||
}
|
||||
|
||||
func betypeinit() {
|
||||
gc.Widthptr = 8
|
||||
gc.Widthint = 8
|
||||
@ -34,8 +18,12 @@ func betypeinit() {
|
||||
|
||||
func Main() {
|
||||
gc.Thearch.Thechar = '0'
|
||||
gc.Thearch.Thestring = thestring
|
||||
gc.Thearch.Thelinkarch = thelinkarch
|
||||
gc.Thearch.Thestring = "mips64"
|
||||
gc.Thearch.Thelinkarch = &mips.Linkmips64
|
||||
if obj.Getgoarch() == "mips64le" {
|
||||
gc.Thearch.Thestring = "mips64le"
|
||||
gc.Thearch.Thelinkarch = &mips.Linkmips64le
|
||||
}
|
||||
gc.Thearch.REGSP = mips.REGSP
|
||||
gc.Thearch.REGCTXT = mips.REGCTXT
|
||||
gc.Thearch.REGCALLX = mips.REG_R1
|
||||
@ -62,7 +50,6 @@ func Main() {
|
||||
gc.Thearch.Ginscon = ginscon
|
||||
gc.Thearch.Ginsnop = ginsnop
|
||||
gc.Thearch.Gmove = gmove
|
||||
gc.Thearch.Linkarchinit = linkarchinit
|
||||
gc.Thearch.Peep = peep
|
||||
gc.Thearch.Proginfo = proginfo
|
||||
gc.Thearch.Regtyp = regtyp
|
||||
|
@ -10,22 +10,6 @@ import (
|
||||
"cmd/internal/obj/ppc64"
|
||||
)
|
||||
|
||||
var (
|
||||
thestring = "ppc64"
|
||||
thelinkarch *obj.LinkArch
|
||||
)
|
||||
|
||||
func linkarchinit() {
|
||||
thestring = obj.Getgoarch()
|
||||
gc.Thearch.Thestring = thestring
|
||||
if thestring == "ppc64le" {
|
||||
thelinkarch = &ppc64.Linkppc64le
|
||||
} else {
|
||||
thelinkarch = &ppc64.Linkppc64
|
||||
}
|
||||
gc.Thearch.Thelinkarch = thelinkarch
|
||||
}
|
||||
|
||||
func betypeinit() {
|
||||
gc.Widthptr = 8
|
||||
gc.Widthint = 8
|
||||
@ -39,8 +23,12 @@ func betypeinit() {
|
||||
|
||||
func Main() {
|
||||
gc.Thearch.Thechar = '9'
|
||||
gc.Thearch.Thestring = thestring
|
||||
gc.Thearch.Thelinkarch = thelinkarch
|
||||
gc.Thearch.Thestring = "ppc64"
|
||||
gc.Thearch.Thelinkarch = &ppc64.Linkppc64
|
||||
if obj.Getgoarch() == "ppc64le" {
|
||||
gc.Thearch.Thestring = "ppc64le"
|
||||
gc.Thearch.Thelinkarch = &ppc64.Linkppc64le
|
||||
}
|
||||
gc.Thearch.REGSP = ppc64.REGSP
|
||||
gc.Thearch.REGCTXT = ppc64.REGCTXT
|
||||
gc.Thearch.REGCALLX = ppc64.REG_R3
|
||||
@ -67,7 +55,6 @@ func Main() {
|
||||
gc.Thearch.Ginscon = ginscon
|
||||
gc.Thearch.Ginsnop = ginsnop
|
||||
gc.Thearch.Gmove = gmove
|
||||
gc.Thearch.Linkarchinit = linkarchinit
|
||||
gc.Thearch.Peep = peep
|
||||
gc.Thearch.Proginfo = proginfo
|
||||
gc.Thearch.Regtyp = regtyp
|
||||
|
@ -12,9 +12,6 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func linkarchinit() {
|
||||
}
|
||||
|
||||
func betypeinit() {
|
||||
gc.Widthptr = 4
|
||||
gc.Widthint = 4
|
||||
@ -67,7 +64,6 @@ func Main() {
|
||||
gc.Thearch.Ginsnop = ginsnop
|
||||
gc.Thearch.Gmove = gmove
|
||||
gc.Thearch.Igenindex = igenindex
|
||||
gc.Thearch.Linkarchinit = linkarchinit
|
||||
gc.Thearch.Peep = peep
|
||||
gc.Thearch.Proginfo = proginfo
|
||||
gc.Thearch.Regtyp = regtyp
|
||||
|
Loading…
Reference in New Issue
Block a user