summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-08-22 12:09:24 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2019-08-23 12:04:15 +0300
commita8300520a714fa5e46e342e10175d237d89221c5 (patch)
tree90823e8854bebb6288a94e36613f8c022336a367 /compiler/cmm
parentc3e26ab3bd450a2ad17cc80b41dda084558039a2 (diff)
downloadhaskell-a8300520a714fa5e46e342e10175d237d89221c5.tar.gz
Make non-streaming LLVM and C backends streaming
This adds a Stream.consume function, uses it in LLVM and C code generators, and removes the use of Stream.collect function which was used to collect streaming Cmm generation results into a list. LLVM and C backends now properly use streamed Cmm generation, instead of collecting Cmm groups into a list before generating LLVM/C code.
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/PprC.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
index d412969ca7..506116c584 100644
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -19,8 +19,7 @@
-----------------------------------------------------------------------------
module PprC (
- writeCs,
- pprStringInCStyle
+ writeC
) where
#include "HsVersions.h"
@@ -68,13 +67,8 @@ import Data.Array.ST
-- --------------------------------------------------------------------------
-- Top level
-pprCs :: [RawCmmGroup] -> SDoc
-pprCs cmms
- = pprCode CStyle (vcat $ map pprC cmms)
-
-writeCs :: DynFlags -> Handle -> [RawCmmGroup] -> IO ()
-writeCs dflags handle cmms
- = printForC dflags handle (pprCs cmms)
+writeC :: DynFlags -> Handle -> RawCmmGroup -> IO ()
+writeC dflags handle cmm = printForC dflags handle (pprC cmm $$ blankLine)
-- --------------------------------------------------------------------------
-- Now do some real work