summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-25 20:06:19 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-03 06:26:54 -0400
commita485c3c4049fff09e989bfd7d2ba47035c92a69b (patch)
treeb1b87b24afa4b175ec4c74165d168783fcac7d32 /compiler/GHC/Cmm
parentf7597aa0c028ced898ac97e344754dd961b70c57 (diff)
downloadhaskell-a485c3c4049fff09e989bfd7d2ba47035c92a69b.tar.gz
Move blob handling into StgToCmm
Move handling of big literal strings from CmmToAsm to StgToCmm. It avoids the use of `sdocWithDynFlags` (cf #10143). We might need to move this handling even higher in the pipeline in the future (cf #17960): this patch will make it easier.
Diffstat (limited to 'compiler/GHC/Cmm')
-rw-r--r--compiler/GHC/Cmm/Ppr/Decl.hs1
-rw-r--r--compiler/GHC/Cmm/Utils.hs3
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Cmm/Ppr/Decl.hs b/compiler/GHC/Cmm/Ppr/Decl.hs
index 6bece6dca8..9190bf61be 100644
--- a/compiler/GHC/Cmm/Ppr/Decl.hs
+++ b/compiler/GHC/Cmm/Ppr/Decl.hs
@@ -155,6 +155,7 @@ pprStatic platform s = case s of
CmmStaticLit lit -> nest 4 $ text "const" <+> pprLit platform lit <> semi
CmmUninitialised i -> nest 4 $ text "I8" <> brackets (int i)
CmmString s' -> nest 4 $ text "I8[]" <+> text (show s')
+ CmmFileEmbed path -> nest 4 $ text "incbin " <+> text (show path)
-- --------------------------------------------------------------------------
-- data sections
diff --git a/compiler/GHC/Cmm/Utils.hs b/compiler/GHC/Cmm/Utils.hs
index 00600c2d67..0b0c848eb7 100644
--- a/compiler/GHC/Cmm/Utils.hs
+++ b/compiler/GHC/Cmm/Utils.hs
@@ -195,10 +195,9 @@ zeroExpr platform = CmmLit (zeroCLit platform)
mkWordCLit :: Platform -> Integer -> CmmLit
mkWordCLit platform wd = CmmInt wd (wordWidth platform)
+-- | We make a top-level decl for the string, and return a label pointing to it
mkByteStringCLit
:: CLabel -> ByteString -> (CmmLit, GenCmmDecl RawCmmStatics info stmt)
--- We have to make a top-level decl for the string,
--- and return a literal pointing to it
mkByteStringCLit lbl bytes
= (CmmLabel lbl, CmmData (Section sec lbl) $ RawCmmStatics lbl [CmmString bytes])
where