[Git][ghc/ghc][master] 4 commits: Use ADTs for parser errors/warnings

Marge Bot gitlab at gitlab.haskell.org
Thu Oct 1 22:36:17 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
a5aaceec by Sylvain Henry at 2020-10-01T18:36:11-04:00
Use ADTs for parser errors/warnings

Haskell and Cmm parsers/lexers now report errors and warnings using ADTs
defined in GHC.Parser.Errors. They can be printed using functions in
GHC.Parser.Errors.Ppr.

Some of the errors provide hints with a separate ADT (e.g. to suggest to
turn on some extension). For now, however, hints are not consistent
across all messages. For example some errors contain the hints in the
main message. I didn't want to change any message with this patch. I
expect these changes to be discussed and implemented later.

Surprisingly, this patch enhances performance. On CI
(x86_64/deb9/hadrian, ghc/alloc):

   parsing001         -11.5%
   T13719             -2.7%
   MultiLayerModules  -3.5%
   Naperian           -3.1%

Bump haddock submodule

Metric Decrease:
    MultiLayerModules
    Naperian
    T13719
    parsing001

- - - - -
a946c7ef by Sylvain Henry at 2020-10-01T18:36:11-04:00
Less DynFlags in Header parsing

- - - - -
dafe7943 by Sylvain Henry at 2020-10-01T18:36:11-04:00
Parser: remove some unused imports

These are not reported by GHC because Happy adds {-# OPTIONS_GHC -w #-}

- - - - -
93d5de16 by Sylvain Henry at 2020-10-01T18:36:11-04:00
Don't import GHC.Unit to reduce the number of dependencies

- - - - -


30 changed files:

- compiler/GHC.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Monad.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Backpack/Syntax.hs
- compiler/GHC/Driver/Finder.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- + compiler/GHC/Parser/Errors.hs
- + compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- + compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Utils/Error.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dca1cb22cab4fa7f5937e9ffdc0ee32313dbd01c...93d5de165a81dfb335bf1646c2e29956f5ab55ea

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dca1cb22cab4fa7f5937e9ffdc0ee32313dbd01c...93d5de165a81dfb335bf1646c2e29956f5ab55ea
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201001/d415692c/attachment.html>


More information about the ghc-commits mailing list