Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/ByteCode/Show.hs
    1
    +{-# LANGUAGE ImportQualifiedPost #-}
    
    1 2
     {-# LANGUAGE RecordWildCards #-}
    
    2 3
     {-# LANGUAGE ScopedTypeVariables #-}
    
    3 4
     
    
    ... ... @@ -15,7 +16,11 @@ import Data.String (String)
    15 16
     import Data.ByteString (ByteString, null, length, unpack)
    
    16 17
     import Numeric (showHex)
    
    17 18
     import System.IO (IO, FilePath)
    
    19
    +import GHC.Data.Strict qualified as Strict (maybe)
    
    20
    +import GHC.Data.FlatBag (FlatBag)
    
    18 21
     import GHC.Types.SrcLoc (noSrcSpan)
    
    22
    +import GHC.Types.Name (Name)
    
    23
    +import GHC.Types.SptEntry (SptEntry)
    
    19 24
     import GHC.Types.Error (MessageClass (MCDump))
    
    20 25
     import GHC.Utils.Logger (Logger, logMsg)
    
    21 26
     import GHC.Utils.Outputable
    
    ... ... @@ -30,10 +35,12 @@ import GHC.Utils.Outputable
    30 35
                withPprStyle,
    
    31 36
                ppr
    
    32 37
            )
    
    33
    -import GHC.ByteCode.Types (CompiledByteCode (..))
    
    38
    +import GHC.ByteCode.Types (UnlinkedBCO, ByteCodeHpcInfo, CompiledByteCode (..))
    
    39
    +import GHC.ByteCode.Breakpoints (InternalModBreaks)
    
    34 40
     import GHC.ByteCode.Binary (OnDiskModuleByteCode (..))
    
    35 41
     import GHC.ByteCode.Serialize (readOnDiskModuleByteCode)
    
    36 42
     import GHC.Driver.Env.Types (HscEnv)
    
    43
    +import GHCi.Message (ConInfoTable)
    
    37 44
     
    
    38 45
     -- | […]
    
    39 46
     showByteCode :: Logger -> HscEnv -> FilePath -> IO ()
    
    ... ... @@ -77,31 +84,31 @@ pprCompiledByteCode CompiledByteCode {..}
    77 84
               text "static-pointer table entries:"
    
    78 85
                   <+> pprStaticPointerTableEntries bc_spt_entries,
    
    79 86
               text "HPC information:"
    
    80
    -              <+> pprHPCInfo bc_hpc_info
    
    87
    +              <+> Strict.maybe (text "<none>") pprHPCInfo bc_hpc_info
    
    81 88
           ]
    
    82 89
     
    
    83 90
     -- | […]
    
    84
    -pprByteCodeObjects :: a -> SDoc
    
    91
    +pprByteCodeObjects :: FlatBag UnlinkedBCO -> SDoc
    
    85 92
     pprByteCodeObjects = pprByteCodeObjects
    
    86 93
     
    
    87 94
     -- | […]
    
    88
    -pprDataConstructorInfoTables :: a -> SDoc
    
    95
    +pprDataConstructorInfoTables :: [(Name, ConInfoTable)] -> SDoc
    
    89 96
     pprDataConstructorInfoTables = pprDataConstructorInfoTables
    
    90 97
     
    
    91 98
     -- | […]
    
    92
    -pprTopLevelStrings :: a -> SDoc
    
    99
    +pprTopLevelStrings :: [(Name, ByteString)] -> SDoc
    
    93 100
     pprTopLevelStrings = pprTopLevelStrings
    
    94 101
     
    
    95 102
     -- | […]
    
    96
    -pprInternalBreakPoints :: a -> SDoc
    
    103
    +pprInternalBreakPoints :: InternalModBreaks -> SDoc
    
    97 104
     pprInternalBreakPoints = pprInternalBreakPoints
    
    98 105
     
    
    99 106
     -- | […]
    
    100
    -pprStaticPointerTableEntries :: a -> SDoc
    
    107
    +pprStaticPointerTableEntries :: [SptEntry] -> SDoc
    
    101 108
     pprStaticPointerTableEntries = pprStaticPointerTableEntries
    
    102 109
     
    
    103 110
     -- | […]
    
    104
    -pprHPCInfo :: a -> SDoc
    
    111
    +pprHPCInfo :: ByteCodeHpcInfo -> SDoc
    
    105 112
     pprHPCInfo = pprHPCInfo
    
    106 113
     
    
    107 114
     -- | […]