1. 15 Dec, 2017 1 commit
    • Simon Peyton Jones's avatar
      Fix tcDataKindSig · 68149452
      Simon Peyton Jones authored
      This patch fixes an outright bug in tcDataKindSig, shown up in Trac
      of a data type declaration.  See Note [TyConBinders for the result kind
      signature of a data type]
      
      I also took the opportunity to elminate the DataKindCheck argument
      and data type from tcDataKindSig, instead moving the check to the
      call site, which is easier to understand.
      68149452
  2. 14 Dec, 2017 7 commits
  3. 13 Dec, 2017 7 commits
    • Gabor Greif's avatar
      Typofix in comment · 6eb32579
      Gabor Greif authored
      6eb32579
    • Simon Peyton Jones's avatar
      Further improvements to well-kinded types · 0a12d92a
      Simon Peyton Jones authored
      The typechecker has the invariant that every type should be well-kinded
      as it stands, without zonking.  See Note [The well-kinded type invariant]
      in TcType.
      
      That invariant was not being upheld, which led to Trac #14174.  I fixed
      part of it, but T14174a showed that there was more.  This patch finishes
      the job.
      
      * See Note [The tcType invariant] in TcHsType, which articulates an
        invariant that was very nearly, but not quite, true.  One place that
        falisified it was the HsWildCardTy case of tc_hs_type, so I fixed that.
      
      * mkNakedCastTy now makes no attempt to eliminate casts; indeed it cannot
        lest it break Note [The well-kinded type invariant].  The prior comment
        suggested that it was crucial for performance but happily it seems not
        to be. The extra Refls are eliminated by the zonker.
      
      * I found I could tidy up TcHsType.instantiateTyN and instantiateTyUntilN
        by eliminating one of its parameters.  That led to a cascade of minor
        improvements in TcTyClsDecls. Hooray.
      0a12d92a
    • Simon Peyton Jones's avatar
      Re-centre perf for T5321Fun · 63e968a9
      Simon Peyton Jones authored
      Bytes allocated has fallen by around 5%. I think this due
      to some of my recent refactoring of the typechecker, but
      I'm not certain about exactly which change did it.
      
      Good though!
      63e968a9
    • Simon Peyton Jones's avatar
      Add missing stderr for Trac #14561 · aef4dee8
      Simon Peyton Jones authored
      aef4dee8
    • Simon Peyton Jones's avatar
      Tidy up of wired-in names · 321b420f
      Simon Peyton Jones authored
      Two things here:
      
      * While debugging Trac #14561 I found it hard to understand
        ghcPrimIds and magicIds in MkId.  This patch adds more
        structure and comments.
      
      * I also discovered that ($) no longer needs to be a wiredInId
        because we now have levity polymorphism.  So I took dollarId
        out of MkId; and gave it a levity-polymorphic type in GHC.Base
      321b420f
    • Simon Peyton Jones's avatar
      Detect levity-polymorphic uses of unsafeCoerce# · e40db7b1
      Simon Peyton Jones authored
      This bug was shown up by Trac #14561. The deguarer carefully
      detects unsaturated and levity-polymorphic uses of primops,
      but not of things like unsafeCoerce#.
      
      The fix is simple: see Note [Levity-polymorphic Ids] in Id.
      e40db7b1
    • Simon Peyton Jones's avatar
      Minor refactor of TcExpr.tcApp · a106a200
      Simon Peyton Jones authored
      This refactoring has no change in behaviour but makes the
      structure clearer
      a106a200
  4. 12 Dec, 2017 1 commit
  5. 11 Dec, 2017 13 commits
  6. 08 Dec, 2017 5 commits
    • Ben Gamari's avatar
      Add hadrian as a submodule · 4335c07c
      Ben Gamari authored
      It will remain a submodule until we are ready to merge Hadrian into the
      tree.
      4335c07c
    • Ben Gamari's avatar
      Rip out hadrian subtree · 7733e44d
      Ben Gamari authored
      Sadly subtrees haven't worked quite as well as we would have liked for
      developers. See Hadrian #440.
      7733e44d
    • Simon Peyton Jones's avatar
      Occurrrence analysis improvements for NOINLINE functions · 5695f462
      Simon Peyton Jones authored
      This patch fixes #14567.  The idea is simple: if a function
      is marked NOINLINE then it makes a great candidate for a loop
      breaker.
      
      Implementation is easy too, but it needs a little extra plubming,
      notably the occ_unf_act field in OccEnv
      5695f462
    • Simon Peyton Jones's avatar
      Improve LiberateCase · 800009d9
      Simon Peyton Jones authored
      This patch, which fixes Trac #14566, makes LiberateCase a little
      more conservative.  In particular:
      
      * In libCaseBind, treat a recursive group as a whole, rather than
        binding-by-binding, allowing the group to be duplicated only if
          - the bindings /considered together/ are smaller than the
            liberate-case threshold (which is large by default)
          - none of them are thunks
          - none of them are guaranteed-diverging
      
        The latter condidtion is new, and happens to apply in the
        case of Data/Typeable/Internal.mkTrApp
      800009d9
    • Simon Peyton Jones's avatar
      Refactor kcHsTyVarBndrs · de204409
      Simon Peyton Jones authored
      This refactoring
      
      * Renames kcHsTyVarBndrs to kcLHsQTyVars,
        which is more truthful. It is only used in getInitialKind.
      
      * Pulls out bind_telescope from that function, and calls it
        kcLHsTyVarBndrs, again to reflect its argument
      
      * Uses the new kcLHsTyVarBndrs in kcConDecl, where the old
        function was wild overkill.
      
      There should not be any change in behaviour
      de204409
  7. 07 Dec, 2017 3 commits
    • Herbert Valerio Riedel's avatar
      Revert accidental hsc2hs submodule downgrade · e4a1f032
      Herbert Valerio Riedel authored
      This submodule update was committed unintentionally in
      fa29df02
      e4a1f032
    • Simon Peyton Jones's avatar
      Refactor ConDecl: Trac #14529 · fa29df02
      Simon Peyton Jones authored
      This patch refactors HsDecls.ConDecl.  Specifically
      
      * ConDeclGADT was horrible, with all the information hidden
        inside con_res_ty.  Now it's kept separate, as it should be.
      
      * ConDeclH98: use [LHsTyVarBndr] instead of LHsQTyVars for the
        existentials. There is no implicit binding here.
      
      * Add a field con_forall to both ConDeclGADT and ConDeclH98
        which says if there is an explicit user-written forall.
      
      * Field renamings in ConDecl
           con_cxt     to con_mb_cxt
           con_details to con_args
      
      There is an accompanying submodule update to Haddock.
      
      Also the following change turned out to remove a lot of clutter:
      
      * add a smart constructor for HsAppsTy, namely mkHsAppsTy,
        and use it consistently. This avoids a lot of painful pattern
        matching for the common singleton case.
      
      Two api-annotation tests (T10278, and T10399) are broken, hence marking
      them as expect_broken(14529).  Alan is going to fix them, probably by
      changing the con_forall field to
         con_forall :: Maybe SrcSpan
      instead of Bool
      fa29df02
    • Herbert Valerio Riedel's avatar
      Forward-port changes from GHC 8.2 branch · 5f332e1d
      Herbert Valerio Riedel authored
      (cherry picked from commit 3fa061a6)
      5f332e1d
  8. 05 Dec, 2017 2 commits
    • Sergei Trofimovich's avatar
      utils/hsc2hs: update submodule · 1ecbe9cc
      Sergei Trofimovich authored
      This pulls single change to fix building of cross-compilers:
      * ghc.mk: Use the same conditional install logic from unlit
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4248
      1ecbe9cc
    • Sergei Trofimovich's avatar
      rts: fix filename case for mingw32 target · 30d6373e
      Sergei Trofimovich authored
      The failure is visible when we build a cross-compiler
      from linux to mingw32 as:
      
      ```
          $ ./configure --host=x86_64-pc-linux-gnu \
                        --target=x86_64-w64-mingw32
          $ make
          rts/linker/PEi386.c:159:10: error:
               fatal error: Psapi.h: No such file or directory
               #include <Psapi.h>
                        ^~~~~~~~~
              |
          159 | #include <Psapi.h>
              |          ^
      ```
      
      The problem here is case-sensitive linux filesystem. On windows
      it does not matter what case is used for includes and libraries.
      
      mingw32 provides all libraries and headers lowercase. This change
      fixes case for <dbghelp.h>, <psapi.h>, -ldbghelp, -lpsapi.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Reviewers: bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4247
      30d6373e
  9. 04 Dec, 2017 1 commit