X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FCoverage.lhs;h=f888d0589459d2fc5a4107d2c48a228c819bf9ef;hp=af9f002723f6c1427de0b03a3fe65a9f400c77d2;hb=d50e93cf95b68bf858be82025b56c9977335ed76;hpb=71e810db51fb7f874f11f561303bd0bcb5e6d3d0 diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs index af9f002..f888d05 100644 --- a/compiler/deSugar/Coverage.lhs +++ b/compiler/deSugar/Coverage.lhs @@ -567,11 +567,6 @@ mixCreate :: String -> String -> Mix -> IO () mixCreate dirName modName mix = writeFile (mixName dirName modName) (show mix) -readMix :: FilePath -> String -> IO Mix -readMix dirName modName = do - contents <- readFile (mixName dirName modName) - return (read contents) - mixName :: FilePath -> String -> String mixName dirName name = dirName ++ "/" ++ name ++ ".mix" @@ -586,21 +581,6 @@ data Tix = Tix [PixEntry] -- The number of tickboxes in each module type TixEntry = Integer --- always read and write Tix from the current working directory. - -readTix :: String -> IO (Maybe Tix) -readTix pname = - catch (do contents <- readFile $ tixName pname - return $ Just $ read contents) - (\ _ -> return $ Nothing) - -writeTix :: String -> Tix -> IO () -writeTix pname tix = - writeFile (tixName pname) (show tix) - -tixName :: String -> String -tixName name = name ++ ".tix" - -- a program index records module names and numbers of tick-boxes -- introduced in each module that has been transformed for coverage @@ -610,40 +590,6 @@ type PixEntry = ( String -- module name , Int -- number of boxes ) -pixUpdate :: FilePath -> String -> String -> Int -> IO () -pixUpdate dirName progName modName boxCount = do - fileUpdate (pixName dirName progName) pixAssign (Pix []) - where - pixAssign :: Pix -> Pix - pixAssign (Pix pes) = - Pix ((modName,boxCount) : filter ((/=) modName . fst) pes) - -readPix :: FilePath -> String -> IO Pix -readPix dirName pname = do - contents <- readFile (pixName dirName pname) - return (read contents) - -tickCount :: Pix -> Int -tickCount (Pix mp) = sum $ map snd mp - -pixName :: FilePath -> String -> String -pixName dirName name = dirName ++ "/" ++ name ++ ".pix" - --- updating a value stored in a file via read and show -fileUpdate :: (Read a, Show a) => String -> (a->a) -> a -> IO() -fileUpdate fname update init = - catch - (do - valueText <- readFile fname - ( case finite valueText of - True -> - writeFile fname (show (update (read valueText))) )) - (const (writeFile fname (show (update init)))) - -finite :: [a] -> Bool -finite [] = True -finite (x:xs) = finite xs - data HpcPos = P !Int !Int !Int !Int deriving (Eq) fromHpcPos :: HpcPos -> (Int,Int,Int,Int)