From: sof Date: Tue, 25 Aug 1998 11:56:10 +0000 (+0000) Subject: [project @ 1998-08-25 11:56:10 by sof] X-Git-Tag: Approx_2487_patches~285 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=64a906607f61efc8e31175bbafde463787eec402;p=ghc-hetmet.git [project @ 1998-08-25 11:56:10 by sof] dumpRealC: Don't drag around cost argument if we're not GranSim'ing (cf. new-rts fix) --- diff --git a/ghc/compiler/absCSyn/PprAbsC.lhs b/ghc/compiler/absCSyn/PprAbsC.lhs index e835dca..fe78a3d 100644 --- a/ghc/compiler/absCSyn/PprAbsC.lhs +++ b/ghc/compiler/absCSyn/PprAbsC.lhs @@ -31,7 +31,7 @@ import CLabel ( externallyVisibleCLabel, mkErrorStdEntryLabel, isReadOnly, needsCDecl, pprCLabel, CLabel{-instance Ord-} ) -import CmdLineOpts ( opt_SccProfilingOn, opt_EmitCExternDecls ) +import CmdLineOpts ( opt_SccProfilingOn, opt_EmitCExternDecls, opt_GranMacros ) import CostCentre ( uppCostCentre, uppCostCentreDecl ) import Costs ( costs, addrModeCosts, CostRes(..), Side(..) ) import CStrings ( stringToC ) @@ -69,7 +69,9 @@ writeRealC handle absC postlude = printForC handle (pprAbsC absC (costs absC) $$ postlude) dumpRealC :: AbstractC -> SDoc -> SDoc -dumpRealC absC postlude = pprCode CStyle (pprAbsC absC (costs absC) $$ postlude) +dumpRealC absC postlude + | opt_GranMacros = pprCode CStyle (pprAbsC absC (costs absC) $$ postlude) + | otherwise = pprCode CStyle (pprAbsC absC (panic "costs") $$ postlude) \end{code} This emits the macro, which is used in GrAnSim to compute the total costs