[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] Add handling of HPC info
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC Commits: e95d51a5 by Wolfgang Jeltsch at 2026-06-06T15:33:00+03:00 Add handling of HPC info - - - - - 1 changed file: - compiler/GHC/ByteCode/Show.hs Changes: ===================================== compiler/GHC/ByteCode/Show.hs ===================================== @@ -64,7 +64,7 @@ import GHC.ByteCode.Types BCONPtr (..), BCOPtr (..), UnlinkedBCO (..), - ByteCodeHpcInfo, + ByteCodeHpcInfo (..), CompiledByteCode (..) ) import GHC.ByteCode.Breakpoints @@ -95,14 +95,14 @@ pprOnDiskModuleByteCode :: OnDiskModuleByteCode -> SDoc pprOnDiskModuleByteCode OnDiskModuleByteCode {..} = entry (text "module" <+> ppr odgbc_module) $ vcat [ - pprHash $ odgbc_hash, + pprOnDiskModuleByteCodeHash $ odgbc_hash, pprCompiledByteCode odgbc_module $ odgbc_compiled_byte_code, pprObjectFileContents $ odgbc_foreign ] -- | […] -pprHash :: Fingerprint -> SDoc -pprHash = entry (text "hash:") . ppr +pprOnDiskModuleByteCodeHash :: Fingerprint -> SDoc +pprOnDiskModuleByteCodeHash = entry (text "hash:") . ppr -- | […] pprCompiledByteCode :: Module -> CompiledByteCode -> SDoc @@ -473,7 +473,34 @@ pprHPCInfo = entry (text "HPC information:") . -- | […] pprHPCInfoData :: ByteCodeHpcInfo -> SDoc -pprHPCInfoData = pprHPCInfoData +pprHPCInfoData ByteCodeHpcInfo {..} + = vcat [ + pprHPCInfoHash $ bchi_hash, + pprModuleName $ bchi_module_name, + pprTickBoxName $ bchi_tickbox_name, + pprTickCount $ bchi_tick_count + ] + where + +-- | […] +pprHPCInfoHash :: Int -> SDoc +pprHPCInfoHash = entry (text "hash:") . pprFixedSizeNatural + +-- | […] +pprModuleName :: ShortByteString -> SDoc +pprModuleName = entry (text "module name:") . + text . + utf8DecodeShortByteString + +-- | […] +pprTickBoxName :: ShortByteString -> SDoc +pprTickBoxName = entry (text "tick box name:") . + text . + utf8DecodeShortByteString + +-- | […] +pprTickCount :: Int -> SDoc +pprTickCount = entry (text "number of ticks:") . ppr -- | […] pprObjectFileContents :: [ByteString] -> SDoc View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e95d51a5ec6e84e1ad251ff23315dbcb... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e95d51a5ec6e84e1ad251ff23315dbcb... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)