1. 21 Dec, 2016 17 commits
    • Edward Z. Yang's avatar
      Support for abi-depends for computing shadowing. · ee4e1654
      Edward Z. Yang authored
      
      
      Summary:
      This is a complete fix based off of
      ed7af26606b3a605a4511065ca1a43b1c0f3b51d for handling
      shadowing and out-of-order -package-db flags simultaneously.
      
      The general strategy is we first put all databases together,
      overriding packages as necessary.  Once this is done, we successfully
      prune out broken packages, including packages which depend on a package
      whose ABI differs from the ABI we need.
      
      Our check gracefully degrades in the absence of abi-depends, as
      we only check deps which are recorded in abi-depends.
      
      Contains time and Cabal submodule update.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: niteria, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2846
      
      GHC Trac Issues: #12485
      ee4e1654
    • Ryan Scott's avatar
      Disambiguate two Notes with identical names · 21892398
      Ryan Scott authored
      It turns out there were two Notes in the GHC codebase named
      [Pattern synonym signatures]. To avoid confusion, I gave one Note a slightly
      different name.
      21892398
    • Ryan Scott's avatar
      Fix a forward reference to a Note · ccc918cd
      Ryan Scott authored
      ccc918cd
    • Simon Peyton Jones's avatar
      Improved perf for T12227 · 74033c46
      Simon Peyton Jones authored
      Improved compiler allocations by abut 5%.  It comes from one of
      
      1a4c04b1 Fix 'SPECIALISE instance'
      c48595ee Never apply worker/wrapper to DFuns
      05d233e8 Move InId/OutId to CoreSyn
      e07ad4db Don't eta-expand in stable unfoldings
      d250d493 Add INLINE pragamas on Traversable default methods
      c66dd05c Move typeSize/coercionSize into TyCoRep
      
      I think d250d493.
      
      But it's good anyway.
      74033c46
    • Simon Peyton Jones's avatar
      Test Trac #12950 · c469db4e
      Simon Peyton Jones authored
      c469db4e
    • Simon Peyton Jones's avatar
      Fix 'SPECIALISE instance' · 1a4c04b1
      Simon Peyton Jones authored
      Trac #12944 showed that the DsBinds code that implemented a
      SPECIALISE pragma was inadequate if the constraints solving
      added let-bindings for dictionaries.  The result was that
      we ended up with an unbound dictionary in a DFunUnfolding -- and
      Lint didn't even check for that!
      
      Fixing this was not entirely straightforward
      
      * In DsBinds.dsSpec we use a new function
           TcEvidence.collectHsWrapBinders
        to pick off the lambda binders from the HsWapper
      
      * dsWrapper now returns a (CoreExpr -> CoreExpr) function
      
      * CoreUnfold.specUnfolding now takes a (CoreExpr -> CoreExpr)
        function it can use to specialise the unfolding.
      
      On the whole the code is simpler than before.
      1a4c04b1
    • Simon Peyton Jones's avatar
      Never apply worker/wrapper to DFuns · c48595ee
      Simon Peyton Jones authored
      While fixing Trac #12444 I found an occasion on which we applied
      worker/wrapper to a DFunId.  This is bad: it destroys the magic
      DFunUnfolding.
      
      This patch is a minor refactoring that stops this corner case
      happening, and tidies up the code a bit too.
      c48595ee
    • Simon Peyton Jones's avatar
      Move InId/OutId to CoreSyn · 05d233e8
      Simon Peyton Jones authored
      It turned out that many different modules defined the same type
      synonyms (InId, OutId, InType, OutType, etc) for the same purpose.
      
      This patch is refactoring only: it moves all those definitions to
      CoreSyn.
      05d233e8
    • Simon Peyton Jones's avatar
      Lint DFunUnfoldings · 0a18231b
      Simon Peyton Jones authored
      Previously we simply failed to Lint these DFunUnfoldings, which led
      to a very delayed error message for Trac #12944
      0a18231b
    • Simon Peyton Jones's avatar
      Don't eta-expand in stable unfoldings · e07ad4db
      Simon Peyton Jones authored
      See SimplUtils Note [No eta expansion in stable unfoldings],
      and Trac #9509 for an excellend diagnosis by Nick Frisby
      e07ad4db
    • Simon Peyton Jones's avatar
      Add INLINE pragamas on Traversable default methods · d250d493
      Simon Peyton Jones authored
      I discovered, when debugging a performance regression in
      the compiler, that the list instance of mapM was not being
      inlined at call sites, with terrible runtime costs.
      
      It turned out that this was a serious (but not entirely obvious)
      omission of an INLINE pragmas in the class declaration for
      Traversable.  This patch fixes it.  I reproduce below the
      Note [Inline default methods], which I wrote at some length.
      
      We may well want to apply the same fix in other class declarations
      whose default methods are often used.
      
      {- Note [Inline default methods]
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Consider
      
         class ... => Traversable t where
             ...
             mapM :: Monad m => (a -> m b) -> t a -> m (t b)
             mapM = traverse   -- Default method
      
         instance Traversable [] where
             {-# INLINE traverse #-}
             traverse = ...code for traverse on lists ...
      
      This gives rise to a list-instance of mapM looking like this
      
        $fTraversable[]_$ctaverse = ...code for traverse on lists...
             {-# INLINE $fTraversable[]_$ctaverse #-}
        $fTraversable[]_$cmapM    = $fTraversable[]_$ctraverse
      
      Now the $ctraverse obediently inlines into the RHS of $cmapM, /but/
      that's all!  We get
      
        $fTraversable[]_$cmapM = ...code for traverse on lists...
      
      with NO INLINE pragma!  This happens even though 'traverse' had an
      INLINE pragma becuase the author knew it should be inlined pretty
      vigorously.
      
      Indeed, it turned out that the rhs of $cmapM was just too big to
      inline, so all uses of mapM on lists used a terribly inefficient
      dictionary-passing style, because of its 'Monad m =>' type.  Disaster!
      
      Solution: add an INLINE pragma on the default method:
      
         class ... => Traversable t where
             ...
             mapM :: Monad m => (a -> m b) -> t a -> m (t b)
             {-# INLINE mapM #-}     -- VERY IMPORTANT!
             mapM = traverse
      d250d493
    • Simon Peyton Jones's avatar
      Move typeSize/coercionSize into TyCoRep · c66dd05c
      Simon Peyton Jones authored
      While investigating something else I found that 'typeSize' was
      allocating like crazy.  Stupid becuase it should allocate precisely
      nothing!!
      
      Turned out that it was because typeSize and coercionSize were mutually
      recursive across module boundaries, and so could not benefit from the
      CPR property.  To fix this I moved them both into TyCoRep.
      
      It's not critical (because typeSize is really only used in
      debug mode, but I tripped over and example (T5642) in which
      typeSize was one of the biggest single allocators in all of GHC.
      And it's easy to fix, so I did.
      c66dd05c
    • Simon Peyton Jones's avatar
      Add note for rebindable syntax of [a..b] · c73a982b
      Simon Peyton Jones authored
      See Trac #12969
      c73a982b
    • Simon Peyton Jones's avatar
      Test Trac #12968, plus some comments · f97d4899
      Simon Peyton Jones authored
      f97d4899
    • Gabor Greif's avatar
      Fix typos (not test relevant) · 1771da25
      Gabor Greif authored
      1771da25
    • Gabor Greif's avatar
      Suppress duplicate .T files · 9a29b65b
      Gabor Greif authored
      As per http://stackoverflow.com/questions/7961363/removing-duplicates-in-lists
      use the set() function to zap duplicates from the obtained list of .T files.
      
      I am using
      $ python3 --version
      Python 3.5.1
      
      and strangely findTFiles() returns some .T files twice:
      
      -- BEFORE
      Found 376 .T files...
      ...
      
      ====> Scanning ../../libraries/array/tests/all.T
      ====> Scanning ../../libraries/array/tests/all.T
      *** framework failure for T2120(duplicate) There are multiple tests with this name
      *** framework failure for largeArray(duplicate) There are multiple tests with this name
      *** framework failure for array001(duplicate) There are multiple tests with this name
      *** framework failure for T9220(duplicate) There are multiple tests with this name
      *** framework failure for T229(duplicate) There are multiple tests with this name
      ...
      
      -- AFTER
      Found 365 .T files...
      ...
      ====> Scanning ../../libraries/array/tests/all.T
      ...
      
      Even more strangely 'find' begs to differ:
      $ find libraries testsuite/tests -name "*.T" | sort | uniq | wc -l
      368
      9a29b65b
    • Edward Z. Yang's avatar
      Rewrite Note [Api annotations] for clarity. · 574abb71
      Edward Z. Yang authored
      
      
      Summary:
      Based off my understanding of how the moving parts work.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: comments only
      
      Reviewers: alanz, mpickering, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2887
      574abb71
  2. 20 Dec, 2016 3 commits
  3. 19 Dec, 2016 3 commits
  4. 18 Dec, 2016 10 commits
  5. 17 Dec, 2016 7 commits
    • siddhanathan's avatar
      Docs: Delete duplicate paragraph in user guide · e0fe7c31
      siddhanathan authored
      Removes duplicate paragraph in user guide. The same paragraph is
      repeated below this one.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2874
      e0fe7c31
    • Rufflewind's avatar
      Improve StringBuffer and FastString docs · 21dde812
      Rufflewind authored
      This area of code contains a lot of unsafe functionality, so it might be
      worth documenting to reduce the risk of misuse.
      
      Test Plan: inspection
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2872
      21dde812
    • Simon Marlow's avatar
      Run some tests with -fexternal-interpreter -prof · 90cfa849
      Simon Marlow authored
      We don't have any other tests for this, except one Template Haskell
      test.  This would have caught the bug I just fixed in D2868, at least
      when validating with profiling on.
      
      Test Plan: Ran tests
      
      Reviewers: niteria, austin, erikd, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2869
      
      GHC Trac Issues: #5654
      90cfa849
    • Simon Marlow's avatar
      Fix bug in previous fix for #5654 · 2a02040b
      Simon Marlow authored
      I forgot to account for BCOs, which have a different layout from
      functions.  This caused crashes when using profiling with GHCi (via
      -fexternal-interpreter -prof), which unfortunately is not tested at all
      by validate, even when profiling is enabled.  I'm going to add some
      testing that would have caught this in a separate patch.
      
      Test Plan:
      ```
      cd nofib/spectral/puzzle && make NoFibWithGHCi=YES
      EXTRA_RUNTEST_OPTS='-fexternal-interpreter -prof'
      ```
      New testsuite tests coming in a separate diff.
      
      Reviewers: niteria, austin, erikd, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2868
      
      GHC Trac Issues: #5654
      2a02040b
    • Ryan Scott's avatar
      Reexport Language.Haskell.TH.Lib from Language.Haskell.TH · 343b1473
      Ryan Scott authored
      Reexporting `Language.Haskell.TH.Lib` from `Language.Haskell.TH` ensures
      that `Language.Haskell.TH` will continue to expose all of the functions
      that `Language.Haskell.TH.Lib` does in the future.
      
      Fixes #12992.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari, goldfire
      
      Reviewed By: bgamari, goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2867
      
      GHC Trac Issues: #12992
      343b1473
    • Ben Gamari's avatar
      rts/win32/IOManager: Fix integer types · 2d1beb1e
      Ben Gamari authored
      This code has been broken on 64-bit systems for some time: the length
      and timeout arguments of `addIORequest` and `addDelayRequest`,
      respectively, were declared as `int`. However, they were passed Haskell
      integers from their respective primops. Integer overflow and madness
      ensued. This resulted in #7325 and who knows what else.
      
      Also, there were a few left-over `BOOL`s in here which were not passed
      to Windows system calls; these were changed to C99 `bool`s.
      
      However, there is still a bit of signedness inconsistency within the
      `delay#` call-chain,
      
       * `GHC.Conc.IO.threadDelay` and the `delay#` primop accept `Int`
         arguments
      
       * The `delay#` implementation in `PrimOps.cmm` expects the timeout as
         a `W_`
      
       * `AsyncIO.c:addDelayRequest` expects an `HsInt` (was `int` prior to
         this patch)
      
       * `IOManager.c:AddDelayRequest` expects an `HsInt`` (was `int`)
      
       * The Windows `Sleep` function expects a `DWORD` (which is unsigned)
      
      Test Plan: Validate on Windows
      
      Reviewers: erikd, austin, simonmar, Phyx
      
      Reviewed By: Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2861
      
      GHC Trac Issues: #7325
      2d1beb1e
    • Rufflewind's avatar
      Windows: Improve terminal detection mechanism · 3dbd2b09
      Rufflewind authored
      The previous detection mechanism allowed environment variables (ANSICON,
      ConEmuANSI, TERM) to supersede the fact that the stderr is not a
      terminal, which is probably what led to color codes appearing in the
      stderr of the tests (see: 847d2293).
      
      This commit changes the detection mechanism to detect Cygwin/MSYS2
      terminals in a more reliable manner, avoiding the use of environment
      variables entirely.
      
      Test Plan: validate
      
      Reviewers: Phyx, austin, erikd, bgamari
      
      Reviewed By: Phyx, bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2809
      3dbd2b09