summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorPhil Ruffwind <rf@rufflewind.com>2017-01-10 14:31:55 -0500
committerBen Gamari <ben@smart-cactus.org>2017-01-10 14:32:18 -0500
commit22845adcc51b40040b9d526c36d2d36edbb11dd7 (patch)
tree788ba7c72b24f4e3054066022be172557331bf0e /compiler/llvmGen
parent35a5b60390f2a400d06a2209eb03b7fd6ccffdab (diff)
downloadhaskell-22845adcc51b40040b9d526c36d2d36edbb11dd7.tar.gz
Fix terminal corruption bug and clean up SDoc interface.
- Fix #13076 by wrapping `printDoc_` so that the terminal color is reset even if an exception occurs. - Add `printSDoc`, `printSDocLn`, and `bufLeftRenderSDoc` to keep `SDoc` values abstract (they are wrappers of `printDoc_`, `printDoc`, and `bufLeftRender` respectively). - Remove unused function: `printForAsm` Test Plan: manual Reviewers: RyanGlScott, austin, dfeuer, bgamari Reviewed By: dfeuer, bgamari Subscribers: dfeuer, mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2932 GHC Trac Issues: #13076
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/Base.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index 824a8595fc..eb4a863e5a 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -46,7 +46,6 @@ import DynFlags
import FastString
import Cmm hiding ( succ )
import Outputable as Outp
-import qualified Pretty as Prt
import Platform
import UniqFM
import Unique
@@ -330,8 +329,8 @@ renderLlvm sdoc = do
-- Write to output
dflags <- getDynFlags
out <- getEnv envOutput
- let doc = Outp.withPprStyleDoc dflags (Outp.mkCodeStyle Outp.CStyle) sdoc
- liftIO $ Prt.bufLeftRender out doc
+ liftIO $ Outp.bufLeftRenderSDoc dflags out
+ (Outp.mkCodeStyle Outp.CStyle) sdoc
-- Dump, if requested
dumpIfSetLlvm Opt_D_dump_llvm "LLVM Code" sdoc