diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-07-03 17:15:23 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-07-03 18:58:11 -0400 |
commit | 0c1f905aea4d5a9e2e329ba6b57d5a009635ce3d (patch) | |
tree | 31db46f80b06045502436a0707ecb556cd48c7a3 | |
parent | d55bea14c745f7f448fb24673a21b511d1c1c222 (diff) | |
download | haskell-0c1f905aea4d5a9e2e329ba6b57d5a009635ce3d.tar.gz |
CmmParse: Emit source notes for assignments
Currently the line information for bare source C-- is rather spartan. These add
notes for assignments, which tend to be useful to identify. Unfortunately, we
had to settle for approximate source locations as none of the parsers in
CmmParse return located things. However, I don't think it's worth changing this.
-rw-r--r-- | compiler/cmm/CmmParse.y | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 9d404aae6b..e2fe593b5d 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -593,9 +593,9 @@ stmt :: { CmmParse () } | lreg '=' expr ';' - { do reg <- $1; e <- $3; emitAssign reg e } + { do reg <- $1; e <- $3; withSourceNote $2 $4 (emitAssign reg e) } | type '[' expr ']' '=' expr ';' - { doStore $1 $3 $6 } + { withSourceNote $2 $7 (doStore $1 $3 $6) } -- Gah! We really want to say "foreign_results" but that causes -- a shift/reduce conflict with assignment. We either |