X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FCoverage.lhs;h=af9f002723f6c1427de0b03a3fe65a9f400c77d2;hp=68bd17f520d1039e352b3c72623672d20c3e2e77;hb=8100cd4395e46ae747be4298c181a4730d6206bc;hpb=859001105a5cbb15959f04519911da86e597f2e1 diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs index 68bd17f..af9f002 100644 --- a/compiler/deSugar/Coverage.lhs +++ b/compiler/deSugar/Coverage.lhs @@ -58,11 +58,23 @@ import System.Directory ( createDirectoryIfMissing ) \begin{code} addCoverageTicksToBinds dflags mod mod_loc binds = do + { let orig_file = + case ml_hs_file mod_loc of + Just file -> file + Nothing -> error "can not find the original file during hpc trans" + + ; if "boot" `isSuffixOf` orig_file then return (binds, 0) + else addCoverageTicksToBinds2 dflags mod orig_file binds + } + +addCoverageTicksToBinds2 dflags mod orig_file binds = do let main_mod = mainModIs dflags main_is = case mainFunIs dflags of Nothing -> "main" Just main -> main + modTime <- getModificationTime' orig_file + let mod_name = moduleNameString (moduleName mod) let (binds1,st) @@ -78,12 +90,6 @@ addCoverageTicksToBinds dflags mod mod_loc binds = do -- write the mix entries for this module let tabStop = 1 -- counts as a normal char in GHC's location ranges. - let orig_file = case ml_hs_file mod_loc of - Just file -> file - Nothing -> error "can not find the original file during hpc trans" - - modTime <- getModificationTime' orig_file - createDirectoryIfMissing True hpc_dir mixCreate hpc_dir mod_name (Mix orig_file modTime tabStop $ reverse $ mixEntries st)