Commit 832082b4 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: remove -A flag

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/31497Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 42b37819
...@@ -227,12 +227,9 @@ func dowidth(t *Type) { ...@@ -227,12 +227,9 @@ func dowidth(t *Type) {
} }
w = 1 // anything will do w = 1 // anything will do
// dummy type; should be replaced before use.
case TANY: case TANY:
if Debug['A'] == 0 { // dummy type; should be replaced before use.
Fatalf("dowidth any") Fatalf("dowidth any")
}
w = 1 // anything will do
case TSTRING: case TSTRING:
if sizeof_String == 0 { if sizeof_String == 0 {
......
...@@ -132,9 +132,9 @@ package gc ...@@ -132,9 +132,9 @@ package gc
import ( import (
"bufio" "bufio"
"bytes" "bytes"
"math/big"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"math/big"
"sort" "sort"
"strings" "strings"
) )
...@@ -208,10 +208,7 @@ func export(out *bufio.Writer, trace bool) int { ...@@ -208,10 +208,7 @@ func export(out *bufio.Writer, trace bool) int {
strIndex: map[string]int{"": 0}, // empty string is mapped to 0 strIndex: map[string]int{"": 0}, // empty string is mapped to 0
pkgIndex: make(map[*Pkg]int), pkgIndex: make(map[*Pkg]int),
typIndex: make(map[*Type]int), typIndex: make(map[*Type]int),
// don't emit pos info for builtin packages posInfoFormat: true,
// (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,
trace: trace, trace: trace,
} }
......
...@@ -10,9 +10,9 @@ package gc ...@@ -10,9 +10,9 @@ package gc
import ( import (
"bufio" "bufio"
"math/big"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"math/big"
"strconv" "strconv"
"strings" "strings"
) )
......
...@@ -82,8 +82,7 @@ func autoexport(n *Node, ctxt Class) { ...@@ -82,8 +82,7 @@ func autoexport(n *Node, ctxt Class) {
return return
} }
// -A is for cmd/gc/mkbuiltin script, so export everything if exportname(n.Sym.Name) || initname(n.Sym.Name) {
if Debug['A'] != 0 || exportname(n.Sym.Name) || initname(n.Sym.Name) {
exportsym(n) exportsym(n)
} }
if asmhdr != "" && n.Sym.Pkg == localpkg && n.Sym.Flags&SymAsm == 0 { if asmhdr != "" && n.Sym.Pkg == localpkg && n.Sym.Flags&SymAsm == 0 {
...@@ -271,7 +270,7 @@ func importsym(s *Sym, op Op) { ...@@ -271,7 +270,7 @@ func importsym(s *Sym, op Op) {
// mark the symbol so it is not reexported // mark the symbol so it is not reexported
if s.Def == nil { if s.Def == nil {
if Debug['A'] != 0 || exportname(s.Name) || initname(s.Name) { if exportname(s.Name) || initname(s.Name) {
s.Flags |= SymExport s.Flags |= SymExport
} else { } else {
s.Flags |= SymPackage // package scope s.Flags |= SymPackage // package scope
......
...@@ -75,11 +75,6 @@ func anyinit(n []*Node) bool { ...@@ -75,11 +75,6 @@ func anyinit(n []*Node) bool {
} }
func fninit(n []*Node) { func fninit(n []*Node) {
if Debug['A'] != 0 {
// sys.go or unsafe.go during compiler build
return
}
nf := initfix(n) nf := initfix(n)
if !anyinit(nf) { if !anyinit(nf) {
return return
......
...@@ -152,7 +152,6 @@ func Main() { ...@@ -152,7 +152,6 @@ func Main() {
flag.BoolVar(&compiling_runtime, "+", false, "compiling runtime") flag.BoolVar(&compiling_runtime, "+", false, "compiling runtime")
obj.Flagcount("%", "debug non-static initializers", &Debug['%']) 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']) obj.Flagcount("B", "disable bounds checking", &Debug['B'])
flag.StringVar(&localimport, "D", "", "set relative `path` for local imports") flag.StringVar(&localimport, "D", "", "set relative `path` for local imports")
obj.Flagcount("E", "debug symbol export", &Debug['E']) obj.Flagcount("E", "debug symbol export", &Debug['E'])
...@@ -677,10 +676,6 @@ func findpkg(name string) (file string, ok bool) { ...@@ -677,10 +676,6 @@ func findpkg(name string) (file string, ok bool) {
// so that the compiler can generate calls to them, // so that the compiler can generate calls to them,
// but does not make them visible to user code. // but does not make them visible to user code.
func loadsys() { func loadsys() {
if Debug['A'] != 0 {
return
}
block = 1 block = 1
iota_ = -1000000 iota_ = -1000000
......
...@@ -321,9 +321,6 @@ func compile(fn *Node) { ...@@ -321,9 +321,6 @@ func compile(fn *Node) {
return return
} }
if Debug['A'] != 0 {
return
}
emitptrargsmap() emitptrargsmap()
return return
} }
......
...@@ -27,7 +27,6 @@ var basicTypes = [...]struct { ...@@ -27,7 +27,6 @@ var basicTypes = [...]struct {
{"complex128", TCOMPLEX128}, {"complex128", TCOMPLEX128},
{"bool", TBOOL}, {"bool", TBOOL},
{"string", TSTRING}, {"string", TSTRING},
{"any", TANY},
} }
var typedefs = [...]struct { var typedefs = [...]struct {
...@@ -117,6 +116,7 @@ func lexinit() { ...@@ -117,6 +116,7 @@ func lexinit() {
idealstring = typ(TSTRING) idealstring = typ(TSTRING)
idealbool = typ(TBOOL) idealbool = typ(TBOOL)
Types[TANY] = typ(TANY)
s := Pkglookup("true", builtinpkg) s := Pkglookup("true", builtinpkg)
s.Def = nodbool(true) s.Def = nodbool(true)
...@@ -461,7 +461,7 @@ func finishUniverse() { ...@@ -461,7 +461,7 @@ func finishUniverse() {
// package block rather than emitting a redeclared symbol error. // package block rather than emitting a redeclared symbol error.
for _, s := range builtinpkg.Syms { for _, s := range builtinpkg.Syms {
if s.Def == nil || (s.Name == "any" && Debug['A'] == 0) { if s.Def == nil {
continue continue
} }
s1 := lookup(s.Name) s1 := lookup(s.Name)
......
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