Fix terminal corruption bug and clean up SDoc interface.
authorPhil Ruffwind <rf@rufflewind.com>
Tue, 10 Jan 2017 19:31:55 +0000 (14:31 -0500)
committerBen Gamari <ben@smart-cactus.org>
Tue, 10 Jan 2017 19:32:18 +0000 (14:32 -0500)
commit22845adcc51b40040b9d526c36d2d36edbb11dd7
tree788ba7c72b24f4e3054066022be172557331bf0e
parent35a5b60390f2a400d06a2209eb03b7fd6ccffdab
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
compiler/llvmGen/LlvmCodeGen/Base.hs
compiler/main/DynFlags.hs
compiler/nativeGen/AsmCodeGen.hs
compiler/utils/Outputable.hs