Skip to content

Commit

Permalink
compile/internal/gc: make typecheckok a bool
Browse files Browse the repository at this point in the history
Change-Id: Ib3960321a4c8164f6b221bfd15977d2f34dbc65b
Reviewed-on: https://go-review.googlesource.com/14175
Reviewed-by: Brad Fitzpatrick <[email protected]>
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
osocurioso authored and bradfitz committed Sep 2, 2015
1 parent 45537d8 commit dc3540d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/dcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func declare(n *Node, ctxt uint8) {
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)
}

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ var thunk int32

var Funcdepth int32

var typecheckok int
var typecheckok bool

var compiling_runtime int

Expand Down
8 changes: 4 additions & 4 deletions src/cmd/compile/internal/gc/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func Main() {
mkpackage(localpkg.Name) // final import not used checks
lexfini()

typecheckok = 1
typecheckok = true
if Debug['f'] != 0 {
frame(1)
}
Expand Down Expand Up @@ -799,7 +799,7 @@ func importfile(f *Val, line int) {
curio.peekc1 = 0
curio.infile = file
curio.nlsemi = 0
typecheckok = 1
typecheckok = true

var c int32
for {
Expand Down Expand Up @@ -836,7 +836,7 @@ func unimportfile() {

pushedio.bin = nil
incannedimport = 0
typecheckok = 0
typecheckok = false
}

func cannedimports(file string, cp string) {
Expand All @@ -852,7 +852,7 @@ func cannedimports(file string, cp string) {
curio.nlsemi = 0
curio.importsafe = false

typecheckok = 1
typecheckok = true
incannedimport = 1
}

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/typecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var typecheck_tcfree *NodeList

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")
}

Expand Down

0 comments on commit dc3540d

Please sign in to comment.