[commit: ghc] master: Built-in Natural literals in Core (fe770c2)

git at git.haskell.org git at git.haskell.org
Fri Jun 15 21:01:19 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/fe770c211631e7b4c9b0b1e88ef9b6046c6585ef/ghc

>---------------------------------------------------------------

commit fe770c211631e7b4c9b0b1e88ef9b6046c6585ef
Author: Sylvain Henry <hsyl20 at gmail.com>
Date:   Fri Jun 15 16:23:53 2018 -0400

    Built-in Natural literals in Core
    
    Add support for built-in Natural literals in Core.
    
    - Replace MachInt,MachWord, LitInteger, etc. with a single LitNumber
      constructor with a LitNumType field
    - Support built-in Natural literals
    - Add desugar warning for negative literals
    - Move Maybe(..) from GHC.Base to GHC.Maybe for module dependency
      reasons
    
    This patch introduces only a few rules for Natural literals (compared
    to Integer's rules). Factorization of the built-in rules for numeric
    literals will be done in another patch as this one is already big to
    review.
    
    Test Plan:
      validate
      test build with integer-simple
    
    Reviewers: hvr, bgamari, goldfire, Bodigrim, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: phadej, simonpj, RyanGlScott, carter, hsyl20, rwbarton,
    thomie
    
    GHC Trac Issues: #14170, #14465
    
    Differential Revision: https://phabricator.haskell.org/D4212


>---------------------------------------------------------------

fe770c211631e7b4c9b0b1e88ef9b6046c6585ef
 compiler/basicTypes/Literal.hs                     | 409 ++++++-----
 compiler/codeGen/StgCmmCon.hs                      |   2 +-
 compiler/codeGen/StgCmmUtils.hs                    |  11 +-
 compiler/coreSyn/CorePrep.hs                       |  76 +-
 compiler/coreSyn/CoreUnfold.hs                     |   3 +-
 compiler/coreSyn/CoreUtils.hs                      |  19 +-
 compiler/coreSyn/MkCore.hs                         |  10 +-
 compiler/deSugar/MatchLit.hs                       |  86 ++-
 compiler/ghci/ByteCodeAsm.hs                       |  12 +-
 compiler/ghci/ByteCodeGen.hs                       |  42 +-
 compiler/iface/TcIface.hs                          |   8 +-
 compiler/main/TidyPgm.hs                           | 103 +--
 compiler/prelude/PrelNames.hs                      |  39 +-
 compiler/prelude/PrelRules.hs                      | 220 ++++--
 compiler/prelude/TysWiredIn.hs                     |   6 +-
 compiler/simplStg/UnariseStg.hs                    |  12 +-
 compiler/stgSyn/CoreToStg.hs                       |   7 +-
 libraries/base/Data/Bits.hs                        |  68 ++
 libraries/base/Data/Data.hs                        |   1 -
 libraries/base/GHC/Arr.hs                          |   9 +
 libraries/base/GHC/Base.hs                         |  28 +-
 libraries/base/GHC/Base.hs-boot                    |   5 +-
 libraries/base/GHC/Enum.hs                         |  73 ++
 libraries/base/GHC/Err.hs                          |   4 +-
 libraries/base/GHC/Exception.hs                    | 161 +----
 libraries/base/GHC/Exception.hs-boot               |  16 +-
 .../base/GHC/{Exception.hs => Exception/Type.hs}   |  91 +--
 libraries/base/GHC/Exception/Type.hs-boot          |  16 +
 libraries/base/GHC/Int.hs                          |  30 +
 libraries/base/GHC/Maybe.hs                        |  31 +
 libraries/base/GHC/Natural.hs                      | 764 ++++++++++-----------
 libraries/base/GHC/Num.hs                          |  43 +-
 libraries/base/GHC/Read.hs                         |  14 +
 libraries/base/GHC/Real.hs                         |  69 +-
 libraries/base/GHC/Show.hs                         |   7 +
 libraries/base/GHC/Stack/Types.hs                  |   1 +
 libraries/base/GHC/Word.hs                         |  30 +
 libraries/base/Unsafe/Coerce.hs                    |   1 +
 libraries/base/base.cabal                          |   2 +
 .../template-haskell/Language/Haskell/TH/Syntax.hs |   4 +-
 testsuite/tests/ado/T13242a.stderr                 |   4 +-
 testsuite/tests/generics/GenDerivOutput.stderr     |  16 +-
 testsuite/tests/generics/GenDerivOutput1_0.stderr  |   4 +-
 testsuite/tests/generics/GenDerivOutput1_1.stderr  |  32 +-
 .../tests/generics/T10604/T10604_deriving.stderr   |  40 +-
 .../tests/ghci.debugger/scripts/break006.stderr    |   4 +-
 .../tests/ghci.debugger/scripts/print019.stderr    |   2 +-
 testsuite/tests/ghci/scripts/Defer02.stderr        |   1 +
 testsuite/tests/ghci/scripts/T10963.stderr         |   2 +-
 testsuite/tests/ghci/scripts/T4175.stdout          |   6 +-
 .../tests/indexed-types/should_fail/T12522a.stderr |   2 +-
 testsuite/tests/numeric/should_compile/Makefile    |   8 +
 testsuite/tests/numeric/should_compile/T14170.hs   |  12 +
 .../tests/numeric/should_compile/T14170.stdout     |  59 ++
 testsuite/tests/numeric/should_compile/T14465.hs   |  26 +
 .../tests/numeric/should_compile/T14465.stderr     |   3 +
 .../tests/numeric/should_compile/T14465.stdout     | 104 +++
 testsuite/tests/numeric/should_compile/all.T       |   2 +
 .../should_fail/overloadedlistsfail01.stderr       |   3 +-
 .../tests/partial-sigs/should_fail/T10999.stderr   |   2 +-
 testsuite/tests/plugins/plugins09.stdout           |   1 +
 testsuite/tests/plugins/plugins11.stdout           |   1 +
 .../simplCore/should_compile/spec-inline.stderr    |   8 +-
 testsuite/tests/th/ClosedFam1TH.stderr             |   4 +-
 testsuite/tests/th/T14060.stdout                   |   4 +-
 testsuite/tests/th/T4135.stderr                    |   4 +-
 testsuite/tests/th/T5037.stderr                    |   6 +-
 testsuite/tests/th/T8953.stderr                    |   2 +-
 testsuite/tests/th/TH_RichKinds2.stderr            |   6 +-
 testsuite/tests/th/TH_reifyDecl2.stderr            |   4 +-
 testsuite/tests/th/TH_repGuard.stderr              |   4 +-
 .../tests/typecheck/should_compile/T14273.stderr   |   4 +-
 .../tests/typecheck/should_compile/holes2.stderr   |   2 +-
 .../should_compile/valid_hole_fits.stderr          |   8 +-
 .../tests/typecheck/should_fail/T14884.stderr      |   2 +-
 testsuite/tests/typecheck/should_fail/T5095.stderr |   2 +-
 .../tests/typecheck/should_fail/tcfail008.stderr   |  35 +-
 .../tests/typecheck/should_fail/tcfail072.stderr   |   4 +-
 .../tests/typecheck/should_fail/tcfail133.stderr   |   2 +-
 .../tests/typecheck/should_fail/tcfail182.stderr   |   3 +-
 80 files changed, 1764 insertions(+), 1207 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fe770c211631e7b4c9b0b1e88ef9b6046c6585ef


More information about the ghc-commits mailing list