mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: various cleanups using tools
* remove unnecessary explicit types * remove dead assignments * remove unused fields * unindent code using early continues * remove some unnecessary type conversions * remove some unused func parameters Change-Id: I202c67e92940beacbd80fc2dc179f9556dc5d9e5 Reviewed-on: https://go-review.googlesource.com/69118 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
7830a19a4f
commit
966c459fa4
8 changed files with 33 additions and 34 deletions
|
|
@ -574,7 +574,7 @@ func (ctxt *Link) loadlib() {
|
|||
if typeSymbolMangling(ctxt) {
|
||||
*FlagW = true // disable DWARF generation
|
||||
for _, s := range ctxt.Syms.Allsym {
|
||||
newName := typeSymbolMangle(ctxt.Syms, s.Name)
|
||||
newName := typeSymbolMangle(s.Name)
|
||||
if newName != s.Name {
|
||||
ctxt.Syms.Rename(s.Name, newName, int(s.Version))
|
||||
}
|
||||
|
|
@ -657,7 +657,7 @@ func typeSymbolMangling(ctxt *Link) bool {
|
|||
}
|
||||
|
||||
// typeSymbolMangle mangles the given symbol name into something shorter.
|
||||
func typeSymbolMangle(syms *sym.Symbols, name string) string {
|
||||
func typeSymbolMangle(name string) string {
|
||||
if !strings.HasPrefix(name, "type.") {
|
||||
return name
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue