summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs/Dump.hs
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2023-05-04 05:30:13 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-16 14:00:00 -0400
commit90e69d5d167b9d6cd63b04e42f8af375dc4b307f (patch)
tree8ce2679872dbc4c4a5cc60025fe9564d36fc7772 /compiler/GHC/Hs/Dump.hs
parent5e3f9bb57680a40f6a9531e41dc2617c5f028e5c (diff)
downloadhaskell-90e69d5d167b9d6cd63b04e42f8af375dc4b307f.tar.gz
compiler: Use compact representation for SourceText
SourceText is serialized along with INLINE pragmas into interface files. Many of these SourceTexts are identical, for example "{-# INLINE#". When deserialized, each such SourceText was previously expanded out into a [Char], which is highly wasteful of memory, and each such instance of the text would allocate an independent list with its contents as deserializing breaks any sharing that might have existed. Instead, we use a `FastString` to represent these, so that each instance unique text will be interned and stored in a memory efficient manner.
Diffstat (limited to 'compiler/GHC/Hs/Dump.hs')
-rw-r--r--compiler/GHC/Hs/Dump.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Hs/Dump.hs b/compiler/GHC/Hs/Dump.hs
index 794607bd49..245a1cd43e 100644
--- a/compiler/GHC/Hs/Dump.hs
+++ b/compiler/GHC/Hs/Dump.hs
@@ -139,8 +139,8 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
sourceText :: SourceText -> SDoc
sourceText NoSourceText = parens $ text "NoSourceText"
sourceText (SourceText src) = case bs of
- NoBlankSrcSpan -> parens $ text "SourceText" <+> text src
- BlankSrcSpanFile -> parens $ text "SourceText" <+> text src
+ NoBlankSrcSpan -> parens $ text "SourceText" <+> ftext src
+ BlankSrcSpanFile -> parens $ text "SourceText" <+> ftext src
_ -> parens $ text "SourceText" <+> text "blanked"
epaAnchor :: EpaLocation -> SDoc