[commit: ghc] master: Pass DynFlags down to printForC and printForAsm (630379c)
Ian Lynagh
igloo at earth.li
Wed Jun 13 17:15:41 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/630379c162876c184a88f73f7948de806374a1f8
>---------------------------------------------------------------
commit 630379c162876c184a88f73f7948de806374a1f8
Author: Ian Lynagh <igloo at earth.li>
Date: Mon Jun 11 21:47:07 2012 +0100
Pass DynFlags down to printForC and printForAsm
>---------------------------------------------------------------
compiler/cmm/PprC.hs | 2 +-
compiler/cmm/PprCmmDecl.hs | 6 ++++--
compiler/utils/Outputable.lhs | 8 ++++----
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
index 39d5a84..bd7b353 100644
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -71,7 +71,7 @@ pprCs dflags cmms
writeCs :: DynFlags -> Handle -> [RawCmmGroup] -> IO ()
writeCs dflags handle cmms
- = printForC handle (pprCs dflags cmms)
+ = printForC dflags handle (pprCs dflags cmms)
-- --------------------------------------------------------------------------
-- Now do some real work
diff --git a/compiler/cmm/PprCmmDecl.hs b/compiler/cmm/PprCmmDecl.hs
index 1143d9b..5c1c6f0 100644
--- a/compiler/cmm/PprCmmDecl.hs
+++ b/compiler/cmm/PprCmmDecl.hs
@@ -48,6 +48,7 @@ import CLabel
import PprCmmExpr
import Cmm
+import DynFlags
import Outputable
import Platform
import FastString
@@ -67,8 +68,9 @@ pprCmms platform cmms = pprCode CStyle (vcat (intersperse separator $ map (pprPl
separator = space $$ ptext (sLit "-------------------") $$ space
writeCmms :: (PlatformOutputable info, PlatformOutputable g)
- => Platform -> Handle -> [GenCmmGroup CmmStatics info g] -> IO ()
-writeCmms platform handle cmms = printForC handle (pprCmms platform cmms)
+ => DynFlags -> Handle -> [GenCmmGroup CmmStatics info g] -> IO ()
+writeCmms dflags handle cmms = printForC dflags handle (pprCmms platform cmms)
+ where platform = targetPlatform dflags
-----------------------------------------------------------------------------
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs
index dffb26f..e9cfaec 100644
--- a/compiler/utils/Outputable.lhs
+++ b/compiler/utils/Outputable.lhs
@@ -340,13 +340,13 @@ printForUserPartWay _ handle d unqual doc
(runSDoc doc (initSDocContext (mkUserStyle unqual (PartWay d))))
-- printForC, printForAsm do what they sound like
-printForC :: Handle -> SDoc -> IO ()
-printForC handle doc =
+printForC :: DynFlags -> Handle -> SDoc -> IO ()
+printForC _ handle doc =
Pretty.printDoc LeftMode handle
(runSDoc doc (initSDocContext (PprCode CStyle)))
-printForAsm :: Handle -> SDoc -> IO ()
-printForAsm handle doc =
+printForAsm :: DynFlags -> Handle -> SDoc -> IO ()
+printForAsm _ handle doc =
Pretty.printDoc LeftMode handle
(runSDoc doc (initSDocContext (PprCode AsmStyle)))
More information about the Cvs-ghc
mailing list