Catch preprocessor errors in downsweep
authorDaniel Gröber <dxld@darkboxed.org>
Sat, 25 May 2019 11:57:45 +0000 (13:57 +0200)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Thu, 30 May 2019 20:44:08 +0000 (16:44 -0400)
commit99e7276982fe41dca0098e37a9cbf71091c3e275
tree92f37e76956e161696926ea65c32505f2f56244d
parent18d3f01d9abe2994b2b3d07b67ee9616c3553e16
Catch preprocessor errors in downsweep

This changes the way preprocessor failures are presented to the
user. Previously the user would simply get an unlocated message on stderr
such as:

    `gcc' failed in phase `C pre-processor'. (Exit code: 1)

Now at the problematic source file is mentioned:

    A.hs:1:1: error:
        `gcc' failed in phase `C pre-processor'. (Exit code: 1)

This also makes live easier for GHC API clients as the preprocessor error
is now thrown as a SourceError exception.
compiler/main/DriverPipeline.hs
compiler/main/GhcMake.hs
testsuite/tests/driver/T8602/T8602.stderr
testsuite/tests/ghc-api/downsweep/PartialDownsweep.darwin.stderr [new file with mode: 0644]
testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs
testsuite/tests/ghc-api/downsweep/PartialDownsweep.stderr
testsuite/tests/ghc-api/downsweep/all.T