[commit: ghc] ghc-8.2: CmmParse: Emit source notes for assignments (8ab6d12)

git at git.haskell.org git at git.haskell.org
Tue Jul 4 00:16:38 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/8ab6d12943f3547208abcfc1f9cf4d7e03a301ad/ghc

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

commit 8ab6d12943f3547208abcfc1f9cf4d7e03a301ad
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.
    
    (cherry picked from commit 0c1f905aea4d5a9e2e329ba6b57d5a009635ce3d)


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

8ab6d12943f3547208abcfc1f9cf4d7e03a301ad
 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 6992581..82f30e9 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