Skip to content
Snippets Groups Projects
  1. Dec 02, 2023
    • Ben Bellick's avatar
      Deprecate -ddump-json and introduce -fdiagnostics-as-json · 0b136485
      Ben Bellick authored
      Addresses #19278
      
      This commit deprecates the underspecified -ddump-json flag and
      introduces a newer, well-specified flag -fdiagnostics-as-json.
      
      Also included is a JSON schema as part of the documentation.
      
      The -ddump-json flag will be slated for removal shortly after this merge.
      0b136485
    • Ben Bellick's avatar
      Deprecate -ddump-json and introduce -fdiagnostics-as-json · 2b031905
      Ben Bellick authored
      Addresses #19278
      
      This commit deprecates the underspecified -ddump-json flag and
      introduces a newer, well-specified flag -fdiagnostics-as-json.
      
      Also included is a JSON schema as part of the documentation.
      
      The -ddump-json flag will be slated for removal shortly after this merge.
      2b031905
  2. Nov 30, 2023
    • Krzysztof Gogolewski's avatar
      Kind-check body of a required forall · bd8acc0c
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      We now require that in 'forall a -> ty', ty has kind TYPE r for some r.
      Fixes #24176
      bd8acc0c
    • Alan Zimmerman's avatar
      EPA: EpaDelta for comment has no comments · c7623b22
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      EpaLocation is used to position things. It has two constructors,
      EpaSpan holding a SrcSpan, and EpaDelta with a delta position and a
      possible list of comments.  The comment list is needed because the
      location in EpaDelta has no absolute information to decide which
      comments should be emitted before them when printing.
      
      But it is also used for specifying the position of a comment.  To
      prevent the absurdity of a comment position having a list of comments
      in it, we make EpaLocation parameterisable, using comments for the
      normal case and a constant for within comments.
      
      Updates haddock submodule.
      
      aarch64-darwin
      Metric Decrease:
          MultiLayerModulesTH_OneShot
      c7623b22
  3. Nov 29, 2023
    • Alan Zimmerman's avatar
      EPA: Clean up TC Monad Utils · 99a6a49c
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      We no longer need the alternative variant of addLocM (addLocMA)
      nor wrapLocAM, wrapLocSndMA.
      
      aarch64-darwin
      Metric Increase:
          MultiLayerModulesTH_OneShot
      
      deb10-numa-slow
      Metric Decrease:
          libdir
      99a6a49c
    • Stefan Schulze Frielinghaus's avatar
      llvmGen: Align objects in the data section · dfe1c354
      Stefan Schulze Frielinghaus authored and Marge Bot's avatar Marge Bot committed
      Objects in the data section may be referenced via tagged pointers.
      Thus, align those objects to a 4- or 8-byte boundary for 32- or 64-bit
      platforms, respectively.  Note, this may need to be reconsidered if
      objects with a greater natural alignment requirement are emitted as e.g.
      128-bit atomics.
      
      Fixes #24163.
      dfe1c354
  4. Nov 28, 2023
  5. Nov 27, 2023
  6. Nov 26, 2023
    • Vladislav Zavialov's avatar
      Update Note [hsScopedTvs and visible foralls] · da863d15
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      The Note was written before GHC gained support for visible forall in
      types of terms. Rewrite a few sentences and use a better example.
      da863d15
    • Vladislav Zavialov's avatar
      Term variable capture (#23740) · d1bf25c7
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch changes type variable lookup rules (lookupTypeOccRn) and
      implicit quantification rules (filterInScope) so that variables bound
      in the term namespace can be captured at the type level
      
        {-# LANGUAGE RequiredTypeArguments #-}
        f1 x = g1 @x                -- `x` used in a type application
        f2 x = g2 (undefined :: x)  -- `x` used in a type annotation
        f3 x = g3 (type x)          -- `x` used in an embedded type
        f4 x = ...
          where g4 :: x -> x        -- `x` used in a type signature
                g4 = ...
      
      This change alone does not allow us to accept examples shown above,
      but at least it gets them past the renamer.
      d1bf25c7
    • Alan Zimmerman's avatar
      EPA: Remove EpAnnNotUsed · 7902ebf8
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      We no longer need the EpAnnNotUsed constructor for EpAnn, as we can
      represent an unused annotation with an anchor having a EpaDelta of
      zero, and empty comments and annotations.
      
      This simplifies code handling annotations considerably.
      
      Updates haddock submodule
      
      Metric Increase:
          parsing001
      7902ebf8
    • Vladislav Zavialov's avatar
      Add name for -Wdeprecated-type-abstractions (#24154) · 3ede659d
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This warning had no name or flag and was triggered unconditionally.
      Now it is part of -Wcompat.
      3ede659d
  7. Nov 24, 2023
    • Alan Zimmerman's avatar
      EPA: Remove parenthesizeHsType · 34d86315
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      This is called from PostProcess.hs, and adds spurious parens.
      With the looser version of exact printing we had before we could
      tolerate this, as they would be swallowed by the original at the same
      place.
      
      But with the next change (remove EpAnnNotUsed) they result in
      duplicates in the output.
      
      For Darwin build:
      
      Metric Increase:
          MultiLayerModulesTH_OneShot
      34d86315
    • Andreas Klebinger's avatar
      Fix FMA primops generating broken assembly on x86. · fa576eb8
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      `genFMA3Code` assumed that we had to take extra precations to avoid overwriting
      the result of `getNonClobberedReg`. One of these special cases caused a bug resulting
      in broken assembly.
      
      I believe we don't need to hadle these cases specially at all, which means this MR simply
      deletes the special cases to fix the bug.
      
      Fixes #24160
      fa576eb8
  8. Nov 23, 2023
    • Alan Zimmerman's avatar
      EPA: empty tup_tail has noAnn · d2733a05
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      In Parser.y, the tup_tail rule had the following option
                | {- empty -} %shift   { return [Left noAnn] }
      
      Once this works through PostProcess.hs, it means we add an extra
      Missing constructor if the last item was a comma.
      
      Change the annotation type to a Bool to indicate this, and use the
      EpAnn Anchor for the print location for the others.
      d2733a05
    • BinderDavid's avatar
      Unify the hpc testsuites · 121c9ab7
      BinderDavid authored and Marge Bot's avatar Marge Bot committed
      The hpc testsuite was split between testsuite/tests/hpc
      and the submodule libraries/hpc/test. This commit unifies
      the two testsuites in the GHC repository in the directory
      testsuite/tests/hpc.
      121c9ab7
  9. Nov 22, 2023
  10. Nov 20, 2023
    • Alan Zimmerman's avatar
      EPA: Use SrcSpan in EpaSpan · 48bf364e
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      This is more natural, since we already need to deal with invalid
      RealSrcSpans, and that is exactly what SrcSpan.UnhelpfulSpan is for.
      
      Updates haddock submodule.
      48bf364e
  11. Nov 18, 2023
    • Alan Zimmerman's avatar
      EPA: Replace Monoid with NoAnn · 615441ef
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Remove the final Monoid instances in the exact print infrastructure.
      
      For Windows CI
      
      Metric Decrease:
          T5205
      615441ef
    • Sven Tennie's avatar
      AArch64: Remove unused instructions · 856e0a4e
      Sven Tennie authored and Marge Bot's avatar Marge Bot committed
      As these aren't ever emitted, we don't even know if they work or will
      ever be used. If one of them is needed in future, we may easily re-add
      it.
      
      Deleted instructions are:
      - CMN
      - ANDS
      - BIC
      - BICS
      - EON
      - ORN
      - ROR
      - TST
      - STP
      - LDP
      - DMBSY
      856e0a4e
  12. Nov 17, 2023
  13. Nov 16, 2023
    • Sylvain Henry's avatar
      Fix unusable units and module reexport interaction (#21097) · cee81370
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      This commit fixes an issue with ModUnusable introduced in df0f148f.
      
      In mkUnusableModuleNameProvidersMap we traverse the list of unusable
      units and generate ModUnusable origin for all the modules they contain:
      exposed modules, hidden modules, and also re-exported modules. To do
      this we have a two-level map:
      
        ModuleName -> Unit:ModuleName (aka Module) -> ModuleOrigin
      
      So for each module name "M" in broken unit "u" we have:
        "M" -> u:M -> ModUnusable reason
      
      However in the case of module reexports we were using the *target*
      module as a key. E.g. if "u:M" is a reexport for "X" from unit "o":
         "M" -> o:X -> ModUnusable reason
      
      Case 1: suppose a reexport without module renaming (u:M -> o:M) from
      unusable unit u:
         "M" -> o:M -> ModUnusable reason
      
      Here it's claiming that the import of M is unusable because a reexport
      from u is unusable. But if unit o isn't unusable we could also have in
      the map:
         "M" -> o:M -> ModOrigin ...
      
      Issue: the Semigroup instance of ModuleOrigin doesn't handle the case
      (ModUnusable <> ModOrigin)
      
      Case 2: similarly we could have 2 unusable units reexporting the same module
      without renaming, say (u:M -> o:M) and (v:M -> o:M) with u and v
      unusable. It gives:
      
        "M" -> o:M -> ModUnusable ... (for u)
        "M" -> o:M -> ModUnusable ... (for v)
      
      Issue: the Semigroup instance of ModuleOrigin doesn't handle the case
      (ModUnusable <> ModUnusable).
      
      This led to #21097, #16996, #11050.
      
      To fix this, in this commit we make ModUnusable track whether the module
      used as key is a reexport or not (for better error messages) and we use
      the re-export module as key. E.g. if "u:M" is a reexport for "o:X" and u
      is unusable, we now record:
      
          "M" -> u:M -> ModUnusable reason reexported=True
      
      So now, we have two cases for a reexport u:M -> o:X:
         - u unusable: "M" -> u:M -> ModUnusable ... reexported=True
         - u usable:   "M" -> o:X -> ModOrigin   ... reexportedFrom=u:M
      
      The second case is indexed with o:X because in this case the Semigroup
      instance of ModOrigin is used to combine valid expositions of a module
      (directly or via reexports).
      
      Note that module lookup functions select usable modules first (those who
      have a ModOrigin value), so it doesn't matter if we add new ModUnusable
      entries in the map like this:
      
        "M" -> {
          u:M -> ModUnusable ... reexported=True
          o:M -> ModOrigin ...
        }
      
      The ModOrigin one will be used. Only if there is no ModOrigin or
      ModHidden entry will the ModUnusable error be printed. See T21097 for an
      example printing several reasons why an import is unusable.
      cee81370
    • Simon Peyton Jones's avatar
      Second fix to #24083 · 2776920e
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      My earlier fix turns out to be too aggressive for data/type families
      
      See wrinkle (DTV1) in Note [Disconnected type variables]
      2776920e
  14. Nov 15, 2023
    • Alan Zimmerman's avatar
      EPA: splitLHsForAllTyInvis does not return ann · 27981fac
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      We did not use the annotations returned from splitLHsForAllTyInvis, so
      do not return them.
      27981fac
    • Krzysztof Gogolewski's avatar
      Remove loopy superclass solve mechanism · 99ced73b
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      Programs with a -Wloopy-superclass-solve warning will now fail with an error.
      
      Fixes #23017
      99ced73b
    • Luite Stegeman's avatar
      JS: Fix missing variable declarations · 2125c176
      Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
      The JStg IR update was missing some local variable declarations
      that were present earlier, causing global variables to be used
      implicitly (or an error in JavaScript strict mode).
      
      This adds the local variable declarations again.
      2125c176
    • Rodrigo Mesquita's avatar
      darwin: Fix single_module is obsolete warning · e6c803f7
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      In XCode 15's linker, -single_module is the default and otherwise
      passing it as a flag results in a warning being raised:
      
          ld: warning: -single_module is obsolete
      
      This patch fixes this warning by, at configure time, determining whether
      the linker supports -single_module (which is likely false for all
      non-darwin linkers, and true for darwin linkers in previous versions of
      macOS), and using that information at runtime to decide to pass or not
      the flag in the invocation.
      
      Fixes #24168
      e6c803f7
  15. Nov 12, 2023
    • Alan Zimmerman's avatar
      EPA: get rid of AnchorOperation · a7492048
      Alan Zimmerman authored
      Now that the Anchor type is an alias for EpaLocation, remove
      AnchorOperation.
      
      Updates haddock submodule
      a7492048
    • Alan Zimmerman's avatar
      EPA: Replace Anchor with EpaLocation · 3f0036ec
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      An Anchor has a location and an operation, which is either that it is
      unchanged or that it has moved with a DeltaPos
      
          data Anchor = Anchor { anchor :: RealSrcSpan
                               , anchor_op :: AnchorOperation }
      
      An EpaLocation also has either a location or a DeltaPos
      
          data EpaLocation = EpaSpan !RealSrcSpan !(Strict.Maybe BufSpan)
                           | EpaDelta !DeltaPos ![LEpaComment]
      
      Now that we do not care about always having a location in the anchor,
      we remove Anchor and replace it with EpaLocation
      
      We do this with a type alias initially, to ease the transition.
      The alias will be removed in time.
      
      We also have helpers to reconstruct the AnchorOperation from an
      EpaLocation. This is also temporary.
      
      Updates Haddock submodule
      3f0036ec
  16. Nov 11, 2023
  17. Nov 10, 2023
    • Simon Peyton Jones's avatar
      Add an extra check in kcCheckDeclHeader_sig · 6dbab180
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      Fix #24083 by checking for a implicitly-scoped type variable that is not
      actually bound.  See Note [Disconnected type variables] in GHC.Tc.Gen.HsType
      
      For some reason, on aarch64-darwin we saw a 2.8% decrease in compiler
      allocations for MultiLayerModulesTH_Make; but 0.0% on other architectures.
      
      Metric Decrease:
          MultiLayerModulesTH_Make
      6dbab180
  18. Nov 09, 2023
  19. Nov 07, 2023
  20. Nov 05, 2023
Loading