Descriptiongo.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 #
MessagesTotal messages: 12
|