Commit 27226504 authored by Daniel Martí's avatar Daniel Martí

cmd: remove some unused parameters

Change-Id: I9d2a4b8df324897e264d30801e95ddc0f0e75f3a
Reviewed-on: https://go-review.googlesource.com/102337
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIlya Tocar <ilya.tocar@intel.com>
parent 0250ef91
......@@ -99,7 +99,7 @@ func (p *Parser) validImmediate(pseudo string, addr *obj.Addr) bool {
// asmText assembles a TEXT pseudo-op.
// TEXT runtime·sigtramp(SB),4,$0-0
func (p *Parser) asmText(word string, operands [][]lex.Token) {
func (p *Parser) asmText(operands [][]lex.Token) {
if len(operands) != 2 && len(operands) != 3 {
p.errorf("expect two or three operands for TEXT")
return
......@@ -180,7 +180,7 @@ func (p *Parser) asmText(word string, operands [][]lex.Token) {
// asmData assembles a DATA pseudo-op.
// DATA masks<>+0x00(SB)/4, $0x00000000
func (p *Parser) asmData(word string, operands [][]lex.Token) {
func (p *Parser) asmData(operands [][]lex.Token) {
if len(operands) != 2 {
p.errorf("expect two operands for DATA")
return
......@@ -240,7 +240,7 @@ func (p *Parser) asmData(word string, operands [][]lex.Token) {
// asmGlobl assembles a GLOBL pseudo-op.
// GLOBL shifts<>(SB),8,$256
// GLOBL shifts<>(SB),$256
func (p *Parser) asmGlobl(word string, operands [][]lex.Token) {
func (p *Parser) asmGlobl(operands [][]lex.Token) {
if len(operands) != 2 && len(operands) != 3 {
p.errorf("expect two or three operands for GLOBL")
return
......@@ -272,7 +272,7 @@ func (p *Parser) asmGlobl(word string, operands [][]lex.Token) {
// asmPCData assembles a PCDATA pseudo-op.
// PCDATA $2, $705
func (p *Parser) asmPCData(word string, operands [][]lex.Token) {
func (p *Parser) asmPCData(operands [][]lex.Token) {
if len(operands) != 2 {
p.errorf("expect two operands for PCDATA")
return
......@@ -303,7 +303,7 @@ func (p *Parser) asmPCData(word string, operands [][]lex.Token) {
// asmFuncData assembles a FUNCDATA pseudo-op.
// FUNCDATA $1, funcdata<>+4(SB)
func (p *Parser) asmFuncData(word string, operands [][]lex.Token) {
func (p *Parser) asmFuncData(operands [][]lex.Token) {
if len(operands) != 2 {
p.errorf("expect two operands for FUNCDATA")
return
......
......@@ -219,15 +219,15 @@ func (p *Parser) instruction(op obj.As, word, cond string, operands [][]lex.Toke
func (p *Parser) pseudo(word string, operands [][]lex.Token) bool {
switch word {
case "DATA":
p.asmData(word, operands)
p.asmData(operands)
case "FUNCDATA":
p.asmFuncData(word, operands)
p.asmFuncData(operands)
case "GLOBL":
p.asmGlobl(word, operands)
p.asmGlobl(operands)
case "PCDATA":
p.asmPCData(word, operands)
p.asmPCData(operands)
case "TEXT":
p.asmText(word, operands)
p.asmText(operands)
default:
return false
}
......
......@@ -2115,7 +2115,7 @@ func naclpad(ctxt *obj.Link, s *obj.LSym, c int32, pad int32) int32 {
return c + pad
}
func spadjop(ctxt *obj.Link, p *obj.Prog, l, q obj.As) obj.As {
func spadjop(ctxt *obj.Link, l, q obj.As) obj.As {
if ctxt.Arch.Family != sys.AMD64 || ctxt.Arch.PtrSize == 4 {
return l
}
......@@ -2144,9 +2144,9 @@ func span6(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
p.To.Reg = REG_SP
v := int32(-p.From.Offset)
p.From.Offset = int64(v)
p.As = spadjop(ctxt, p, AADDL, AADDQ)
p.As = spadjop(ctxt, AADDL, AADDQ)
if v < 0 {
p.As = spadjop(ctxt, p, ASUBL, ASUBQ)
p.As = spadjop(ctxt, ASUBL, ASUBQ)
v = -v
p.From.Offset = int64(v)
}
......@@ -2173,9 +2173,9 @@ func span6(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) {
p.To.Reg = REG_SP
v := int32(-p.From.Offset)
p.From.Offset = int64(v)
p.As = spadjop(ctxt, p, AADDL, AADDQ)
p.As = spadjop(ctxt, AADDL, AADDQ)
if v < 0 {
p.As = spadjop(ctxt, p, ASUBL, ASUBQ)
p.As = spadjop(ctxt, ASUBL, ASUBQ)
v = -v
p.From.Offset = int64(v)
}
......@@ -2496,7 +2496,7 @@ func instinit(ctxt *obj.Link) {
var isAndroid = (objabi.GOOS == "android")
func prefixof(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int {
func prefixof(ctxt *obj.Link, a *obj.Addr) int {
if a.Reg < REG_CS && a.Index < REG_CS { // fast path
return 0
}
......@@ -3797,11 +3797,11 @@ func (asmbuf *AsmBuf) doasm(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog) {
return
}
pre := prefixof(ctxt, p, &p.From)
pre := prefixof(ctxt, &p.From)
if pre != 0 {
asmbuf.Put1(byte(pre))
}
pre = prefixof(ctxt, p, &p.To)
pre = prefixof(ctxt, &p.To)
if pre != 0 {
asmbuf.Put1(byte(pre))
}
......
......@@ -964,7 +964,7 @@ func isZeroArgRuntimeCall(s *obj.LSym) bool {
return false
}
func indir_cx(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) {
func indir_cx(ctxt *obj.Link, a *obj.Addr) {
if ctxt.Headtype == objabi.Hnacl && ctxt.Arch.Family == sys.AMD64 {
a.Type = obj.TYPE_MEM
a.Reg = REG_R15
......@@ -1032,7 +1032,7 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
p.As = cmp
p.From.Type = obj.TYPE_REG
p.From.Reg = REG_SP
indir_cx(ctxt, p, &p.To)
indir_cx(ctxt, &p.To)
p.To.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0
if cursym.CFunc() {
p.To.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1
......@@ -1054,7 +1054,7 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
p.As = cmp
p.From.Type = obj.TYPE_REG
p.From.Reg = REG_AX
indir_cx(ctxt, p, &p.To)
indir_cx(ctxt, &p.To)
p.To.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0
if cursym.CFunc() {
p.To.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1
......@@ -1078,7 +1078,7 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
p = obj.Appendp(p, newprog)
p.As = mov
indir_cx(ctxt, p, &p.From)
indir_cx(ctxt, &p.From)
p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0
if cursym.CFunc() {
p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1
......
......@@ -266,7 +266,7 @@ func (ar *Archive) scan(action func(*Entry)) {
}
// listEntry prints to standard output a line describing the entry.
func listEntry(ar *Archive, entry *Entry, verbose bool) {
func listEntry(entry *Entry, verbose bool) {
if verbose {
fmt.Fprintf(stdout, "%s\n", entry)
} else {
......@@ -457,7 +457,7 @@ var stdout io.Writer = os.Stdout
func (ar *Archive) printContents(entry *Entry) {
if ar.match(entry) {
if verbose {
listEntry(ar, entry, false)
listEntry(entry, false)
}
ar.output(entry, stdout)
} else {
......@@ -474,7 +474,7 @@ func (ar *Archive) skipContents(entry *Entry) {
// tableOfContents implements the 't' command.
func (ar *Archive) tableOfContents(entry *Entry) {
if ar.match(entry) {
listEntry(ar, entry, verbose)
listEntry(entry, verbose)
}
ar.skip(entry)
}
......@@ -483,7 +483,7 @@ func (ar *Archive) tableOfContents(entry *Entry) {
func (ar *Archive) extractContents(entry *Entry) {
if ar.match(entry) {
if verbose {
listEntry(ar, entry, false)
listEntry(entry, false)
}
fd, err := os.OpenFile(entry.name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, entry.mode)
if err != nil {
......
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