1
0
mirror of https://github.com/golang/go synced 2024-11-20 05:44:44 -07:00

cmd/compile: remove dead flags

For some time now, the -d flag has been used to control various named
debug options, rather than setting Debug['d']. Consequently, that
means dflag() always returns false, which means the -y flag is also
useless.

Similarly, Debug['L'] is never used anywhere, so the -L flag can be
dropped too.

Change-Id: I4bb12454e462410115ec4f5565facf76c5c2f255
Reviewed-on: https://go-review.googlesource.com/22121
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2016-04-15 14:22:27 -07:00
parent 75c079cb97
commit d57a118afa
2 changed files with 0 additions and 24 deletions

View File

@ -13,19 +13,6 @@ import (
// Declaration stack & operations // Declaration stack & operations
func dflag() bool {
if Debug['d'] == 0 {
return false
}
if Debug['y'] != 0 {
return true
}
if incannedimport != 0 {
return false
}
return true
}
var externdcl []*Node var externdcl []*Node
var blockgen int32 // max block number var blockgen int32 // max block number
@ -67,9 +54,6 @@ func push() *Sym {
func pushdcl(s *Sym) *Sym { func pushdcl(s *Sym) *Sym {
d := push() d := push()
dcopy(d, s) dcopy(d, s)
if dflag() {
fmt.Printf("\t%v push %v %p\n", linestr(lineno), s, s.Def)
}
return d return d
} }
@ -82,9 +66,6 @@ func popdcl() {
lno := s.Lastlineno lno := s.Lastlineno
dcopy(s, d) dcopy(s, d)
d.Lastlineno = lno d.Lastlineno = lno
if dflag() {
fmt.Printf("\t%v pop %v %p\n", linestr(lineno), s, s.Def)
}
} }
if d == nil { if d == nil {
@ -194,9 +175,6 @@ func declare(n *Node, ctxt Class) {
gen := 0 gen := 0
if ctxt == PEXTERN { if ctxt == PEXTERN {
externdcl = append(externdcl, n) externdcl = append(externdcl, n)
if dflag() {
fmt.Printf("\t%v global decl %v %p\n", linestr(lineno), s, n)
}
} else { } else {
if Curfn == nil && ctxt == PAUTO { if Curfn == nil && ctxt == PAUTO {
Fatalf("automatic outside function") Fatalf("automatic outside function")

View File

@ -153,7 +153,6 @@ func Main() {
obj.Flagcount("E", "debug symbol export", &Debug['E']) obj.Flagcount("E", "debug symbol export", &Debug['E'])
obj.Flagfn1("I", "add `directory` to import search path", addidir) obj.Flagfn1("I", "add `directory` to import search path", addidir)
obj.Flagcount("K", "debug missing line numbers", &Debug['K']) obj.Flagcount("K", "debug missing line numbers", &Debug['K'])
obj.Flagcount("L", "use full (long) path in error messages", &Debug['L'])
obj.Flagcount("M", "debug move generation", &Debug['M']) obj.Flagcount("M", "debug move generation", &Debug['M'])
obj.Flagcount("N", "disable optimizations", &Debug['N']) obj.Flagcount("N", "disable optimizations", &Debug['N'])
obj.Flagcount("P", "debug peephole optimizer", &Debug['P']) obj.Flagcount("P", "debug peephole optimizer", &Debug['P'])
@ -191,7 +190,6 @@ func Main() {
obj.Flagcount("w", "debug type checking", &Debug['w']) obj.Flagcount("w", "debug type checking", &Debug['w'])
flag.BoolVar(&use_writebarrier, "wb", true, "enable write barrier") flag.BoolVar(&use_writebarrier, "wb", true, "enable write barrier")
obj.Flagcount("x", "debug lexer", &Debug['x']) obj.Flagcount("x", "debug lexer", &Debug['x'])
obj.Flagcount("y", "debug declarations in canned imports (with -d)", &Debug['y'])
var flag_shared bool var flag_shared bool
var flag_dynlink bool var flag_dynlink bool
if supportsDynlink(Thearch.LinkArch.Arch) { if supportsDynlink(Thearch.LinkArch.Arch) {