Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
-
86a646a6
by Andreas Klebinger at 2026-04-22T13:00:05-04:00
-
bc9ee1cf
by Wen Kokke at 2026-04-22T13:00:51-04:00
-
cc9cc6d5
by Cheng Shao at 2026-04-23T09:40:46+00:00
-
2ea7ef8e
by Cheng Shao at 2026-04-23T09:46:26+00:00
-
e6ae5764
by Cheng Shao at 2026-04-23T12:35:01-04:00
-
744b4d80
by Cheng Shao at 2026-04-23T12:35:01-04:00
-
40523880
by Cheng Shao at 2026-04-23T12:35:01-04:00
17 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- + changelog.d/binary-array-no-list
- + changelog.d/llvm-22
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Data/Pair.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Types/Unique/DSet.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Ppr/Colour.hs
- configure.ac
- hadrian/doc/flavours.md
Changes:
| ... | ... | @@ -445,7 +445,7 @@ opsysVariables _ FreeBSD14 = mconcat |
| 445 | 445 | -- Prefer to use the system's clang-based toolchain and not gcc
|
| 446 | 446 | , "CC" =: "cc"
|
| 447 | 447 | , "CXX" =: "c++"
|
| 448 | - , "FETCH_GHC_VERSION" =: "9.10.1"
|
|
| 448 | + , "FETCH_GHC_VERSION" =: "9.10.3"
|
|
| 449 | 449 | , "CABAL_INSTALL_VERSION" =: "3.14.2.0"
|
| 450 | 450 | ]
|
| 451 | 451 | opsysVariables arch (Linux distro) = distroVariables arch distro
|
| ... | ... | @@ -1721,7 +1721,7 @@ |
| 1721 | 1721 | "CC": "cc",
|
| 1722 | 1722 | "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
|
| 1723 | 1723 | "CXX": "c++",
|
| 1724 | - "FETCH_GHC_VERSION": "9.10.1",
|
|
| 1724 | + "FETCH_GHC_VERSION": "9.10.3",
|
|
| 1725 | 1725 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 1726 | 1726 | "RUNTEST_ARGS": "",
|
| 1727 | 1727 | "TEST_ENV": "x86_64-freebsd14-validate",
|
| ... | ... | @@ -4543,7 +4543,7 @@ |
| 4543 | 4543 | "CC": "cc",
|
| 4544 | 4544 | "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
|
| 4545 | 4545 | "CXX": "c++",
|
| 4546 | - "FETCH_GHC_VERSION": "9.10.1",
|
|
| 4546 | + "FETCH_GHC_VERSION": "9.10.3",
|
|
| 4547 | 4547 | "IGNORE_PERF_FAILURES": "all",
|
| 4548 | 4548 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 4549 | 4549 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -5643,7 +5643,7 @@ |
| 5643 | 5643 | "CC": "cc",
|
| 5644 | 5644 | "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
|
| 5645 | 5645 | "CXX": "c++",
|
| 5646 | - "FETCH_GHC_VERSION": "9.10.1",
|
|
| 5646 | + "FETCH_GHC_VERSION": "9.10.3",
|
|
| 5647 | 5647 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 5648 | 5648 | "RUNTEST_ARGS": "",
|
| 5649 | 5649 | "TEST_ENV": "x86_64-freebsd14-validate"
|
| 1 | +section: compiler
|
|
| 2 | +synopsis: Reduce allocations when (de)serialising `Array` in the `ghc` library.
|
|
| 3 | +issues: #27109
|
|
| 4 | +mrs: !15805
|
|
| 5 | + |
|
| 6 | +description: {
|
|
| 7 | + The `ghc` library's `Binary` instance for `Array` was changed to
|
|
| 8 | + avoid allocating an intermediate list and to omit a redundant length
|
|
| 9 | + field during (de)serialisation.
|
|
| 10 | + |
|
| 11 | + This should only affect the `ghc` library's (de)serialisation code paths,
|
|
| 12 | + primarily when parsing HIE files and bytecode objects.
|
|
| 13 | +} |
| 1 | +section: llvm-backend
|
|
| 2 | +synopsis: Bump LlvmMaxVersion to support LLVM 22.x releases.
|
|
| 3 | +issues: #26813
|
|
| 4 | +mrs: !15405 |
| ... | ... | @@ -2,8 +2,6 @@ |
| 2 | 2 | {-# LANGUAGE MultiWayIf #-}
|
| 3 | 3 | {-# LANGUAGE ParallelListComp #-}
|
| 4 | 4 | {-# LANGUAGE NondecreasingIndentation #-}
|
| 5 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 6 | -{-# LANGUAGE DerivingVia #-}
|
|
| 7 | 5 | |
| 8 | 6 | -----------------------------------------------------------------------------
|
| 9 | 7 | --
|
| ... | ... | @@ -74,8 +72,6 @@ import GHC.Cmm.CLabel |
| 74 | 72 | import GHC.Types.Tickish ( GenTickish(..) )
|
| 75 | 73 | import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol )
|
| 76 | 74 | |
| 77 | -import GHC.Generics (Generic, Generically(..))
|
|
| 78 | - |
|
| 79 | 75 | -- The rest:
|
| 80 | 76 | import GHC.Data.Maybe ( expectJust )
|
| 81 | 77 | import GHC.Types.ForeignCall ( CCallConv(..) )
|
| ... | ... | @@ -440,7 +436,7 @@ getRegisterReg _ (CmmLocal lreg) = getLocalRegReg lreg |
| 440 | 436 | |
| 441 | 437 | getRegisterReg platform (CmmGlobal mid)
|
| 442 | 438 | = case globalRegMaybe platform $ globalRegUse_reg mid of
|
| 443 | - Just reg -> RegReal reg
|
|
| 439 | + Just reg -> RegReal $ reg
|
|
| 444 | 440 | Nothing -> pprPanic "getRegisterReg-memory" (ppr $ CmmGlobal mid)
|
| 445 | 441 | -- By this stage, the only MagicIds remaining should be the
|
| 446 | 442 | -- ones which map to a real machine register on this
|
| ... | ... | @@ -4936,8 +4932,11 @@ data LoadArgs |
| 4936 | 4932 | -- | The code to assign arguments to registers used for argument passing.
|
| 4937 | 4933 | , assignArgsCode :: InstrBlock
|
| 4938 | 4934 | }
|
| 4939 | - deriving (Generic)
|
|
| 4940 | - deriving (Semigroup, Monoid) via Generically LoadArgs
|
|
| 4935 | +instance Semigroup LoadArgs where
|
|
| 4936 | + LoadArgs a1 d1 r1 j1 <> LoadArgs a2 d2 r2 j2
|
|
| 4937 | + = LoadArgs (a1 ++ a2) (d1 ++ d2) (r1 ++ r2) (j1 S.<> j2)
|
|
| 4938 | +instance Monoid LoadArgs where
|
|
| 4939 | + mempty = LoadArgs [] [] [] nilOL
|
|
| 4941 | 4940 | |
| 4942 | 4941 | -- | An argument passed on the stack, either directly or by reference.
|
| 4943 | 4942 | --
|
| 1 | 1 | {-# LANGUAGE CPP #-}
|
| 2 | 2 | {-# LANGUAGE MultiWayIf #-}
|
| 3 | 3 | {-# OPTIONS_GHC -fno-warn-type-defaults #-}
|
| 4 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 5 | -{-# LANGUAGE DerivingVia #-}
|
|
| 6 | 4 | |
| 7 | 5 | -- | Handle conversion of CmmProc to LLVM code.
|
| 8 | 6 | module GHC.CmmToLlvm.CodeGen ( genLlvmProc ) where
|
| ... | ... | @@ -31,8 +29,6 @@ import GHC.Data.FastString |
| 31 | 29 | import GHC.Data.Maybe (expectJust)
|
| 32 | 30 | import GHC.Data.OrdList
|
| 33 | 31 | |
| 34 | -import GHC.Generics (Generic, Generically(..))
|
|
| 35 | - |
|
| 36 | 32 | import GHC.Types.ForeignCall
|
| 37 | 33 | import GHC.Types.Unique.DSM
|
| 38 | 34 | import GHC.Types.Unique
|
| ... | ... | @@ -52,6 +48,7 @@ import Data.List ( nub ) |
| 52 | 48 | import qualified Data.List as List
|
| 53 | 49 | import Data.List.NonEmpty ( NonEmpty (..), nonEmpty )
|
| 54 | 50 | import Data.Maybe ( catMaybes )
|
| 51 | +import qualified Data.Semigroup as Semigroup
|
|
| 55 | 52 | |
| 56 | 53 | type Atomic = Maybe MemoryOrdering
|
| 57 | 54 | type LlvmStatements = OrdList LlvmStatement
|
| ... | ... | @@ -2478,8 +2475,14 @@ getTBAARegMeta = getTBAAMeta . getTBAA |
| 2478 | 2475 | |
| 2479 | 2476 | -- | A more convenient way of accumulating LLVM statements and declarations.
|
| 2480 | 2477 | data LlvmAccum = LlvmAccum LlvmStatements [LlvmCmmDecl]
|
| 2481 | - deriving (Generic)
|
|
| 2482 | - deriving (Monoid, Semigroup) via Generically LlvmAccum
|
|
| 2478 | + |
|
| 2479 | +instance Semigroup LlvmAccum where
|
|
| 2480 | + LlvmAccum stmtsA declsA <> LlvmAccum stmtsB declsB =
|
|
| 2481 | + LlvmAccum (stmtsA Semigroup.<> stmtsB) (declsA Semigroup.<> declsB)
|
|
| 2482 | + |
|
| 2483 | +instance Monoid LlvmAccum where
|
|
| 2484 | + mempty = LlvmAccum nilOL []
|
|
| 2485 | + mappend = (Semigroup.<>)
|
|
| 2483 | 2486 | |
| 2484 | 2487 | liftExprData :: LlvmM ExprData -> WriterT LlvmAccum LlvmM LlvmVar
|
| 2485 | 2488 | liftExprData action = do
|
| 1 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 2 | -{-# LANGUAGE DerivingVia #-}
|
|
| 3 | - |
|
| 4 | 1 | {-
|
| 5 | 2 | A simple homogeneous pair type with useful Functor, Applicative, and
|
| 6 | 3 | Traversable instances.
|
| ... | ... | @@ -23,12 +20,8 @@ import GHC.Prelude |
| 23 | 20 | import GHC.Utils.Outputable
|
| 24 | 21 | import qualified Data.Semigroup as Semi
|
| 25 | 22 | |
| 26 | -import GHC.Generics (Generic, Generically(..))
|
|
| 27 | - |
|
| 28 | 23 | data Pair a = Pair { pFst :: a, pSnd :: a }
|
| 29 | - deriving (Foldable, Functor, Traversable, Generic)
|
|
| 30 | - deriving (Semigroup, Monoid) via Generically (Pair a)
|
|
| 31 | - |
|
| 24 | + deriving (Foldable, Functor, Traversable)
|
|
| 32 | 25 | -- Note that Pair is a *unary* type constructor
|
| 33 | 26 | -- whereas (,) is binary
|
| 34 | 27 | |
| ... | ... | @@ -40,6 +33,13 @@ instance Applicative Pair where |
| 40 | 33 | pure x = Pair x x
|
| 41 | 34 | (Pair f g) <*> (Pair x y) = Pair (f x) (g y)
|
| 42 | 35 | |
| 36 | +instance Semi.Semigroup a => Semi.Semigroup (Pair a) where
|
|
| 37 | + Pair a1 b1 <> Pair a2 b2 = Pair (a1 Semi.<> a2) (b1 Semi.<> b2)
|
|
| 38 | + |
|
| 39 | +instance (Semi.Semigroup a, Monoid a) => Monoid (Pair a) where
|
|
| 40 | + mempty = Pair mempty mempty
|
|
| 41 | + mappend = (Semi.<>)
|
|
| 42 | + |
|
| 43 | 43 | instance Outputable a => Outputable (Pair a) where
|
| 44 | 44 | ppr (Pair a b) = ppr a <+> char '~' <+> ppr b
|
| 45 | 45 |
| 1 | 1 | {-# LANGUAGE TypeFamilies #-}
|
| 2 | +{-# LANGUAGE ViewPatterns #-}
|
|
| 2 | 3 | {-# LANGUAGE UndecidableInstances #-} -- Wrinkle in Note [Trees That Grow]
|
| 3 | 4 | -- in module Language.Haskell.Syntax.Extension
|
| 4 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 5 | -{-# LANGUAGE DerivingVia #-}
|
|
| 5 | + |
|
| 6 | 6 | {-# OPTIONS_GHC -Wno-orphans #-} -- NamedThing, Outputable, OutputableBndrId
|
| 7 | 7 | |
| 8 | 8 | {-
|
| ... | ... | @@ -117,7 +117,6 @@ import GHC.Core.Ppr ( pprOccWithTick) |
| 117 | 117 | import GHC.Core.Type
|
| 118 | 118 | import GHC.Core.Multiplicity( pprArrowWithModifiers )
|
| 119 | 119 | import GHC.Hs.Doc
|
| 120 | -import GHC.Generics (Generic, Generically(..))
|
|
| 121 | 120 | import GHC.Types.Basic
|
| 122 | 121 | import GHC.Types.SrcLoc
|
| 123 | 122 | import GHC.Utils.Outputable
|
| ... | ... | @@ -233,8 +232,6 @@ data HsTyPatRnBuilder = |
| 233 | 232 | hstpb_imp_tvs :: Bag Name,
|
| 234 | 233 | hstpb_exp_tvs :: Bag Name
|
| 235 | 234 | }
|
| 236 | - deriving (Generic)
|
|
| 237 | - deriving (Semigroup, Monoid) via Generically HsTyPatRnBuilder
|
|
| 238 | 235 | |
| 239 | 236 | tpBuilderExplicitTV :: Name -> HsTyPatRnBuilder
|
| 240 | 237 | tpBuilderExplicitTV name = mempty {hstpb_exp_tvs = unitBag name}
|
| ... | ... | @@ -246,6 +243,16 @@ tpBuilderPatSig HsPSRn {hsps_nwcs, hsps_imp_tvs} = |
| 246 | 243 | hstpb_imp_tvs = listToBag hsps_imp_tvs
|
| 247 | 244 | }
|
| 248 | 245 | |
| 246 | +instance Semigroup HsTyPatRnBuilder where
|
|
| 247 | + HsTPRnB nwcs1 imp_tvs1 exptvs1 <> HsTPRnB nwcs2 imp_tvs2 exptvs2 =
|
|
| 248 | + HsTPRnB
|
|
| 249 | + (nwcs1 `unionBags` nwcs2)
|
|
| 250 | + (imp_tvs1 `unionBags` imp_tvs2)
|
|
| 251 | + (exptvs1 `unionBags` exptvs2)
|
|
| 252 | + |
|
| 253 | +instance Monoid HsTyPatRnBuilder where
|
|
| 254 | + mempty = HsTPRnB emptyBag emptyBag emptyBag
|
|
| 255 | + |
|
| 249 | 256 | buildHsTyPatRn :: HsTyPatRnBuilder -> HsTyPatRn
|
| 250 | 257 | buildHsTyPatRn HsTPRnB {hstpb_nwcs, hstpb_imp_tvs, hstpb_exp_tvs} =
|
| 251 | 258 | HsTPRn {
|
| 1 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 2 | -{-# LANGUAGE DerivingVia #-}
|
|
| 3 | - |
|
| 4 | 1 | -- | This module coverage checks pattern matches. It finds
|
| 5 | 2 | --
|
| 6 | 3 | -- * Uncovered patterns, certifying non-exhaustivity
|
| ... | ... | @@ -66,7 +63,6 @@ import {-# SOURCE #-} GHC.HsToCore.Expr (dsLExpr) |
| 66 | 63 | import GHC.HsToCore.Monad
|
| 67 | 64 | import GHC.Data.Bag
|
| 68 | 65 | import GHC.Data.OrdList
|
| 69 | -import GHC.Generics (Generic, Generically(..))
|
|
| 70 | 66 | |
| 71 | 67 | import Control.Monad (when, forM_)
|
| 72 | 68 | import qualified Data.Semigroup as Semi
|
| ... | ... | @@ -468,8 +464,13 @@ data CIRB |
| 468 | 464 | , cirb_red :: !(OrdList SrcInfo) -- ^ Redundant clauses
|
| 469 | 465 | , cirb_bangs :: !(OrdList SrcInfo) -- ^ Redundant bang patterns
|
| 470 | 466 | }
|
| 471 | - deriving (Generic)
|
|
| 472 | - deriving (Semigroup, Monoid) via Generically CIRB
|
|
| 467 | + |
|
| 468 | +instance Semigroup CIRB where
|
|
| 469 | + CIRB a b c d <> CIRB e f g h = CIRB (a <> e) (b <> f) (c <> g) (d <> h)
|
|
| 470 | + where (<>) = (Semi.<>)
|
|
| 471 | + |
|
| 472 | +instance Monoid CIRB where
|
|
| 473 | + mempty = CIRB mempty mempty mempty mempty
|
|
| 473 | 474 | |
| 474 | 475 | -- See Note [Determining inaccessible clauses]
|
| 475 | 476 | ensureOneNotRedundant :: CIRB -> CIRB
|
| ... | ... | @@ -2,8 +2,6 @@ |
| 2 | 2 | {-# LANGUAGE ViewPatterns #-}
|
| 3 | 3 | {-# LANGUAGE MultiWayIf #-}
|
| 4 | 4 | {-# LANGUAGE TypeFamilies #-}
|
| 5 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 6 | -{-# LANGUAGE DerivingVia #-}
|
|
| 7 | 5 | |
| 8 | 6 | -- | Domain types used in "GHC.HsToCore.Pmc.Solver".
|
| 9 | 7 | -- The ultimate goal is to define 'Nabla', which models normalised refinement
|
| ... | ... | @@ -71,7 +69,6 @@ import GHC.Types.CompleteMatch |
| 71 | 69 | import GHC.Types.SourceText (SourceText(..), mkFractionalLit, FractionalLit
|
| 72 | 70 | , fractionalLitFromRational
|
| 73 | 71 | , FractionalExponentBase(..))
|
| 74 | -import GHC.Generics (Generic, Generically(..))
|
|
| 75 | 72 | |
| 76 | 73 | import Numeric (fromRat)
|
| 77 | 74 | import Data.Ratio
|
| ... | ... | @@ -108,13 +105,19 @@ instance Outputable Nabla where |
| 108 | 105 | |
| 109 | 106 | -- | A disjunctive bag of 'Nabla's, representing a refinement type.
|
| 110 | 107 | newtype Nablas = MkNablas (Bag Nabla)
|
| 111 | - -- deriving 'Outputable' removes `MkNablas` label
|
|
| 112 | - deriving (Generic, Outputable)
|
|
| 113 | - deriving (Semigroup, Monoid) via Generically Nablas
|
|
| 114 | 108 | |
| 115 | 109 | initNablas :: Nablas
|
| 116 | 110 | initNablas = MkNablas (unitBag initNabla)
|
| 117 | 111 | |
| 112 | +instance Outputable Nablas where
|
|
| 113 | + ppr (MkNablas nablas) = ppr nablas
|
|
| 114 | + |
|
| 115 | +instance Semigroup Nablas where
|
|
| 116 | + MkNablas l <> MkNablas r = MkNablas (l `unionBags` r)
|
|
| 117 | + |
|
| 118 | +instance Monoid Nablas where
|
|
| 119 | + mempty = MkNablas emptyBag
|
|
| 120 | + |
|
| 118 | 121 | -- | The type oracle state. An 'GHC.Tc.Solver.Monad.InertSet' that we
|
| 119 | 122 | -- incrementally add local type constraints to, together with a sequence
|
| 120 | 123 | -- number that counts the number of times we extended it with new facts.
|
| 1 | 1 | {-# LANGUAGE ApplicativeDo #-}
|
| 2 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 3 | 2 | {-# LANGUAGE DerivingVia #-}
|
| 4 | 3 | {-# LANGUAGE TypeFamilies #-}
|
| 5 | 4 | |
| ... | ... | @@ -62,7 +61,6 @@ import {-# SOURCE #-} GHC.Parser (parseIdentifier) |
| 62 | 61 | import GHC.Parser.Lexer
|
| 63 | 62 | import GHC.Parser.HaddockLex
|
| 64 | 63 | import GHC.Parser.Errors.Types
|
| 65 | -import GHC.Generics (Generic, Generically(..))
|
|
| 66 | 64 | import GHC.Utils.Misc (mergeListsBy, filterOut, (<&&>))
|
| 67 | 65 | import qualified GHC.Data.Strict as Strict
|
| 68 | 66 | |
| ... | ... | @@ -1349,8 +1347,13 @@ data LocRange = |
| 1349 | 1347 | { loc_range_from :: !LowerLocBound,
|
| 1350 | 1348 | loc_range_to :: !UpperLocBound,
|
| 1351 | 1349 | loc_range_col :: !ColumnBound }
|
| 1352 | - deriving (Generic)
|
|
| 1353 | - deriving (Semigroup, Monoid) via Generically LocRange
|
|
| 1350 | + |
|
| 1351 | +instance Semigroup LocRange where
|
|
| 1352 | + LocRange from1 to1 col1 <> LocRange from2 to2 col2 =
|
|
| 1353 | + LocRange (from1 <> from2) (to1 <> to2) (col1 <> col2)
|
|
| 1354 | + |
|
| 1355 | +instance Monoid LocRange where
|
|
| 1356 | + mempty = LocRange mempty mempty mempty
|
|
| 1354 | 1357 | |
| 1355 | 1358 | -- The location range from the specified position to the end of the file.
|
| 1356 | 1359 | locRangeFrom :: Strict.Maybe BufPos -> LocRange
|
| 1 | 1 | {-# LANGUAGE DuplicateRecordFields #-}
|
| 2 | 2 | {-# LANGUAGE MultiWayIf #-}
|
| 3 | 3 | {-# LANGUAGE RecursiveDo #-}
|
| 4 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 5 | -{-# LANGUAGE DerivingVia #-}
|
|
| 6 | 4 | |
| 7 | 5 | {-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
|
| 8 | 6 | {-
|
| ... | ... | @@ -147,13 +145,13 @@ import GHC.Utils.Outputable |
| 147 | 145 | import GHC.Utils.Panic
|
| 148 | 146 | import GHC.Utils.Constants (debugIsOn)
|
| 149 | 147 | |
| 150 | -import GHC.Generics (Generic, Generically(..))
|
|
| 151 | - |
|
| 152 | 148 | import Control.Monad
|
| 153 | 149 | import Data.IORef
|
| 154 | 150 | import GHC.Data.Maybe
|
| 155 | 151 | import GHC.Types.Name.Reader
|
| 156 | 152 | |
| 153 | +import qualified Data.Semigroup as Semi
|
|
| 154 | + |
|
| 157 | 155 | {-
|
| 158 | 156 | ************************************************************************
|
| 159 | 157 | * *
|
| ... | ... | @@ -1281,8 +1279,17 @@ data CandidatesQTvs |
| 1281 | 1279 | -- These are covars. Included only so that we don't repeatedly
|
| 1282 | 1280 | -- look at covars' kinds in accumulator. Not used by quantifyTyVars.
|
| 1283 | 1281 | }
|
| 1284 | - deriving (Generic)
|
|
| 1285 | - deriving (Semigroup, Monoid) via Generically CandidatesQTvs
|
|
| 1282 | + |
|
| 1283 | +instance Semi.Semigroup CandidatesQTvs where
|
|
| 1284 | + (DV { dv_kvs = kv1, dv_tvs = tv1, dv_cvs = cv1 })
|
|
| 1285 | + <> (DV { dv_kvs = kv2, dv_tvs = tv2, dv_cvs = cv2 })
|
|
| 1286 | + = DV { dv_kvs = kv1 `unionDVarSet` kv2
|
|
| 1287 | + , dv_tvs = tv1 `unionDVarSet` tv2
|
|
| 1288 | + , dv_cvs = cv1 `unionVarSet` cv2 }
|
|
| 1289 | + |
|
| 1290 | +instance Monoid CandidatesQTvs where
|
|
| 1291 | + mempty = DV { dv_kvs = emptyDVarSet, dv_tvs = emptyDVarSet, dv_cvs = emptyVarSet }
|
|
| 1292 | + mappend = (Semi.<>)
|
|
| 1286 | 1293 | |
| 1287 | 1294 | instance Outputable CandidatesQTvs where
|
| 1288 | 1295 | ppr (DV {dv_kvs = kvs, dv_tvs = tvs, dv_cvs = cvs })
|
| ... | ... | @@ -44,7 +44,6 @@ import GHC.Types.Unique |
| 44 | 44 | |
| 45 | 45 | import Data.Coerce
|
| 46 | 46 | import Data.Data
|
| 47 | -import Data.Semigroup
|
|
| 48 | 47 | |
| 49 | 48 | -- See Note [UniqSet invariant] in GHC.Types.Unique.Set for why we want a newtype here.
|
| 50 | 49 | -- Beyond preserving invariants, we may also want to 'override' typeclass
|
| ... | ... | @@ -155,9 +154,3 @@ instance Outputable a => Outputable (UniqDSet a) where |
| 155 | 154 | |
| 156 | 155 | pprUniqDSet :: (a -> SDoc) -> UniqDSet a -> SDoc
|
| 157 | 156 | pprUniqDSet f = braces . pprWithCommas f . uniqDSetToList |
| 158 | - |
|
| 159 | -instance Semigroup (UniqDSet a) where
|
|
| 160 | - (<>) = unionUniqDSets
|
|
| 161 | - |
|
| 162 | -instance Monoid (UniqDSet a) where
|
|
| 163 | - mempty = emptyUniqDSet |
| ... | ... | @@ -142,6 +142,8 @@ import Control.DeepSeq |
| 142 | 142 | import Control.Monad ( when, (<$!>), unless, forM_, void )
|
| 143 | 143 | import Foreign hiding (bit, setBit, clearBit, shiftL, shiftR, void)
|
| 144 | 144 | import Data.Array
|
| 145 | +import Data.Array.Base (unsafeFreezeIOArray)
|
|
| 146 | +import Data.Array.IArray (traverseArray_)
|
|
| 145 | 147 | import Data.Array.IO
|
| 146 | 148 | import Data.Array.Unsafe
|
| 147 | 149 | import qualified Data.Binary as Binary
|
| ... | ... | @@ -970,11 +972,12 @@ instance Binary a => Binary (NonEmpty a) where |
| 970 | 972 | instance (Ix a, Binary a, Binary b) => Binary (Array a b) where
|
| 971 | 973 | put_ bh arr = do
|
| 972 | 974 | put_ bh $ bounds arr
|
| 973 | - put_ bh $ elems arr
|
|
| 975 | + traverseArray_ (put_ bh) arr
|
|
| 976 | + |
|
| 974 | 977 | get bh = do
|
| 975 | - bounds <- get bh
|
|
| 976 | - xs <- get bh
|
|
| 977 | - return $ listArray bounds xs
|
|
| 978 | + (l, u) <- get bh
|
|
| 979 | + marr <- newGenArray (l, u) $ \_ -> get bh
|
|
| 980 | + unsafeFreezeIOArray marr
|
|
| 978 | 981 | |
| 979 | 982 | instance Binary a => Binary (SmallArray a) where
|
| 980 | 983 | put_ bh sa = do
|
| 1 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 2 | -{-# LANGUAGE DerivingVia #-}
|
|
| 3 | - |
|
| 4 | 1 | module GHC.Utils.Ppr.Colour where
|
| 5 | 2 | import GHC.Prelude.Basic
|
| 6 | 3 | |
| 7 | 4 | import Data.Maybe (fromMaybe)
|
| 8 | 5 | import GHC.Data.Bool
|
| 9 | -import GHC.Generics (Generic, Generically(..))
|
|
| 6 | +import Data.Semigroup as Semi
|
|
| 10 | 7 | |
| 11 | 8 | -- | A colour\/style for use with 'coloured'.
|
| 12 | 9 | newtype PprColour = PprColour { renderColour :: String }
|
| 13 | - deriving (Generic)
|
|
| 14 | - deriving (Semigroup, Monoid) via Generically PprColour
|
|
| 10 | + |
|
| 11 | +instance Semi.Semigroup PprColour where
|
|
| 12 | + PprColour s1 <> PprColour s2 = PprColour (s1 <> s2)
|
|
| 13 | + |
|
| 14 | +-- | Allow colours to be combined (e.g. bold + red);
|
|
| 15 | +-- In case of conflict, right side takes precedence.
|
|
| 16 | +instance Monoid PprColour where
|
|
| 17 | + mempty = PprColour mempty
|
|
| 18 | + mappend = (<>)
|
|
| 15 | 19 | |
| 16 | 20 | renderColourAfresh :: PprColour -> String
|
| 17 | 21 | renderColourAfresh c = renderColour (colReset `mappend` c)
|
| ... | ... | @@ -547,7 +547,7 @@ AC_SUBST(InstallNameToolCmd) |
| 547 | 547 | # versions of LLVM simultaneously, but that stopped working around
|
| 548 | 548 | # 3.5/3.6 release of LLVM.
|
| 549 | 549 | LlvmMinVersion=13 # inclusive
|
| 550 | -LlvmMaxVersion=22 # not inclusive
|
|
| 550 | +LlvmMaxVersion=23 # not inclusive
|
|
| 551 | 551 | AC_SUBST([LlvmMinVersion])
|
| 552 | 552 | AC_SUBST([LlvmMaxVersion])
|
| 553 | 553 |
| ... | ... | @@ -166,18 +166,6 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH |
| 166 | 166 | <td>-O</td>
|
| 167 | 167 | <td>-O</td>
|
| 168 | 168 | </tr>
|
| 169 | - <tr>
|
|
| 170 | - <th>static</td>
|
|
| 171 | - <td></td>
|
|
| 172 | - <td>-O<br>+RTS<br>-O64M<br>-RTS<br>-fPIC -static</td>
|
|
| 173 | - <td>-O<br>+RTS<br>-O64M<br>-RTS<br>-fPIC -static</td>
|
|
| 174 | - <td></td>
|
|
| 175 | - <td>-O2</td>
|
|
| 176 | - <td>-O2</td>
|
|
| 177 | - <td>-O2</td>
|
|
| 178 | - <td>-O<br>-optl -static</td>
|
|
| 179 | - <td>-O2<br>-optl -static</td>
|
|
| 180 | - </tr>
|
|
| 181 | 169 | </table>
|
| 182 | 170 | |
| 183 | 171 | ## Flavour transformers
|
| ... | ... | @@ -335,18 +323,6 @@ The supported transformers are listed below: |
| 335 | 323 | </tr>
|
| 336 | 324 | </table>
|
| 337 | 325 | |
| 338 | -### Static
|
|
| 339 | - |
|
| 340 | -The `static` flavour does not strictly follow the groupings in the table
|
|
| 341 | -above because it links all the executables statically, not just GHC
|
|
| 342 | -itself, and because it passes `-optc -static` when delegating to a C
|
|
| 343 | -compiler. It also turns off dynamic linking at runtime by by adding the
|
|
| 344 | -`-dynamic-system-linker` cabal flag to the `ghc` package build because
|
|
| 345 | -`musl` doesn't allow dynamic linking in executables that were statically
|
|
| 346 | -linked against `libc`. Static flags are only added when building in a
|
|
| 347 | -non-dynamic _way_. Some of the considerations for a static build aren't
|
|
| 348 | -a great fit for the flavour system, so it's a little bit hacky.
|
|
| 349 | - |
|
| 350 | 326 | ## Ways
|
| 351 | 327 | |
| 352 | 328 | Libraries and GHC can be built in different _ways_, e.g. with or without profiling
|