Simplify -ddump-json implementation
authorMatthew Pickering <matthewtpickering@gmail.com>
Sun, 13 May 2018 15:39:34 +0000 (11:39 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 13 May 2018 22:30:43 +0000 (18:30 -0400)
commit6ab7cf995dafcc9196e87bbde76b4f6937507592
tree499b36d722e3caa22b07fcc73f2138fd37f8b033
parent00049e2dce93b1e468c3fde3287371eb988aafdc
Simplify -ddump-json implementation

This patch takes the much simpler route of whenever the compiler tries
to output something. We just dump a JSON document there and then.

I think this should be sufficient to work with and anything more refined
quickly got complicated as it was necessary to demarcate message scopes
and so on.

Reviewers: bgamari, dfeuer

Reviewed By: bgamari

Subscribers: Phyx, dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #14078

Differential Revision: https://phabricator.haskell.org/D4532
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/GHC.hs
testsuite/tests/driver/json.stderr
testsuite/tests/driver/json2.stderr