From: Simon Marlow Date: Wed, 27 Jan 2010 11:32:05 +0000 (+0000) Subject: addCoverageTicksToBinds: tolerate a non-existent .hs file (#3803) X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=eb8117f959ee0e109dbb8a9b500bcac2eb7871dc;p=ghc-hetmet.git addCoverageTicksToBinds: tolerate a non-existent .hs file (#3803) --- diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs index b161a21..52c0f04 100644 --- a/compiler/deSugar/Coverage.lhs +++ b/compiler/deSugar/Coverage.lhs @@ -52,12 +52,10 @@ addCoverageTicksToBinds -> LHsBinds Id -> IO (LHsBinds Id, HpcInfo, ModBreaks) -addCoverageTicksToBinds dflags mod mod_loc tyCons binds = do - - let orig_file = - case ml_hs_file mod_loc of - Just file -> file - Nothing -> panic "can not find the original file during hpc trans" +addCoverageTicksToBinds dflags mod mod_loc tyCons binds = + case ml_hs_file mod_loc of + Nothing -> return (binds, emptyHpcInfo False, emptyModBreaks) + Just orig_file -> do if "boot" `isSuffixOf` orig_file then return (binds, emptyHpcInfo False, emptyModBreaks) else do