1. 25 Feb, 2020 4 commits
  2. 24 Feb, 2020 4 commits
    • Ben Gamari's avatar
      Bump directory submodule to 1.3.6.0 · 84dd9610
      Ben Gamari authored
      84dd9610
    • Ben Gamari's avatar
      users-guide: Drop old release notes · e3f17413
      Ben Gamari authored
      e3f17413
    • Ben Gamari's avatar
      users-guide: Shuffle text · 5aa6c188
      Ben Gamari authored
      5aa6c188
    • Vladislav Zavialov's avatar
      Remove Ord SrcLoc, Ord SrcSpan · 26e8fff3
      Vladislav Zavialov authored
      Before this patch, GHC relied on Ord SrcSpan to identify source elements, by
      using SrcSpan as Map keys:
      
      	blackList :: Map SrcSpan ()      -- compiler/GHC/HsToCore/Coverage.hs
      	instanceMap :: Map SrcSpan Name  -- compiler/GHC/HsToCore/Docs.hs
      
      Firstly, this design is not valid in presence of UnhelpfulSpan, as it
      distinguishes between  UnhelpfulSpan "X"  and  UnhelpfulSpan "Y", but those
      strings are messages for the user, unfit to serve as identifiers for source
      elements.
      
      Secondly, this design made it hard to extend SrcSpan with additional data.
      Recall that the definition of SrcSpan is:
      
      	data SrcSpan =
      	    RealSrcSpan !RealSrcSpan
      	  | UnhelpfulSpan !FastString
      
      Say we want to extend the RealSrcSpan constructor with additional information:
      
      	data SrcSpan =
      	    RealSrcSpan !RealSrcSpan !AdditionalInformation
      	  | UnhelpfulSpan !FastString
      
      	getAdditionalInformation :: SrcSpan -> AdditionalInformation
      	getAdditionalInformation (RealSrcSpan _ a) = a
      
      Now, in order for  Map SrcSpan  to keep working correctly, we must *ignore* additional
      information when comparing SrcSpan values:
      
      	instance Ord SrcSpan where
      	  compare (RealSrcSpan r1 _) (RealSrcSpan r2 _) = compare r1 r2
      	  ...
      
      However, this would violate an important law:
      
      	a == b  therefore  f a == f b
      
      Ignoring  AdditionalInformation  in comparisons would mean that with
      f=getAdditionalInformation, the law above does not hold.
      
      A more robust design is to avoid  Ord SrcSpan  altogether, which is what this patch implements.
      The mappings are changed to use RealSrcSpan instead:
      
      	blackList :: Set RealSrcSpan         -- compiler/GHC/HsToCore/Coverage.hs
      	instanceMap :: Map RealSrcSpan Name  -- compiler/GHC/HsToCore/Docs.hs
      
      All SrcSpan comparisons are now done with explicit comparison strategies:
      
      	SrcLoc.leftmost_smallest
      	SrcLoc.leftmost_largest
      	SrcLoc.rightmost_smallest
      
      These strategies are not subject to the law mentioned above and can easily
      discard both the string stored in  UnhelpfulSpan  and  AdditionalInformation.
      
      Updates haddock submodule.
      26e8fff3
  3. 23 Feb, 2020 4 commits
  4. 22 Feb, 2020 5 commits
    • Sylvain Henry's avatar
      9d094111
    • 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
  5. 21 Feb, 2020 20 commits
    • Sylvain Henry's avatar
      Hadrian: fix source-dist target (#17849) · e2cce997
      Sylvain Henry authored
      e2cce997
    • Sylvain Henry's avatar
      Make: fix sdist target (#17848) · 3cea6795
      Sylvain Henry authored
      3cea6795
    • Ryan Scott's avatar
      Generalize liftData to work over any Quote (#17857) · 33fa8d94
      Ryan Scott authored
      The Overloaded Quotations proposal generalized the type of `lift`
      to work over any `Quote`, but not the type of `liftData`, leading
      to #17857. Thankfully, generalizing `liftData` is extremely
      straightforward.
      
      Fixes #17857.
      33fa8d94
    • Sylvain Henry's avatar
      Hadrian: minor GMP refactoring · 58175379
      Sylvain Henry authored
      Somehow I forgot to totally remove `gmpContext` in
      d7029cc0. This patch fixes it and adds
      some additional comments.
      58175379
    • Ben Gamari's avatar
      users-guide: Mention dependency on `exceptions` in release notes · abd7f962
      Ben Gamari authored
      Fixes #17845.
      abd7f962
    • 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
    • Ben Gamari's avatar
      gitlab-ci: Avoid duplicating ~/.cabal contents with every build · f44c7e67
      Ben Gamari authored
      Previously our attempt to cache the cabal store would
      `cp cabal-cache ~/.cabal`. However, if the latter already
       existed this meant that we would end up with
      ~/.cabal/cabal-cache. Not only would this not help caching
      but it would exponentially grow the size of ~/.cabal. Not
      good!
      f44c7e67
    • Ben Gamari's avatar
      05251b17
    • Adam Sandberg Eriksson's avatar
    • 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
    • Peter Trommler's avatar
      Fix testsuite on powerpc64le · c8439fc7
      Peter Trommler authored
      Remove expect broken on recomp tests, #11260 was closed
      by !2264 and #11323 most likely by !2264 as well.
      
      GHCi scripts tests work on GHCi but not the external interpreter,
      adjust test configuration accordingly. Fixes unexpected passes.
      
      Mark test requiring DWARF expect fail on powerpc64[le] for #11261.
      c8439fc7
    • Julien Debon's avatar
      doc(List): Add examples to GHC.List · 70a90110
      Julien Debon authored
      * Add examples
      * Cleanup documentation
      * Clarify merge process and Marge bot
      70a90110
    • 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
  6. 20 Feb, 2020 2 commits
  7. 19 Feb, 2020 1 commit