Skip to content
Snippets Groups Projects
  1. May 07, 2024
  2. May 06, 2024
  3. May 05, 2024
  4. May 04, 2024
  5. May 02, 2024
    • Sylvain Henry's avatar
      GHCi: support inlining breakpoints (#24712) · b85b1199
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      When a breakpoint is inlined, its context may change (e.g. tyvars in
      scope). We must take this into account and not used the breakpoint tick
      index as its sole identifier. Each instance of a breakpoint (even with
      the same tick index) now gets a different "info" index.
      
      We also need to distinguish modules:
      - tick module: module with the break array (tick counters, status, etc.)
      - info module: module having the CgBreakInfo (info at occurrence site)
      b85b1199
    • Alan Zimmerman's avatar
      EPA: fix span for empty \case(s) · 167a56a0
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      In
          instance SDecide Nat where
            SZero %~ (SSucc _) = Disproved (\case)
      
      Ensure the span for the HsLam covers the full construct.
      
      Closes #24748
      167a56a0
    • Alan Zimmerman's avatar
      EPA: Preserve comments for PrefixCon · 40026ac3
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Preserve comments in
      
          fun (Con {- c1 -} a b)
              = undefined
      
      Closes #24736
      40026ac3
  6. May 01, 2024
  7. Apr 30, 2024
  8. Apr 26, 2024
    • Simon Peyton Jones's avatar
      Fix missing escaping-kind check in tcPatSynSig · 4d6394dd
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      Note [Escaping kind in type signatures] explains how we deal
      with escaping kinds in type signatures, e.g.
          f :: forall r (a :: TYPE r). a
      where the kind of the body is (TYPE r), but `r` is not in
      scope outside the forall-type.
      
      I had missed this subtlety in tcPatSynSig, leading to #24686.
      This MR fixes it; and a similar bug in tc_top_lhs_type. (The
      latter is tested by T24686a.)
      4d6394dd
    • Hannes Siebenhandl's avatar
      Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` · bac57298
      Hannes Siebenhandl authored and Marge Bot's avatar Marge Bot committed
      A `BinHandle` contains too much information for reading data.
      For example, it needs to keep a `FastMutInt` and a `IORef BinData`,
      when the non-mutable variants would suffice.
      
      Additionally, this change has the benefit that anyone can immediately
      tell whether the `BinHandle` is used for reading or writing.
      
      Bump haddock submodule BinHandle split.
      bac57298
    • Hannes Siebenhandl's avatar
      Refactor the Binary serialisation interface · fa03b1fb
      Hannes Siebenhandl authored and Marge Bot's avatar Marge Bot committed
      The goal is simplifiy adding deduplication tables to `ModIface`
      interface serialisation.
      
      We identify two main points of interest that make this difficult:
      
      1. UserData hardcodes what `Binary` instances can have deduplication
         tables. Moreover, it heavily uses partial functions.
      2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and
         'FastString', making it difficult to add more deduplication.
      
      Instead of having a single `UserData` record with fields for all the
      types that can have deduplication tables, we allow to provide custom
      serialisers for any `Typeable`.
      These are wrapped in existentials and stored in a `Map` indexed by their
      respective `TypeRep`.
      The `Binary` instance of the type to deduplicate still needs to
      explicitly look up the decoder via `findUserDataReader` and
      `findUserDataWriter`, which is no worse than the status-quo.
      
      `Map` was chosen as microbenchmarks indicate it is the fastest for a
      small number of keys (< 10).
      
      To generalise the deduplication table serialisation mechanism, we
      introduce the types `ReaderTable` and `WriterTable` which provide a
      simple interface that is sufficient to implement a general purpose
      deduplication mechanism for `writeBinIface` and `readBinIface`.
      
      This allows us to provide a list of deduplication tables for
      serialisation that can be extended more easily, for example for
      `IfaceTyCon`, see the issue #24540
      for more motivation.
      
      In addition to this refactoring, we split `UserData` into `ReaderUserData`
      and `WriterUserData`, to avoid partial functions and reduce overall
      memory usage, as we need fewer mutable variables.
      
      Bump haddock submodule to accomodate for `UserData` split.
      
      -------------------------
      Metric Increase:
          MultiLayerModulesTH_Make
          MultiLayerModulesRecomp
          T21839c
      -------------------------
      fa03b1fb
  9. Apr 25, 2024
  10. Apr 23, 2024
    • Cheng Shao's avatar
      driver: force merge objects when building dynamic objects · d2b17f32
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This patch forces the driver to always merge objects when building
      dynamic objects even when ar -L is supported. It is an oversight of
      !8887: original rationale of that patch is favoring the relatively
      cheap ar -L operation over object merging when ar -L is supported,
      which makes sense but only if we are building static objects! Omitting
      check for whether we are building dynamic objects will result in
      broken .so files with undefined reference errors at executable link
      time when building GHC with llvm-ar. Fixes #22210.
      d2b17f32
    • Alan Zimmerman's avatar
      EPA: Keep comments in a CaseAlt match · e916fc92
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      The comments now live in the surrounding location, not inside the
      Match. Make sure we keep them.
      
      Closes #24707
      e916fc92
    • Hannes Siebenhandl's avatar
      Typecheck corebindings lazily during bytecode generation · 1ba39b05
      Hannes Siebenhandl authored and Marge Bot's avatar Marge Bot committed
      This delays typechecking the corebindings until the bytecode generation
      happens.
      
      We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`.
      In general, we shouldn't retain values of the hydrated `Type`, as not evaluating
      the bytecode object keeps it alive.
      
      It is better if we retain the unhydrated `IfaceType`.
      
      See Note [Hydrating Modules]
      1ba39b05
  11. Apr 21, 2024
  12. Apr 20, 2024
    • Alan Zimmerman's avatar
      EPA: Avoid duplicated comments in splice decls · 2f8e3a25
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Contributes to #24669
      2f8e3a25
    • Jade's avatar
      Put the newline after errors instead of before them · 275e41a9
      Jade authored and Marge Bot's avatar Marge Bot committed
      This mainly has consequences for GHCi but also slightly alters how the
      output of GHC on the commandline looks.
      
      Fixes: #22499
      275e41a9
    • Sebastian Graf's avatar
      Make `seq#` a magic Id and inline it in CorePrep (#24124) · 385cd1c4
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      We can save much code and explanation in Tag Inference and StgToCmm by making
      `seq#` a known-key Magic Id in `GHC.Internal.IO` and inline this definition in
      CorePrep. See the updated `Note [seq# magic]`.
      I also implemented a new `Note [Flatten case-bind]` to get better code for
      otherwise nested case scrutinees.
      
      I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to
      resolve the clash between `type CpeApp = CoreExpr` and the data constructor of
      `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`.
      
      Fixes #24252 and #24124.
      385cd1c4
Loading