Skip to content
Snippets Groups Projects
  1. Feb 25, 2024
  2. Feb 24, 2024
  3. Feb 23, 2024
    • Ben Gamari's avatar
      Allow docstrings after exports · 5121a4ed
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Here we extend the parser and AST to preserve docstrings following
      export items. We then extend Haddock to parse `@since` annotations in
      such docstrings, allowing changes in export structure to be properly
      documented.
      
      Bumps haddock submodule.
      5121a4ed
  4. Feb 21, 2024
  5. Feb 20, 2024
  6. Feb 19, 2024
    • Cheng Shao's avatar
      testsuite: mark T23540 as fragile on i386 · a6142e0c
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      See #24449 for details.
      a6142e0c
    • Cheng Shao's avatar
      hadrian: fix wasm backend post linker script permissions · 4696b966
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      The post-link.mjs script was incorrectly copied and installed as a
      regular data file without executable permission, this commit fixes it.
      4696b966
    • Brandon Chinn's avatar
      Fix searching for errors in sphinx build · 35b0ad90
      Brandon Chinn authored and Marge Bot's avatar Marge Bot committed
      35b0ad90
    • John Ericson's avatar
      Fix reST in users guide · 17e309d2
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      It appears that aef587f6 wasn't valid syntax.
      17e309d2
    • Jade's avatar
    • Andrei Borzenkov's avatar
      Parser, renamer, type checker for @a-binders (#17594) · 0dbd729e
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      GHC Proposal 448 introduces binders for invisible type arguments
      (@a-binders) in various contexts. This patch implements @-binders
      in lambda patterns and function equations:
      
        {-# LANGUAGE TypeAbstractions #-}
      
        id1 :: a -> a
        id1 @t x = x :: t      -- @t-binder on the LHS of a function equation
      
        higherRank :: (forall a. (Num a, Bounded a) => a -> a) -> (Int8, Int16)
        higherRank f = (f 42, f 42)
      
        ex :: (Int8, Int16)
        ex = higherRank (\ @a x -> maxBound @a - x )
                               -- @a-binder in a lambda pattern in an argument
                               -- to a higher-order function
      
      Syntax
      ------
      
      To represent those @-binders in the AST, the list of patterns in Match
      now uses ArgPat instead of Pat:
      
        data Match p body
           = Match {
               ...
      -        m_pats  :: [LPat p],
      +        m_pats  :: [LArgPat p],
               ...
         }
      
      + data ArgPat pass
      +   = VisPat (XVisPat pass) (LPat pass)
      +   | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass))
      +   | XArgPat !(XXArgPat pass)
      
      The VisPat constructor represents patterns for visible arguments,
      which include ordinary value-level arguments and required type arguments
      (neither is prefixed with a @), while InvisPat represents invisible type
      arguments (prefixed with a @).
      
      Parser
      ------
      
      In the grammar (Parser.y), the lambda and lambda-cases productions of
      aexp non-terminal were updated to accept argpats instead of apats:
      
        aexp : ...
      -        | '\\' apats '->' exp
      +        | '\\' argpats '->' exp
               ...
      -        | '\\' 'lcases' altslist(apats)
      +        | '\\' 'lcases' altslist(argpats)
               ...
      
      + argpat : apat
      +        | PREFIX_AT atype
      
      Function left-hand sides did not require any changes to the grammar, as
      they were already parsed with productions capable of parsing @-binders.
      Those binders were being rejected in post-processing (isFunLhs), and now
      we accept them.
      
      In Parser.PostProcess, patterns are constructed with the help of
      PatBuilder, which is used as an intermediate data structure when
      disambiguating between FunBind and PatBind. In this patch we define
      ArgPatBuilder to accompany PatBuilder. ArgPatBuilder is a short-lived
      data structure produced in isFunLhs and consumed in checkFunBind.
      
      Renamer
      -------
      
      Renaming of @-binders builds upon prior work on type patterns,
      implemented in 2afbddb0, which guarantees proper scoping and
      shadowing behavior of bound type variables.
      
      This patch merely defines rnLArgPatsAndThen to process a mix of visible
      and invisible patterns:
      
      + rnLArgPatsAndThen :: NameMaker -> [LArgPat GhcPs] -> CpsRn [LArgPat GhcRn]
      + rnLArgPatsAndThen mk = mapM (wrapSrcSpanCps rnArgPatAndThen) where
      +   rnArgPatAndThen (VisPat x p)    = ... rnLPatAndThen ...
      +   rnArgPatAndThen (InvisPat _ tp) = ... rnHsTyPat ...
      
      Common logic between rnArgPats and rnPats is factored out into the
      rn_pats_general helper.
      
      Type checker
      ------------
      
      Type-checking of @-binders builds upon prior work on lazy skolemisation,
      implemented in f5d3e03c.
      
      This patch extends tcMatchPats to handle @-binders. Now it takes and
      returns a list of LArgPat rather than LPat:
      
        tcMatchPats ::
                    ...
      -             -> [LPat GhcRn]
      +             -> [LArgPat GhcRn]
                    ...
      -             -> TcM ([LPat GhcTc], a)
      +             -> TcM ([LArgPat GhcTc], a)
      
      Invisible binders in the Match are matched up with invisible (Specified)
      foralls in the type. This is done with a new clause in the `loop` worker
      of tcMatchPats:
      
        loop :: [LArgPat GhcRn] -> [ExpPatType] -> TcM ([LArgPat GhcTc], a)
        loop (L l apat : pats) (ExpForAllPatTy (Bndr tv vis) : pat_tys)
          ...
          -- NEW CLAUSE:
          | InvisPat _ tp <- apat, isSpecifiedForAllTyFlag vis
          = ...
      
      In addition to that, tcMatchPats no longer discards type patterns. This
      is done by filterOutErasedPats in the desugarer instead.
      
      x86_64-linux-deb10-validate+debug_info
      Metric Increase:
          MultiLayerModulesTH_OneShot
      0dbd729e
    • Ben Gamari's avatar
      Drop dependence on `touch` · 7a0293cc
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This drops GHC's dependence on the `touch` program, instead implementing
      it within GHC. This eliminates an external dependency and means that we
      have one fewer program to keep track of in the `configure` script
      7a0293cc
  7. Feb 17, 2024
    • Cheng Shao's avatar
      rts: remove redundant rCCCS initialization · a7569495
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This commit removes the redundant logic of initializing each
      Capability's rCCCS to CCS_SYSTEM in initProfiling(). Before
      initProfiling() is called during RTS startup, each Capability's rCCCS
      has already been assigned CCS_SYSTEM when they're first initialized.
      a7569495
    • Bodigrim's avatar
      Bump submodule text to 2.1.1 · 56e3f097
      Bodigrim authored and Marge Bot's avatar Marge Bot committed
      T17123 allocates less because of improvements to Data.Text.concat in 1a6a06a.
      
      Metric Decrease:
          T17123
      56e3f097
    • Cheng Shao's avatar
      ci: bump ci-images to use updated wasm image · 1fb3974e
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This commit bumps our ci-images revision to use updated wasm image.
      1fb3974e
    • Cheng Shao's avatar
      testsuite: fix hs_try_putmvar002 for targets without pthread.h · 2ce2a493
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      hs_try_putmvar002 includes pthread.h and doesn't work on targets
      without this header (e.g. wasm32). It doesn't need to include this
      header at all. This was previously unnoticed by wasm CI, though recent
      toolchain upgrade brought in upstream changes that completely removes
      pthread.h in the single-threaded wasm32-wasi sysroot, therefore we
      need to handle that change.
      2ce2a493
    • Cheng Shao's avatar
      compiler: add SEQ_CST fence support · bd5a1f91
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      In addition to existing Acquire/Release fences, this commit adds
      SEQ_CST fence support to GHC, allowing Cmm code to explicitly emit a
      fence that enforces total memory ordering. The following logic is
      added:
      
      - The MO_SeqCstFence callish MachOp
      - The %prim fence_seq_cst() Cmm syntax and the SEQ_CST_FENCE macro in Cmm.h
      - MO_SeqCstFence lowering logic in every single GHC codegen backend
      bd5a1f91
Loading