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

@ -16,10 +16,10 @@ var PrintFunc = printFunc
var Opt = opt
var Deadcode = deadcode
var Copyelim = copyelim
var TestCtxt = obj.Linknew(&x86.Linkamd64)
func testConfig(t testing.TB) *Config {
testCtxt := &obj.Link{Arch: &x86.Linkamd64}
return NewConfig("amd64", DummyFrontend{t}, testCtxt, true)
return NewConfig("amd64", DummyFrontend{t}, TestCtxt, true)
}
// DummyFrontend is a test-only frontend.
@ -68,8 +68,8 @@ func (DummyFrontend) Line(_ src.XPos) string {
}
func (DummyFrontend) AllocFrame(f *Func) {
}
func (DummyFrontend) Syslook(s string) interface{} {
return DummySym(s)
func (DummyFrontend) Syslook(s string) *obj.LSym {
return obj.Linklookup(TestCtxt, s, 0)
}
func (d DummyFrontend) Logf(msg string, args ...interface{}) { d.t.Logf(msg, args...) }
@ -100,7 +100,3 @@ func (d DummyFrontend) CanSSA(t Type) bool {
// There are no un-SSAable types in dummy land.
return true
}
type DummySym string
func (s DummySym) String() string { return string(s) }