compile/internal/gc: make typecheckok a bool
Change-Id: Ib3960321a4c8164f6b221bfd15977d2f34dbc65b
Reviewed-on: https://go-review.googlesource.com/14175
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/src/cmd/compile/internal/gc/dcl.go b/src/cmd/compile/internal/gc/dcl.go
index 99f29f4..157f525 100644
--- a/src/cmd/compile/internal/gc/dcl.go
+++ b/src/cmd/compile/internal/gc/dcl.go
@@ -182,7 +182,7 @@
s := n.Sym
// 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)
}
diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go
index b692fc8..8c7328f 100644
--- a/src/cmd/compile/internal/gc/go.go
+++ b/src/cmd/compile/internal/gc/go.go
@@ -638,7 +638,7 @@
var Funcdepth int32
-var typecheckok int
+var typecheckok bool
var compiling_runtime int
diff --git a/src/cmd/compile/internal/gc/lex.go b/src/cmd/compile/internal/gc/lex.go
index 863fa88..3fab358 100644
--- a/src/cmd/compile/internal/gc/lex.go
+++ b/src/cmd/compile/internal/gc/lex.go
@@ -360,7 +360,7 @@
mkpackage(localpkg.Name) // final import not used checks
lexfini()
- typecheckok = 1
+ typecheckok = true
if Debug['f'] != 0 {
frame(1)
}
@@ -799,7 +799,7 @@
curio.peekc1 = 0
curio.infile = file
curio.nlsemi = 0
- typecheckok = 1
+ typecheckok = true
var c int32
for {
@@ -836,7 +836,7 @@
pushedio.bin = nil
incannedimport = 0
- typecheckok = 0
+ typecheckok = false
}
func cannedimports(file string, cp string) {
@@ -852,7 +852,7 @@
curio.nlsemi = 0
curio.importsafe = false
- typecheckok = 1
+ typecheckok = true
incannedimport = 1
}
diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go
index 502c62c..ff394f4 100644
--- a/src/cmd/compile/internal/gc/typecheck.go
+++ b/src/cmd/compile/internal/gc/typecheck.go
@@ -118,7 +118,7 @@
func typecheck(np **Node, top int) *Node {
// cannot type check until all the source has been parsed
- if typecheckok == 0 {
+ if !typecheckok {
Fatalf("early typecheck")
}