summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgHpc.hs
diff options
context:
space:
mode:
authorandy@galois.com <unknown>2007-04-30 22:59:15 +0000
committerandy@galois.com <unknown>2007-04-30 22:59:15 +0000
commit55a5d8d90280a611bafb659bc80778d3927a6bff (patch)
treef6a7d65afdd524713e30dbe600fb9dfe89685d95 /compiler/codeGen/CgHpc.hs
parent182edd420fe8d5ec0d12fcabaec7d13416a77cd6 (diff)
downloadhaskell-55a5d8d90280a611bafb659bc80778d3927a6bff.tar.gz
Changing internal data structures used by Hpc
- .tix files are now a list of MixModule, which contain a hash of the contents of the .mix file. - .mix files now have (the same) hash number. This changes allow different binaries that use the same module compiled in the same way to share coverage information.
Diffstat (limited to 'compiler/codeGen/CgHpc.hs')
-rw-r--r--compiler/codeGen/CgHpc.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/codeGen/CgHpc.hs b/compiler/codeGen/CgHpc.hs
index d5f354216c..7bd7c03739 100644
--- a/compiler/codeGen/CgHpc.hs
+++ b/compiler/codeGen/CgHpc.hs
@@ -58,16 +58,16 @@ cgTickBox mod n = do
visible_tick = mkFastString "hs_hpc_tick"
hpcTable :: Module -> HpcInfo -> Code
-hpcTable this_mod hpc_tickCount = do
+hpcTable this_mod (HpcInfo hpc_tickCount _) = do
emitData ReadOnlyData
[ CmmDataLabel mkHpcModuleNameLabel
, CmmString $ map (fromIntegral . ord)
(module_name_str)
++ [0]
]
- emitData Data
+ emitData Data -- change Offset => Data or Info
[ CmmDataLabel (mkHpcModuleOffsetLabel this_mod)
- , CmmStaticLit (CmmInt 0 I32)
+ , CmmStaticLit (CmmInt 0 I32) -- stored offset?
]
emitData Data $ [ CmmDataLabel (mkHpcTicksLabel this_mod)
] ++
@@ -76,10 +76,10 @@ hpcTable this_mod hpc_tickCount = do
]
where
module_name_str = moduleNameString (Module.moduleName this_mod)
-
+hpcTable this_mod (NoHpcInfo) = error "TODO: impossible"
initHpc :: Module -> HpcInfo -> Code
-initHpc this_mod tickCount
+initHpc this_mod (HpcInfo tickCount hashNo)
= do { id <- newTemp wordRep
; emitForeignCall'
PlayRisky
@@ -90,6 +90,7 @@ initHpc this_mod tickCount
)
[ (mkLblExpr mkHpcModuleNameLabel,PtrHint)
, (CmmLit $ mkIntCLit tickCount,NoHint)
+ , (CmmLit $ mkIntCLit hashNo,NoHint)
, (CmmLit $ CmmLabel $ mkHpcTicksLabel $ this_mod,PtrHint)
]
(Just [])