[project @ 2005-01-28 12:55:17 by simonmar]
[ghc-hetmet.git] / ghc / compiler / codeGen / CgProf.hs
index 30f801d..5177072 100644 (file)
@@ -24,8 +24,6 @@ module CgProf (
   ) where
 
 #include "HsVersions.h"
-#include "../includes/ghcconfig.h"
-       -- Needed by Constants.h
 #include "../includes/Constants.h"
        -- For LDV_CREATE_MASK, LDV_STATE_USE
        -- which are StgWords
@@ -43,7 +41,7 @@ import MachOp
 import CmmUtils                ( zeroCLit, mkIntCLit, mkLblExpr )
 import CLabel          ( mkCCLabel, mkCCSLabel, mkRtsDataLabel )
 
-import Module          ( moduleNameUserString )
+import Module          ( moduleUserString )
 import Id              ( Id )
 import CostCentre
 import StgSyn          ( GenStgExpr(..), StgExpr )
@@ -291,7 +289,7 @@ emitCostCentreDecl
    -> Code
 emitCostCentreDecl cc = do 
   { label <- mkStringCLit (costCentreUserName cc)
-  ; modl  <- mkStringCLit (moduleNameUserString (cc_mod cc))
+  ; modl  <- mkStringCLit (moduleUserString (cc_mod cc))
   ; let
      lits = [ zero,    -- StgInt ccID,
              label,    -- char *label,
@@ -389,9 +387,9 @@ emitSetCCC :: CostCentre -> Code
 emitSetCCC cc
   | not opt_SccProfilingOn = nopC
   | otherwise = do 
-    ASSERTM(sccAbleCostCentre cc)
     tmp <- newTemp wordRep
-    pushCostCentre tmp curCCS cc
+    ASSERT( sccAbleCostCentre cc )
+      pushCostCentre tmp curCCS cc
     stmtC (CmmStore curCCSAddr (CmmReg tmp))
     when (isSccCountCostCentre cc) $ 
        stmtC (bumpSccCount curCCS)
@@ -457,7 +455,8 @@ ldvEnter cl_ptr
                 (cmmOrWord loadEra (CmmLit (mkWordCLit lDV_STATE_USE)))
 
 loadEra :: CmmExpr 
-loadEra = CmmLoad (mkLblExpr (mkRtsDataLabel SLIT("era"))) cIntRep
+loadEra = CmmMachOp (MO_U_Conv cIntRep wordRep)
+         [CmmLoad (mkLblExpr (mkRtsDataLabel SLIT("era"))) cIntRep]
 
 ldvWord :: CmmExpr -> CmmExpr
 -- Takes the address of a closure, and returns