[commit: ghc] master: Strip source ticks from iface code if DWARF is disabled (a0895fc)

git at git.haskell.org git at git.haskell.org
Tue Dec 16 21:02:17 UTC 2014


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

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

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

commit a0895fcb8c47949aac2c5e4a509d69de57582e76
Author: Peter Wortmann <scpmw at leeds.ac.uk>
Date:   Tue Oct 22 16:05:16 2013 +0100

    Strip source ticks from iface code if DWARF is disabled
    
    They would be unneeded at minimum. Not completely sure this is the right
    place to do this.
    
    (From Phabricator D169)


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

a0895fcb8c47949aac2c5e4a509d69de57582e76
 compiler/iface/TcIface.hs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs
index 96e72df..cf0dc5b 100644
--- a/compiler/iface/TcIface.hs
+++ b/compiler/iface/TcIface.hs
@@ -1009,8 +1009,14 @@ tcIfaceExpr (IfaceLet (IfaceRec pairs) body)
 
 tcIfaceExpr (IfaceTick tickish expr) = do
     expr' <- tcIfaceExpr expr
-    tickish' <- tcIfaceTickish tickish
-    return (Tick tickish' expr')
+    -- If debug flag is not set: Ignore source notes
+    dbgFlag <- fmap (gopt Opt_Debug) getDynFlags
+    case tickish of
+      IfaceSource{} | not dbgFlag
+                    -> return expr'
+      _otherwise    -> do
+        tickish' <- tcIfaceTickish tickish
+        return (Tick tickish' expr')
 
 -------------------------
 tcIfaceApps :: IfaceExpr -> IfaceExpr -> IfL CoreExpr



More information about the ghc-commits mailing list