Commit 700574e7 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile/internal/ssa: ExternSymbol's Typ field is unused too

Change-Id: I5b692eb0586c40f3735a6b9c928e97ffa00a70e6
Reviewed-on: https://go-review.googlesource.com/40471
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent dec95d8f
...@@ -1380,13 +1380,13 @@ func (s *state) expr(n *Node) *ssa.Value { ...@@ -1380,13 +1380,13 @@ func (s *state) expr(n *Node) *ssa.Value {
len := s.newValue1(ssa.OpStringLen, types.Types[TINT], str) len := s.newValue1(ssa.OpStringLen, types.Types[TINT], str)
return s.newValue3(ssa.OpSliceMake, n.Type, ptr, len, len) return s.newValue3(ssa.OpSliceMake, n.Type, ptr, len, len)
case OCFUNC: case OCFUNC:
aux := s.lookupSymbol(n, &ssa.ExternSymbol{Typ: n.Type, Sym: Linksym(n.Left.Sym)}) aux := s.lookupSymbol(n, &ssa.ExternSymbol{Sym: Linksym(n.Left.Sym)})
return s.entryNewValue1A(ssa.OpAddr, n.Type, aux, s.sb) return s.entryNewValue1A(ssa.OpAddr, n.Type, aux, s.sb)
case ONAME: case ONAME:
if n.Class == PFUNC { if n.Class == PFUNC {
// "value" of a function is the address of the function's closure // "value" of a function is the address of the function's closure
sym := Linksym(funcsym(n.Sym)) sym := Linksym(funcsym(n.Sym))
aux := s.lookupSymbol(n, &ssa.ExternSymbol{Typ: n.Type, Sym: sym}) aux := s.lookupSymbol(n, &ssa.ExternSymbol{Sym: sym})
return s.entryNewValue1A(ssa.OpAddr, types.NewPtr(n.Type), aux, s.sb) return s.entryNewValue1A(ssa.OpAddr, types.NewPtr(n.Type), aux, s.sb)
} }
if s.canSSA(n) { if s.canSSA(n) {
...@@ -2826,7 +2826,7 @@ func init() { ...@@ -2826,7 +2826,7 @@ func init() {
sys.ARM64) sys.ARM64)
makeOnesCount := func(op64 ssa.Op, op32 ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value { makeOnesCount := func(op64 ssa.Op, op32 ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
return func(s *state, n *Node, args []*ssa.Value) *ssa.Value { return func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
aux := s.lookupSymbol(n, &ssa.ExternSymbol{Typ: types.Types[TBOOL], Sym: Linksym(syslook("support_popcnt").Sym)}) aux := s.lookupSymbol(n, &ssa.ExternSymbol{Sym: Linksym(syslook("support_popcnt").Sym)})
addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), aux, s.sb) addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), aux, s.sb)
v := s.newValue2(ssa.OpLoad, types.Types[TBOOL], addr, s.mem()) v := s.newValue2(ssa.OpLoad, types.Types[TBOOL], addr, s.mem())
b := s.endBlock() b := s.endBlock()
...@@ -3197,7 +3197,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value { ...@@ -3197,7 +3197,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value {
switch n.Class { switch n.Class {
case PEXTERN: case PEXTERN:
// global variable // global variable
aux := s.lookupSymbol(n, &ssa.ExternSymbol{Typ: n.Type, Sym: Linksym(n.Sym)}) aux := s.lookupSymbol(n, &ssa.ExternSymbol{Sym: Linksym(n.Sym)})
v := s.entryNewValue1A(ssa.OpAddr, t, aux, s.sb) v := s.entryNewValue1A(ssa.OpAddr, t, aux, s.sb)
// TODO: Make OpAddr use AuxInt as well as Aux. // TODO: Make OpAddr use AuxInt as well as Aux.
if n.Xoffset != 0 { if n.Xoffset != 0 {
...@@ -4744,7 +4744,7 @@ func (e *ssafn) StringData(s string) interface{} { ...@@ -4744,7 +4744,7 @@ func (e *ssafn) StringData(s string) interface{} {
e.strings = make(map[string]interface{}) e.strings = make(map[string]interface{})
} }
data := stringsym(s) data := stringsym(s)
aux := &ssa.ExternSymbol{Typ: types.Idealstring, Sym: data} aux := &ssa.ExternSymbol{Sym: data}
e.strings[s] = aux e.strings[s] = aux
return aux return aux
} }
......
...@@ -237,7 +237,6 @@ func (v *Value) isGenericIntConst() bool { ...@@ -237,7 +237,6 @@ func (v *Value) isGenericIntConst() bool {
// ExternSymbol is an aux value that encodes a variable's // ExternSymbol is an aux value that encodes a variable's
// constant offset from the static base pointer. // constant offset from the static base pointer.
type ExternSymbol struct { type ExternSymbol struct {
Typ Type // Go type
Sym *obj.LSym Sym *obj.LSym
// Note: the offset for an external symbol is not // Note: the offset for an external symbol is not
// calculated until link time. // calculated until link time.
......
...@@ -93,7 +93,7 @@ func writebarrier(f *Func) { ...@@ -93,7 +93,7 @@ func writebarrier(f *Func) {
if sp == nil { if sp == nil {
sp = f.Entry.NewValue0(initpos, OpSP, f.Config.Types.Uintptr) sp = f.Entry.NewValue0(initpos, OpSP, f.Config.Types.Uintptr)
} }
wbsym := &ExternSymbol{Typ: f.Config.Types.Bool, Sym: f.fe.Syslook("writeBarrier")} wbsym := &ExternSymbol{Sym: f.fe.Syslook("writeBarrier")}
wbaddr = f.Entry.NewValue1A(initpos, OpAddr, f.Config.Types.UInt32Ptr, wbsym, sb) wbaddr = f.Entry.NewValue1A(initpos, OpAddr, f.Config.Types.UInt32Ptr, wbsym, sb)
writebarrierptr = f.fe.Syslook("writebarrierptr") writebarrierptr = f.fe.Syslook("writebarrierptr")
typedmemmove = f.fe.Syslook("typedmemmove") typedmemmove = f.fe.Syslook("typedmemmove")
...@@ -176,7 +176,7 @@ func writebarrier(f *Func) { ...@@ -176,7 +176,7 @@ func writebarrier(f *Func) {
ptr := w.Args[0] ptr := w.Args[0]
var typ interface{} var typ interface{}
if w.Op != OpStoreWB { if w.Op != OpStoreWB {
typ = &ExternSymbol{Typ: types.Uintptr, Sym: w.Aux.(Type).Symbol()} typ = &ExternSymbol{Sym: w.Aux.(Type).Symbol()}
} }
pos = w.Pos pos = w.Pos
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment