From: simonmar Date: Thu, 16 Jun 2005 09:36:15 +0000 (+0000) Subject: [project @ 2005-06-16 09:36:15 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~426 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fb3a22d8d261e67742f92bf26861080ad9b774e9;hp=1172cf9f1b48a0f9ea13269af9395c5c0e13a175;p=ghc-hetmet.git [project @ 2005-06-16 09:36:15 by simonmar] Fix -optdep--exclude-module (looks like this has been broken for a while) --- diff --git a/ghc/compiler/main/DriverMkDepend.hs b/ghc/compiler/main/DriverMkDepend.hs index 36990cb..f161d64 100644 --- a/ghc/compiler/main/DriverMkDepend.hs +++ b/ghc/compiler/main/DriverMkDepend.hs @@ -71,7 +71,7 @@ doMkDependHS session srcs -- Prcess them one by one, dumping results into makefile -- and complaining about cycles - ; mapM (processDeps session (mkd_tmp_hdl files)) sorted + ; mapM (processDeps session excl_mods (mkd_tmp_hdl files)) sorted -- Tidy up ; endMkDependHS dflags files } @@ -150,6 +150,7 @@ beginMkDependHS dflags = do ----------------------------------------------------------------- processDeps :: Session + -> [Module] -> Handle -- Write dependencies to here -> SCC ModSummary -> IO () @@ -168,11 +169,11 @@ processDeps :: Session -- -- For {-# SOURCE #-} imports the "hi" will be "hi-boot". -processDeps session hdl (CyclicSCC nodes) +processDeps session excl_mods hdl (CyclicSCC nodes) = -- There shouldn't be any cycles; report them throwDyn (ProgramError (showSDoc $ GHC.cyclicModuleErr nodes)) -processDeps session hdl (AcyclicSCC node) +processDeps session excl_mods hdl (AcyclicSCC node) = do { extra_suffixes <- readIORef v_Dep_suffixes ; hsc_env <- GHC.sessionHscEnv session ; include_pkg_deps <- readIORef v_Dep_include_pkg_deps @@ -200,8 +201,14 @@ processDeps session hdl (AcyclicSCC node) ; writeDependency hdl obj_files src_file -- Emit a dependency for each import - ; mapM_ (do_imp True . unLoc) (ms_srcimps node) -- SOURCE imports - ; mapM_ (do_imp False . unLoc) (ms_imps node) -- regular imports + + -- SOURCE imports + ; mapM_ (do_imp True) + (filter (`notElem` excl_mods) (map unLoc (ms_srcimps node))) + + -- regular imports + ; mapM_ (do_imp False) + (filter (`notElem` excl_mods) (map unLoc (ms_imps node))) }