[commit: ghc] master: CmmParse: Emit source notes for assignments (0c1f905)

git at git.haskell.org git at git.haskell.org
Mon Jul 3 22:58:49 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0c1f905aea4d5a9e2e329ba6b57d5a009635ce3d/ghc

>---------------------------------------------------------------

commit 0c1f905aea4d5a9e2e329ba6b57d5a009635ce3d
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Jul 3 17:15:23 2017 -0400

    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.


>---------------------------------------------------------------

0c1f905aea4d5a9e2e329ba6b57d5a009635ce3d
 compiler/cmm/CmmParse.y | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y
index 9d404aa..e2fe593 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



More information about the ghc-commits mailing list