1. 22 Feb, 2020 4 commits
    • Sylvain Henry's avatar
      Modules: Driver (#13009) · 240f5bf6
      Sylvain Henry authored
      submodule updates: nofib, haddock
      240f5bf6
    • Vladislav Zavialov's avatar
      Parser API annotations: RealSrcLoc · be7068a6
      Vladislav Zavialov authored
      During parsing, GHC collects lexical information about AST nodes and
      stores it in a map. It is needed to faithfully restore original source
      code, e.g. compare these expressions:
      
      	a =  b
      	a  = b
      
      The position of the equality sign is not recorded in the AST, so it must
      be stored elsewhere.
      
      This system is described in Note [Api annotations].
      
      Before this patch, the mapping was represented by:
      
      	Map (SrcSpan, AnnKeywordId) SrcSpan
      
      After this patch, the mapping is represented by:
      
      	Map (RealSrcSpan, AnnKeywordId) RealSrcSpan
      
      The motivation behind this change is to avoid using the Ord SrcSpan
      instance (required by Map here), as it interferes with #17632 (see the
      discussion there).
      
      SrcSpan is isomorphic to  Either String RealSrcSpan,  but we shouldn't
      use those strings as Map keys. Those strings are intended as hints to
      the user, e.g. "<interactive>" or "<compiler-generated code>", so they
      are not a valid way to identify nodes in the source code.
      be7068a6
    • Matthew Pickering's avatar
      TH: wrapGenSyns, don't split the element type too much · 0482f58a
      Matthew Pickering authored
      The invariant which allowed the pervious method of splitting the type of
      the body to find the type of the elements didn't work in the new
      overloaded quotation world as the type can be something like
      `WriterT () m a` rather than `Q a` like before.
      
      Fixes #17839
      0482f58a
    • Matthew Pickering's avatar
      Special case `mkTyConApp liftedTypeKind []` · 0a4c89b2
      Matthew Pickering authored
      We really need to make sure that these are shared because otherwise GHC
      will allocate thousands of identical `TyConApp` nodes.
      
      See #17292
      
      -------------------------
      Metric Decrease:
          haddock.Cabal
          T14683
      -------------------------
      0a4c89b2
  2. 21 Feb, 2020 10 commits
    • Andreas Klebinger's avatar
      Fix #17724 by having occAnal preserve used bindings. · 6de966f1
      Andreas Klebinger authored
      It sometimes happened that occAnal would remove bindings
      as dead code by relying on bindings to be in dependency
      order. The fix was contributed by SPJ.
      6de966f1
    • Ben Gamari's avatar
      Enable -Wstar-is-type in -Wall · 04eb0d6c
      Ben Gamari authored
      As noted in [proposal 0143][proposal] this is supposed to happen in
      8.12.
      
      Also fix an incorrect claim in the users guide that -Wstar-is-type is
      enabled by default.
      
      [proposal]: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0143-remove-star-kind.rst
      04eb0d6c
    • Ben Gamari's avatar
      Use Type instead of * in GHC · 89cb4cc4
      Ben Gamari authored
      89cb4cc4
    • Ben Gamari's avatar
      GHC.Hs.Extension: Use Type instead of * · c5ec9965
      Ben Gamari authored
      c5ec9965
    • Alexis King's avatar
      4e622fca
    • Krzysztof Gogolewski's avatar
      Use TTG for HsSplicedT constructor · 466e1ad5
      Krzysztof Gogolewski authored
      The constructor HsSplicedT occurs only in the GhcTc pass.
      This enforces this fact statically via TTG.
      466e1ad5
    • Roland Senn's avatar
      Fix #17832: Weird handling of exports named main in 8.10-rc1 · 8b76d457
      Roland Senn authored
      Switching from `lookupGlobalOccRn_maybe` to `lookupInfoOccRn`
      to check whether a `main` function is in scope. Unfortunately
      `lookupGlobalOccRn_maybe` complains if there are multiple `main`
      functions in scope.
      8b76d457
    • Ömer Sinan Ağacan's avatar
    • Sylvain Henry's avatar
      Disentangle DynFlags and SDoc · 6880d6aa
      Sylvain Henry authored
      Remove several uses of `sdocWithDynFlags`. The remaining ones are mostly
      CodeGen related (e.g. depend on target platform constants) and will be
      fixed separately.
      
      Metric Decrease:
         T12425
         T9961
         WWRec
         T1969
         T14683
      6880d6aa
    • Simon Peyton Jones's avatar
      Re-implement unsafe coercions in terms of unsafe equality proofs · 74ad75e8
      Simon Peyton Jones authored
      (Commit message written by Omer, most of the code is written by Simon
      and Richard)
      
      See Note [Implementing unsafeCoerce] for how unsafe equality proofs and
      the new unsafeCoerce# are implemented.
      
      New notes added:
      
      - [Checking for levity polymorphism] in CoreLint.hs
      - [Implementing unsafeCoerce] in base/Unsafe/Coerce.hs
      - [Patching magic definitions] in Desugar.hs
      - [Wiring in unsafeCoerce#] in Desugar.hs
      
      Only breaking change in this patch is unsafeCoerce# is not exported from
      GHC.Exts, instead of GHC.Prim.
      
      Fixes #17443
      Fixes #16893
      
      NoFib
      -----
      
      --------------------------------------------------------------------------------
              Program           Size    Allocs    Instrs     Reads    Writes
      --------------------------------------------------------------------------------
                   CS          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  CSD          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                   FS          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                    S          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                   VS          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  VSD          -0.1%      0.0%     -0.0%     -0.0%     -0.1%
                  VSM          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 anna          -0.0%      0.0%     -0.0%     -0.0%     -0.0%
                 ansi          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 atom          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               awards          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               banner          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
           bernouilli          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         binary-trees          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                boyer          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               boyer2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 bspt          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            cacheprof          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             calendar          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             cichelli          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              circsim          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             clausify          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
        comp_lab_zift          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             compress          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            compress2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
          constraints          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         cryptarithm1          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         cryptarithm2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  cse          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         digits-of-e1          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         digits-of-e2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               dom-lt          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                eliza          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                event          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
          exact-reals          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               exp3_8          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               expert          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
       fannkuch-redux          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                fasta          -0.1%      0.0%     -0.5%     -0.3%     -0.4%
                  fem          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  fft          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 fft2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             fibheaps          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 fish          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                fluid          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               fulsom          -0.1%      0.0%     +0.0%     +0.0%     +0.0%
               gamteb          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  gcd          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
          gen_regexps          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               genfft          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                   gg          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 grep          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               hidden          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  hpg          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  ida          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                infer          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              integer          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            integrate          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         k-nucleotide          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                kahan          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              knights          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               lambda          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
           last-piece          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 lcss          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 life          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 lift          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               linear          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            listcompr          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             listcopy          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             maillist          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               mandel          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              mandel2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 mate          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              minimax          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              mkhprog          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
           multiplier          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               n-body          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             nucleic2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 para          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            paraffins          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               parser          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              parstof          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  pic          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             pidigits          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                power          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               pretty          -0.1%      0.0%     -0.1%     -0.1%     -0.1%
               primes          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            primetest          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               prolog          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               puzzle          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               queens          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              reptile          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
      reverse-complem          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              rewrite          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 rfib          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  rsa          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  scc          -0.1%      0.0%     -0.1%     -0.1%     -0.1%
                sched          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  scs          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               simple          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                solid          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              sorting          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
        spectral-norm          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               sphere          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
               symalg          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                  tak          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            transform          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
             treejoin          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            typecheck          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
              veritas          -0.0%      0.0%     -0.0%     -0.0%     -0.0%
                 wang          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
            wave4main          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         wheel-sieve1          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
         wheel-sieve2          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
                 x2n1          -0.1%      0.0%     -0.0%     -0.0%     -0.0%
      --------------------------------------------------------------------------------
                  Min          -0.1%      0.0%     -0.5%     -0.3%     -0.4%
                  Max          -0.0%      0.0%     +0.0%     +0.0%     +0.0%
       Geometric Mean          -0.1%     -0.0%     -0.0%     -0.0%     -0.0%
      
      Test changes
      ------------
      
      - break006 is marked as broken, see #17833
      - The compiler allocates less when building T14683 (an unsafeCoerce#-
        heavy happy-generated code) on 64-platforms. Allocates more on 32-bit
        platforms.
      - Rest of the increases are tiny amounts (still enough to pass the
        threshold) in micro-benchmarks. I briefly looked at each one in a
        profiling build: most of the increased allocations seem to be because
        of random changes in the generated code.
      
      Metric Decrease:
          T14683
      
      Metric Increase:
          T12150
          T12234
          T12425
          T13035
          T14683
          T5837
          T6048
      Co-Authored-By: Richard Eisenberg's avatarRichard Eisenberg <rae@cs.brynmawr.edu>
      Co-Authored-By: Ömer Sinan Ağacan's avatarÖmer Sinan Ağacan <omeragacan@gmail.com>
      74ad75e8
  3. 19 Feb, 2020 4 commits
  4. 16 Feb, 2020 1 commit
  5. 14 Feb, 2020 5 commits
  6. 13 Feb, 2020 1 commit
  7. 12 Feb, 2020 4 commits
  8. 11 Feb, 2020 5 commits
    • Matthew Pickering's avatar
      TemplateHaskellQuotes: Allow nested splices · 82023524
      Matthew Pickering authored
      There is no issue with nested splices as they do not require any compile
      time code execution. All execution is delayed until the top-level
      splice.
      82023524
    • Simon Peyton Jones's avatar
      Notes only: telescopes · d8d73d77
      Simon Peyton Jones authored
      This documentation-only patch fixes #17793
      d8d73d77
    • Sylvain Henry's avatar
      Add arithmetic exception primops (#14664) · aba51b65
      Sylvain Henry authored
      aba51b65
    • Richard Eisenberg's avatar
      Do not create nested quantified constraints · de32beff
      Richard Eisenberg authored
      Previously, we would accidentally make constraints like
      forall a. C a => forall b. D b => E a b c as we traversed
      superclasses. No longer!
      
      This patch also expands Note [Eagerly expand given superclasses]
      to work over quantified constraints; necessary for T16502b.
      
      Close #17202 and #16502.
      
      test cases: typecheck/should_compile/T{17202,16502{,b}}
      de32beff
    • Sebastian Graf's avatar
      Fix long distance info for record updates · f3e737bb
      Sebastian Graf authored
      For record updates where the `record_expr` is a variable, as in #17783:
      
      ```hs
      data PartialRec = No
                      | Yes { a :: Int, b :: Bool }
      update No = No
      update r@(Yes {}) = r { b = False }
      ```
      
      We should make use of long distance info in
      `-Wincomplete-record-updates` checking. But the call to `matchWrapper`
      in the `RecUpd` case didn't specify a scrutinee expression, which would
      correspond to the `record_expr` `r` here. That is fixed now.
      
      Fixes #17783.
      f3e737bb
  9. 09 Feb, 2020 3 commits
    • Andreas Klebinger's avatar
      Fix -ddump-stg-final. · b2e18e26
      Andreas Klebinger authored
      Once again make sure this dumps the STG used for codegen.
      b2e18e26
    • Roland Senn's avatar
      Fix #14628: Panic (No skolem Info) in GHCi · 82f9be8c
      Roland Senn authored
      This patch implements the [sugggestion from Simon (PJ)](ghc/ghc#14628 (comment 146559)):
      - Make `TcErrors.getSkolemInfo` return a `SkolemInfo` rather than an `Implication`.
      - If `getSkolemInfo` gets `RuntimeUnk`s, just return a new data constructor in `SkolemInfo`, called `RuntimeUnkSkol`.
      - In `TcErrors.pprSkols` print something sensible for a `RuntimeUnkSkol`.
      
      The `getSkolemInfo` function paniced while formating suggestions to add type annotations (subfunction `suggestAddSig`)
      to a *"Couldn't match type ‘x’ with ‘y’"* error message.
      The `getSkolemInfo` function didn't find any Implication value and paniced.
      With this patch the `getSkolemInfo` function does no longer panic, if it finds `RuntimeUnkSkol`s.
      
      As the panic occured while processing an error message, we don't need to implement any new error message!
      82f9be8c
    • Arnaud Spiwack's avatar
      Fix an outdated note link · a906595f
      Arnaud Spiwack authored
      This link appears to have been forgotten in
      0dad81ca .
      a906595f
  10. 08 Feb, 2020 3 commits