cmd/compile/internal: named types for Etype and Op in struct Node

Type Op is enfored now.
Type EType will need further CLs.
Added TODOs where Node.EType is used as a union type.
The TODOs have the format `TODO(marvin): Fix Node.EType union type.`.

Furthermore:
-The flag of Econv function in fmt.go is removed, since unused.
-Some cleaning along the way, e.g. declare vars first when getting initialized.

Passes go build -toolexec 'toolstash -cmp' -a std.

Fixes #11846

Change-Id: I908b955d5a78a195604970983fb9194bd9e9260b
Reviewed-on: https://go-review.googlesource.com/14956
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Marvin Stenger <marvin.stenger94@gmail.com>
This commit is contained in:
Marvin Stenger 2015-09-24 23:21:18 +02:00 committed by Keith Randall
parent f5f480e1df
commit 8e7a3ea11e
36 changed files with 1927 additions and 1729 deletions

View file

@ -277,7 +277,7 @@ func Datastring(s string, a *obj.Addr) {
a.Sym = Linksym(symdata)
a.Node = symdata.Def
a.Offset = 0
a.Etype = Simtype[TINT]
a.Etype = uint8(Simtype[TINT])
}
func datagostring(sval string, a *obj.Addr) {
@ -287,7 +287,7 @@ func datagostring(sval string, a *obj.Addr) {
a.Sym = Linksym(symhdr)
a.Node = symhdr.Def
a.Offset = 0
a.Etype = TSTRING
a.Etype = uint8(TSTRING)
}
func dgostringptr(s *Sym, off int, str string) int {
@ -312,7 +312,7 @@ func dgostrlitptr(s *Sym, off int, lit *string) int {
p.From3.Offset = int64(Widthptr)
datagostring(*lit, &p.To)
p.To.Type = obj.TYPE_ADDR
p.To.Etype = Simtype[TINT]
p.To.Etype = uint8(Simtype[TINT])
off += Widthptr
return off
@ -373,8 +373,8 @@ func gdata(nam *Node, nr *Node, wid int) {
}
func gdatacomplex(nam *Node, cval *Mpcplx) {
w := cplxsubtype(int(nam.Type.Etype))
w = int(Types[w].Width)
cst := cplxsubtype(nam.Type.Etype)
w := int(Types[cst].Width)
p := Thearch.Gins(obj.ADATA, nam, nil)
p.From3 = new(obj.Addr)