[project @ 1998-08-25 11:56:10 by sof]
authorsof <unknown>
Tue, 25 Aug 1998 11:56:10 +0000 (11:56 +0000)
committersof <unknown>
Tue, 25 Aug 1998 11:56:10 +0000 (11:56 +0000)
dumpRealC: Don't drag around cost argument if we're not GranSim'ing (cf. new-rts fix)

ghc/compiler/absCSyn/PprAbsC.lhs

index e835dca..fe78a3d 100644 (file)
@@ -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