1. 18 Feb, 2021 1 commit
  2. 17 Feb, 2021 20 commits
  3. 16 Feb, 2021 9 commits
    • Ryan Scott's avatar
      Parse symbolic names in ANN type correctly with otycon · a04179e7
      Ryan Scott authored
      This adds a new `otycon` production to the parser that allows for type
      constructor names that are either alphanumeric (`tycon`) or symbolic
      (`tyconsym`), where the latter must be parenthesized appropriately.
      `otycon` is much like the existing `oqtycon` production, except that it does
      not permit qualified names. The parser now uses `otycon` to parse type
      constructor names in `ANN type` declarations, which fixes #19374.
      To make sure that all of this works, I added three test cases:
      * `should_compile/T19374a`: the original test case from #19374
      * `should_fail/T19374b`: a test that makes sure that an `ANN` with a qualified
        name fails to parse
      * `should_fail/T19374c`: a test that makes sure that an `ANN type` with a
        qualified name fails to parse
    • Adam Gundry's avatar
      Avoid false redundant import warning with DisambiguateRecordFields · 7686f9f8
      Adam Gundry authored
      Fixes #17853. We mustn't discard the result of pickGREs, because doing
      so might lead to incorrect redundant import warnings.
    • Andrzej Rybczak's avatar
      Add Generic tuple instances up to 15 · c2029001
      Andrzej Rybczak authored
    • Simon Peyton Jones's avatar
      Avoid useless w/w split · c6faa42b
      Simon Peyton Jones authored
      This patch is just a tidy-up for the post-strictness-analysis
      worker wrapper split.  Consider
         f x = x
      Strictnesss analysis does not lead to a w/w split, so the
      obvious thing is to leave it 100% alone.  But actually, because
      the RHS is small, we ended up adding a StableUnfolding for it.
      There is some reason to do this if we choose /not/ do to w/w
      on the grounds that the function is small.  See
      Note [Don't w/w inline small non-loop-breaker things]
      But there is no reason if we would not have done w/w anyway.
      This patch just moves the conditional to later.  Easy.
      This does move some -ddump-simpl printouts around a bit.
      I also discovered that the previous code was overwritten an
      InlineCompulsory with InlineStable, which is utterly wrong.  That in
      turn meant that some default methods (marked InlineCompulsory)
      were getting their InlineCompulsory squashed. This patch fixes
      that bug --- but of course that does mean a bit more inlining!
      Metric Decrease:
      Metric Increase:
    • Oleg Grenrus's avatar
      Use explicit import list for Data.List · 963e1e9a
      Oleg Grenrus authored
    • Sylvain Henry's avatar
    • Sylvain Henry's avatar
      Don't build extra object with -no-hs-main · a01e78cc
      Sylvain Henry authored
      We don't need to compile/link an additional empty C file when it is not
      This patch may also fix #18938 by avoiding trying to lookup the RTS unit
      when there is none (yet) in the unit database.
    • Adam Gundry's avatar
      Make sure HasField use counts for -Wunused-top-binds · 1109896c
      Adam Gundry authored
      This is a small fix that depends on the previous commit, because it
      corrected the rnExpr free variable calculation for HsVars which refer
      to ambiguous fields. Fixes #19213.
    • Adam Gundry's avatar
      Implement NoFieldSelectors extension (ghc-proposals 160) · 2521b041
      Adam Gundry authored
      Fixes #5972. This adds an extension NoFieldSelectors to disable the generation
      of selector functions corresponding to record fields.  When this extension is
      enabled, record field selectors are not accessible as functions, but users are
      still able to use them for record construction, pattern matching and updates.
      See Note [NoFieldSelectors] in GHC.Rename.Env for details.
      Defining the same field multiple times requires the DuplicateRecordFields
      extension to be enabled, even when NoFieldSelectors is in use.
      Along the way, this fixes the use of non-imported DuplicateRecordFields in GHCi
      with -fimplicit-import-qualified (fixes #18729).
      Moreover, it extends DisambiguateRecordFields to ignore non-fields when looking
      up fields in record updates (fixes #18999), as described by
      Note [DisambiguateRecordFields for updates].
      Co-authored-by: Simon Hafner's avatarSimon Hafner <hafnersimon@gmail.com>
      Co-authored-by: Fumiaki Kinoshita's avatarFumiaki Kinoshita <fumiexcel@gmail.com>
  4. 14 Feb, 2021 10 commits
    • Daniel Gröber (dxld)'s avatar
    • Daniel Gröber (dxld)'s avatar
    • Daniel Gröber (dxld)'s avatar
    • Daniel Gröber (dxld)'s avatar
      Fix non power-of-two Storable.alignment in Capi_Ctype tests · 3deb1387
      Daniel Gröber (dxld) authored
      Alignments passed to alloca and friends must be a power of two for the code
      in allocatePinned to work properly. Commit 41230e26 ("Zero out pinned
      block alignment slop when profiling") introduced an ASSERT for this but
      this test was still violating it.
    • Ben Gamari's avatar
      validate: Fix copy-pasta · b9fe4cd5
      Ben Gamari authored
      Previously the Hadrian codepath of `validate` inverted the logic which
      decides whether the test build of `xhtml` should be built with
      `--enable-shared`. This resulted in validate failures on Windows, which
      does not support dynamic linkage of Haskell code.
    • Simon Peyton Jones's avatar
      Fix over-eager inlining in SimpleOpt · 4dc2002a
      Simon Peyton Jones authored
      In GHC.Core.SimpleOpt, I found that its inlining could duplicate
      an arbitary redex inside a lambda!  Consider (\xyz. x+y).  The
      occurrence-analysis treats the lamdda as a group, and says that
      both x and y occur once, even though the occur under the lambda-z.
      See Note [Occurrence analysis for lambda binders] in OccurAnal.
      When the lambda is under-applied in a call, the Simplifier is
      careful to zap the occ-info on x,y, because they appear under the \z.
      (See the call to zapLamBndrs in simplExprF1.)  But SimpleOpt
      missed this test, resulting in #19347.
      So this patch
      * commons up the binder-zapping in GHC.Core.Utils.zapLamBndrs.
      * Calls this new function from GHC.Core.Opt.Simplify
      * Adds a call to zapLamBndrs to GHC.Core.SimpleOpt.simple_app
      This change makes test T12990 regress somewhat, but it was always
      very delicate, so I'm going to put up with that.
      In this voyage I also discovered a small, rather unrelated infelicity
      in the Simplifier:
      * In GHC.Core.Opt.Simplify.simplNonRecX we should apply isStrictId
        to the OutId not the InId. See Note [Dark corner with levity polymorphism]
      It may never "bite", because SimpleOpt should have inlined all
      the levity-polymorphic compulsory inlnings already, but somehow
      it bit me at one point and it's generally a more solid thing
      to do.
      Fixing the main bug increases runtime allocation in test
      perf/should_run/T12990, for (acceptable) reasons explained in a
      comement on
      Metric Increase:
    • Ben Gamari's avatar
      Drop GHC_LOADED_IN_GHCI · bc5cb5f9
      Ben Gamari authored
      This previously supported the ghc-in-ghci script which has been since
      dropped. Hadrian's ghci support does not need this macro (which disabled
      uses of UnboxedTuples) since it uses `-fno-code` rather than produce
    • Ben Gamari's avatar
      ghc-in-ghci: Drop it · 72f23083
      Ben Gamari authored
      isovector recently noticed that it is broken and regardless it is
      superceded by `hadrian/ghci`.
    • Ben Gamari's avatar
    • Ben Gamari's avatar
      base: Use keepAlive# in Foreign.Marshal.Alloc · 267d31c1
      Ben Gamari authored