aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/scope.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2017-04-18 15:21:02 -0700
committerRobert Griesemer <gri@golang.org>2017-04-19 00:36:55 +0000
commit48163968b2927247213fca7a6f4678d3c93855dc (patch)
tree6f5b804f26d165e6087cd4b295c09a99f5c14d5b /src/cmd/compile/internal/types/scope.go
parent912a638b0c759fdd6c04d3c3a426157d2285a855 (diff)
downloadgo-48163968b2927247213fca7a6f4678d3c93855dc.tar.gz
go-48163968b2927247213fca7a6f4678d3c93855dc.zip
cmd/compile: remove uses of types.Dclstack - not needed anymore
Follow-up on https://go-review.googlesource.com/#/c/39998/. Change-Id: I8830eebd7ea7e02b7edda99e67b6d43529401201 Reviewed-on: https://go-review.googlesource.com/40974 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/scope.go')
-rw-r--r--src/cmd/compile/internal/types/scope.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/types/scope.go b/src/cmd/compile/internal/types/scope.go
index 9ee3f796f7..67de273f25 100644
--- a/src/cmd/compile/internal/types/scope.go
+++ b/src/cmd/compile/internal/types/scope.go
@@ -14,19 +14,19 @@ import (
var blockgen int32 = 1 // max block number
var Block int32 // current block number
-// Dclstack maintains a stack of shadowed symbol declarations so that
+// dclstack maintains a stack of shadowed symbol declarations so that
// popdcl can restore their declarations when a block scope ends.
// The stack is maintained as a linked list, using Sym's Link field.
//
// In practice, the "stack" actually ends up forming a tree: goto and label
-// statements record the current state of Dclstack so that checkgoto can
+// statements record the current state of dclstack so that checkgoto can
// validate that a goto statement does not jump over any declarations or
// into a new block scope.
//
// Finally, the Syms in this list are not "real" Syms as they don't actually
// represent object names. Sym is just a convenient type for saving shadowed
// Sym definitions, and only a subset of its fields are actually used.
-var Dclstack *Sym
+var dclstack *Sym
func dcopy(a, b *Sym) {
a.Pkg = b.Pkg
@@ -39,8 +39,8 @@ func dcopy(a, b *Sym) {
func push(pos src.XPos) *Sym {
d := new(Sym)
d.Lastlineno = pos
- d.Link = Dclstack
- Dclstack = d
+ d.Link = dclstack
+ dclstack = d
return d
}
@@ -54,7 +54,7 @@ func Pushdcl(s *Sym, pos src.XPos) {
// Popdcl pops the innermost block scope and restores all symbol declarations
// to their previous state.
func Popdcl() {
- d := Dclstack
+ d := dclstack
for ; d != nil && d.Name != ""; d = d.Link {
s := d.Pkg.Lookup(d.Name)
lno := s.Lastlineno
@@ -66,7 +66,7 @@ func Popdcl() {
Fatalf("popdcl: no mark")
}
- Dclstack = d.Link // pop mark
+ dclstack = d.Link // pop mark
Block = d.Block
}
@@ -83,7 +83,7 @@ func Markdcl(lineno src.XPos) {
// keep around for debugging
func DumpDclstack() {
i := 0
- for d := Dclstack; d != nil; d = d.Link {
+ for d := dclstack; d != nil; d = d.Link {
fmt.Printf("%6d %p", i, d)
if d.Name != "" {
fmt.Printf(" '%s' %v\n", d.Name, d.Pkg.Lookup(d.Name))
@@ -95,7 +95,7 @@ func DumpDclstack() {
}
func IsDclstackValid() bool {
- for d := Dclstack; d != nil; d = d.Link {
+ for d := dclstack; d != nil; d = d.Link {
if d.Name == "" {
return false
}