[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] Add treatment of `UnlinkedStaticCon`
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC Commits: f893ce2c by Wolfgang Jeltsch at 2026-06-04T11:29:05+03:00 Add treatment of `UnlinkedStaticCon` - - - - - 1 changed file: - compiler/GHC/ByteCode/Show.hs Changes: ===================================== compiler/GHC/ByteCode/Show.hs ===================================== @@ -11,7 +11,7 @@ import Control.Exception (assert) import Data.Eq ((==)) import Data.Bits (FiniteBits, finiteBitSize) import Data.Function (($), (.)) -import Data.Bool (otherwise) +import Data.Bool (Bool, otherwise) import Data.Int (Int) import Data.Word (Word, Word16) import Data.Maybe (Maybe, maybe) @@ -117,21 +117,13 @@ pprByteCodeObject currentModule byteCodeObject = case byteCodeObject of pprLiterals currentModule $ unlinkedBCOLits, pprPointers currentModule $ unlinkedBCOPtrs ] - UnlinkedStaticCon {{-..-}} - -> entry (text "static constructor object:") $ --FIXME: Remove colon and add name. + UnlinkedStaticCon {..} + -> entry (text "static constructor object" <+> ppr unlinkedStaticConName) $ vcat [ - {- - unlinkedStaticConName :: !Name, - -- ^ The name to which this static constructor is bound, not to be - -- confused with the name of the static constructor itself - -- ('unlinkedStaticConDataConName') - unlinkedStaticConDataConName :: !Name, - unlinkedStaticConLits :: !(FlatBag BCONPtr), - -- ^ non-ptrs full words, where sub-word literals have already been - -- packed into full words as needed - unlinkedStaticConPtrs :: !(FlatBag BCOPtr), -- ptrs - unlinkedStaticConIsUnlifted :: !Bool - -} + pprDataConstructorName $ unlinkedStaticConDataConName, + pprNoOrYes $ unlinkedStaticConIsUnlifted, + pprLiterals currentModule $ unlinkedStaticConLits, + pprPointers currentModule $ unlinkedStaticConPtrs ] -- | […] @@ -146,6 +138,10 @@ pprInstructions = entry (text "instructions:") . pprBCOByteArray pprBitmap :: BCOByteArray Word -> SDoc pprBitmap = entry (text "bitmap:") . pprBCOByteArray +-- | […] +pprDataConstructorName :: Name -> SDoc +pprDataConstructorName = entry (text "data constructor name:") . ppr + -- | […] pprLiterals :: Module -> FlatBag BCONPtr -> SDoc pprLiterals currentModule = entry (text "literals:") . @@ -290,6 +286,10 @@ pprFixedSizeNatural num unpadded :: String unpadded = showHex num "" +-- | […] +pprNoOrYes :: Bool -> SDoc +pprNoOrYes bool = text (if bool then "yes" else "no") + -- | […] entry :: SDoc -> SDoc -> SDoc entry title content = hang title 2 content View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f893ce2cf51274c58515305acf3f4d6c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f893ce2cf51274c58515305acf3f4d6c... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)