diff options
author | Robert Griesemer <gri@golang.org> | 2016-12-06 17:08:06 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2016-12-08 21:26:25 +0000 |
commit | 24597c080bdba1de8f7e5d46aa250e5f25d24311 (patch) | |
tree | c26985b4bdd805a4b0cbbab8ea0b564559d4600d /src/cmd/compile/internal/ssa/sparsemap.go | |
parent | 0be4ef3ea6a915e3b2ab0cac35209566a1ae3068 (diff) | |
download | go-24597c080bdba1de8f7e5d46aa250e5f25d24311.tar.gz go-24597c080bdba1de8f7e5d46aa250e5f25d24311.zip |
[dev.inline] cmd/compile: introduce cmd/internal/src.Pos type for line numbers
This is a step toward chosing a different position representation.
By introducing an explicit type, it will be easier to make the
transition step-wise while ensuring everything keeps running.
This has been reviewed via https://go-review.googlesource.com/#/c/34025/.
Change-Id: Ibceddcd62d8f346321ac3250e3940e9c436ed684
Reviewed-on: https://go-review.googlesource.com/34132
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Lazar <lazard@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/sparsemap.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/sparsemap.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/sparsemap.go b/src/cmd/compile/internal/ssa/sparsemap.go index 70c4f6190c..3bc4eb9d78 100644 --- a/src/cmd/compile/internal/ssa/sparsemap.go +++ b/src/cmd/compile/internal/ssa/sparsemap.go @@ -4,13 +4,15 @@ package ssa +import "cmd/internal/src" + // from http://research.swtch.com/sparse // in turn, from Briggs and Torczon type sparseEntry struct { key ID val int32 - aux int32 + aux src.Pos } type sparseMap struct { @@ -43,7 +45,7 @@ func (s *sparseMap) get(k ID) int32 { return -1 } -func (s *sparseMap) set(k ID, v, a int32) { +func (s *sparseMap) set(k ID, v int32, a src.Pos) { i := s.sparse[k] if i < int32(len(s.dense)) && s.dense[i].key == k { s.dense[i].val = v |