Allow proper errors/warnings in core2core passes
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 5 Aug 2015 12:31:48 +0000 (13:31 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 5 Aug 2015 13:25:23 +0000 (14:25 +0100)
commite2b5738141d1f60858e53ed1edd7167b1a93800c
tree85ce804431207c0eef5faf3731def28d29dc35a2
parent575abf42e218925e456bf765abb14f069ac048a0
Allow proper errors/warnings in core2core passes

This patch makes it possible for core-to-core passes to emit
proper error messages and warnings.

  * New function CoreMonad.warnMsg

  * CoreMonad.warnMsg and errorMsg now print a proper warning/error
    message heading.

  * CoreMonad carries a SrcSpan, which is used in warning/error
    messages.  It is initialised to be the source file name, but
    a core-to-core pass could set it more specifically if it had
    better location information.

There was a bit of plumbing needed to get the filename to the
right place.
compiler/basicTypes/SrcLoc.hs
compiler/coreSyn/CoreLint.hs
compiler/deSugar/Desugar.hs
compiler/main/ErrUtils.hs
compiler/main/ErrUtils.hs-boot
compiler/main/HscMain.hs
compiler/main/HscTypes.hs
compiler/simplCore/CoreMonad.hs
compiler/simplCore/SimplCore.hs