]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove legacy debug flags
authorMatthew Dempsky <mdempsky@google.com>
Mon, 31 Oct 2016 19:01:32 +0000 (12:01 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 31 Oct 2016 19:18:47 +0000 (19:18 +0000)
-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: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/parser.go

index fd536ee06dafc3a0ec640f8c3d48caa32a3849b9..d1c012baeda0024c5dc4bb721510f9bba5483ba1 100644 (file)
 
 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
 }
index c5ae7d3fba37a9b5f9ec6f832b42edbf7885c559..edb37c2c742a22cc4da10c8c1c01e63ee0cd12ae 100644 (file)
@@ -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
index 641dcb65d0394858ec63e12725ea9cecf5315484..8f630183ef5f802ad8b082190653201a54cc20c6 100644 (file)
@@ -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 {