X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FDriverMkDepend.hs;h=95587cd6c1cb6da086fb2491a3c569ce187f8abb;hp=aad9b8a574a35c5695236cdaeb30f078339679d2;hb=ca360a5558674e11ccab38017a1544bbb99422d0;hpb=7eb5e29b4a7b6fef55512bc7bf3308e712ca3eba diff --git a/compiler/main/DriverMkDepend.hs b/compiler/main/DriverMkDepend.hs index aad9b8a..95587cd 100644 --- a/compiler/main/DriverMkDepend.hs +++ b/compiler/main/DriverMkDepend.hs @@ -22,7 +22,7 @@ module DriverMkDepend ( import qualified GHC import GHC ( Session, ModSummary(..) ) import DynFlags -import Util ( escapeSpaces ) +import Util import HscTypes ( HscEnv, IsBootInterface, msObjFilePath, msHsFilePath ) import SysTools ( newTempName ) import qualified SysTools @@ -35,6 +35,7 @@ import Panic import SrcLoc import Data.List import CmdLineParser +import FastString import ErrUtils ( debugTraceMsg, putMsg ) @@ -248,10 +249,10 @@ findDependency hsc_env src imp is_boot include_pkg_deps ----------------------------- writeDependency :: Handle -> [FilePath] -> FilePath -> IO () -- (writeDependency h [t1,t2] dep) writes to handle h the dependency --- t1 t2 : dep +-- t1 t2 : dep writeDependency hdl targets dep - = hPutStrLn hdl (unwords (map escapeSpaces targets) ++ " : " - ++ escapeSpaces dep) + = hPutStrLn hdl (unwords (map forOutput targets) ++ " : " ++ forOutput dep) + where forOutput = escapeSpaces . reslash Forwards . normalise ----------------------------- insertSuffixes @@ -275,7 +276,9 @@ insertSuffixes insertSuffixes file_name extras = file_name : [ basename <.> (extra ++ "_" ++ suffix) | extra <- extras ] where - (basename, suffix) = splitExtension file_name + (basename, suffix) = case splitExtension file_name of + -- Drop the "." from the extension + (b, s) -> (b, drop 1 s) ----------------------------------------------------------------- @@ -330,16 +333,16 @@ dumpModCycles dflags mod_summaries = return () | null cycles - = putMsg dflags (ptext SLIT("No module cycles")) + = putMsg dflags (ptext (sLit "No module cycles")) | otherwise - = putMsg dflags (hang (ptext SLIT("Module cycles found:")) 2 pp_cycles) + = putMsg dflags (hang (ptext (sLit "Module cycles found:")) 2 pp_cycles) where cycles :: [[ModSummary]] cycles = [ c | CyclicSCC c <- GHC.topSortModuleGraph True mod_summaries Nothing ] - pp_cycles = vcat [ (ptext SLIT("---------- Cycle") <+> int n <+> ptext SLIT("----------")) + pp_cycles = vcat [ (ptext (sLit "---------- Cycle") <+> int n <+> ptext (sLit "----------")) $$ pprCycle c $$ text "" | (n,c) <- [1..] `zip` cycles ] @@ -369,7 +372,7 @@ pprCycle summaries = pp_group (CyclicSCC summaries) pp_ms summary = text mod_str <> text (take (20 - length mod_str) (repeat ' ')) <+> (pp_imps empty (ms_imps summary) $$ - pp_imps (ptext SLIT("{-# SOURCE #-}")) (ms_srcimps summary)) + pp_imps (ptext (sLit "{-# SOURCE #-}")) (ms_srcimps summary)) where mod_str = moduleNameString (moduleName (ms_mod summary)) @@ -378,7 +381,7 @@ pprCycle summaries = pp_group (CyclicSCC summaries) pp_imps what lms = case [m | L _ m <- lms, m `elem` cycle_mods] of [] -> empty - ms -> what <+> ptext SLIT("imports") <+> + ms -> what <+> ptext (sLit "imports") <+> pprWithCommas ppr ms -----------------------------------------------------------------