Two funcs and a field were unused. Remove them.
A few statements could be made simpler.
importsym's pos parameter was unused, so remove it.
Finally, don't use printf-like funcs with constant strings that have no
formatting directives.
Change-Id: I415452249bf2168aa353ac4f3643dfc03017ee53
Reviewed-on: https://go-review.googlesource.com/117699
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
uniq []bvec // unique bvecs, in insertion order
}
-func newBvecSet(size int) bvecSet {
- // bvecSet is a linear probing hash table.
- // The hash table has 4n entries to keep the linear
- // scan short.
- index := make([]int, size*4)
- for i := range index {
- index[i] = -1
- }
- return bvecSet{index, nil}
-}
-
func (m *bvecSet) grow() {
// Allocate new index.
n := len(m.index) * 2
v.U.(*Mpint).Neg()
case OCOM_ | CTINT_:
- var et types.EType = Txxx
+ et := Txxx
if nl.Type != nil {
et = nl.Type.Etype
}
// return temps (~r%d) that were created during
// lowering, or unnamed params ("_").
v.ChildIndex = int32(synthCount)
- synthCount += 1
+ synthCount++
}
}
}
}
}
-func importsym(ipkg *types.Pkg, pos src.XPos, s *types.Sym, op Op) *Node {
+func importsym(ipkg *types.Pkg, s *types.Sym, op Op) *Node {
n := asNode(s.PkgDef())
if n == nil {
// iimport should have created a stub ONONAME
// If no such type has been declared yet, a forward declaration is returned.
// ipkg is the package being imported
func importtype(ipkg *types.Pkg, pos src.XPos, s *types.Sym) *types.Type {
- n := importsym(ipkg, pos, s, OTYPE)
+ n := importsym(ipkg, s, OTYPE)
if n.Op != OTYPE {
t := types.New(TFORW)
t.Sym = s
// importobj declares symbol s as an imported object representable by op.
// ipkg is the package being imported
func importobj(ipkg *types.Pkg, pos src.XPos, s *types.Sym, op Op, ctxt Class, t *types.Type) *Node {
- n := importsym(ipkg, pos, s, op)
+ n := importsym(ipkg, s, op)
if n.Op != ONONAME {
if n.Op == op && (n.Class() != ctxt || !eqtype(n.Type, t)) {
redeclare(lineno, s, fmt.Sprintf("during import %q", ipkg.Path))
if !ok {
w := p.newWriter()
w.doTyp(t)
- off = predeclReserved + uint64(w.flush())
+ off = predeclReserved + w.flush()
p.typIndex[t] = off
}
return off
}
// display help about the -d option itself and quit
if name == "help" {
- fmt.Printf(debugHelpHeader)
+ fmt.Print(debugHelpHeader)
maxLen := len("ssa/help")
for _, t := range debugtab {
if len(t.name) > maxLen {
}
// ssa options have their own help
fmt.Printf("\t%-*s\t%s\n", maxLen, "ssa/help", "print help about SSA debugging")
- fmt.Printf(debugHelpFooter)
+ fmt.Print(debugHelpFooter)
os.Exit(0)
}
val, valstring, haveInt := 1, "", true
}
}
-func (x *Mpint) String() string {
- return bconv(x, 0)
+func (a *Mpint) String() string {
+ return bconv(a, 0)
}
func bconv(xval *Mpint, flag FmtFlag) string {
dwarfData *dwarf.Data
dwarfReader *dwarf.Reader
scopegen int
- lines map[line][]int
}
// readScope reads the DW_TAG_lexical_block or the DW_TAG_subprogram in
return v
}
-func iscallret(n *Node) bool {
- if n == nil {
- return false
- }
- n = outervalue(n)
- return n.Op == OINDREGSP
-}
-
// isReflectHeaderDataField reports whether l is an expression p.Data
// where p has type reflect.SliceHeader or reflect.StringHeader.
func isReflectHeaderDataField(l *Node) bool {