Commit dc3540d9 authored by Håvard Haugen's avatar Håvard Haugen Committed by Brad Fitzpatrick

compile/internal/gc: make typecheckok a bool

Change-Id: Ib3960321a4c8164f6b221bfd15977d2f34dbc65b
Reviewed-on: https://go-review.googlesource.com/14175Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 45537d89
...@@ -182,7 +182,7 @@ func declare(n *Node, ctxt uint8) { ...@@ -182,7 +182,7 @@ func declare(n *Node, ctxt uint8) {
s := n.Sym s := n.Sym
// kludgy: typecheckok means we're past parsing. Eg genwrapper may declare out of package names later. // kludgy: typecheckok means we're past parsing. Eg genwrapper may declare out of package names later.
if importpkg == nil && typecheckok == 0 && s.Pkg != localpkg { if importpkg == nil && !typecheckok && s.Pkg != localpkg {
Yyerror("cannot declare name %v", s) Yyerror("cannot declare name %v", s)
} }
......
...@@ -638,7 +638,7 @@ var thunk int32 ...@@ -638,7 +638,7 @@ var thunk int32
var Funcdepth int32 var Funcdepth int32
var typecheckok int var typecheckok bool
var compiling_runtime int var compiling_runtime int
......
...@@ -360,7 +360,7 @@ func Main() { ...@@ -360,7 +360,7 @@ func Main() {
mkpackage(localpkg.Name) // final import not used checks mkpackage(localpkg.Name) // final import not used checks
lexfini() lexfini()
typecheckok = 1 typecheckok = true
if Debug['f'] != 0 { if Debug['f'] != 0 {
frame(1) frame(1)
} }
...@@ -799,7 +799,7 @@ func importfile(f *Val, line int) { ...@@ -799,7 +799,7 @@ func importfile(f *Val, line int) {
curio.peekc1 = 0 curio.peekc1 = 0
curio.infile = file curio.infile = file
curio.nlsemi = 0 curio.nlsemi = 0
typecheckok = 1 typecheckok = true
var c int32 var c int32
for { for {
...@@ -836,7 +836,7 @@ func unimportfile() { ...@@ -836,7 +836,7 @@ func unimportfile() {
pushedio.bin = nil pushedio.bin = nil
incannedimport = 0 incannedimport = 0
typecheckok = 0 typecheckok = false
} }
func cannedimports(file string, cp string) { func cannedimports(file string, cp string) {
...@@ -852,7 +852,7 @@ func cannedimports(file string, cp string) { ...@@ -852,7 +852,7 @@ func cannedimports(file string, cp string) {
curio.nlsemi = 0 curio.nlsemi = 0
curio.importsafe = false curio.importsafe = false
typecheckok = 1 typecheckok = true
incannedimport = 1 incannedimport = 1
} }
......
...@@ -118,7 +118,7 @@ var typecheck_tcfree *NodeList ...@@ -118,7 +118,7 @@ var typecheck_tcfree *NodeList
func typecheck(np **Node, top int) *Node { func typecheck(np **Node, top int) *Node {
// cannot type check until all the source has been parsed // cannot type check until all the source has been parsed
if typecheckok == 0 { if !typecheckok {
Fatalf("early typecheck") Fatalf("early typecheck")
} }
......
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