Skip to content
Snippets Groups Projects
  1. Mar 19, 2024
    • Matthew Craven's avatar
      CorePrep: Rework lowering of BigNat# literals · b56d2761
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      Don't use bigNatFromWord#, because that's terrible:
       * We shouldn't have to traverse a linked list at run-time
         to build a BigNat# literal. That's just silly!
       * The static List object we have to create is much larger
         than the actual BigNat#'s contents, bloating code size.
       * We have to read the corresponding interface file,
         which causes un-tracked implicit dependencies. (#23942)
      
      Instead, encode them into the appropriate platform-dependent
      sequence of bytes, and generate code that copies these bytes
      at run-time from an Addr# literal into a new ByteArray#.
      A ByteArray# literal would be the correct thing to generate,
      but these are not yet supported; see also #17747.
      
      Somewhat surprisingly, this change results in a slight
      reduction in compiler allocations, averaging around 0.5%
      on ghc's compiler performance tests, including when compiling
      programs that contain no bignum literals to begin with.
      The specific cause of this has not been investigated.
      
      Since this lowering no longer reads the interface file for
      GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer]
      is obsoleted.  But the story of un-tracked built-in dependencies
      remains complex, and Note [Tracking dependencies on primitives]
      now exists to explain this complexity.
      
      Additionally, many empty imports have been modified to refer to
      this new note and comply with its guidance.  Several empty imports
      necessary for other reasons have also been given brief explanations.
      
      Metric Decrease:
          MultiLayerModulesTH_OneShot
      b56d2761
    • Hannes Siebenhandl's avatar
      Escape multiple arguments in the settings file · 31bf85ee
      Hannes Siebenhandl authored and Marge Bot's avatar Marge Bot committed
      Uses responseFile syntax.
      
      The issue arises when GHC is installed on windows into a location that
      has a space, for example the user name is 'Fake User'.
      The $topdir will also contain a space, consequentially.
      When we resolve the top dir in the string `-I$topdir/mingw/include`,
      then `words` will turn this single argument into `-I/C/Users/Fake` and
      `User/.../mingw/include` which trips up the flag argument parser of
      various tools such as gcc or clang.
      We avoid this by escaping the $topdir before replacing it in
      `initSettngs`.
      Additionally, we allow to escape spaces and quotation marks for
      arguments in `settings` file.
      
      Add regression test case to count the number of options after variable
      expansion and argument escaping took place.
      Additionally, we check that escaped spaces and double quotation marks are
      correctly parsed.
      31bf85ee
    • Alan Zimmerman's avatar
      EPA: Address more 9.10.1-alpha1 regressions from recent changes · bd8209eb
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Closes #24533
      Hopefully for good this time
      bd8209eb
  2. Mar 14, 2024
  3. Mar 12, 2024
  4. Mar 11, 2024
  5. Mar 10, 2024
  6. Mar 09, 2024
  7. Mar 08, 2024
  8. Mar 07, 2024
    • Vladislav Zavialov's avatar
      Rephrase error message to say "visible arguments" (#24318) · 9cd9efb4
      Vladislav Zavialov authored
      * Main change: make the error message generated by mkFunTysMsg more
        accurate by changing "value arguments" to "visible arguments".
      
      * Refactor: define a new type synonym VisArity and use it instead of
        Arity in a few places.
      
      It might be the case that there other places in the compiler that should
      talk about visible arguments rather than value arguments, but I haven't
      tried to find them all, focusing only on the error message reported in
      the ticket.
      9cd9efb4
  9. Mar 06, 2024
  10. Mar 05, 2024
  11. Mar 04, 2024
  12. Mar 01, 2024
    • Arnaud Spiwack's avatar
      Improve error messages coming from non-linear patterns · dec6d8d3
      Arnaud Spiwack authored and Marge Bot's avatar Marge Bot committed
      This enriched the `CtOrigin` for non-linear patterns to include data
      of the pattern that created the constraint (which can be quite useful
      if it occurs nested in a pattern) as well as an explanation why the
      pattern is non-restricted in (at least in some cases).
      dec6d8d3
    • Torsten Schmits's avatar
      Introduce ListTuplePuns extension · d91d00fc
      Torsten Schmits authored and Marge Bot's avatar Marge Bot committed
      This implements Proposal 0475, introducing the `ListTuplePuns` extension
      which is enabled by default.
      
      Disabling this extension makes it invalid to refer to list, tuple and
      sum type constructors by using built-in syntax like `[Int]`,
      `(Int, Int)`, `(# Int#, Int# #)` or `(# Int | Int #)`.
      Instead, this syntax exclusively denotes data constructors for use with
      `DataKinds`.
      The conventional way of referring to these data constructors by
      prefixing them with a single quote (`'(Int, Int)`) is now a parser
      error.
      
      Tuple declarations have been moved to `GHC.Tuple.Prim` and the `Solo`
      data constructor has been renamed to `MkSolo` (in a previous commit).
      Unboxed tuples and sums now have real source declarations in `GHC.Types`.
      Unit and solo types for tuples are now called `Unit`, `Unit#`, `Solo`
      and `Solo#`.
      Constraint tuples now have the unambiguous type constructors `CTuple<n>`
      as well as `CUnit` and `CSolo`, defined in `GHC.Classes` like before.
      
      A new parser construct has been added for the unboxed sum data
      constructor declarations.
      
      The type families `Tuple`, `Sum#` etc. that were intended to provide
      nicer syntax have been omitted from this change set due to inference
      problems, to be implemented at a later time.
      See the MR discussion for more info.
      
      Updates the submodule utils/haddock.
      Updates the cabal submodule due to new language extension.
      
          Metric Increase:
              haddock.base
      
          Metric Decrease:
              MultiLayerModulesTH_OneShot
              size_hello_artifact
      
      Proposal document: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst
      
      Merge request: !8820
      
      Tracking ticket: #21294
      d91d00fc
Loading