]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove -A flag
authorMatthew Dempsky <mdempsky@google.com>
Wed, 19 Oct 2016 19:58:16 +0000 (12:58 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 19 Oct 2016 20:22:13 +0000 (20:22 +0000)
mkbuiltin.go now generates builtin.go using go/ast instead of running
the compiler, so we don't need the -A flag anymore.

Passes toolstash -cmp.

Change-Id: Ifa70f4f3c9feae10c723cbec81a0a47c39610090
Reviewed-on: https://go-review.googlesource.com/31497
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/align.go
src/cmd/compile/internal/gc/bexport.go
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/export.go
src/cmd/compile/internal/gc/init.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/universe.go

index 375870ee805282138ed7f8842ddeacf938ba0068..eee801fb8e771527e54cd7516a17b324358afc54 100644 (file)
@@ -227,12 +227,9 @@ func dowidth(t *Type) {
                }
                w = 1 // anything will do
 
-       // dummy type; should be replaced before use.
        case TANY:
-               if Debug['A'] == 0 {
-                       Fatalf("dowidth any")
-               }
-               w = 1 // anything will do
+               // dummy type; should be replaced before use.
+               Fatalf("dowidth any")
 
        case TSTRING:
                if sizeof_String == 0 {
index 03223b421e6cf39f95a08724178e4591f1ea9cae..c40a338a8d21a2d5038f32e636f35666e8913efa 100644 (file)
@@ -132,9 +132,9 @@ package gc
 import (
        "bufio"
        "bytes"
-       "math/big"
        "encoding/binary"
        "fmt"
+       "math/big"
        "sort"
        "strings"
 )
@@ -204,14 +204,11 @@ type exporter struct {
 // export writes the exportlist for localpkg to out and returns the number of bytes written.
 func export(out *bufio.Writer, trace bool) int {
        p := exporter{
-               out:      out,
-               strIndex: map[string]int{"": 0}, // empty string is mapped to 0
-               pkgIndex: make(map[*Pkg]int),
-               typIndex: make(map[*Type]int),
-               // don't emit pos info for builtin packages
-               // (not needed and avoids path name diffs in builtin.go between
-               // Windows and non-Windows machines, exposed via builtin_test.go)
-               posInfoFormat: Debug['A'] == 0,
+               out:           out,
+               strIndex:      map[string]int{"": 0}, // empty string is mapped to 0
+               pkgIndex:      make(map[*Pkg]int),
+               typIndex:      make(map[*Type]int),
+               posInfoFormat: true,
                trace:         trace,
        }
 
index 3c75b8f087dc0ab40984f8bcbe8d6004532c06c7..562f31b82ba66ac404c0bfd43ec5a0574dc55419 100644 (file)
@@ -10,9 +10,9 @@ package gc
 
 import (
        "bufio"
-       "math/big"
        "encoding/binary"
        "fmt"
+       "math/big"
        "strconv"
        "strings"
 )
index 972101f91098e1f74538928c7b94d6f45836ed5f..8df871d08e41a205ce3b4f9f302c4aa5f4ede499 100644 (file)
@@ -82,8 +82,7 @@ func autoexport(n *Node, ctxt Class) {
                return
        }
 
-       // -A is for cmd/gc/mkbuiltin script, so export everything
-       if Debug['A'] != 0 || exportname(n.Sym.Name) || initname(n.Sym.Name) {
+       if exportname(n.Sym.Name) || initname(n.Sym.Name) {
                exportsym(n)
        }
        if asmhdr != "" && n.Sym.Pkg == localpkg && n.Sym.Flags&SymAsm == 0 {
@@ -271,7 +270,7 @@ func importsym(s *Sym, op Op) {
 
        // mark the symbol so it is not reexported
        if s.Def == nil {
-               if Debug['A'] != 0 || exportname(s.Name) || initname(s.Name) {
+               if exportname(s.Name) || initname(s.Name) {
                        s.Flags |= SymExport
                } else {
                        s.Flags |= SymPackage // package scope
index 6b3f5600af71692d7fa0efa82da7365bfedceb3e..5693052fdf1baaa6aa6ad61d2bcec934367e8d03 100644 (file)
@@ -75,11 +75,6 @@ func anyinit(n []*Node) bool {
 }
 
 func fninit(n []*Node) {
-       if Debug['A'] != 0 {
-               // sys.go or unsafe.go during compiler build
-               return
-       }
-
        nf := initfix(n)
        if !anyinit(nf) {
                return
index b19319963ab94138d61c472ee9a90e29a68738fb..0e6965c4bd8127b36b25999e3cb7916d852c8059 100644 (file)
@@ -152,7 +152,6 @@ func Main() {
 
        flag.BoolVar(&compiling_runtime, "+", false, "compiling runtime")
        obj.Flagcount("%", "debug non-static initializers", &Debug['%'])
-       obj.Flagcount("A", "for bootstrapping, allow 'any' type", &Debug['A'])
        obj.Flagcount("B", "disable bounds checking", &Debug['B'])
        flag.StringVar(&localimport, "D", "", "set relative `path` for local imports")
        obj.Flagcount("E", "debug symbol export", &Debug['E'])
@@ -677,10 +676,6 @@ func findpkg(name string) (file string, ok bool) {
 // so that the compiler can generate calls to them,
 // but does not make them visible to user code.
 func loadsys() {
-       if Debug['A'] != 0 {
-               return
-       }
-
        block = 1
        iota_ = -1000000
 
index f88e3702775e31965c78d397f37b91df1dfe8ef1..8c5925ff040f6e1235c7db6a06f8ef128b93d124 100644 (file)
@@ -321,9 +321,6 @@ func compile(fn *Node) {
                        return
                }
 
-               if Debug['A'] != 0 {
-                       return
-               }
                emitptrargsmap()
                return
        }
index 5ac29d305c8240c8613c7b82a8d4deff4f59529e..6798a9a906c5cca30e2af90c748ac35e5e9c137e 100644 (file)
@@ -27,7 +27,6 @@ var basicTypes = [...]struct {
        {"complex128", TCOMPLEX128},
        {"bool", TBOOL},
        {"string", TSTRING},
-       {"any", TANY},
 }
 
 var typedefs = [...]struct {
@@ -117,6 +116,7 @@ func lexinit() {
 
        idealstring = typ(TSTRING)
        idealbool = typ(TBOOL)
+       Types[TANY] = typ(TANY)
 
        s := Pkglookup("true", builtinpkg)
        s.Def = nodbool(true)
@@ -461,7 +461,7 @@ func finishUniverse() {
        // package block rather than emitting a redeclared symbol error.
 
        for _, s := range builtinpkg.Syms {
-               if s.Def == nil || (s.Name == "any" && Debug['A'] == 0) {
+               if s.Def == nil {
                        continue
                }
                s1 := lookup(s.Name)