Skip to content
Snippets Groups Projects

Ghc.Tc.Errors refactoring for Richard

  1. Feb 15, 2021
    • Alfredo Di Napoli's avatar
      Refactor GHC.Tc.Errors · e815ac85
      Alfredo Di Napoli authored
      This commit:
      
      * Refactors GHC.Tc.Errors so that we use Severity for "choices" (defer
      types errors, holes, etc);
      
      * We get rid of reportWarning and reportError in favour of a general
      reportDiagnostic.
      e815ac85
    • Alfredo Di Napoli's avatar
      Separate MessageClass and Severity for a MsgEnvelope. · f23d4aa6
      Alfredo Di Napoli authored
      Other than that:
      
      * Fix T16167,json,json2,T7478,T10637 tests to reflect the introduction of
        the MessageClass type.
      
      * Add sevErrorNoReason and sevWarnNoReason functions. They simply wraps `SevError NoErrReason`
        and `SevWarning NoWarnReason` and make construction of diagnostics a bit less verbose.
      
      * Remove makeIntoWarning
      
      * Remove warningsToMessages
      f23d4aa6
  2. Feb 14, 2021
    • Ben Gamari's avatar
      validate: Fix copy-pasta · b9fe4cd5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      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.
      b9fe4cd5
    • Simon Peyton Jones's avatar
      Fix over-eager inlining in SimpleOpt · 4dc2002a
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      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:
          T12990
      4dc2002a
    • Ben Gamari's avatar
      Drop GHC_LOADED_IN_GHCI · bc5cb5f9
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      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
      bytecode.
      bc5cb5f9
    • Ben Gamari's avatar
      ghc-in-ghci: Drop it · 72f23083
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      isovector recently noticed that it is broken and regardless it is
      superceded by `hadrian/ghci`.
      72f23083
    • Ben Gamari's avatar
      ghc-compact: Use keepAlive# in GHC.Compact.Serialized · ee77148e
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      ee77148e
    • Ben Gamari's avatar
      base: Use keepAlive# in Foreign.Marshal.Alloc · 267d31c1
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      267d31c1
    • Ben Gamari's avatar
      base: Use keepAlive# in withForeignPtr · 2de81332
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      2de81332
    • Ben Gamari's avatar
      Introduce keepAlive primop · 74fec146
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      74fec146
    • Ben Gamari's avatar
      genprimopcode: Add a second levity-polymorphic tyvar · 544329c8
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This will be needed shortly.
      544329c8
    • Ben Gamari's avatar
      StringBuffer: Use unsafeWithForeignPtr · 65d98c6e
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      65d98c6e
    • Ben Gamari's avatar
      Bump bytestring submodule · eb9bbd38
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Teach it to use unsafeWithForeignPtr where appropriate.
      eb9bbd38
    • Ben Gamari's avatar
      base: Use unsafeWithForeignPtr in GHC.IO.Buffer · 3e22a935
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      3e22a935
    • Ben Gamari's avatar
      base: Eliminate allocating withForeignPtrs from GHC.Event.Array · 6d3d79af
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      6d3d79af
    • Ben Gamari's avatar
      GHC.Utils.Binary: Eliminate allocating withForeignPtr uses · c81996a4
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      c81996a4
    • Ben Gamari's avatar
      base: Add unsafeWithForeignPtr · a699389f
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      a699389f
    • Sylvain Henry's avatar
      Bignum: fix bogus rewrite rule (#19345) · 5e71dd33
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Fix the following rule:
      
        "fromIntegral/Int->Natural" fromIntegral = naturalFromWord . fromIntegral
      
      Its type wasn't constrained to Int hence #19345.
      5e71dd33
    • songzh's avatar
      Fix example code in Deriving via. · 3331b3ad
      songzh authored and Marge Bot's avatar Marge Bot committed
      3331b3ad
    • Simon Peyton Jones's avatar
      Fix a serious bug in roughMatchTcs · be3c0d62
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      The roughMatchTcs function enables a quick definitely-no-match test
      in lookupInstEnv.  Unfortunately, it didn't account for type families.
      This didn't matter when type families were flattened away, but now
      they aren't flattened it matters a lot.
      
      The fix is very easy. See INVARIANT in GHC.Core.InstEnv
      Note [ClsInst laziness and the rough-match fields]
      
      Fixes #19336
      
      The change makes compiler perf worse on two very-type-family-heavy
      benchmarks, T9872{a,d}:
        T9872a(normal) ghc/alloc  2172536442.7  2216337648.0  +2.0%
        T9872d(normal) ghc/alloc   614584024.0   621081384.0  +1.1%
      (Everything else is 0.0% or at most 0.1%.)
      
      I think we just have to put up with this. Some cases were being
      wrongly filtered out by roughMatchTcs that might actually match, which
      could lead to false apartness checks.  And it only affects these very
      type-family-heavy cases.
      
      Metric Increase:
          T9872a
          T9872d
      be3c0d62
    • Krzysztof Gogolewski's avatar
      Remove deprecated -XGenerics and -XMonoPatBinds · dcc4b2de
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      They have no effect since 2011 (GHC 7.2/7.4),
      commits cb698570 and 49dbe605.
      dcc4b2de
    • Krzysztof Gogolewski's avatar
      Add tests for solved arrow tickets #5777 #15175 · 18e53386
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      Merge requests !4464 and !4474 fixed the Lint problems.
      
      Closes #5777.
      Closes #15175.
      18e53386
    • Simon Jakobi's avatar
      Remove Data.Semigroup.Option · a6c3ddfe
      Simon Jakobi authored and Marge Bot's avatar Marge Bot committed
      Bumps the binary and deepseq submodules.
      
      Fixes ghc/ghc#15028.
      a6c3ddfe
    • Marcin Szamotulski's avatar
      closeFd: improve documentation · a5ec3515
      Marcin Szamotulski authored and Marge Bot's avatar Marge Bot committed
      I think it is worth to say that closeFd is interruptible by asynchronous
      exceptions.
      
      And also fix indentation of closeFd_.
      a5ec3515
    • Marcin Szamotulski's avatar
      Make closeFdWith uninterrupitble · 83ace021
      Marcin Szamotulski authored and Marge Bot's avatar Marge Bot committed
      closeFdWith is accessing shared TMVar - the IO manager callbak table
      var.  It might be concurrently used by different threads: either becuase
      it contains information about different file descriptors or a single
      file descriptor is accessed from different threads.  For this reason
      `takeMVar` might block, although for a very short time as all the
      IO operations are using epoll (or its equivalent).
      
      This change makes hClose and Network.Socket.close safe in presence of
      asynchronous exceptions.  This is especailly important in the context of
      `bracket` which expects uninterruptible close handler.
      83ace021
    • Roland Senn's avatar
      GHCi :complete command for operators: Fix spaceless cases of #10576. · 793dcb3d
      Roland Senn authored and Marge Bot's avatar Marge Bot committed
      When separating operators from identifiers in a `:complete` command
      take advantage from the different character sets of the two items:
      * operators contain only specialSymbol characters.
      * Identifiers don't contain specialSymbol characters, with the exception of dots.
      793dcb3d
    • Joachim Breitner's avatar
      Always set `safeInferred`, not only when it turns `False` · f1362008
      Joachim Breitner authored and Marge Bot's avatar Marge Bot committed
      previously, `safeFlagCheck` would be happy to switch the `safeFlag` to
      `False`, but not the other way around. This meant that after
      
          :set -XGeneralizedNewtypeDeriving
          :set -XNoGeneralizedNewtypeDeriving
      
      in GHCi all loaded files would be still be infered as unsafe.
      
      This fixes #19243.
      
      This is a corner case, but somewhat relevant once ghci by default starts
      with `GeneralizedNewtypeDeriving` on (due to GHC2021).
      f1362008
    • Marcin Szamotulski's avatar
      Apply 1 suggestion(s) to 1 file(s) · 448fd22d
      Marcin Szamotulski authored and Marge Bot's avatar Marge Bot committed
      448fd22d
    • Marcin Szamotulski's avatar
      Improve bracket documentation · 4b068fc3
      Marcin Szamotulski authored and Marge Bot's avatar Marge Bot committed
      4b068fc3
    • Sylvain Henry's avatar
      Refactor Logger · 8e2f85f6
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Before this patch, the only way to override GHC's default logging
      behavior was to set `log_action`, `dump_action` and `trace_action`
      fields in DynFlags. This patch introduces a new Logger abstraction and
      stores it in HscEnv instead.
      
      This is part of #17957 (avoid storing state in DynFlags). DynFlags are
      duplicated and updated per-module (because of OPTIONS_GHC pragma), so
      we shouldn't store global state in them.
      
      This patch also fixes a race in parallel "--make" mode which updated
      the `generatedDumps` IORef concurrently.
      
      Bump haddock submodule
      
      The increase in MultilayerModules is tracked in #19293.
      
      Metric Increase:
          MultiLayerModules
      8e2f85f6
  3. Feb 10, 2021
  4. Feb 09, 2021
  5. Feb 06, 2021
Loading