[commit: ghc] master: Pass DynFlags down to printForUser (df34ee6)

Ian Lynagh igloo at earth.li
Wed Jun 13 17:15:36 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/df34ee6d318aab836425ae86a78bda12245f4bd9

>---------------------------------------------------------------

commit df34ee6d318aab836425ae86a78bda12245f4bd9
Author: Ian Lynagh <igloo at earth.li>
Date:   Mon Jun 11 21:39:23 2012 +0100

    Pass DynFlags down to printForUser

>---------------------------------------------------------------

 compiler/rename/RnNames.lhs   |    3 ++-
 compiler/utils/Outputable.lhs |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs
index 69284db..22d7554 100644
--- a/compiler/rename/RnNames.lhs
+++ b/compiler/rename/RnNames.lhs
@@ -1392,9 +1392,10 @@ printMinimalImports :: [ImportDeclUsage] -> RnM ()
 printMinimalImports imports_w_usage
   = do { imports' <- mapM mk_minimal imports_w_usage
        ; this_mod <- getModule
+       ; dflags   <- getDynFlags
        ; liftIO $
          do { h <- openFile (mkFilename this_mod) WriteMode
-            ; printForUser h neverQualify (vcat (map ppr imports')) }
+            ; printForUser dflags h neverQualify (vcat (map ppr imports')) }
               -- The neverQualify is important.  We are printing Names
               -- but they are in the context of an 'import' decl, and
               -- we never qualify things inside there
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs
index 738b835..726e00c 100644
--- a/compiler/utils/Outputable.lhs
+++ b/compiler/utils/Outputable.lhs
@@ -328,8 +328,8 @@ hPrintDump _ h doc = do
  where
    better_doc = doc $$ blankLine
 
-printForUser :: Handle -> PrintUnqualified -> SDoc -> IO ()
-printForUser handle unqual doc
+printForUser :: DynFlags -> Handle -> PrintUnqualified -> SDoc -> IO ()
+printForUser _ handle unqual doc
   = Pretty.printDoc PageMode handle
       (runSDoc doc (initSDocContext (mkUserStyle unqual AllTheWay)))
 





More information about the Cvs-ghc mailing list