diff options
author | Ian Lynagh <igloo@earth.li> | 2011-12-02 22:30:58 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-12-02 22:30:58 +0000 |
commit | 4fb390370051439c89958be96308d6d0577ff864 (patch) | |
tree | 57a858398e4702dee497319b0053be47422c43a1 /compiler/codeGen | |
parent | 9fd5a2ca9b5dda5b45af57cea7c8dc6f3dab422d (diff) | |
parent | 1469f1eb7817fbc46b17e994498450a9a6b12ea7 (diff) | |
download | haskell-4fb390370051439c89958be96308d6d0577ff864.tar.gz |
Merge branch 'master' of http://darcs.haskell.org/ghc
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/CgProf.hs | 6 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmProf.hs | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/compiler/codeGen/CgProf.hs b/compiler/codeGen/CgProf.hs index cac33eef90..a2e40d0f78 100644 --- a/compiler/codeGen/CgProf.hs +++ b/compiler/codeGen/CgProf.hs @@ -170,11 +170,15 @@ emitCostCentreDecl cc = do -- All cost centres will be in the main package, since we -- don't normally use -auto-all or add SCCs to other packages. -- Hence don't emit the package name in the module here. + ; loc <- newByteStringCLit $ bytesFS $ mkFastString $ + showSDoc (ppr (costCentreSrcSpan cc)) + -- XXX going via FastString to get UTF-8 encoding is silly ; let lits = [ zero, -- StgInt ccID, label, -- char *label, modl, -- char *module, - zero, -- StgWord time_ticks + loc, -- char *srcloc, + zero, -- StgWord time_ticks zero64, -- StgWord64 mem_alloc is_caf, -- StgInt is_caf zero -- struct _CostCentre *link diff --git a/compiler/codeGen/StgCmmProf.hs b/compiler/codeGen/StgCmmProf.hs index 115ef1f45e..88031dce48 100644 --- a/compiler/codeGen/StgCmmProf.hs +++ b/compiler/codeGen/StgCmmProf.hs @@ -58,6 +58,7 @@ import Constants -- Lots of field offsets import Outputable import Control.Monad +import Data.Char (ord) ----------------------------------------------------------------------------- -- @@ -217,18 +218,25 @@ emitCostCentreDecl cc = do ; modl <- newByteStringCLit (bytesFS $ Module.moduleNameFS $ Module.moduleName $ cc_mod cc) + ; loc <- newStringCLit (showSDoc (ppr (costCentreSrcSpan cc))) + -- XXX should UTF-8 encode -- All cost centres will be in the main package, since we -- don't normally use -auto-all or add SCCs to other packages. -- Hence don't emit the package name in the module here. ; let lits = [ zero, -- StgInt ccID, label, -- char *label, - modl, -- char *module, - zero, -- StgWord time_ticks + modl, -- char *module, + loc, -- char *srcloc, + zero, -- StgWord time_ticks zero64, -- StgWord64 mem_alloc + is_caf, -- StgInt is_caf zero -- struct _CostCentre *link ] ; emitDataLits (mkCCLabel cc) lits } + where + is_caf | isCafCC cc = mkIntCLit (ord 'c') -- 'c' == is a CAF + | otherwise = zero emitCostCentreStackDecl :: CostCentreStack -> FCode () emitCostCentreStackDecl ccs |