mirror of https://github.com/golang/go.git
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
dec95d8fad
commit
700574e791
|
|
@ -1380,13 +1380,13 @@ func (s *state) expr(n *Node) *ssa.Value {
|
|||
len := s.newValue1(ssa.OpStringLen, types.Types[TINT], str)
|
||||
return s.newValue3(ssa.OpSliceMake, n.Type, ptr, len, len)
|
||||
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)
|
||||
case ONAME:
|
||||
if n.Class == PFUNC {
|
||||
// "value" of a function is the address of the function's closure
|
||||
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)
|
||||
}
|
||||
if s.canSSA(n) {
|
||||
|
|
@ -2826,7 +2826,7 @@ func init() {
|
|||
sys.ARM64)
|
||||
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 {
|
||||
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)
|
||||
v := s.newValue2(ssa.OpLoad, types.Types[TBOOL], addr, s.mem())
|
||||
b := s.endBlock()
|
||||
|
|
@ -3197,7 +3197,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value {
|
|||
switch n.Class {
|
||||
case PEXTERN:
|
||||
// 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)
|
||||
// TODO: Make OpAddr use AuxInt as well as Aux.
|
||||
if n.Xoffset != 0 {
|
||||
|
|
@ -4744,7 +4744,7 @@ func (e *ssafn) StringData(s string) interface{} {
|
|||
e.strings = make(map[string]interface{})
|
||||
}
|
||||
data := stringsym(s)
|
||||
aux := &ssa.ExternSymbol{Typ: types.Idealstring, Sym: data}
|
||||
aux := &ssa.ExternSymbol{Sym: data}
|
||||
e.strings[s] = aux
|
||||
return aux
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,6 @@ func (v *Value) isGenericIntConst() bool {
|
|||
// ExternSymbol is an aux value that encodes a variable's
|
||||
// constant offset from the static base pointer.
|
||||
type ExternSymbol struct {
|
||||
Typ Type // Go type
|
||||
Sym *obj.LSym
|
||||
// Note: the offset for an external symbol is not
|
||||
// calculated until link time.
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ func writebarrier(f *Func) {
|
|||
if sp == nil {
|
||||
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)
|
||||
writebarrierptr = f.fe.Syslook("writebarrierptr")
|
||||
typedmemmove = f.fe.Syslook("typedmemmove")
|
||||
|
|
@ -176,7 +176,7 @@ func writebarrier(f *Func) {
|
|||
ptr := w.Args[0]
|
||||
var typ interface{}
|
||||
if w.Op != OpStoreWB {
|
||||
typ = &ExternSymbol{Typ: types.Uintptr, Sym: w.Aux.(Type).Symbol()}
|
||||
typ = &ExternSymbol{Sym: w.Aux.(Type).Symbol()}
|
||||
}
|
||||
pos = w.Pos
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue