diff options
author | Peter Trommler <ptrommler@acm.org> | 2019-01-13 16:36:07 -0500 |
---|---|---|
committer | Peter Trommler <ptrommler@acm.org> | 2019-01-13 16:36:07 -0500 |
commit | 4ad9ffd3897924313fb509515c60b4f09429e5cf (patch) | |
tree | 1ccda69aad63a1f348369a88a1277f3649edf95e /compiler/nativeGen/PPC/Ppr.hs | |
parent | a34ee61545930d569d0dbafb3a4a5db3a7a711e5 (diff) | |
download | haskell-4ad9ffd3897924313fb509515c60b4f09429e5cf.tar.gz |
PPC NCG: Reduce memory consumption emitting string literals
Diffstat (limited to 'compiler/nativeGen/PPC/Ppr.hs')
-rw-r--r-- | compiler/nativeGen/PPC/Ppr.hs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index d7175b8689..6aafb595c6 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -125,12 +125,9 @@ pprDatas :: CmmStatics -> SDoc pprDatas (Statics lbl dats) = vcat (pprLabel lbl : map pprData dats) pprData :: CmmStatic -> SDoc -pprData (CmmString str) = pprASCII str -pprData (CmmUninitialised bytes) = keyword <> int bytes - where keyword = sdocWithPlatform $ \platform -> - case platformOS platform of - OSAIX -> text ".space " - _ -> text ".skip " +pprData (CmmString str) + = text "\t.string" <+> doubleQuotes (pprASCII str) +pprData (CmmUninitialised bytes) = text ".space " <> int bytes pprData (CmmStaticLit lit) = pprDataItem lit pprGloblDecl :: CLabel -> SDoc @@ -151,15 +148,6 @@ pprLabel lbl = pprGloblDecl lbl $$ pprTypeAndSizeDecl lbl $$ (ppr lbl <> char ':') - -pprASCII :: [Word8] -> SDoc -pprASCII str - = vcat (map do1 str) $$ do1 0 - where - do1 :: Word8 -> SDoc - do1 w = text "\t.byte\t" <> int (fromIntegral w) - - -- ----------------------------------------------------------------------------- -- pprInstr: print an 'Instr' |