aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/sym.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2017-04-21 11:11:15 -0700
committerRobert Griesemer <gri@golang.org>2017-04-21 19:41:11 +0000
commiteaf02e1fc9d5f22415233783c02bb0b687d216ec (patch)
treef019ac514ecbf02ad4dfdac52e4f1b685f118c2a /src/cmd/compile/internal/types/sym.go
parent227fff2ea4f21ec357eebe27324cc04b7c9919c7 (diff)
downloadgo-eaf02e1fc9d5f22415233783c02bb0b687d216ec.tar.gz
go-eaf02e1fc9d5f22415233783c02bb0b687d216ec.zip
cmd/compile/internal/types: remove unused lineno arguments for PushDcl/MarkDcl
More steps towards simpler symbol handling: - Pushdcl's incoming pos argument, saved in a newly pushed *Sym, was always immediately overwritten by the Lastlineno value of the saved *Sym. - Markdcl's incoming pos argument, saved in the stack mark *Sym, was not restored when the stack mark was popped. - Popdcl always maintained the most recent Lastlineno for a *Sym given by package and name, making it unnecessary to save Lastlineno in the first place. Removed Lastlineno from the set of fields that need saving, and simplified Popdcl. Change-Id: Ie93da1fbd780dcafc2703044e781c0c6298df569 Reviewed-on: https://go-review.googlesource.com/41390 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/sym.go')
-rw-r--r--src/cmd/compile/internal/types/sym.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go
index c969f96b47..e316e99ce7 100644
--- a/src/cmd/compile/internal/types/sym.go
+++ b/src/cmd/compile/internal/types/sym.go
@@ -18,15 +18,15 @@ import (
// allows using Sym pointer equality to test for Go identifier uniqueness when
// handling selector expressions.
type Sym struct {
- Importdef *Pkg // where imported definition was found
- Linkname string // link name
+ Importdef *Pkg // where imported definition was found
+ Linkname string // link name
+ Lastlineno src.XPos // last declaration for diagnostic
// saved and restored by dcopy
- Pkg *Pkg
- Name string // object name
- Def *Node // definition: ONAME OTYPE OPACK or OLITERAL
- Lastlineno src.XPos // last declaration for diagnostic
- Block int32 // blocknumber to catch redeclaration
+ Pkg *Pkg
+ Name string // object name
+ Def *Node // definition: ONAME OTYPE OPACK or OLITERAL
+ Block int32 // blocknumber to catch redeclaration
flags bitset8
Label *Node // corresponding label (ephemeral)