Commit 49b2dd58 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: remove legacy debug flags

-M, -P, and -R were for debugging backend passes that no longer
exists.

-g is used for debugging instructions generated with Gins, but the SSA
backend mostly generates instructions directly. The handful of
instructions still generated with Gins are pretty useless for
debugging.

-x was used to debug the old lexer, but now it only causes us to print
file names as they're parsed, and only if we manually hack the
compiler to enable tracing.

Change-Id: Ia58d4bc9c1312693466171a3fcefc1221e9a2381
Reviewed-on: https://go-review.googlesource.com/32428
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 7b50bd8a
......@@ -30,10 +30,7 @@
package gc
import (
"cmd/internal/obj"
"fmt"
)
import "cmd/internal/obj"
func Prog(as obj.As) *obj.Prog {
var p *obj.Prog
......@@ -314,9 +311,5 @@ func Gins(as obj.As, f, t *Node) *obj.Prog {
p := Prog(as)
Naddr(&p.From, f)
Naddr(&p.To, t)
if Debug['g'] != 0 {
fmt.Printf("%v\n", p)
}
return p
}
......@@ -155,10 +155,7 @@ func Main() {
obj.Flagcount("E", "debug symbol export", &Debug['E'])
obj.Flagfn1("I", "add `directory` to import search path", addidir)
obj.Flagcount("K", "debug missing line numbers", &Debug['K'])
obj.Flagcount("M", "debug move generation", &Debug['M'])
obj.Flagcount("N", "disable optimizations", &Debug['N'])
obj.Flagcount("P", "debug peephole optimizer", &Debug['P'])
obj.Flagcount("R", "debug register optimizer", &Debug['R'])
obj.Flagcount("S", "print assembly listing", &Debug['S'])
obj.Flagfn0("V", "print compiler version", doversion)
obj.Flagcount("W", "debug parse tree after type checking", &Debug['W'])
......@@ -168,7 +165,6 @@ func Main() {
flag.StringVar(&debugstr, "d", "", "print debug information about items in `list`")
obj.Flagcount("e", "no limit on number of errors reported", &Debug['e'])
obj.Flagcount("f", "debug stack frames", &Debug['f'])
obj.Flagcount("g", "debug code generation", &Debug['g'])
obj.Flagcount("h", "halt on error", &Debug['h'])
obj.Flagcount("i", "debug line number stack", &Debug['i'])
obj.Flagfn1("importmap", "add `definition` of the form source=actual to import map", addImportMap)
......@@ -191,7 +187,6 @@ func Main() {
obj.Flagcount("v", "increase debug verbosity", &Debug['v'])
obj.Flagcount("w", "debug type checking", &Debug['w'])
flag.BoolVar(&use_writebarrier, "wb", true, "enable write barrier")
obj.Flagcount("x", "debug lexer", &Debug['x'])
var flag_shared bool
var flag_dynlink bool
if supportsDynlink(Thearch.LinkArch.Arch) {
......@@ -309,10 +304,6 @@ func Main() {
timings.Start("fe", "parse")
lexlineno0 := lexlineno
for _, infile = range flag.Args() {
if trace && Debug['x'] != 0 {
fmt.Printf("--- %s ---\n", infile)
}
linehistpush(infile)
block = 1
iota_ = -1000000
......
......@@ -12,8 +12,6 @@ package gc
// Semicolons are inserted by the lexer. The parser uses one-token look-ahead
// to handle optional commas and semicolons before a closing ) or } .
const trace = false // if set, parse tracing can be enabled with -x
func mkname(sym *Sym) *Node {
n := oldname(sym)
if n.Name != nil && n.Name.Pack != 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