, CmmLit (CmmInt 1 I64)
])
]
- let ext_tick_box = CmmLit $ CmmLabel $ mkHpcModuleOffsetLabel $ mod
-
- whenC (opt_Hpc_Tracer) $ do
- emitForeignCall'
- PlayRisky -- ??
- []
- (CmmForeignCall
- (CmmLit $ CmmLabel $ mkForeignLabel visible_tick Nothing False)
- CCallConv
- )
- [ (CmmMachOp (MO_Add I32)
- [ CmmLoad ext_tick_box I32
- , CmmLit (CmmInt (fromIntegral n) I32)
- ]
- , NoHint) ]
- (Just [])
where
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
- [ CmmDataLabel (mkHpcModuleOffsetLabel this_mod)
- , CmmStaticLit (CmmInt 0 I32)
- ]
emitData Data $ [ CmmDataLabel (mkHpcTicksLabel this_mod)
] ++
[ CmmStaticLit (CmmInt 0 I64)
]
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
)
[ (mkLblExpr mkHpcModuleNameLabel,PtrHint)
, (CmmLit $ mkIntCLit tickCount,NoHint)
+ , (CmmLit $ mkIntCLit hashNo,NoHint)
, (CmmLit $ CmmLabel $ mkHpcTicksLabel $ this_mod,PtrHint)
]
(Just [])
- ; let ext_tick_box = CmmLit $ CmmLabel $ mkHpcModuleOffsetLabel $ this_mod
- ; stmtsC [ CmmStore ext_tick_box (CmmReg id) ]
}
where
mod_alloc = mkFastString "hs_hpc_module"