[commit: ghc] master: Ignore Tickish Breakpoints when serialising Core into interface files (d57f2ad)

git at git.haskell.org git at git.haskell.org
Fri Sep 20 15:52:12 CEST 2013


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

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

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

commit d57f2ad3048dc954053ccac51180097e837d8055
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Sep 20 14:46:13 2013 +0100

    Ignore Tickish Breakpoints when serialising Core into interface files
    
    This fixes Trac #8333
    
    Thanks to 'klao', who identified the cause and provided the patch


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

d57f2ad3048dc954053ccac51180097e837d8055
 compiler/iface/MkIface.lhs |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index 9143b29..8e1a165 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -1837,13 +1837,17 @@ toIfaceExpr (Case s x ty as)
   | otherwise               = IfaceCase (toIfaceExpr s) (getFS x) (map toIfaceAlt as)
 toIfaceExpr (Let b e)       = IfaceLet (toIfaceBind b) (toIfaceExpr e)
 toIfaceExpr (Cast e co)     = IfaceCast (toIfaceExpr e) (toIfaceCoercion co)
-toIfaceExpr (Tick t e)    = IfaceTick (toIfaceTickish t) (toIfaceExpr e)
+toIfaceExpr (Tick t e) 
+  | Just t' <- toIfaceTickish t = IfaceTick t' (toIfaceExpr e) 
+  | otherwise                   = toIfaceExpr e
 
 ---------------------
-toIfaceTickish :: Tickish Id -> IfaceTickish
-toIfaceTickish (ProfNote cc tick push) = IfaceSCC cc tick push
-toIfaceTickish (HpcTick modl ix)       = IfaceHpcTick modl ix
-toIfaceTickish _ = panic "toIfaceTickish"
+toIfaceTickish :: Tickish Id -> Maybe IfaceTickish
+toIfaceTickish (ProfNote cc tick push) = Just (IfaceSCC cc tick push)
+toIfaceTickish (HpcTick modl ix)       = Just (IfaceHpcTick modl ix)
+toIfaceTickish (Breakpoint {})         = Nothing 
+   -- Ignore breakpoints, since they are relevant only to GHCi, and 
+   -- should not be serialised (Trac #8333)
 
 ---------------------
 toIfaceBind :: Bind Id -> IfaceBinding




More information about the ghc-commits mailing list