Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(52)

Issue 92880043: code review 92880043: go.tools/go.ssa: positions for ssa.Store

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by neelance
Modified:
9 years, 10 months ago
Reviewers:
CC:
golang-codereviews, gobot, adonovan, mail_richard-musiol.de
Visibility:
Public.

Description

go.tools/go.ssa: positions for ssa.Store I am doing some analysis on ssa.Store instructions and I need the positions of those for proper error reporting. However, the position is 0 if the ssa.Store was generated from an ast.AssignStmt without an ast.StarExpr (the common case). I first tried to pass the position through with several new pos parameters (as it is done for other instructions), but this quickly lead to a lot of changed lines. Then I saw that there is the currentBlock field in ssa.Function, which already is state information of the builder. That's why I decided to add the currentPosition field to pass the position from builder.stmt to the emitStore function. What do you think of this approach, since it is not consistent with how positions for other instructions are handled? EDIT: New version uses pos parameters as described by Alan.

Patch Set 1 #

Patch Set 2 : diff -r 4df3c625eb79 https://code.google.com/p/go.tools #

Patch Set 3 : diff -r 4df3c625eb79 https://code.google.com/p/go.tools #

Patch Set 4 : diff -r 8a11e1300048 https://code.google.com/p/go.tools #

Total comments: 4

Patch Set 5 : diff -r 8a11e1300048 https://code.google.com/p/go.tools #

Patch Set 6 : diff -r 8a11e1300048 https://code.google.com/p/go.tools #

Patch Set 7 : diff -r 8a11e1300048 https://code.google.com/p/go.tools #

Patch Set 8 : diff -r b8a3d1d592e7 https://code.google.com/p/go.tools #

Patch Set 9 : diff -r 72d7a3f16024 https://code.google.com/p/go.tools #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -35 lines) Patch
M go/ssa/builder.go View 18 chunks +24 lines, -21 lines 0 comments Download
M go/ssa/emit.go View 2 chunks +4 lines, -3 lines 0 comments Download
M go/ssa/lvalue.go View 1 chunk +5 lines, -6 lines 0 comments Download
M go/ssa/ssa.go View 2 chunks +9 lines, -3 lines 0 comments Download
M go/ssa/testmain.go View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12
neelance
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go.tools
10 years, 6 months ago (2014-04-30 12:43:40 UTC) #1
gobot
R=adonovan@google.com (assigned by crawshaw@golang.org)
10 years, 6 months ago (2014-05-07 14:16:49 UTC) #2
adonovan
On 2014/05/07 14:16:49, gobot wrote: > mailto:R=adonovan@google.com (assigned by mailto:crawshaw@golang.org) Hi Richard, Thanks for sending ...
10 years, 6 months ago (2014-05-07 14:51:06 UTC) #3
adonovan
Oh, I forgot you'll also need to provide the pos field each time you construct ...
10 years, 6 months ago (2014-05-07 16:42:58 UTC) #4
mail_richard-musiol.de
That's exactly why I was refraining from doing the larger change, because I did not ...
10 years, 6 months ago (2014-05-08 11:00:37 UTC) #5
neelance
Hi Alan, I finally took the time to implement the position for ssa.Store in the ...
10 years, 2 months ago (2014-08-24 15:24:51 UTC) #6
adonovan
On 2014/08/24 15:24:51, neelance wrote: > Hi Alan, > > I finally took the time ...
10 years, 2 months ago (2014-08-25 15:30:44 UTC) #7
neelance
On 2014/08/25 15:30:44, adonovan wrote: > On 2014/08/24 15:24:51, neelance wrote: > > Hi Alan, ...
10 years, 2 months ago (2014-08-25 15:38:06 UTC) #8
adonovan
Looks good. Could you change the documentation for ssa.Store to read: // Pos() returns the ...
10 years, 2 months ago (2014-08-25 16:23:38 UTC) #9
neelance
> https://codereview.appspot.com/92880043/diff/50001/go/ssa/builder.go#newcode1805 > go/ssa/builder.go:1805: k, v, loop, done = b.rangeIndexed(fn, x, tv, s.For) > Perhaps ...
10 years, 1 month ago (2014-09-18 22:57:03 UTC) #10
adonovan
On 2014/09/18 22:57:03, neelance wrote: > > > https://codereview.appspot.com/92880043/diff/50001/go/ssa/builder.go#newcode1805 > > go/ssa/builder.go:1805: k, v, loop, ...
10 years, 1 month ago (2014-09-19 17:01:14 UTC) #11
gobot
9 years, 10 months ago (2014-12-19 05:18:58 UTC) #12
R=close

To the author of this CL:

The Go project has moved to Gerrit Code Review.

If this CL should be continued, please see the latest version of
https://golang.org/doc/contribute.html for instructions on
how to set up Git and the Go project's Gerrit codereview plugin,
and then create a new change with your current code.

If there has been discussion on this CL, please give a link to it
(golang.org/cl/92880043 is best) in the description in your
new CL.

Thanks very much.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b