diff options
| author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-09-17 08:09:36 +0100 |
|---|---|---|
| committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-09-17 08:09:36 +0100 |
| commit | 8c3b9aca3aaf946a91c9af6c07fc9d2afb6bbb76 (patch) | |
| tree | 4cad3f73dbb84bbda3b0b7141c5bde2afd359664 /compiler/codeGen/CgProf.hs | |
| parent | 7b8a17ad3c0792f06ffa991e9e587f5458610a3c (diff) | |
| parent | b0f4c44ed777af599daf35035b0830b35e57fa4a (diff) | |
| download | haskell-8c3b9aca3aaf946a91c9af6c07fc9d2afb6bbb76.tar.gz | |
Merge branch 'master' of http://darcs.haskell.org/ghc
Diffstat (limited to 'compiler/codeGen/CgProf.hs')
| -rw-r--r-- | compiler/codeGen/CgProf.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/codeGen/CgProf.hs b/compiler/codeGen/CgProf.hs index 19376b95ca..6d87ee7127 100644 --- a/compiler/codeGen/CgProf.hs +++ b/compiler/codeGen/CgProf.hs @@ -45,7 +45,6 @@ import CostCentre import DynFlags import FastString import Module -import Constants -- Lots of field offsets import Outputable import Data.Char @@ -203,7 +202,9 @@ emitCostCentreStackDecl ccs -- pad out the struct with zero words until we hit the -- size of the overall struct (which we get via DerivedConstants.h) -- - lits = zero dflags : mkCCostCentre cc : replicate (sizeof_ccs_words - 2) (zero dflags) + lits = zero dflags + : mkCCostCentre cc + : replicate (sizeof_ccs_words dflags - 2) (zero dflags) ; emitDataLits (mkCCSLabel ccs) lits } | otherwise = pprPanic "emitCostCentreStackDecl" (ppr ccs) @@ -213,13 +214,13 @@ zero dflags = mkIntCLit dflags 0 zero64 :: CmmLit zero64 = CmmInt 0 W64 -sizeof_ccs_words :: Int -sizeof_ccs_words +sizeof_ccs_words :: DynFlags -> Int +sizeof_ccs_words dflags -- round up to the next word. | ms == 0 = ws | otherwise = ws + 1 where - (ws,ms) = SIZEOF_CostCentreStack `divMod` wORD_SIZE + (ws,ms) = SIZEOF_CostCentreStack `divMod` wORD_SIZE dflags -- --------------------------------------------------------------------------- -- Set the current cost centre stack @@ -284,8 +285,8 @@ ldvRecordCreate closure = do dflags <- getDynFlags ldvEnterClosure :: ClosureInfo -> Code ldvEnterClosure closure_info = do dflags <- getDynFlags + let tag = funTag dflags closure_info ldvEnter (cmmOffsetB dflags (CmmReg nodeReg) (-tag)) - where tag = funTag closure_info -- don't forget to substract node's tag ldvEnter :: CmmExpr -> Code |
