cmd/compile/internal/ssa: use obj.LSym instead of gc.Sym

Gc's Sym type represents a package-qualified identifier, which is a
frontend concept and doesn't belong in SSA. Bonus: we can replace some
interface{} types with *obj.LSym.

Passes toolstash -cmp.

Change-Id: I456eb9957207d80f99f6eb9b8eab4a1f3263e9ed
Reviewed-on: https://go-review.googlesource.com/36415
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Matthew Dempsky 2017-02-06 13:30:40 -08:00
parent c2bc727f94
commit 87c475c227
12 changed files with 39 additions and 43 deletions

View file

@ -660,7 +660,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
q.To.Reg = r
}
case ssa.Op386CALLstatic:
if v.Aux.(*gc.Sym) == gc.Deferreturn.Sym {
if v.Aux.(*obj.LSym) == gc.Linksym(gc.Deferreturn.Sym) {
// Deferred calls will appear to be returning to
// the CALL deferreturn(SB) that we are about to emit.
// However, the stack trace code will show the line
@ -674,7 +674,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
p := gc.Prog(obj.ACALL)
p.To.Type = obj.TYPE_MEM
p.To.Name = obj.NAME_EXTERN
p.To.Sym = gc.Linksym(v.Aux.(*gc.Sym))
p.To.Sym = v.Aux.(*obj.LSym)
if gc.Maxarg < v.AuxInt {
gc.Maxarg = v.AuxInt
}
@ -864,7 +864,7 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
p := gc.Prog(obj.AJMP)
p.To.Type = obj.TYPE_MEM
p.To.Name = obj.NAME_EXTERN
p.To.Sym = gc.Linksym(b.Aux.(*gc.Sym))
p.To.Sym = b.Aux.(*obj.LSym)
case ssa.Block386EQF:
gc.SSAGenFPJump(s, b, next, &eqfJumps)