From gitlab at gitlab.haskell.org Sat Feb 1 00:22:39 2025 From: gitlab at gitlab.haskell.org (Bodigrim (@Bodigrim)) Date: Fri, 31 Jan 2025 19:22:39 -0500 Subject: [Git][ghc/ghc][wip/ne-cyclic-scc] Replace CyclicSCC with NECyclicSCC in a few trivial places Message-ID: <679d694fc314a_16cd61507fc0674f4@gitlab.mail> Bodigrim pushed to branch wip/ne-cyclic-scc at Glasgow Haskell Compiler / GHC Commits: c8cf9773 by Andrew Lelechenko at 2025-02-01T00:22:26+00:00 Replace CyclicSCC with NECyclicSCC in a few trivial places - - - - - 14 changed files: - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/Data/Graph/Directed/Reachability.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/HsToCore/Binds.hs - compiler/GHC/Iface/Recomp.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/StgToJS/Sinker/Sinker.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Unit/State.hs - compiler/GHC/Utils/Outputable.hs - ghc/Main.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs Changes: ===================================== compiler/GHC/CmmToAsm/CFG.hs ===================================== @@ -804,7 +804,7 @@ loopMembers cfg = setLevel :: SCC BlockId -> LabelMap Bool -> LabelMap Bool setLevel (AcyclicSCC bid) m = mapInsert bid False m - setLevel (CyclicSCC bids) m = foldl' (\m k -> mapInsert k True m) m bids + setLevel (NECyclicSCC bids) m = foldl' (\m k -> mapInsert k True m) m bids loopLevels :: CFG -> BlockId -> LabelMap Int loopLevels cfg root = liLevels loopInfos ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -140,6 +140,8 @@ import GHC.Platform import Data.Containers.ListUtils import Data.Maybe import Data.List (sortOn) +import Data.List.NonEmpty (NonEmpty) +import qualified Data.List.NonEmpty as NE import Control.Monad -- ----------------------------------------------------------------------------- @@ -273,7 +275,7 @@ linearRA_SCCs entry_ids block_live blocksAcc (AcyclicSCC block : sccs) ((reverse blocks') ++ blocksAcc) sccs -linearRA_SCCs entry_ids block_live blocksAcc (CyclicSCC blocks : sccs) +linearRA_SCCs entry_ids block_live blocksAcc (NECyclicSCC blocks : sccs) = do blockss' <- process entry_ids block_live blocks linearRA_SCCs entry_ids block_live @@ -295,10 +297,10 @@ linearRA_SCCs entry_ids block_live blocksAcc (CyclicSCC blocks : sccs) process :: forall freeRegs instr. (OutputableRegConstraint freeRegs instr) => [BlockId] -> BlockMap (UniqSet RegWithFormat) - -> [GenBasicBlock (LiveInstr instr)] + -> NonEmpty (GenBasicBlock (LiveInstr instr)) -> RegM freeRegs [[NatBasicBlock instr]] process entry_ids block_live = - \blocks -> go blocks [] (return []) False + \blocks -> go (NE.toList blocks) [] (return []) False where go :: [GenBasicBlock (LiveInstr instr)] -> [GenBasicBlock (LiveInstr instr)] ===================================== compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs ===================================== @@ -33,6 +33,8 @@ import GHC.Utils.Outputable import GHC.CmmToAsm.Format import GHC.Types.Unique.Set +import Data.List.NonEmpty (NonEmpty(..)) + -- | For a jump instruction at the end of a block, generate fixup code so its -- vregs are in the correct regs for its destination. -- @@ -327,7 +329,7 @@ handleComponent delta _ (AcyclicSCC (DigraphNode vreg src dsts)) -- require a fixup. -- handleComponent delta instr - (CyclicSCC ((DigraphNode vreg (InReg (RealRegUsage sreg scls)) ((InReg (RealRegUsage dreg dcls): _))) : rest)) + (NECyclicSCC ((DigraphNode vreg (InReg (RealRegUsage sreg scls)) ((InReg (RealRegUsage dreg dcls): _))) :| rest)) -- dest list may have more than one element, if the reg is also InMem. = do -- spill the source into its slot @@ -344,7 +346,7 @@ handleComponent delta instr -- so we don't end up clobbering the source values. return (instrSpill ++ concat remainingFixUps ++ instrLoad) -handleComponent _ _ (CyclicSCC _) +handleComponent _ _ (NECyclicSCC _) = panic "Register Allocator: handleComponent cyclic" ===================================== compiler/GHC/Data/Graph/Directed/Reachability.hs ===================================== @@ -21,6 +21,7 @@ import Data.Graph ( Vertex, SCC(..) ) import Data.Array ((!)) import qualified Data.IntMap as IM import qualified Data.IntSet as IS +import qualified Data.List.NonEmpty as NE import GHC.Data.Graph.Directed.Internal @@ -84,9 +85,9 @@ cyclicGraphReachability (Graph g from to) = earlier_neighbours = neighboursOf v earlier_further = mapMaybe (flip IM.lookup earlier) earlier_neighbours all_remotes = IS.unions (IS.fromList earlier_neighbours : earlier_further) - add_one_comp earlier (CyclicSCC vs) = IM.union (IM.fromList [(v, local v `IS.union` all_remotes) | v <- vs]) earlier + add_one_comp earlier (NECyclicSCC vs) = IM.union (IM.fromList [(v, local v `IS.union` all_remotes) | v <- NE.toList vs]) earlier where - all_locals = IS.fromList vs + all_locals = IS.fromList (NE.toList vs) local v = IS.delete v all_locals -- Arguably, for a cyclic SCC we should include each -- vertex in its own reachable set. However, this could ===================================== compiler/GHC/Driver/MakeFile.hs ===================================== @@ -211,9 +211,9 @@ processDeps :: DynFlags -- -- For {-# SOURCE #-} imports the "hi" will be "hi-boot". -processDeps _ _ _ _ _ (CyclicSCC nodes) +processDeps _ _ _ _ _ (NECyclicSCC nodes) = -- There shouldn't be any cycles; report them - throwOneError $ cyclicModuleErr nodes + throwOneError $ cyclicModuleErr $ NE.toList nodes processDeps _ _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) = -- There shouldn't be any backpack instantiations; report them as well ===================================== compiler/GHC/HsToCore/Binds.hs ===================================== @@ -75,6 +75,7 @@ import GHC.Data.Maybe import GHC.Data.OrdList import GHC.Data.Graph.Directed import GHC.Data.Bag +import qualified Data.List.NonEmpty as NE import qualified Data.Set as S import GHC.Utils.Constants (debugIsOn) @@ -1384,9 +1385,9 @@ dsEvBinds ev_binds thing_inside new_unspecables | transitively_unspecable = S.singleton v | otherwise = mempty - ds_component unspecables (CyclicSCC nodes) = (Rec pairs, new_unspecables) + ds_component unspecables (NECyclicSCC nodes) = (Rec pairs, new_unspecables) where - (pairs, direct_canonicity) = unzip $ map unpack_node nodes + (pairs, direct_canonicity) = unzip $ map unpack_node $ NE.toList nodes is_unspecable_remote dep = dep `S.member` unspecables transitively_unspecable = or [ is_unspecable this_canonical || any is_unspecable_remote deps ===================================== compiler/GHC/Iface/Recomp.hs ===================================== @@ -70,6 +70,7 @@ import GHC.Unit.Module.Deps import Control.Monad import Data.List (sortBy, sort, sortOn) +import qualified Data.List.NonEmpty as NE import qualified Data.Map as Map import qualified Data.Set as Set import Data.Word (Word64) @@ -1062,8 +1063,8 @@ addFingerprints hsc_env iface0 env' <- extend_hash_env local_env (hash,decl) return (env', (hash,decl) : decls_w_hashes) - fingerprint_group (local_env, decls_w_hashes) (CyclicSCC abis) - = do let stable_abis = sortBy cmp_abiNames abis + fingerprint_group (local_env, decls_w_hashes) (NECyclicSCC abis) + = do let stable_abis = sortBy cmp_abiNames (NE.toList abis) stable_decls = map abiDecl stable_abis local_env1 <- foldM extend_hash_env local_env (zip (map mkRecFingerprint [0..]) stable_decls) ===================================== compiler/GHC/Rename/Bind.hs ===================================== @@ -77,6 +77,7 @@ import Language.Haskell.Syntax.Basic (FieldLabelString(..)) import Control.Monad import Data.List ( partition ) import Data.List.NonEmpty ( NonEmpty(..) ) +import qualified Data.List.NonEmpty as NE import GHC.Types.Unique.DSet (mkUniqDSet) import GHC.Data.BooleanFormula (bfTraverse) @@ -651,13 +652,13 @@ depAnalBinds binds_w_dus binds_w_dus get_binds (AcyclicSCC (bind, _, _)) = (NonRecursive, [bind]) - get_binds (CyclicSCC binds_w_dus) = (Recursive, [b | (b,_,_) <- binds_w_dus]) + get_binds (NECyclicSCC binds_w_dus) = (Recursive, [b | (b,_,_) <- NE.toList binds_w_dus]) get_du (AcyclicSCC (_, bndrs, uses)) = (Just (mkNameSet bndrs), uses) - get_du (CyclicSCC binds_w_dus) = (Just defs, uses) + get_du (NECyclicSCC binds_w_dus) = (Just defs, uses) where - defs = mkNameSet [b | (_,bs,_) <- binds_w_dus, b <- bs] - uses = unionNameSets [u | (_,_,u) <- binds_w_dus] + defs = mkNameSet [b | (_,bs,_) <- NE.toList binds_w_dus, b <- bs] + uses = unionNameSets [u | (_,_,u) <- NE.toList binds_w_dus] --------------------- -- Bind the top-level forall'd type variables in the sigs. ===================================== compiler/GHC/StgToJS/Sinker/Sinker.hs ===================================== @@ -137,6 +137,6 @@ topSortDecls _m binds = rest ++ nr' [ (i, b) | StgVarArg i <- args, i `elementOfUniqSet` keys ] collectDeps _ = [] g = graphFromVerticesAndAdjacency vs (concatMap collectDeps nr) - nr' | (not . null) [()| CyclicSCC _ <- stronglyConnCompG g] + nr' | (not . null) [()| NECyclicSCC _ <- stronglyConnCompG g] = error "topSortDecls: unexpected cycle" | otherwise = map node_payload (topologicalSortG g) ===================================== compiler/GHC/Tc/Gen/Bind.hs ===================================== @@ -92,6 +92,7 @@ import GHC.Data.Maybe import Control.Monad import Data.Foldable (find, traverse_) +import qualified Data.List.NonEmpty as NE {- ************************************************************************ @@ -398,7 +399,7 @@ tc_group top_lvl sig_fn prag_fn (Recursive, binds) closed thing_inside go [] = do { thing <- thing_inside; return ([], thing) } tc_scc (AcyclicSCC bind) = tc_sub_group NonRecursive [bind] - tc_scc (CyclicSCC binds) = tc_sub_group Recursive binds + tc_scc (NECyclicSCC binds) = tc_sub_group Recursive (NE.toList binds) tc_sub_group rec_tc binds = tcPolyBinds top_lvl sig_fn prag_fn Recursive rec_tc closed binds ===================================== compiler/GHC/Unit/State.hs ===================================== @@ -111,6 +111,7 @@ import Control.Monad import Data.Graph (stronglyConnComp, SCC(..)) import Data.Char ( toUpper ) import Data.List ( intersperse, partition, sortBy, isSuffixOf, sortOn ) +import qualified Data.List.NonEmpty as NE import Data.Set (Set) import Data.Monoid (First(..)) import qualified Data.Semigroup as Semigroup @@ -1266,10 +1267,10 @@ reportCycles :: Logger -> [SCC UnitInfo] -> IO () reportCycles logger sccs = mapM_ report sccs where report (AcyclicSCC _) = return () - report (CyclicSCC vs) = + report (NECyclicSCC vs) = debugTraceMsg logger 2 $ text "these packages are involved in a cycle:" $$ - nest 2 (hsep (map (ppr . unitId) vs)) + nest 2 (hsep (map (ppr . unitId) (NE.toList vs))) reportUnusable :: Logger -> UnusableUnits -> IO () reportUnusable logger pkgs = mapM_ report (nonDetUniqMapToList pkgs) @@ -1431,7 +1432,7 @@ validateDatabase cfg pkg_map1 = -- Find recursive units sccs = stronglyConnComp [ (pkg, unitId pkg, unitDepends pkg) | pkg <- nonDetEltsUniqMap pkg_map2 ] - getCyclicSCC (CyclicSCC vs) = map unitId vs + getCyclicSCC (NECyclicSCC vs) = map unitId (NE.toList vs) getCyclicSCC (AcyclicSCC _) = [] (pkg_map3, cyclic) = removeUnits (concatMap getCyclicSCC sccs) index pkg_map2 unusable_cyclic = mk_unusable CyclicDependencies depsNotAvailable pkg_map3 cyclic ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1069,7 +1069,7 @@ instance Outputable Fingerprint where instance Outputable a => Outputable (SCC a) where ppr (AcyclicSCC v) = text "NONREC" $$ (nest 3 (ppr v)) - ppr (CyclicSCC vs) = text "REC" $$ (nest 3 (vcat (map ppr vs))) + ppr (NECyclicSCC vs) = text "REC" $$ (nest 3 (vcat (map ppr (NEL.toList vs)))) instance Outputable Serialized where ppr (Serialized the_type bytes) = int (length bytes) <+> text "of type" <+> text (show the_type) ===================================== ghc/Main.hs ===================================== @@ -898,7 +898,7 @@ checkUnitCycles dflags graph = processSCCs (HUG.hugSCCs graph) processSCCs [] = return () processSCCs (AcyclicSCC _: other_sccs) = processSCCs other_sccs - processSCCs (CyclicSCC uids: _) = throwGhcException $ CmdLineError $ showSDoc dflags (cycle_err uids) + processSCCs (NECyclicSCC uids: _) = throwGhcException $ CmdLineError $ showSDoc dflags (cycle_err uids) cycle_err uids = @@ -910,8 +910,8 @@ checkUnitCycles dflags graph = processSCCs (HUG.hugSCCs graph) (map (\uid -> text "-" <+> ppr uid <+> text "depends on") start) ++ [text "-" <+> ppr final] where - start = init uids - final = last uids + start = NE.init uids + final = NE.last uids -- | Check that we don't have multiple units with the same UnitId. checkDuplicateUnits :: DynFlags -> [(FilePath, DynFlags)] -> Ghc () ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -229,7 +229,7 @@ createIfaces verbosity modules flags instIfaceMap = do | NotBoot <- isBootSummary ms = [ms] | otherwise = [] go (AcyclicSCC _) = [] - go (CyclicSCC _) = error "haddock: module graph cyclic even with boot files" + go (NECyclicSCC _) = error "haddock: module graph cyclic even with boot files" -- Visit modules in that order sortedMods = concatMap go $ topSortModuleGraph False modGraph Nothing View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c8cf9773c9f32f8c069a89e22db06f93454bfa83 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c8cf9773c9f32f8c069a89e22db06f93454bfa83 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 09:41:53 2025 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Sat, 01 Feb 2025 04:41:53 -0500 Subject: [Git][ghc/ghc][wip/T24359] WIP: another approach to 'fully solving' for tcSpecPrag Message-ID: <679dec6176d66_f377013f4430871c@gitlab.mail> sheaf pushed to branch wip/T24359 at Glasgow Haskell Compiler / GHC Commits: e3f56022 by sheaf at 2025-02-01T10:41:44+01:00 WIP: another approach to 'fully solving' for tcSpecPrag - - - - - 2 changed files: - compiler/GHC/Tc/Gen/Sig.hs - testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs Changes: ===================================== compiler/GHC/Tc/Gen/Sig.hs ===================================== @@ -39,7 +39,7 @@ import GHC.Tc.Gen.HsType import GHC.Tc.Solver( reportUnsolvedEqualities, pushLevelAndSolveEqualitiesX , emitResidualConstraints ) import GHC.Tc.Solver.Solve( solveWanteds ) -import GHC.Tc.Solver.Monad( runTcS, runTcSSpecPragWithEvBinds ) +import GHC.Tc.Solver.Monad( runTcS, runTcSWithEvBinds ) import GHC.Tc.Validity ( checkValidType ) import GHC.Tc.Utils.Monad @@ -57,6 +57,7 @@ import GHC.Tc.Zonk.TcType import GHC.Tc.Zonk.Type import GHC.Core( hasSomeUnfolding ) +import GHC.Core.FVs (exprSomeFreeVars) import GHC.Core.Type import GHC.Core.Multiplicity import GHC.Core.Predicate @@ -71,6 +72,7 @@ import GHC.Types.Basic import GHC.Types.Name import GHC.Types.Name.Env import GHC.Types.SrcLoc +import GHC.Types.Unique.Set import GHC.Builtin.Names( mkUnboundName ) import GHC.Unit.Module( Module, getModule ) @@ -80,12 +82,15 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Data.Bag -import GHC.Data.Maybe( orElse, whenIsJust ) +import GHC.Data.Maybe( orElse, whenIsJust, expectJust ) import Control.Monad( unless ) import Data.Foldable ( toList ) +import qualified Data.Graph as Graph +import Data.List ((\\), nub) import qualified Data.List.NonEmpty as NE import Data.Maybe( mapMaybe ) +import qualified Data.Semigroup as S {- ------------------------------------------------------------- @@ -976,27 +981,67 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) let skol_info_anon = SpecESkol nm ; traceTc "tcSpecPrag SpecSigE 1" (ppr nm $$ ppr spec_e) ; skol_info <- mkSkolemInfo skol_info_anon - ; (rhs_tclvl, wanted, (rule_bndrs', (tc_spec_e, _rho))) + ; (rhs_tclvl, spec_e_wanted, (rule_bndrs', (tc_spec_e, _rho))) <- tcRuleBndrs skol_info rule_bndrs $ tcInferRho spec_e - -- (2) Simplify the constraints, in special TcSSpecPrag mode + -- (2) Solve the Wanteds that arose from typechecking spec_e, but + -- in a special way: every original Wanted should be either fully solved + -- or left untouched. + -- + -- We achieve this by: + -- + -- 2.1. Clone the wanteds that arose from typechecking spec_e. + -- + -- 2.2 Try to solve them, and look through the evidence to see which + -- ones we could fully solve. + -- + -- 2.3 Separate the original Wanteds into two groups, those that + -- we could fully solve and those that we couldn't + -- + -- The fully soluble ones get solved again (a bit wasteful). + -- The other ones either get quantified or emitted as residuals, + -- depending on whether they can be quantified (see 'getRuleQuantCts'.) + ; ev_binds_var_clone <- newTcEvBinds + ; spec_e_wanted_clone <- cloneWC spec_e_wanted + ; simpl_spec_e_wanted_clone <- setTcLevel rhs_tclvl $ + runTcSWithEvBinds ev_binds_var_clone $ + solveWanteds spec_e_wanted_clone + ; not_fully_solved <- + notFullySolvedWanteds ev_binds_var_clone simpl_spec_e_wanted_clone + + ; spec_e_wanted <- liftZonkM $ zonkWC spec_e_wanted + + ; let (fully_soluble1, other1) = + partitionWC + (\ ev_id -> not (ev_id `elemVarSet` not_fully_solved)) + spec_e_wanted + ; ev_binds_var <- newTcEvBinds - ; wanted <- setTcLevel rhs_tclvl $ - runTcSSpecPragWithEvBinds ev_binds_var $ - solveWanteds wanted + ; simpl_fully_soluble1 <- setTcLevel rhs_tclvl $ + runTcSWithEvBinds ev_binds_var $ + solveWanteds fully_soluble1 + ; massertPpr (isSolvedWC simpl_fully_soluble1) $ + vcat [ text "tcSpecPrag: fully soluble Wanteds couldn't be fully solved?" + , text "spec_e_wanted:" <+> ppr spec_e_wanted + , text "spec_e_wanted_clone:" <+> ppr spec_e_wanted_clone + , text "simpl_spec_e_wanted_clone:" <+> ppr simpl_spec_e_wanted_clone + , text "not_fully_solved:" <+> ppr not_fully_solved + , text "fully_soluble1:" <+> ppr fully_soluble1 + , text "other1:" <+> ppr other1 + , text "simpl_fully_soluble1:" <+> ppr simpl_fully_soluble1 + ] -- (3) Quantify over the constraints - ; qevs <- mapM newEvVar $ - ctsPreds $ - approximateWC False wanted + ; (quant_cts, residual) <- getRuleQuantCts other1 + ; let qevs = map ctEvId $ bagToList quant_cts -- (4) Emit the residual (non-quantified) constraints, -- and wrap the expression in the evidence let bindings ; let tv_bndrs = filter isTyVar rule_bndrs' ; emitResidualConstraints rhs_tclvl skol_info_anon ev_binds_var emptyVarSet tv_bndrs qevs - wanted + residual ; let lhs_call = mkLHsWrap (WpLet (TcEvBinds ev_binds_var)) tc_spec_e ; traceTc "tcSpecPrag:SpecSigE" $ @@ -1004,7 +1049,19 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) , text "rule_bndrs':" <+> ppr rule_bndrs' , text "qevs:" <+> ppr qevs , text "spec_e:" <+> ppr tc_spec_e - , text "inl:" <+> ppr inl ] + , text "inl:" <+> ppr inl + , text (replicate 40 '=') + , text "spec_e_wanted:" <+> ppr spec_e_wanted + , text "spec_e_wanted_clone:" <+> ppr spec_e_wanted_clone + , text "simpl_spec_e_wanted_clone:" <+> ppr simpl_spec_e_wanted_clone + , text "not_fully_solved:" <+> ppr not_fully_solved + , text "fully_soluble1:" <+> ppr fully_soluble1 + , text "other1:" <+> ppr other1 + , text "simpl_fully_soluble1:" <+> ppr simpl_fully_soluble1 + , text (replicate 40 '-') + , text "quant_cts:" <+> ppr quant_cts + , text "residual:" <+> ppr residual + ] ; return [SpecPragE { spe_fn_nm = nm , spe_fn_id = poly_id @@ -1015,6 +1072,73 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) tcSpecPrag _ prag = pprPanic "tcSpecPrag" (ppr prag) +-- | Figure out the 'EvId's of all the Wanted constraints that +-- are not fully solved, by inspecting their evidence terms. +notFullySolvedWanteds :: EvBindsVar -> WantedConstraints -> TcM VarSet +notFullySolvedWanteds ev_binds_var wc + = do { (unsolved_ids, ev_deps_edges) <- ev_binds_edges ev_binds_var wc + ; let (ev_graph, node_from_vertex, vertex_from_key) = Graph.graphFromEdges ev_deps_edges + evid_from_vertex v = case node_from_vertex v of ( ev_id, _, _ ) -> ev_id + reachable = mkVarSet + $ concatMap (map evid_from_vertex . toList) + $ Graph.dfs + (Graph.transposeG ev_graph) + (map (expectJust "tcSpecPrag (computing fully solved)" . vertex_from_key) unsolved_ids) + ; return reachable + } + +ev_binds_edges :: EvBindsVar -> WantedConstraints -> TcM ([EvId], [(EvId, EvId, [EvId])]) +ev_binds_edges ev_binds_var0 ( WC { wc_simple = cts, wc_impl = implics } ) + = do { ev_binds <- getTcEvBindsMap ev_binds_var0 + ; edges1 <- foldMapM ev_bind_edges (evBindMapBinds ev_binds) + ; let edges2 = foldMap (\ ct -> let i = ctEvId ct in ([i], [(i,i,[])])) cts + ; (insols3, edges3) <- foldMapM go_implic implics + ; return $ + edges2 S.<> ( insols3, edges1 S.<> edges3 ) + } + where + ev_bind_edges :: EvBind -> TcM [(EvId, EvId, [EvId])] + ev_bind_edges (EvBind { eb_lhs = ev_id, eb_rhs = body }) = do + ev_deps <- evVarsOfTerm' body + return [(ev_id, ev_id, nonDetEltsUniqSet ev_deps)] + go_implic :: Implication -> TcM ([EvId], [(EvId, EvId, [EvId])]) + go_implic ( Implic { ic_binds = ev_binds_var, ic_wanted = wc }) = + ev_binds_edges ev_binds_var wc + +-- Like 'GHC.Tc.Types.Evidence.evVarsOfTerm', except that it properly computes +-- the 'VarSet' for an 'EvFun'. +evVarsOfTerm' :: EvTerm -> TcM VarSet +evVarsOfTerm' (EvExpr e) = return $ exprSomeFreeVars isEvVar e +evVarsOfTerm' (EvTypeable _ ev) = + case ev of + EvTypeableTyCon _ e -> foldMapM evVarsOfTerm' e + EvTypeableTyApp e1 e2 -> foldMapM evVarsOfTerm' [e1,e2] + EvTypeableTrFun e1 e2 e3 -> foldMapM evVarsOfTerm' [e1,e2,e3] + EvTypeableTyLit e -> evVarsOfTerm' e +evVarsOfTerm' (EvFun { et_given = givens, et_binds = tcev_binds, et_body = body_id }) = do + ev_binds <- + bagToList <$> + case tcev_binds of + TcEvBinds var -> evBindMapBinds <$> getTcEvBindsMap var + EvBinds binds -> return binds + let lhs_evvars = map evBindVar ev_binds + rhs_evvars <- foldMapM (evVarsOfTerm' . eb_rhs) ev_binds + return $ + ( ( rhs_evvars `extendVarSet` body_id ) + `delVarSetList` lhs_evvars + ) `delVarSetList` givens + +partitionWC :: (EvId -> Bool) -> WantedConstraints -> (WantedConstraints, WantedConstraints) +partitionWC f wc@(WC { wc_simple = cts, wc_impl = implics }) = + let (yes_cts, no_cts) = partitionBag (f . ctEvId) cts + (yes_impls, no_impls) = unzipBag $ mapBag f_impl implics + in ( wc { wc_simple = yes_cts, wc_impl = yes_impls } + , wc { wc_simple = no_cts, wc_impl = no_impls } ) + where + f_impl i@(Implic { ic_wanted = wc' }) = + let (yes, no) = partitionWC f wc' + in (i { ic_wanted = yes }, i { ic_wanted = no }) + -------------- tcSpecWrapper :: UserTypeCtxt -> TcType -> TcType -> TcM HsWrapper -- A simpler variant of tcSubType, used for SPECIALISE pragmas ===================================== testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs ===================================== @@ -78,6 +78,6 @@ f6 z = z == z -- Quantify over this same quantified constraint, but discharge the -- other dictionary constraints. -{-# SPECIALISE f6 :: ( forall x. ( Eq x, Eq ( T x ) ) => Eq ( f x ) ) => f Int -> Bool #-} +{-# SPECIALISE f6 :: ( forall y. ( Eq y, Eq ( T y ) ) => Eq ( g y ) ) => g Int -> Bool #-} -------------------------------------------------------------------------------- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3f560229af562c577a2357b368f4424ba6bb999 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3f560229af562c577a2357b368f4424ba6bb999 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 10:46:31 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Sat, 01 Feb 2025 05:46:31 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] 5864 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <679dfb86e0d97_12e1e3608c54887af@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 Move parser + parser tests out to own package. We move some types out that are necessary as well and then re-export and specialise them in the core Haddock. Reason for moving out spec tests is that if we're working on the parser, we can simply work on that and we can ignore the rest of Haddock. The downside is that it's a little inconvenient if at the end of the day we want to see that everything passes. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 Remove no longer necessary parser error handling. We can now drop some Maybe tests and even lets us strip an error handling monad away in a few places. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 Please the GHC build-system. As I can not figure out how to do this properly, if we're in GHC tree, we treat the library as being the same package. If we're not in the tree, we require that the library be installed separately. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 Revert "Accomodate change in PatSyn representation" This reverts commit 57aa591362d7c8ba21285fccd6a958629a422091. I am reverting this because I pushed it to master when it was meant to stay on a wip-branch. Sorry Gergo and everyone who had trouble due to this. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 Update cabal files Update repository urls, use subdir property for haddock-library and use a separate versioning scheme for haddock-library in preparation for release. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 haddock-library: Do not depend on haddock-library in test suite I think you either add src to hs-source-dirs or the library to build-depends. But doing both does not make sense (AFAICT). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 Use Travis with multiple GHC versions When using HEAD, we build haddock-library directly from repository as a dependency (and thanks to --enable-tests, the tests get ran anyway). In all other cases, we manually run the tests on haddock-library only and don't test the main project. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 Drop DocParagraph from front of headers I can not remember why they were wrapped in paragraphs to begin with and it seems unnecessary now that I test it. Closes haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 Don't mangle append order for nested lists. The benefit of this is that the ‘top-level’ element of such lists is properly wrapped in <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 Merge branch 'reverts' This reverts any changes that were made to have Haddock compile with 7.9. When 7.10 release comes, we can simply re-apply all the patches and any patches that occur on ghc-head branch from now on. This allows us to build master with 7.8.3 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#313 by doing some list munging. I get rid of the Monoid instance because we weren't satisfying the laws. Convenience of having <> didn't outweigh the shock-factor of having it behave badly. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#188. Because the change is in GHC 7.9 and we now work against 7.8.3, this test no longer makes sense. We revert it until 7.10 becomes the standard version. If anything, there should be a test for this in GHC itself. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 Fix extra whitespace on signatures and update all test cases This was long overdue, now running ./accept.lhs on a clean test from master will not generate a bunch of changes. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 Changes due to ghc api changes in package representation Also fix a bug with finding the package name and version given a module. This had become wrong due to the package key changes (it was very hacky in the first place). We now look up the package key in the package db to get the package info properly. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 Import Data.Word w/o import-list This is needed to keep the compilation warning free (and thus pass GHC's ./validate) regardless of whether Word is re-exported from Prelude or not See https://ghc.haskell.org/trac/ghc/ticket/9531 for more details - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 Revert "Followup changes to addition of -fwarn-context-quantification" This reverts commit 4023817d7c0e46db012ba2eea28022626841ca9b temporarily as the respective feature hasn't landed in GHC HEAD yet, but this commit blocks later commits from being referenced in GHC HEAD. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 Revert "Fix import of 'empty' due to AMP." This reverts commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 since it turns out we don't need to re-export `empty` from Control.Monad after all. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 Fix improper lazy IO use Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 Fix use-after-close lazy IO bug Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results. Signed-off-by: David Feuer <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 Allow an optional colon after the closing bracket of definition lists This is to disambiguate them from markdown links and will be require with a future release. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 Turn some uses of error into recoverable warnings This should at the very least not abort when something weird happens. It does feel like we should have a type that carries these errors until the end however as the user might not see them unless they are printed at the end. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 Allow the parser to spit out meta-info Currently we only use it only for ‘since’ annotations but with these patches it should be fairly simple to add new attributes if we wish to. Closes haskell/haddock#26. It seems to work fine but due to 7.10 rush I don't have the chance to do more exhaustive testing right now. The way the meta is output (emphasis at the end of the whole comment) is fairly arbitrary and subject to bikeshedding. Note that this makes test for Bug310 fail due to interface version bump: it can't find the docs for base with this interface version so it fails. There is not much we can do to help this because it tests for ’built-in’ identifier, not something we can provide ourselves. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 Changes due to ghc api changes in package representation Also fix a bug with finding the package name and version given a module. This had become wrong due to the package key changes (it was very hacky in the first place). We now look up the package key in the package db to get the package info properly. Conflicts: haddock-api/src/Haddock.hs - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 Import Data.Word w/o import-list This is needed to keep the compilation warning free (and thus pass GHC's ./validate) regardless of whether Word is re-exported from Prelude or not See https://ghc.haskell.org/trac/ghc/ticket/9531 for more details - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 Support for PartialTypeSignatures Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs haddock-api/src/Haddock/Interface/Create.hs - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 Treat GHC 7.10 the same as GHC 7.9 ...since the current GHC 7.9 is going to become GHC 7.10 real-soon-now anyway - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 Fixup ghc.mk (follow-up to 1739375eb23342) This makes the GHC build-system aware of the data-files to be copied into the bindist (as haddock.cabal doesn't list those anymore) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 Update test files Test: a correct behaviour for fields comma-separating values. I'm surprised we had no bug open for this. Maybe it affects how haskell/haddock#301 renders now but I doubt. Operators: Seems GHC is giving us a new order for operators, something must have changed on their side again. cc @haasn , this makes the fixity to the side not match the order on the LHS which is a bit unpleasant. Maybe the fixity can be made to match the GHC order? Bug335: We expand examples by default now. Bug310: Now inferred safe. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --package-name and --package-version flags Used for --hoogle amongst other things. Now we need to teach cabal to use it. The situation is still a bit sub-par because if the flags aren't passed in, the crash will occur. Closes haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --package-name and --package-version flags Used for --hoogle amongst other things. Now we need to teach cabal to use it. The situation is still a bit sub-par because if the flags aren't passed in, the crash will occur. Closes haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 Prevent Synopsis from using up too much horizontal space When long type signatures occur in the Synopsis, the element is stretched beyond the width of the window. Scrollbars don't appear, so it's impossible to read anything when this happens. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Test for anchor defaulting I delete the old tests because it turns out that: * test runner would never put them in scope of each other even with imports so just one would suffice * test runner actually needed some hacking to keep links so in the end we would end up with no anchors making them useless - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 Output method documentation in Hoogle backend One thing of note is that we no longer preserve grouping of methods and print each method on its own line. We could preserve it if no documentation is present for any methods in the group if someone asks for it though. Fixes haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 ApiAnnotations : strings in warnings do not return SourceText The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 Update after wild card renaming refactoring in D613 Summary: * Move `Post*` type instances to `Haddock.Types` as other modules than `Haddock.Interface.Rename` will rely on these type instances. * Update after wild card renaming refactoring in D613. Reviewers: simonpj, austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D954 GHC Trac Issues: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 Fix haddock: internal error: spliceURL UnhelpfulSpan (#207) Inferred type signatures don't have SrcSpans, so let's use the one from the declaration. I've tested this manually on the test-case from haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 Fix alignment of Source links in instance table in Firefox Due to a Firefox bug [1], a combination of 'whitespace: nowrap' on the parent element with 'float: right' on the inner element can cause the floated element to be displaced downwards for no apparent reason. To work around this, the left side is wrapped in its own <span> and set to 'float: left'. As a precautionary measure to prevent the parent element from collapsing entirely, we also add the classic "clearfix" hack. The latter is not strictly needed but it helps prevent bugs if the layout is altered again in the future. Fixes haskell/haddock#384. Remark: line 159 of src/Haddock/Backends/Xhtml/Layout.hs was indented to prevent confusion over the operator precedence of (<+>) vs (<<). [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=488725 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 ApiAnnotations : strings in warnings do not return SourceText The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 Update after wild card renaming refactoring in D613 Summary: * Move `Post*` type instances to `Haddock.Types` as other modules than `Haddock.Interface.Rename` will rely on these type instances. * Update after wild card renaming refactoring in D613. Reviewers: simonpj, austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D954 GHC Trac Issues: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 56b403c9 by Ben Gamari at 2023-09-13T19:21:36-04:00 spec-constr: Lift argument limit for SPEC-marked functions When the user adds a SPEC argument to a function, they are informing us that they expect the function to be specialised. However, previously this instruction could be preempted by the specialised-argument limit (sc_max_args). Fix this. This fixes #14003. - - - - - 6840012e by Simon Peyton Jones at 2023-09-13T19:22:13-04:00 Fix eta reduction Issue #23922 showed that GHC was bogusly eta-reducing a join point. We should never eta-reduce (\x -> j x) to j, if j is a join point. It is extremly difficult to trigger this bug. It took me 45 mins of trying to make a small tests case, here immortalised as T23922a. - - - - - e5c00092 by Andreas Klebinger at 2023-09-14T08:57:43-04:00 Profiling: Properly escape characters when using `-pj`. There are some ways in which unusual characters like quotes or others can make it into cost centre names. So properly escape these. Fixes #23924 - - - - - ec490578 by Ellie Hermaszewska at 2023-09-14T08:58:24-04:00 Use clearer example variable names for bool eliminator - - - - - 5126a2fe by Sylvain Henry at 2023-09-15T11:18:02-04:00 Add missing int64/word64-to-double/float rules (#23907) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/203 - - - - - 566ef411 by Mario Blažević at 2023-09-15T11:18:43-04:00 Fix and test TH pretty-printing of type operator role declarations This commit fixes and tests `Language.Haskell.TH.Ppr.pprint` so that it correctly pretty-prints `type role` declarations for operator names. Fixes #23954 - - - - - 8e05c54a by Simon Peyton Jones at 2023-09-16T01:42:33-04:00 Use correct FunTyFlag in adjustJoinPointType As the Lint error in #23952 showed, the function adjustJoinPointType was failing to adjust the FunTyFlag when adjusting the type. I don't think this caused the seg-fault reported in the ticket, but it is definitely. This patch fixes it. It is tricky to come up a small test case; Krzysztof came up with this one, but it only triggers a failure in GHC 9.6. - - - - - 778c84b6 by Pierre Le Marre at 2023-09-16T01:43:15-04:00 Update to Unicode 15.1.0 See: https://www.unicode.org/versions/Unicode15.1.0/ - - - - - f9d79a6c by Alan Zimmerman at 2023-09-18T00:00:14-04:00 EPA: track unicode version for unrestrictedFunTyCon Closes #23885 Updates haddock submodule - - - - - 9374f116 by Andrew Lelechenko at 2023-09-18T00:00:54-04:00 Bump parsec submodule to allow text-2.1 and bytestring-0.12 - - - - - 7ca0240e by Ben Gamari at 2023-09-18T15:16:48-04:00 base: Advertise linear time of readFloat As noted in #23538, `readFloat` has runtime that scales nonlinearly in the size of its input. Consequently, its use on untrusted input can be exploited as a denial-of-service vector. Point this out and suggest use of `read` instead. See #23538. - - - - - f3f58f13 by Simon Peyton Jones at 2023-09-18T15:17:24-04:00 Remove dead code GHC.CoreToStg.Prep.canFloat This function never fires, so we can delete it: #23965. - - - - - ccab5b15 by Ben Gamari at 2023-09-18T15:18:02-04:00 base/changelog: Move fix for #23907 to 9.8.1 section Since the fix was backported to 9.8.1 - - - - - 51b57d65 by Matthew Pickering at 2023-09-19T08:44:31-04:00 Add aarch64 alpine bindist This is dynamically linked and makes creating statically linked executables more straightforward. Fixes #23482 - - - - - 02c87213 by Matthew Pickering at 2023-09-19T08:44:31-04:00 Add aarch64-deb11 bindist This adds a debian 11 release job for aarch64. Fixes #22005 - - - - - 8b61dfd6 by Alexis King at 2023-09-19T08:45:13-04:00 Don’t store the async exception masking state in CATCH frames - - - - - 86d2971e by doyougnu at 2023-09-19T19:08:19-04:00 compiler,ghci: error codes link to HF error index closes: #23259 - adds -fprint-error-index-links={auto|always|never} flag - - - - - 5f826c18 by sheaf at 2023-09-19T19:09:03-04:00 Pass quantified tyvars in tcDefaultAssocDecl This commit passes the correct set of quantified type variables written by the user in associated type default declarations for validity checking. This ensures that validity checking of associated type defaults mirrors that of standalone type family instances. Fixes #23768 (see testcase T23734 in subsequent commit) - - - - - aba18424 by sheaf at 2023-09-19T19:09:03-04:00 Avoid panic in mkGADTVars This commit avoids panicking in mkGADTVars when we encounter a type variable as in #23784 that is bound by a user-written forall but not actually used. Fixes #23784 - - - - - a525a92a by sheaf at 2023-09-19T19:09:03-04:00 Adjust reporting of unused tyvars in data FamInsts This commit adjusts the validity checking of data family instances to improve the reporting of unused type variables. See Note [Out of scope tvs in data family instances] in GHC.Tc.Validity. The problem was that, in a situation such as data family D :: Type data instance forall (d :: Type). D = MkD the RHS passed to 'checkFamPatBinders' would be the TyCon app R:D d which mentions the type variable 'd' quantified in the user-written forall. Thus, when computing the set of unused type variables in the RHS of the data family instance, we would find that 'd' is used, and report a strange error message that would say that 'd' is not bound on the LHS. To fix this, we special-case the data-family instance case, manually extracting all the type variables that appear in the arguments of all the data constructores of the data family instance. Fixes #23778 - - - - - 28dd52ee by sheaf at 2023-09-19T19:09:03-04:00 Unused tyvars in FamInst: only report user tyvars This commit changes how we perform some validity checking for coercion axioms to mirror how we handle default declarations for associated type families. This allows us to keep track of whether type variables in type and data family instances were user-written or not, in order to only report the user-written ones in "unused type variable" error messages. Consider for example: {-# LANGUAGE PolyKinds #-} type family F type instance forall a. F = () In this case, we get two quantified type variables, (k :: Type) and (a :: k); the second being user-written, but the first is introduced by the typechecker. We should only report 'a' as being unused, as the user has no idea what 'k' is. Fixes #23734 - - - - - 1eed645c by sheaf at 2023-09-19T19:09:03-04:00 Validity: refactor treatment of data families This commit refactors the reporting of unused type variables in type and data family instances to be more principled. This avoids ad-hoc logic in the treatment of data family instances. - - - - - 35bc506b by John Ericson at 2023-09-19T19:09:40-04:00 Remove `ghc-cabal` It is dead code since the Make build system was removed. I tried to go over every match of `git grep -i ghc-cabal` to find other stray bits. Some of those might be workarounds that can be further removed. - - - - - 665ca116 by John Paul Adrian Glaubitz at 2023-09-19T19:10:39-04:00 Re-add unregisterised build support for sparc and sparc64 Closes #23959 - - - - - 142f8740 by Matthew Pickering at 2023-09-19T19:11:16-04:00 Bump ci-images to use updated version of Alex Fixes #23977 - - - - - fa977034 by John Ericson at 2023-09-21T12:55:25-04:00 Use Cabal 3.10 for Hadrian We need the newer version for `CABAL_FLAG_*` env vars for #17191. - - - - - a5d22cab by John Ericson at 2023-09-21T12:55:25-04:00 hadrian: `need` any `configure` script we will call When the script is changed, we should reconfigure. - - - - - db882b57 by John Ericson at 2023-09-21T12:55:25-04:00 hadrian: Make it easier to debug Cabal configure Right now, output is squashed. This make per-package configure scripts extremely hard to maintain, because we get vague "library is missing" errors when the actually probably is usually completely unrelated except for also involving the C/C++ toolchain. (I can always pass `-VVV` to Hadrian locally, but these errors are subtle and I often cannot reproduce them locally!) `--disable-option-checking` was added back in 75c6e0684dda585c37b4ac254cd7a13537a59a91 but seems to be a bit overkill; if other flags are passed that are not recognized behind the two from Cabal mentioned in the former comment, we *do* want to know about it. - - - - - 7ed65f5a by John Ericson at 2023-09-21T12:55:25-04:00 hadrian: Increase verbosity of certain cabal commands This is a hack to get around the cabal function we're calling *decreasing* the verbosity it passes to another function, which is the stuff we often actually care about. Sigh. Keeping this a separate commit so if this makes things too verbose it is easy to revert. - - - - - a4fde569 by John Ericson at 2023-09-21T12:55:25-04:00 rts: Move most external symbols logic to the configure script This is much more terse because we are programmatically handling the leading underscore. `findPtr` however is still handled in the Cabal file because we need a newer Cabal to pass flags to the configure script automatically. Co-Authored-By: Ben Gamari <ben at well-typed.com> - - - - - 56cc85fb by Andrew Lelechenko at 2023-09-21T12:56:21-04:00 Bump Cabal submodule to allow text-2.1 and bytestring-0.12 - - - - - 0cd6148c by Matthew Pickering at 2023-09-21T12:56:21-04:00 hadrian: Generate Distribution/Fields/Lexer.x before creating a source-dist - - - - - b10ba6a3 by Andrew Lelechenko at 2023-09-21T12:56:21-04:00 Bump hadrian's index-state to upgrade alex at least to 3.2.7.3 - - - - - 11ecc37b by Luite Stegeman at 2023-09-21T12:57:03-04:00 JS: correct file size and times Programs produced by the JavaScript backend were returning incorrect file sizes and modification times, causing cabal related tests to fail. This fixes the problem and adds an additional test that verifies basic file information operations. fixes #23980 - - - - - b35fd2cd by Ben Gamari at 2023-09-21T12:57:39-04:00 gitlab-ci: Drop libiserv from upload_ghc_libs libiserv has been merged into the ghci package. - - - - - 37ad04e8 by Ben Gamari at 2023-09-21T12:58:15-04:00 testsuite: Fix Windows line endings - - - - - 5795b365 by Ben Gamari at 2023-09-21T12:58:15-04:00 testsuite: Use makefile_test - - - - - 15118740 by Ben Gamari at 2023-09-21T12:58:55-04:00 system-cxx-std-lib: Add license and description - - - - - 0208f1d5 by Ben Gamari at 2023-09-21T12:59:33-04:00 gitlab/issue-templates: Rename bug.md -> default.md So that it is visible by default. - - - - - 23cc3f21 by Andrew Lelechenko at 2023-09-21T20:18:11+01:00 Bump submodule text to 2.1 - - - - - b8e4fe23 by Andrew Lelechenko at 2023-09-22T20:05:05-04:00 Bump submodule unix to 2.8.2.1 - - - - - 54b2016e by John Ericson at 2023-09-23T11:40:41-04:00 Move lib{numa,dw} defines to RTS configure Clean up the m4 to handle the auto case always and be more consistent. Also simplify the CPP --- we should always have both headers if we are using libnuma. "side effects" (AC_DEFINE, and AC_SUBST) are removed from the macros to better separate searching from actions taken based on search results. This might seem overkill now, but will make shuffling logic between configure scripts easier later. The macro comments are converted from `dnl` to `#` following the recomendation in https://www.gnu.org/software/autoconf/manual/autoconf-2.71/html_node/Macro-Definitions.html - - - - - d51b601b by John Ericson at 2023-09-23T11:40:50-04:00 Shuffle libzstd configuring between scripts Like the prior commit for libdw and libnuma, `AC_DEFINE` to RTS configure, `AC_SUBST` goes to the top-level configure script, and the documentation of the m4 macro is improved. - - - - - d1425af0 by John Ericson at 2023-09-23T11:41:03-04:00 Move `FP_ARM_OUTLINE_ATOMICS` to RTS configure It is just `AC_DEFINE` it belongs there instead. - - - - - 18de37e4 by John Ericson at 2023-09-23T11:41:03-04:00 Move mmap in the runtime linker check to the RTS configure `AC_DEFINE` should go there instead. - - - - - 74132c2b by Andrew Lelechenko at 2023-09-25T21:56:54-04:00 Elaborate comment on GHC_NO_UNICODE - - - - - de142aa2 by Ben Gamari at 2023-09-26T15:25:03-04:00 gitlab-ci: Mark T22012 as broken on CentOS 7 Due to #23979. - - - - - 6a896ce8 by Teo Camarasu at 2023-09-26T15:25:39-04:00 hadrian: better error for failing to find file's dependencies Resolves #24004 - - - - - d697a6c2 by Stefan Holdermans at 2023-09-26T20:58:37+00:00 Refactor uses of `partitionEithers . map` This patch changes occurences of the idiom `partitionEithers (map f xs)` by the simpler form `partitionWith f xs` where `partitionWith` is the utility function defined in `GHC.Utils.Misc`. Resolves: #23953 - - - - - 8a2968b7 by Stefan Holdermans at 2023-09-26T20:58:37+00:00 Refactor uses of `partitionEithers <$> mapM f xs` This patch changes occurences of the idiom `partitionEithers <$> mapM f xs` by the simpler form `partitionWithM f xs` where `partitionWithM` is a utility function newly added to `GHC.Utils.Misc`. - - - - - 6a27eb97 by Stefan Holdermans at 2023-09-26T20:58:37+00:00 Mark `GHC.Utils.Misc.partitionWithM` as inlineable This patch adds an `INLINEABLE` pragma for `partitionWithM` to ensure that the right-hand side of the definition of this function remains available for specialisation at call sites. - - - - - f1e5245a by David Binder at 2023-09-27T01:19:00-04:00 Add RTS option to supress tix file - - - - - 1f43124f by David Binder at 2023-09-27T01:19:00-04:00 Add expected output to testsuite in test interface-stability/base-exports - - - - - b9d2c354 by David Binder at 2023-09-27T01:19:00-04:00 Expose HpcFlags and getHpcFlags from GHC.RTS.Flags - - - - - 345675c6 by David Binder at 2023-09-27T01:19:00-04:00 Fix expected output of interface-stability test - - - - - 146e1c39 by David Binder at 2023-09-27T01:19:00-04:00 Implement getHpcFlags - - - - - 61ba8e20 by David Binder at 2023-09-27T01:19:00-04:00 Add section in user guide - - - - - ea05f890 by David Binder at 2023-09-27T01:19:01-04:00 Rename --emit-tix-file to --write-tix-file - - - - - cabce2ce by David Binder at 2023-09-27T01:19:01-04:00 Update the golden files for interface stability - - - - - 1dbdb9d0 by Krzysztof Gogolewski at 2023-09-27T01:19:37-04:00 Refactor: introduce stgArgRep The function 'stgArgType' returns the type in STG. But this violates the abstraction: in STG we're supposed to operate on PrimReps. This introduces stgArgRep ty = typePrimRep (stgArgType ty) stgArgRep1 ty = typePrimRep1 (stgArgType ty) stgArgRep_maybe ty = typePrimRep_maybe (stgArgType ty) stgArgType is still directly used for unboxed tuples (should be fixable), FFI and in ticky. - - - - - b02f8042 by Mario Blažević at 2023-09-27T17:33:28-04:00 Fix TH pretty-printer's parenthesization This PR Fixes `Language.Haskell.TH.Ppr.pprint` so it correctly emits parentheses where needed. Fixes #23962, #23968, #23971, and #23986 - - - - - 79104334 by Krzysztof Gogolewski at 2023-09-27T17:34:04-04:00 Add a testcase for #17564 The code in the ticket relied on the behaviour of Derived constraints. Derived constraints were removed in GHC 9.4 and now the code works as expected. - - - - - d7a80143 by sheaf at 2023-09-28T03:25:53-04:00 lint-codes: add new modes of operation This commit adds two new modes of operation to the lint-codes utility: list - list all statically used diagnostic codes outdated - list all outdated diagnostic codes The previous behaviour is now: test - test consistency and coverage of diagnostic codes - - - - - 477d223c by sheaf at 2023-09-28T03:25:53-04:00 lint codes: avoid using git-grep We manually traverse through the filesystem to find the diagnostic codes embedded in .stdout and .stderr files, to avoid any issues with old versions of grep. Fixes #23843 - - - - - a38ae69a by sheaf at 2023-09-28T03:25:53-04:00 lint-codes: add Hadrian targets This commit adds new Hadrian targets: codes, codes:used - list all used diagnostic codes codes:outdated - list outdated diagnostic codes This allows users to easily query GHC for used and outdated diagnostic codes, e.g. hadrian/build -j --flavour=<..> codes will list all used diagnostic codes in the command line by running the lint-codes utility in the "list codes" mode of operation. The diagnostic code consistency and coverage test is still run as usual, through the testsuite: hadrian/build test --only="codes" - - - - - 9cdd629b by Ben Gamari at 2023-09-28T03:26:29-04:00 hadrian: Install LICENSE files in bindists Fixes #23548. - - - - - b8ebf876 by Matthew Craven at 2023-09-28T03:27:05-04:00 Fix visibility when eta-reducing a type lambda Fixes #24014. - - - - - d3874407 by Torsten Schmits at 2023-09-30T16:08:10-04:00 Fix several mistakes around free variables in iface breakpoints Fixes #23612 , #23607, #23998 and #23666. MR: !11026 The fingerprinting logic in `Iface.Recomp` failed lookups when processing decls containing breakpoints for two reasons: * IfaceBreakpoint created binders for free variables instead of expressions * When collecting free names for the dependency analysis for fingerprinting, breakpoint FVs were skipped - - - - - ef5342cd by Simon Peyton Jones at 2023-09-30T16:08:48-04:00 Refactor to combine HsLam and HsLamCase This MR is pure refactoring (#23916): * Combine `HsLam` and `HsLamCase` * Combine `HsCmdLam` and `HsCmdLamCase` This just arranges to treat uniformly \x -> e \case pi -> ei \cases pis -> ie In the exising code base the first is treated differently to the latter two. No change in behaviour. More specifics: * Combine `HsLam` and `HsLamCase` (constructors of `Language.Haskell.Syntax.Expr.HsExpr`) into one data construtor covering * Lambda * `\case` * `\cases` * The new `HsLam` has an argument of type `HsLamVariant` to distinguish the three cases. * Similarly, combine `HsCmdLam` and `HsCmdLamCase` (constructors of `Language.Haskell.Syntax.Expr.HsCmd` ) into one. * Similarly, combine `mkHsLamPV` and `mkHsLamCasePV` (methods of class `DisambECP`) into one. (Thank you Alan Zimmerman.) * Similarly, combine `LambdaExpr` and `LamCaseAlt` (constructors of `Language.Haskell.Syntax.Expr.HsMatchContext`) into one: `LamAlt` with a `HsLamVariant` argument. * Similarly, combine `KappaExpr` and `ArrowLamCaseAlt` (constructors of `Language.Haskell.Syntax.Expr.HsArrowMatchContext`) into one: `ArrowLamAlt` with a `HsLamVariant` argument. * Similarly, combine `PsErrLambdaInPat` and `PsErrLambdaCaseInPat` (constructors of `GHC.Parser.Errors.Ppr.PsError`) into one. * Similarly, combine `PsErrLambdaInPat` and `PsErrLambdaCaseInPat` (constructors of `GHC.Parser.Errors.Ppr.PsError`) into one. * In the same `PsError` data type, combine `PsErrLambdaCmdInFunAppCmd` and `PsErrLambdaCaseCmdInFunAppCmd` into one. * In the same `PsError` data tpye, combine `PsErrLambdaInFunAppExpr` and `PsErrLambdaCaseInFunAppExpr` into one. p* Smilarly combine `ExpectedFunTyLam` and `ExpectedFunTyLamCase` (constructors of `GHC.Tc.Types.Origin.ExpectedFunTyOrigin`) into one. Phew! - - - - - b048bea0 by Andreas Klebinger at 2023-09-30T16:09:24-04:00 Arm: Make ppr methods easier to use by not requiring NCGConfig - - - - - 2adc0508 by Andreas Klebinger at 2023-09-30T16:09:24-04:00 AArch64: Fix broken conditional jumps for offsets >= 1MB Rewrite conditional jump instructions with offsets >= 1MB to use unconditional jumps to avoid overflowing the immediate. Fixes #23746 - - - - - 1424f790 by Alan Zimmerman at 2023-09-30T16:10:00-04:00 EPA: Replace Monoid with NoAnn We currently use the Monoid class as a constraint on Exact Print Annotation functions, so we can use mempty. But this leads to requiring Semigroup instances too, which do not always make sense. Instead, introduce a class NoAnn, with a function noAnn analogous to mempty. Closes #20372 Updates haddock submodule - - - - - c1a3ecde by Ben Gamari at 2023-09-30T16:10:36-04:00 users-guide: Refactor handling of :base-ref: et al. - - - - - bc204783 by Richard Eisenberg at 2023-10-02T14:50:52+02:00 Simplify and correct nasty case in coercion opt This fixes #21062. No test case, because triggering this code seems challenging. - - - - - 9c9ca67e by Andrew Lelechenko at 2023-10-04T05:42:28-04:00 Bump bytestring submodule to 0.12.0.2 - - - - - 4e46dc2b by Andrew Lelechenko at 2023-10-04T05:42:28-04:00 Inline bucket_match - - - - - f6b2751f by Ben Gamari at 2023-10-04T05:43:05-04:00 configure: Fix #21712 again This is a bit of a shot in the dark to fix #24033, which appears to be another instance of #21712. For some reason the ld-override logic *still* appears to be active on Darwin targets (or at least one). Consequently, on misconfigured systems we may choose a non-`ld64` linker. It's a bit unclear exactly what happened in #24033 but ultimately the check added for #21712 was not quite right, checking for the `ghc_host_os` (the value of which depends upon the bootstrap compiler) instead of the target platform. Fix this. Fixes #24033. - - - - - 2f0a101d by Krzysztof Gogolewski at 2023-10-04T05:43:42-04:00 Add a regression test for #24029 - - - - - 8cee3fd7 by sheaf at 2023-10-04T05:44:22-04:00 Fix non-symbolic children lookup of fixity decl The fix for #23664 did not correctly account for non-symbolic names when looking up children of a given parent. This one-line fix changes that. Fixes #24037 - - - - - a4785b33 by Cheng Shao at 2023-10-04T05:44:59-04:00 rts: fix incorrect ticket reference - - - - - e037f459 by Ben Gamari at 2023-10-04T05:45:35-04:00 users-guide: Fix discussion of -Wpartial-fields * fix a few typos * add a new example showing when the warning fires * clarify the existing example * point out -Wincomplete-record-selects Fixes #24049. - - - - - 8ff3134e by Matthew Pickering at 2023-10-05T05:34:58-04:00 Revert "Pass preprocessor options to C compiler when building foreign C files (#16737)" This reverts commit 1c18d3b41f897f34a93669edaebe6069f319f9e2. `-optP` should pass options to the preprocessor, that might be a very different program to the C compiler, so passing the options to the C compiler is likely to result in `-optP` being useless. Fixes #17185 and #21291 - - - - - 8f6010b9 by Ben Gamari at 2023-10-05T05:35:36-04:00 rts/nonmoving: Fix on LLP64 platforms Previously `NONMOVING_SEGMENT_MASK` and friends were defined with the `UL` size suffix. However, this is wrong on LLP64 platforms like Windows, where `long` is 32-bits. Fixes #23003. Fixes #24042. - - - - - f20d02f8 by Andreas Klebinger at 2023-10-05T05:36:14-04:00 Fix isAArch64Bitmask for 32bit immediates. Fixes #23802 - - - - - 63afb701 by Bryan Richter at 2023-10-05T05:36:49-04:00 Work around perf note fetch failure Addresses #24055. - - - - - 242102f4 by Krzysztof Gogolewski at 2023-10-05T05:37:26-04:00 Add a test for #21348 - - - - - 7d390bce by Rewbert at 2023-10-05T05:38:08-04:00 Fixes #24046 - - - - - 69abb171 by Finley McIlwaine at 2023-10-06T14:06:28-07:00 Ensure unconstrained instance dictionaries get IPE info In the `StgRhsCon` case of `GHC.Stg.Debug.collectStgRhs`, we were not coming up with an initial source span based on the span of the binder, which was causing instance dictionaries without dynamic superclass constraints to not have source locations in their IPE info. Now they do. Resolves #24005 - - - - - 390443b7 by Andreas Klebinger at 2023-10-07T10:00:20-04:00 rts: Split up rts/include/stg/MachRegs.h by arch - - - - - 3685942f by Bryan Richter at 2023-10-07T10:00:56-04:00 Actually set hackage index state Or at least, use a version of the cabal command that *claims* to set the index state. Time will tell. - - - - - 46a0e5be by Bryan Richter at 2023-10-07T10:00:56-04:00 Update hackage index state - - - - - d4b037de by Bryan Richter at 2023-10-07T10:00:56-04:00 Ensure hadrian uses CI's hackage index state - - - - - e206be64 by Andrew Lelechenko at 2023-10-08T15:06:14-04:00 Do not use O_NONBLOCK on regular files or block devices CLC proposal https://github.com/haskell/core-libraries-committee/issues/166 - - - - - a06197c4 by David Binder at 2023-10-08T15:06:55-04:00 Update hpc-bin submodule to 0.69 - - - - - ed6785b6 by David Binder at 2023-10-08T15:06:55-04:00 Update Hadrian with correct path to happy file for hpc-bin - - - - - 94066d58 by Alan Zimmerman at 2023-10-09T21:35:53-04:00 EPA: Introduce HasAnnotation class The class is defined as class HasAnnotation e where noAnnSrcSpan :: SrcSpan -> e This generalises noAnnSrcSpan, and allows noLocA :: (HasAnnotation e) => a -> GenLocated e a noLocA = L (noAnnSrcSpan noSrcSpan) - - - - - 8792a1bc by Ben Gamari at 2023-10-09T21:36:29-04:00 Bump unix submodule to v2.8.3.0 - - - - - e96c51cb by Andreas Klebinger at 2023-10-10T16:44:27+01:00 Add a flag -fkeep-auto-rules to optionally keep auto-generated rules around. The motivation for the flag is given in #21917. - - - - - 3ed58cef by Matthew Pickering at 2023-10-10T19:01:22-04:00 hadrian: Add ghcToolchain to tool args list This allows you to load ghc-toolchain and ghc-toolchain-bin into HLS. - - - - - 476c02d4 by Matthew Pickering at 2023-10-10T19:01:22-04:00 ghc-toolchain: Normalise triple via config.sub We were not normalising the target triple anymore like we did with the old make build system. Fixes #23856 - - - - - 303dd237 by Matthew Pickering at 2023-10-10T19:01:22-04:00 ghc-toolchain: Add missing vendor normalisation This is copied from m4/ghc_convert_vendor.m4 Towards #23868 - - - - - 838026c9 by Matthew Pickering at 2023-10-10T19:01:22-04:00 ghc-toolchain: Add loongarch64 to parseArch Towards #23868 - - - - - 1a5bc0b5 by Matthew Pickering at 2023-10-10T19:01:22-04:00 Add same LD hack to ghc-toolchain In the ./configure script, if you pass the `LD` variable then this has the effect of stopping use searching for a linker and hence passing `-fuse-ld=...`. We want to emulate this logic in ghc-toolchain, if a use explicilty specifies `LD` variable then don't add `-fuse-ld=..` with the goal of making ./configure and ghc-toolchain agree on which flags to use when using the C compiler as a linker. This is quite unsavoury as we don't bake the choice of LD into the configuration anywhere but what's important for now is making ghc-toolchain and ./configure agree as much as possible. See #23857 for more discussion - - - - - 42d50b5a by Ben Gamari at 2023-10-10T19:01:22-04:00 ghc-toolchain: Check for C99 support with -std=c99 Previously we failed to try enabling C99 support with `-std=c99`, as `autoconf` attempts. This broke on older compilers (e.g. CentOS 7) which don't enable C99 by default. Fixes #23879. - - - - - da2961af by Matthew Pickering at 2023-10-10T19:01:22-04:00 ghc-toolchain: Add endianess check using __BYTE_ORDER__ macro In very old toolchains the BYTE_ORDER macro is not set but thankfully the __BYTE_ORDER__ macro can be used instead. - - - - - d8da73cd by Matthew Pickering at 2023-10-10T19:01:22-04:00 configure: AC_PATH_TARGET_TOOL for LD We want to make sure that LD is set to an absolute path in order to be consistent with the `LD=$(command -v ld)` call. The AC_PATH_TARGET_TOOL macro uses the absolute path rather than AC_CHECK_TARGET_TOOL which might use a relative path. - - - - - 171f93cc by Matthew Pickering at 2023-10-10T19:01:22-04:00 ghc-toolchain: Check whether we need -std=gnu99 for CPP as well In ./configure the C99 flag is passed to the C compiler when used as a C preprocessor. So we also check the same thing in ghc-toolchain. - - - - - 89a0918d by Matthew Pickering at 2023-10-10T19:01:22-04:00 Check for --target linker flag separately to C compiler There are situations where the C compiler doesn't accept `--target` but when used as a linker it does (but doesn't do anything most likely) In particular with old gcc toolchains, the C compiler doesn't support --target but when used as a linker it does. - - - - - 37218329 by Matthew Pickering at 2023-10-10T19:01:22-04:00 Use Cc to compile test file in nopie check We were attempting to use the C compiler, as a linker, to compile a file in the nopie check, but that won't work in general as the flags we pass to the linker might not be compatible with the ones we pass when using the C compiler. - - - - - 9b2dfd21 by Matthew Pickering at 2023-10-10T19:01:22-04:00 configure: Error when ghc-toolchain fails to compile This is a small QOL change as if you are working on ghc-toolchain and it fails to compile then configure will continue and can give you outdated results. - - - - - 1f0de49a by Matthew Pickering at 2023-10-10T19:01:22-04:00 configure: Check whether -no-pie works when the C compiler is used as a linker `-no-pie` is a flag we pass when using the C compiler as a linker (see pieCCLDOpts in GHC.Driver.Session) so we should test whether the C compiler used as a linker supports the flag, rather than just the C compiler. - - - - - 62cd2579 by Matthew Pickering at 2023-10-10T19:01:22-04:00 ghc-toolchain: Remove javascript special case for --target detection emcc when used as a linker seems to ignore the --target flag, and for consistency with configure which now tests for --target, we remove this special case. - - - - - 0720fde7 by Ben Gamari at 2023-10-10T19:01:22-04:00 toolchain: Don't pass --target to emscripten toolchain As noted in `Note [Don't pass --target to emscripten toolchain]`, emscripten's `emcc` is rather inconsistent with respect to its treatment of the `--target` flag. Avoid this by special-casing this toolchain in the `configure` script and `ghc-toolchain`. Fixes on aspect of #23744. - - - - - 6354e1da by Matthew Pickering at 2023-10-10T19:01:22-04:00 hadrian: Don't pass `--gcc-options` as a --configure-arg to cabal configure Stop passing -gcc-options which mixed together linker flags and non-linker flags. There's no guarantee the C compiler will accept both of these in each mode. - - - - - c00a4bd6 by Ben Gamari at 2023-10-10T19:01:22-04:00 configure: Probe stage0 link flags For consistency with later stages and CC. - - - - - 1f11e7c4 by Sebastian Graf at 2023-10-10T19:01:58-04:00 Stricter Binary.get in GHC.Types.Unit (#23964) I noticed some thunking while looking at Core. This change has very modest, but throughout positive ghc/alloc effect: ``` hard_hole_fits(normal) ghc/alloc 283,057,664 281,620,872 -0.5% geo. mean -0.1% minimum -0.5% maximum +0.0% ``` Fixes #23964. - - - - - a4f1a181 by Bryan Richter at 2023-10-10T19:02:37-04:00 rel_eng/upload.sh cleanups - - - - - 80705335 by doyougnu at 2023-10-10T19:03:18-04:00 ci: add javascript label rule This adds a rule which triggers the javascript job when the "javascript" label is assigned to an MR. - - - - - a2c0fff6 by Matthew Craven at 2023-10-10T19:03:54-04:00 Make 'wWarningFlagsDeps' include every WarningFlag Fixes #24071. - - - - - d055f099 by Jan Hrček at 2023-10-10T19:04:33-04:00 Fix pretty printing of overlap pragmas in TH splices (fixes #24074) - - - - - 0746b868 by Andreas Klebinger at 2023-10-10T19:05:09-04:00 Aarch64 NCG: Use encoded immediates for literals. Try to generate instr x2, <imm> instead of mov x1, lit instr x2, x1 When possible. This get's rid if quite a few redundant mov instructions. I believe this causes a metric decrease for LargeRecords as we reduce register pressure. ------------------------- Metric Decrease: LargeRecord ------------------------- - - - - - 739f4e6f by Andreas Klebinger at 2023-10-10T19:05:09-04:00 AArch NCG: Refactor getRegister' Remove some special cases which can be handled just as well by the generic case. This increases code re-use while also fixing #23749. Since some of the special case wasn't upholding Note [Signed arithmetic on AArch64]. - - - - - 1b213d33 by Andreas Klebinger at 2023-10-10T19:05:09-04:00 Aarch ncg: Optimize immediate use for address calculations When the offset doesn't fit into the immediate we now just reuse the general getRegister' code path which is well optimized to compute the offset into a register instead of a special case for CmmRegOff. This means we generate a lot less code under certain conditions which is why performance metrics for these improve. ------------------------- Metric Decrease: T4801 T5321FD T5321Fun ------------------------- - - - - - b7df0732 by John Ericson at 2023-10-11T16:02:11-04:00 RTS configure: Move over mem management checks These are for heap allocation, a strictly RTS concern. All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it belongs in the RTS configure and should be safe to move without modification. The RTS configure one has a new ``` AC_CHECK_SIZEOF([void *]) ``` that the top-level configure version didn't have, so that `ac_cv_sizeof_void_p` is defined. Once more code is moved over in latter commits, that can go away. Progress towards #17191 - - - - - 41130a65 by John Ericson at 2023-10-11T16:02:11-04:00 RTS configure: Move over `__thread` check This used by (@bgamari thinks) the `GCThread` abstraction in the RTS. All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it belongs in the RTS configure and should be safe to move without modification. Progress towards #17191 - - - - - cc5ec2bd by John Ericson at 2023-10-11T16:02:11-04:00 RTS configure: Move over misc function checks These are for general use in the RTS. All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it belongs in the RTS configure and should be safe to move without modification. Progress towards #17191 - - - - - 809e7c2d by John Ericson at 2023-10-11T16:02:11-04:00 RTS configure: Move over `eventfd` check This check is for the RTS part of the event manager and has a corresponding part in `base`. All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it belongs in the RTS configure and should be safe to move without modification. Progress towards #17191 - - - - - 58f3babf by John Ericson at 2023-10-11T16:02:48-04:00 Split `FP_CHECK_PTHREADS` and move part to RTS configure `NEED_PTHREAD_LIB` is unused since 3609340743c1b25fdfd0e18b1670dac54c8d8623 (part of the make build system), and so is no longer defined. Progress towards #17191 - - - - - e99cf237 by Moritz Angermann at 2023-10-11T16:03:24-04:00 nativeGen: section flags for .text$foo only Commit 3ece9856d157c85511d59f9f862ab351bbd9b38b, was supposed to fix #22834 in !9810. It does however add "xr" indiscriminatly to .text sections even if splitSections is disabled. This leads to the assembler saying: ghc_1.s:7849:0: error: Warning: Ignoring changed section attributes for .text | 7849 | .section .text,"xr" | ^ - - - - - f383a242 by Sylvain Henry at 2023-10-11T16:04:04-04:00 Modularity: pass TempDir instead of DynFlags (#17957) - - - - - 34fc28b0 by John Ericson at 2023-10-12T06:48:28-04:00 Test that functions from `mingwex` are available Ryan wrote these two minimizations, but they never got added to the test suite. See #23309, #23378 Co-Authored-By: Ben Gamari <bgamari.foss at gmail.com> Co-Authored-By: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - bdb54a0e by John Ericson at 2023-10-12T06:48:28-04:00 Do not check for the `mingwex` library in `/configure` See the recent discussion in !10360 --- Cabal will itself check for the library for the packages that need it, and while the autoconf check additionally does some other things like define a `HAS_LIBMINGWEX` C Preprocessor macro, those other things are also unused and unneeded. Progress towards #17191, which aims to get rid of `/configure` entirely. - - - - - 43e814e1 by Ben Gamari at 2023-10-12T06:49:40-04:00 base: Introduce move modules into src The only non-move changes here are whitespace changes to pass the `whitespace` test and a few testsuite adaptations. - - - - - df81536f by Moritz Angermann at 2023-10-12T06:50:16-04:00 [PEi386 linker] Bounds check and null-deref guard We should resonably be able to expect that we won't exceed the number of sections if we assume to be dealing with legal object files. We can however not guarantee that we get some negative values, and while we try to special case most, we should exclude negative indexing into the sections array. We also need to ensure that we do not try to derefences targetSection, if it is NULL, due to the switch statement. - - - - - c74c4f00 by John Ericson at 2023-10-12T10:31:13-04:00 Move apple compat check to RTS configure - - - - - c80778ea by John Ericson at 2023-10-12T10:31:13-04:00 Move clock/timer fun checks to RTS configure Actual library check (which will set the Cabal flag) is left in the top-level configure for now. Progress towards #17191 - - - - - 7f9f2686 by John Ericson at 2023-10-12T10:31:13-04:00 Move visibility and "musttail" annotation checks to the RTS configure All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it belongs in the RTS configure and should be safe to move without modification. Progress towards #17191 - - - - - ffb3efe6 by John Ericson at 2023-10-12T10:31:13-04:00 Move leading underscore checks to RTS configure `CabalLeadingUnderscore` is done via Hadrian already, so we can stop `AC_SUBST`ing it completely. - - - - - 25fa4b02 by John Ericson at 2023-10-12T10:31:13-04:00 Move alloca, fork, const, and big endian checks to RTS configure All of this should boil down to `AC_DEFINE` not `AC_SUBST`, so it belongs in the RTS configure and should be safe to move without modification. - - - - - 5170f42a by John Ericson at 2023-10-12T10:31:13-04:00 Move libdl check to RTS configure - - - - - ea7a1447 by John Ericson at 2023-10-12T10:31:13-04:00 Adjust `FP_FIND_LIBFFI` Just set vars, and `AC_SUBST` in top-level configure. Don't define `HAVE_SYSTEM_LIBFFI` because nothing is using it. It hasn't be in used since 3609340743c1b25fdfd0e18b1670dac54c8d8623 (part of the make build system). - - - - - f399812c by John Ericson at 2023-10-12T10:31:13-04:00 Split BFD support to RTS configure The flag is still in the top-level configure, but the other checks (which define various macros --- important) are in the RTS configure. - - - - - f64f44e9 by John Ericson at 2023-10-12T10:31:13-04:00 Split libm check between top level and RTS - - - - - dafc4709 by Moritz Angermann at 2023-10-12T10:31:49-04:00 CgUtils.fixStgRegStmt respect register width This change ensure that the reg + offset computation is always of the same size. Before this we could end up with a 64bit register, and then add a 32bit offset (on 32bit platforms). This not only would fail type sanity checking, but also incorrectly truncate 64bit values into 32bit values silently on 32bit architectures. - - - - - 9e6ef7ba by Matthew Pickering at 2023-10-12T20:35:00-04:00 hadrian: Decrease verbosity of cabal commands In Normal, most tools do not produce output to stdout unless there are error conditions. Reverts 7ed65f5a1bc8e040e318ccff395f53a9bbfd8217 - - - - - 08fc27af by John Ericson at 2023-10-12T20:35:36-04:00 Do not substitute `@...@` for stage-specific values in cabal files `rts` and `ghc-prim` now no longer have a `*.cabal.in` to set Cabal flag defaults; instead manual choices are passed to configure in the usual way. The old way was fundamentally broken, because it meant we were baking these Cabal files for a specific stage. Now we only do stage-agnostic @...@ substitution in cabal files (the GHC version), and so all stage-specific configuration is properly confined to `_build` and the right stage dir. Also `include-ghc-prim` is a flag that no longer exists for `ghc-prim` (it was removed in 835d8ddbbfb11796ea8a03d1806b7cee38ba17a6) so I got rid of it. Co-Authored-By: Matthew Pickering <matthewtpickering at gmail.com> - - - - - a0ac8785 by Sebastian Graf at 2023-10-14T19:17:12-04:00 Fix restarts in .ghcid Using the whole of `hadrian/` restarted in a loop for me. - - - - - fea9ecdb by Sebastian Graf at 2023-10-14T19:17:12-04:00 CorePrep: Refactor FloatingBind (#23442) A drastically improved architecture for local floating in CorePrep that decouples the decision of whether a float is going to be let- or case-bound from how far it can float (out of strict contexts, out of lazy contexts, to top-level). There are a couple of new Notes describing the effort: * `Note [Floating in CorePrep]` for the overview * `Note [BindInfo and FloatInfo]` for the new classification of floats * `Note [Floats and FloatDecision]` for how FloatInfo is used to inform floating decisions This is necessary ground work for proper treatment of Strict fields and unlifted values at top-level. Fixes #23442. NoFib results (omitted = 0.0%): ``` -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- pretty 0.0% -1.6% scc 0.0% -1.7% -------------------------------------------------------------------------------- Min 0.0% -1.7% Max 0.0% -0.0% Geometric Mean -0.0% -0.0% ``` - - - - - 32523713 by Matthew Pickering at 2023-10-14T19:17:49-04:00 hadrian: Move ghcBinDeps into ghcLibDeps This completes a5227080b57cb51ac34d4c9de1accdf6360b818b, the `ghc-usage.txt` and `ghci-usage.txt` file are also used by the `ghc` library so need to make sure they are present in the libdir even if we are not going to build `ghc-bin`. This also fixes things for cross compilers because the stage2 cross-compiler requires the ghc-usage.txt file, but we are using the stage2 lib folder but not building stage3:exe:ghc-bin so ghc-usage.txt was not being generated. - - - - - ec3c4488 by sheaf at 2023-10-14T19:18:29-04:00 Combine GREs when combining in mkImportOccEnv In `GHC.Rename.Names.mkImportOccEnv`, we sometimes discard one import item in favour of another, as explained in Note [Dealing with imports] in `GHC.Rename.Names`. However, this can cause us to lose track of important parent information. Consider for example #24084: module M1 where { class C a where { type T a } } module M2 ( module M1 ) where { import M1 } module M3 where { import M2 ( C, T ); instance C () where T () = () } When processing the import list of `M3`, we start off (for reasons that are not relevant right now) with two `Avail`s attached to `T`, namely `C(C, T)` and `T(T)`. We combine them in the `combine` function of `mkImportOccEnv`; as described in Note [Dealing with imports] we discard `C(C, T)` in favour of `T(T)`. However, in doing so, we **must not** discard the information want that `C` is the parent of `T`. Indeed, losing track of this information can cause errors when importing, as we could get an error of the form ‘T’ is not a (visible) associated type of class ‘C’ We fix this by combining the two GREs for `T` using `plusGRE`. Fixes #24084 - - - - - 257c2807 by Ilias Tsitsimpis at 2023-10-14T19:19:07-04:00 hadrian: Pass -DNOSMP to C compiler when needed Hadrian passes the -DNOSMP flag to GHC when the target doesn't support SMP, but doesn't pass it to CC as well, leading to the following compilation error on mips64el: | Run Cc (FindCDependencies CDep) Stage1: rts/sm/NonMovingScav.c => _build/stage1/rts/build/c/sm/NonMovingScav.o.d Command line: /usr/bin/mips64el-linux-gnuabi64-gcc -E -MM -MG -MF _build/stage1/rts/build/c/hooks/FlagDefaults.thr_debug_p_o.d -MT _build/stage1/rts/build/c/hooks/FlagDefaults.o -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include -Irts/include -x c rts/hooks/FlagDefaults.c -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Wundef -fno-strict-aliasing -DTHREADED_RTS -DDEBUG -fomit-frame-pointer -O2 -g -Irts -I_build/stage1/rts/build -DDEBUG -fno-omit-frame-pointer -g3 -O0 ===> Command failed with error code: 1 In file included from rts/include/Stg.h:348, from rts/include/Rts.h:38, from rts/hooks/FlagDefaults.c:8: rts/include/stg/SMP.h:416:2: error: #error memory barriers unimplemented on this architecture 416 | #error memory barriers unimplemented on this architecture | ^~~~~ rts/include/stg/SMP.h:440:2: error: #error memory barriers unimplemented on this architecture 440 | #error memory barriers unimplemented on this architecture | ^~~~~ rts/include/stg/SMP.h:464:2: error: #error memory barriers unimplemented on this architecture 464 | #error memory barriers unimplemented on this architecture | ^~~~~ The old make system correctly passed this flag to both GHC and CC [1]. Fix this error by passing -DNOSMP to CC as well. [1] https://gitlab.haskell.org/ghc/ghc/-/blob/00920f176b0235d5bb52a8e054d89a664f8938fe/rts/ghc.mk#L407 Closes #24082 - - - - - 13d3c613 by John Ericson at 2023-10-14T19:19:42-04:00 Users Guide: Drop dead code for Haddock refs to `parallel` I noticed while working on !11451 that `@LIBRARY_parallel_UNIT_ID@` was not substituted. It is dead code -- there is no `parallel-ref` usages and it doesn't look like there ever was (going back to 3e5d0f188d6c8633e55e9ba6c8941c07e459fa4b), so let's delete it. - - - - - fe067577 by Sylvain Henry at 2023-10-18T19:40:25-04:00 Avoid out-of-bound array access in bigNatIsPowerOf2 (fix #24066) bigNatIndex# in the `where` clause wasn't guarded by "bigNatIsZero a". - - - - - cc1625b1 by Sylvain Henry at 2023-10-18T19:40:25-04:00 Bignum: fix right shift of negative BigNat with native backend - - - - - cbe4400d by Sylvain Henry at 2023-10-18T19:40:25-04:00 Rts: expose rtsOutOfBoundsAccess symbol - - - - - 72c7380c by Sylvain Henry at 2023-10-18T19:40:25-04:00 Hadrian: enable `-fcheck-prim-bounds` in validate flavour This allows T24066 to fail when the bug is present. Otherwise the out-of-bound access isn't detected as it happens in ghc-bignum which wasn't compiled with the bounds check. - - - - - f9436990 by John Ericson at 2023-10-18T19:41:01-04:00 Make Hadrian solely responsible for substituting `docs/users_guide/ghc_config.py.in` Fixes #24091 Progress on #23966 Issue #24091 reports that `@ProjectVersion@` is no longer being substituted in the GHC user's guide. I assume this is a recent issue, but I am not sure how it's worked since c1a3ecde720b3bddc2c8616daaa06ee324e602ab; it looks like both Hadrian and configure are trying to substitute the same `.in` file! Now only Hadrian does. That is better anyways; already something that issue #23966 requested. It seems like we were missing some dependencies in Hadrian. (I really, really hate that this is possible!) Hopefully it is fixed now. - - - - - b12df0bb by John Ericson at 2023-10-18T19:41:37-04:00 `ghcversion.h`: No need to cope with undefined `ProjectPatchLevel*` Since 4e6c80197f1cc46dfdef0300de46847c7cfbdcb0, these are guaranteed to be defined. (Guaranteed including a test in the testsuite.) - - - - - 0295375a by John Ericson at 2023-10-18T19:41:37-04:00 Generate `ghcversion.h` from a `.in` file Now that there are no conditional sections (see the previous commit), we can just a do simple substitution rather than pasting it together line by line. Progress on #23966 - - - - - 740a1b85 by Krzysztof Gogolewski at 2023-10-19T11:37:20-04:00 Add a regression test for #24064 - - - - - 921fbf2f by Hécate Moonlight at 2023-10-19T11:37:59-04:00 CLC Proposal #182: Export List from Data.List Proposal link: https://github.com/haskell/core-libraries-committee/issues/182 - - - - - 4f02d3c1 by Sylvain Henry at 2023-10-20T04:01:32-04:00 rts: fix small argument passing on big-endian arch (fix #23387) - - - - - b86243b4 by Sylvain Henry at 2023-10-20T04:02:13-04:00 Interpreter: fix literal alignment on big-endian architectures (fix #19261) Literals weren't correctly aligned on big-endian, despite what the comment said. - - - - - a4b2ec47 by Sylvain Henry at 2023-10-20T04:02:54-04:00 Testsuite: recomp011 and recomp015 are fixed on powerpc These tests have been fixed but not tested and re-enabled on big-endian powerpc (see comments in #11260 and #11323) - - - - - fded7dd4 by Sebastian Graf at 2023-10-20T04:03:30-04:00 CorePrep: Allow floating dictionary applications in -O0 into a Rec (#24102) - - - - - 02efc181 by John Ericson at 2023-10-22T02:48:55-04:00 Move function checks to RTS configure Some of these functions are used in `base` too, but we can copy the checks over to its configure if that's an issue. - - - - - 5f4bccab by John Ericson at 2023-10-22T02:48:55-04:00 Move over a number of C-style checks to RTS configure - - - - - 5cf04f58 by John Ericson at 2023-10-22T02:48:55-04:00 Move/Copy more `AC_DEFINE` to RTS config Only exception is the LLVM version macros, which are used for GHC itself. - - - - - b8ce5dfe by John Ericson at 2023-10-22T02:48:55-04:00 Define `TABLES_NEXT_TO_CODE` in the RTS configure We create a new cabal flag to facilitate this. - - - - - 4a40271e by John Ericson at 2023-10-22T02:48:55-04:00 Configure scripts: `checkOS`: Make a bit more robust `mingw64` and `mingw32` are now both accepted for `OSMinGW32`. This allows us to cope with configs/triples that we haven't normalized extra being what GNU `config.sub` does. - - - - - 16bec0a0 by John Ericson at 2023-10-22T02:48:55-04:00 Generate `ghcplatform.h` from RTS configure We create a new cabal flag to facilitate this. - - - - - 7dfcab2f by John Ericson at 2023-10-22T02:48:55-04:00 Get rid of all mention of `mk/config.h` The RTS configure script is now solely responsible for managing its headers; the top level configure script does not help. - - - - - c1e3719c by Cheng Shao at 2023-10-22T02:49:33-04:00 rts: drop stale mentions of MIN_UPD_SIZE We used to have MIN_UPD_SIZE macro that describes the minimum reserved size for thunks, so that the thunk can be overwritten in place as indirections or blackholes. However, this macro has not been actually defined or used anywhere since a long time ago; StgThunkHeader already reserves a padding word for this purpose. Hence this patch which drops stale mentions of MIN_UPD_SIZE. - - - - - d24b0d85 by Andrew Lelechenko at 2023-10-22T02:50:11-04:00 base changelog: move non-backported entries from 4.19 section to 4.20 Neither !10933 (check https://hackage.haskell.org/package/base-4.19.0.0/docs/src/Text.Read.Lex.html#numberToRangedRational) nor !10189 (check https://hackage.haskell.org/package/base-4.19.0.0/docs/src/Data.List.NonEmpty.html#unzip) were backported to `base-4.19.0.0`. Moving them to `base-4.20.0.0` section. Also minor stylistic changes to other entries, bringing them to a uniform form. - - - - - de78b32a by Alan Zimmerman at 2023-10-23T09:09:41-04:00 EPA Some tweaks to annotations - Fix span for GRHS - Move TrailingAnns from last match to FunBind - Fix GADT 'where' clause span - Capture full range for a CaseAlt Match - - - - - d5a8780d by Simon Hengel at 2023-10-23T09:10:23-04:00 Update primitives.rst - - - - - 4d075924 by Josh Meredith at 2023-10-24T23:04:12+11:00 JS/userguide: add explanation of writing jsbits - - - - - 07ab5cc1 by Cheng Shao at 2023-10-24T15:40:32-04:00 testsuite: increase timeout of ghc-api tests for wasm32 ghc-api tests for wasm32 are more likely to timeout due to the large wasm module sizes, especially when testing with wasm native tail calls, given wasmtime's handling of tail call opcodes are suboptimal at the moment. It makes sense to increase timeout specifically for these tests on wasm32. This doesn't affect other targets, and for wasm32 we don't increase timeout for all tests, so not to risk letting major performance regressions slip through the testsuite. - - - - - 0d6acca5 by Greg Steuck at 2023-10-26T08:44:23-04:00 Explicitly require RLIMIT_AS before use in OSMem.c This is done elsewhere in the source tree. It also suddenly is required on OpenBSD. - - - - - 9408b086 by Sylvain Henry at 2023-10-26T08:45:03-04:00 Modularity: modularize external linker Decouple runLink from DynFlags to allow calling runLink more easily. This is preliminary work for calling Emscripten's linker (emcc) from our JavaScript linker. - - - - - e0f35030 by doyougnu at 2023-10-27T08:41:12-04:00 js: add JStg IR, remove unsaturated constructor - Major step towards #22736 and adding the optimizer in #22261 - - - - - 35587eba by Simon Peyton Jones at 2023-10-27T08:41:48-04:00 Fix a bug in tail calls with ticks See #24078 for the diagnosis. The change affects only the Tick case of occurrence analysis. It's a bit hard to test, so no regression test (yet anyway). - - - - - 9bc5cb92 by Matthew Craven at 2023-10-28T07:06:17-04:00 Teach tag-inference about SeqOp/seq# Fixes the STG/tag-inference analogue of #15226. Co-Authored-By: Simon Peyton Jones <simon.peytonjones at gmail.com> - - - - - 34f06334 by Moritz Angermann at 2023-10-28T07:06:53-04:00 [PEi386] Mask SYM_TYPE_DUP_DISCARD in makeSymbolExtra 48e391952c17ff7eab10b0b1456e3f2a2af28a9b introduced `SYM_TYPE_DUP_DISCARD` to the bitfield. The linker however, failed to mask the `SYM_TYPE_DUP_DISCARD` value. Thus `== SYM_TYPE_CODE` comparisons easily failed. This lead to us relocating DATA lookups (GOT) into E8 (call) and E9 (jump) instructions. - - - - - 5b51b2a2 by Mario Blažević at 2023-10-28T07:07:33-04:00 Fix and test for issue #24111, TH.Ppr output of pattern synonyms - - - - - 723bc352 by Alan Zimmerman at 2023-10-30T20:36:41-04:00 EPA: print doc comments as normal comments And ignore the ones allocated in haddock processing. It does not guarantee that every original haddock-like comment appears in the output, as it discards ones that have no legal attachment point. closes #23459 - - - - - 21b76843 by Simon Peyton Jones at 2023-10-30T20:37:17-04:00 Fix non-termination bug in equality solver constraint left-to-right then right to left, forever. Easily fixed. - - - - - 270867ac by Sebastian Graf at 2023-10-30T20:37:52-04:00 ghc-toolchain: build with `-package-env=-` (#24131) Otherwise globally installed libraries (via `cabal install --lib`) break the build. Fixes #24131. - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - 7a90020f by Krzysztof Gogolewski at 2023-10-31T20:03:37-04:00 docs: fix ScopedTypeVariables example (#24101) The previous example didn't compile. Furthermore, it wasn't demonstrating the point properly. I have changed it to an example which shows that 'a' in the signature must be the same 'a' as in the instance head. - - - - - 49f69f50 by Krzysztof Gogolewski at 2023-10-31T20:04:13-04:00 Fix pretty-printing of type family dependencies "where" should be after the injectivity annotation. - - - - - 73c191c0 by Ben Gamari at 2023-10-31T20:04:49-04:00 gitlab-ci: Bump LLVM bootstrap jobs to Debian 12 As the Debian 10 images have too old an LLVM. Addresses #24056. - - - - - 5b0392e0 by Matthew Pickering at 2023-10-31T20:04:49-04:00 ci: Run aarch64 llvm backend job with "LLVM backend" label This brings it into line with the x86 LLVM backend job. - - - - - 9f9c9227 by Ryan Scott at 2023-11-01T09:19:12-04:00 More robust checking for DataKinds As observed in #22141, GHC was not doing its due diligence in catching code that should require `DataKinds` in order to use. Most notably, it was allowing the use of arbitrary data types in kind contexts without `DataKinds`, e.g., ```hs data Vector :: Nat -> Type -> Type where ``` This patch revamps how GHC tracks `DataKinds`. The full specification is written out in the `DataKinds` section of the GHC User's Guide, and the implementation thereof is described in `Note [Checking for DataKinds]` in `GHC.Tc.Validity`. In brief: * We catch _type_-level `DataKinds` violations in the renamer. See `checkDataKinds` in `GHC.Rename.HsType` and `check_data_kinds` in `GHC.Rename.Pat`. * We catch _kind_-level `DataKinds` violations in the typechecker, as this allows us to catch things that appear beneath type synonyms. (We do *not* want to do this in type-level contexts, as it is perfectly fine for a type synonym to mention something that requires DataKinds while still using the type synonym in a module that doesn't enable DataKinds.) See `checkValidType` in `GHC.Tc.Validity`. * There is now a single `TcRnDataKindsError` that classifies all manner of `DataKinds` violations, both in the renamer and the typechecker. The `NoDataKindsDC` error has been removed, as it has been subsumed by `TcRnDataKindsError`. * I have added `CONSTRAINT` is `isKindTyCon`, which is what checks for illicit uses of data types at the kind level without `DataKinds`. Previously, `isKindTyCon` checked for `Constraint` but not `CONSTRAINT`. This is inconsistent, given that both `Type` and `TYPE` were checked by `isKindTyCon`. Moreover, it thwarted the implementation of the `DataKinds` check in `checkValidType`, since we would expand `Constraint` (which was OK without `DataKinds`) to `CONSTRAINT` (which was _not_ OK without `DataKinds`) and reject it. Now both are allowed. * I have added a flurry of additional test cases that test various corners of `DataKinds` checking. Fixes #22141. - - - - - 575d7690 by Sylvain Henry at 2023-11-01T09:19:53-04:00 JS: fix FFI "wrapper" and "dynamic" Fix codegen and helper functions for "wrapper" and "dynamic" foreign imports. Fix tests: - ffi006 - ffi011 - T2469 - T4038 Related to #22363 - - - - - 81fb8885 by Alan Zimmerman at 2023-11-01T22:23:56-04:00 EPA: Use full range for Anchor This change requires a series of related changes, which must all land at the same time, otherwise all the EPA tests break. * Use the current Anchor end as prior end Use the original anchor location end as the source of truth for calculating print deltas. This allows original spacing to apply in most cases, only changed AST items need initial delta positions. * Add DArrow to TrailingAnn * EPA Introduce HasTrailing in ExactPrint Use [TrailingAnn] in enterAnn and remove it from ExactPrint (LocatedN RdrName) * In HsDo, put TrailingAnns at top of LastStmt * EPA: do not convert comments to deltas when balancing. * EPA: deal with fallout from getMonoBind * EPA fix captureLineSpacing * EPA print any comments in the span before exiting it * EPA: Add comments to AnchorOperation * EPA: remove AnnEofComment, it is no longer used Updates Haddock submodule - - - - - 03e82511 by Rodrigo Mesquita at 2023-11-01T22:24:32-04:00 Fix in docs regarding SSymbol, SNat, SChar (#24119) - - - - - 362cc693 by Matthew Pickering at 2023-11-01T22:25:08-04:00 hadrian: Update bootstrap plans (9.4.6, 9.4.7, 9.6.2, 9.6.3, 9.8.1) Updating the bootstrap plans with more recent GHC versions. - - - - - 00b9b8d3 by Matthew Pickering at 2023-11-01T22:25:08-04:00 ci: Add 9.8.1 bootstrap testing job - - - - - ef3d20f8 by Matthew Pickering at 2023-11-01T22:25:08-04:00 Compatibility with 9.8.1 as boot compiler This fixes several compatability issues when using 9.8.1 as the boot compiler. * An incorrect version guard on the stack decoding logic in ghc-heap * Some ghc-prim bounds need relaxing * ghc is no longer wired in, so we have to remove the -this-unit-id ghc call. Fixes #24077 - - - - - 6755d833 by Jaro Reinders at 2023-11-03T10:54:42+01:00 Add NCG support for common 64bit operations to the x86 backend. These used to be implemented via C calls which was obviously quite bad for performance for operations like simple addition. Co-authored-by: Andreas Klebinger - - - - - 0dfb1fa7 by Vladislav Zavialov at 2023-11-03T14:08:41-04:00 T2T in Expressions (#23738) This patch implements the T2T (term-to-type) transformation in expressions. Given a function with a required type argument vfun :: forall a -> ... the user can now call it as vfun (Maybe Int) instead of vfun (type (Maybe Int)) The Maybe Int argument is parsed and renamed as a term (HsExpr), but then undergoes a conversion to a type (HsType). See the new function expr_to_type in compiler/GHC/Tc/Gen/App.hs and Note [RequiredTypeArguments and the T2T mapping] Left as future work: checking for puns. - - - - - cc1c7c54 by Duncan Coutts at 2023-11-05T00:23:44-04:00 Add a test for I/O managers It tries to cover the cases of multiple threads waiting on the same fd for reading and multiple threads waiting for writing, including wait cancellation by async exceptions. It should work for any I/O manager, in-RTS or in-Haskell. Unfortunately it will not currently work for Windows because it relies on anonymous unix sockets. It could in principle be ported to use Windows named pipes. - - - - - 2e448f98 by Cheng Shao at 2023-11-05T00:23:44-04:00 Skip the IOManager test on wasm32 arch. The test relies on the sockets API which are not (yet) available. - - - - - fe50eb35 by Cheng Shao at 2023-11-05T00:24:20-04:00 compiler: fix eager blackhole symbol in wasm32 NCG - - - - - af771148 by Cheng Shao at 2023-11-05T00:24:20-04:00 testsuite: fix optasm tests for wasm32 - - - - - 1b90735c by Matthew Pickering at 2023-11-05T00:24:20-04:00 testsuite: Add wasm32 to testsuite arches with NCG The compiler --info reports that wasm32 compilers have a NCG, so we should agree with that here. - - - - - db9a6496 by Alan Zimmerman at 2023-11-05T00:24:55-04:00 EPA: make locA a function, not a field name And use it to generalise reLoc The following for the windows pipeline one. 5.5% Metric Increase: T5205 - - - - - 833e250c by Simon Peyton Jones at 2023-11-05T00:25:31-04:00 Update the unification count in wrapUnifierX Omitting this caused type inference to fail in #24146. This was an accidental omision in my refactoring of the equality solver. - - - - - e451139f by Andreas Klebinger at 2023-11-05T00:26:07-04:00 Remove an accidental git conflict marker from a comment. - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 30baac7a by Tobias Haslop at 2023-11-06T10:50:32+00:00 Add laws relating between Foldable/Traversable with their Bi- superclasses See https://github.com/haskell/core-libraries-committee/issues/205 for discussion. This commit also documents that the tuple instances only satisfy the laws up to lazyness, similar to the documentation added in !9512. - - - - - df626f00 by Tobias Haslop at 2023-11-07T02:20:37-05:00 Elaborate on the quantified superclass of Bifunctor This was requested in the comment https://github.com/haskell/core-libraries-committee/issues/93#issuecomment-1597271700 for when Traversable becomes a superclass of Bitraversable, but similarly applies to Functor/Bifunctor, which already are in a superclass relationship. - - - - - 8217acb8 by Alan Zimmerman at 2023-11-07T02:21:12-05:00 EPA: get rid of l2l and friends Replace them with l2l to convert the location la2la to convert a GenLocated thing Updates haddock submodule - - - - - dd88a260 by Luite Stegeman at 2023-11-07T02:21:53-05:00 JS: remove broken newIdents from JStg Monad GHC.JS.JStg.Monad.newIdents was broken, resulting in duplicate identifiers being generated in h$c1, h$c2, ... . This change removes the broken newIdents. - - - - - 455524a2 by Matthew Craven at 2023-11-09T08:41:59-05:00 Create specially-solved DataToTag class Closes #20532. This implements CLC proposal 104: https://github.com/haskell/core-libraries-committee/issues/104 The design is explained in Note [DataToTag overview] in GHC.Tc.Instance.Class. This replaces the existing `dataToTag#` primop. These metric changes are not "real"; they represent Unique-related flukes triggering on a different set of jobs than they did previously. See also #19414. Metric Decrease: T13386 T8095 Metric Increase: T13386 T8095 Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com> - - - - - a05f4554 by Alan Zimmerman at 2023-11-09T08:42:35-05:00 EPA: get rid of glRR and friends in GHC/Parser.y With the HasLoc and HasAnnotation classes, we can replace a number of type-specific helper functions in the parser with polymorphic ones instead Metric Decrease: MultiLayerModulesTH_Make - - - - - 18498538 by Cheng Shao at 2023-11-09T16:58:12+00:00 ci: bump ci-images for wasi-sdk upgrade - - - - - 52c0fc69 by PHO at 2023-11-09T19:16:22-05:00 Don't assume the current locale is *.UTF-8, set the encoding explicitly primops.txt contains Unicode characters: > LC_ALL=C ./genprimopcode --data-decl < ./primops.txt > genprimopcode: <stdin>: hGetContents: invalid argument (cannot decode byte sequence starting from 226) Hadrian must also avoid using readFile' to read primops.txt because it tries to decode the file with a locale-specific encoding. - - - - - 7233b3b1 by PHO at 2023-11-09T19:17:01-05:00 Use '[' instead of '[[' because the latter is a Bash-ism It doesn't work on platforms where /bin/sh is something other than Bash. - - - - - 6dbab180 by Simon Peyton Jones at 2023-11-09T19:17:36-05:00 Add an extra check in kcCheckDeclHeader_sig 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 - - - - - 22551364 by Sven Tennie at 2023-11-11T06:35:22-05:00 AArch64: Delete unused LDATA pseudo-instruction Though there were consuming functions for LDATA, there were no producers. Thus, the removed code was "dead". - - - - - 2a0ec8eb by Alan Zimmerman at 2023-11-11T06:35:59-05:00 EPA: harmonise acsa and acsA in GHC/Parser.y With the HasLoc class, we can remove the acsa helper function, using acsA instead. - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 7ae517a0 by Teo Camarasu at 2023-11-12T08:04:12-05:00 nofib: bump submodule This includes changes that: - fix building a benchmark with HEAD - remove a Makefile-ism that causes errors in bash scripts Resolves #24178 - - - - - 3f0036ec by Alan Zimmerman at 2023-11-12T08:04:47-05:00 EPA: Replace Anchor with EpaLocation 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 - - - - - a7492048 by Alan Zimmerman at 2023-11-12T13:43:07+00:00 EPA: get rid of AnchorOperation Now that the Anchor type is an alias for EpaLocation, remove AnchorOperation. Updates haddock submodule - - - - - 0745c34d by Andrew Lelechenko at 2023-11-13T16:25:07-05:00 Add since annotation for showHFloat - - - - - e98051a5 by Rodrigo Mesquita at 2023-11-15T13:18:58-05:00 Suppress duplicate librares linker warning of new macOS linker Fixes #24167 XCode 15 introduced a new linker which warns on duplicate libraries being linked. To disable this warning, we pass -Wl,-no_warn_duplicate_libraries as suggested by Brad King in CMake issue #25297. This flag isn't necessarily available to other linkers on darwin, so we must only configure it into the CC linker arguments if valid. - - - - - c411c431 by Rodrigo Mesquita at 2023-11-15T13:18:58-05:00 testsuite: Encoding test witnesses recent iconv bug is fragile A regression in the new iconv() distributed with XCode 15 and MacOS Sonoma causes the test 'encoding004' to fail in the CP936 roundrip. We mark this test as fragile until this is fixed upstream (rather than broken, since previous versions of iconv pass the test) See #24161 - - - - - ce7fe5a9 by Rodrigo Mesquita at 2023-11-15T13:18:58-05:00 testsuite: Update to LC_ALL=C no longer being ignored in darwin MacOS seems to have fixed an issue where it used to ignore the variable `LC_ALL` in program invocations and default to using Unicode. Since the behaviour seems to be fixed to account for the locale variable, we mark tests that were previously broken in spite of it as fragile (since they now pass in recent macOS distributions) See #24161 - - - - - e6c803f7 by Rodrigo Mesquita at 2023-11-15T13:18:58-05:00 darwin: Fix single_module is obsolete warning 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 - - - - - 929ba2f9 by Rodrigo Mesquita at 2023-11-15T13:18:58-05:00 testsuite: Skip MultiLayerModulesTH_Make on darwin The recent toolchain upgrade on darwin machines resulted in the MultiLayerModulesTH_Make test metrics varying too much from the baseline, ultimately blocking the CI pipelines. This commit skips the test on darwin to temporarily avoid failures due to the environment change in the runners. However, the metrics divergence is being investigated still (tracked in #24177) - - - - - af261ccd by Rodrigo Mesquita at 2023-11-15T13:18:58-05:00 configure: check target (not build) understands -no_compact_unwind Previously, we were branching on whether the build system was darwin to shortcut this check, but we really want to branch on whether the target system (which is what we are configuring ld_prog for) is darwin. - - - - - 2125c176 by Luite Stegeman at 2023-11-15T13:19:38-05:00 JS: Fix missing variable declarations 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. - - - - - 99ced73b by Krzysztof Gogolewski at 2023-11-15T13:20:14-05:00 Remove loopy superclass solve mechanism Programs with a -Wloopy-superclass-solve warning will now fail with an error. Fixes #23017 - - - - - 2aff2361 by Zubin Duggal at 2023-11-15T13:20:50-05:00 users-guide: Fix links to libraries from the users-guide. The unit-ids generated in c1a3ecde720b3bddc2c8616daaa06ee324e602ab include the package name, so we don't need to explicitly add it to the links. Fixes #24151 - - - - - 27981fac by Alan Zimmerman at 2023-11-15T13:21:25-05:00 EPA: splitLHsForAllTyInvis does not return ann We did not use the annotations returned from splitLHsForAllTyInvis, so do not return them. - - - - - a6467834 by Krzysztof Gogolewski at 2023-11-15T22:22:59-05:00 Document defaulting of RuntimeReps Fixes #24099 - - - - - 2776920e by Simon Peyton Jones at 2023-11-15T22:23:35-05:00 Second fix to #24083 My earlier fix turns out to be too aggressive for data/type families See wrinkle (DTV1) in Note [Disconnected type variables] - - - - - cee81370 by Sylvain Henry at 2023-11-16T09:57:46-05:00 Fix unusable units and module reexport interaction (#21097) This commit fixes an issue with ModUnusable introduced in df0f148feae. 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. - - - - - 3e606230 by Krzysztof Gogolewski at 2023-11-16T09:58:22-05:00 Fix IPE test A helper function was defined in a different module than used. To reproduce: ./hadrian/build test --test-root-dirs=testsuite/tests/rts/ipe - - - - - 49f5264b by Andreas Klebinger at 2023-11-16T20:52:11-05:00 Properly compute unpacked sizes for -funpack-small-strict-fields. Use rep size rather than rep count to compute the size. Fixes #22309 - - - - - b4f84e4b by James Henri Haydon at 2023-11-16T20:52:53-05:00 Explicit methods for Alternative Compose Explicitly define some and many in Alternative instance for Data.Functor.Compose Implementation of https://github.com/haskell/core-libraries-committee/issues/181 - - - - - 9bc0dd1f by Ignat Insarov at 2023-11-16T20:53:34-05:00 Add permutations for non-empty lists. Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/68#issuecomment-1221409837 - - - - - 5643ecf9 by Andrew Lelechenko at 2023-11-16T20:53:34-05:00 Update changelog and since annotations for Data.List.NonEmpty.permutations Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/68#issuecomment-1221409837 - - - - - 94ff2134 by Oleg Alexander at 2023-11-16T20:54:15-05:00 Update doc string for traceShow Updated doc string for traceShow. - - - - - faff671a by Luite Stegeman at 2023-11-17T14:12:51+01:00 JS: clean up some foreign imports - - - - - 856e0a4e by Sven Tennie at 2023-11-18T06:54:11-05:00 AArch64: Remove unused instructions 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 - - - - - 615441ef by Alan Zimmerman at 2023-11-18T06:54:46-05:00 EPA: Replace Monoid with NoAnn Remove the final Monoid instances in the exact print infrastructure. For Windows CI Metric Decrease: T5205 - - - - - 5a6c49d4 by David Feuer at 2023-11-20T18:53:18-05:00 Speed up stimes in instance Semigroup Endo As discussed at https://github.com/haskell/core-libraries-committee/issues/4 - - - - - cf9da4b3 by Andrew Lelechenko at 2023-11-20T18:53:18-05:00 base: reflect latest changes in the changelog - - - - - 48bf364e by Alan Zimmerman at 2023-11-20T18:53:54-05:00 EPA: Use SrcSpan in EpaSpan 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. - - - - - 97ec37cc by Sebastian Graf at 2023-11-20T18:54:31-05:00 Add regression test for #6070 Fixes #6070. - - - - - e9d5ae41 by Owen Shepherd at 2023-11-21T18:32:23-05:00 chore: Correct typo in the gitlab MR template [skip ci] - - - - - f158a8d0 by Rodrigo Mesquita at 2023-11-21T18:32:59-05:00 Improve error message when reading invalid `.target` files A `.target` file generated by ghc-toolchain or by configure can become invalid if the target representation (`Toolchain.Target`) is changed while the files are not re-generated by calling `./configure` or `ghc-toolchain` again. There is also the issue of hadrian caching the dependencies on `.target` files, which makes parsing fail when reading reading the cached value if the representation has been updated. This patch provides a better error message in both situations, moving away from a terrible `Prelude.read: no parse` error that you would get otherwise. Fixes #24199 - - - - - 955520c6 by Ben Gamari at 2023-11-21T18:33:34-05:00 users guide: Note that QuantifiedConstraints implies ExplicitForAll Fixes #24025. - - - - - 17ec3e97 by Owen Shepherd at 2023-11-22T09:37:28+01:00 fix: Change type signatures in NonEmpty export comments to reflect reality This fixes several typos in the comments of Data.List.NonEmpty export list items. - - - - - 2fd78f9f by Samuel Thibault at 2023-11-22T11:49:13-05:00 Fix the platform string for GNU/Hurd As commited in Cargo https://github.com/haskell/cabal/pull/9434 there is confusion between "gnu" and "hurd". This got fixed in Cargo, we need the converse in Hadrian. Fixes #24180 - - - - - a79960fe by Alan Zimmerman at 2023-11-22T11:49:48-05:00 EPA: Tuple Present no longer has annotation The Present constructor for a Tuple argument will never have an exact print annotation. So make this impossible. - - - - - 121c9ab7 by David Binder at 2023-11-22T21:12:29-05:00 Unify the hpc testsuites 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. - - - - - d2733a05 by Alan Zimmerman at 2023-11-22T21:13:05-05:00 EPA: empty tup_tail has noAnn 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. - - - - - fa576eb8 by Andreas Klebinger at 2023-11-24T08:29:13-05:00 Fix FMA primops generating broken assembly on x86. `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 - - - - - 34d86315 by Alan Zimmerman at 2023-11-24T08:29:49-05:00 EPA: Remove parenthesizeHsType 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 - - - - - 3ede659d by Vladislav Zavialov at 2023-11-26T06:43:32-05:00 Add name for -Wdeprecated-type-abstractions (#24154) This warning had no name or flag and was triggered unconditionally. Now it is part of -Wcompat. - - - - - 7902ebf8 by Alan Zimmerman at 2023-11-26T06:44:08-05:00 EPA: Remove EpAnnNotUsed 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 - - - - - 471b2672 by Mario Blažević at 2023-11-26T06:44:48-05:00 Bumped the upper bound of text to <2.2 - - - - - d1bf25c7 by Vladislav Zavialov at 2023-11-26T11:45:49-05:00 Term variable capture (#23740) 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. - - - - - da863d15 by Vladislav Zavialov at 2023-11-26T11:46:26-05:00 Update Note [hsScopedTvs and visible foralls] The Note was written before GHC gained support for visible forall in types of terms. Rewrite a few sentences and use a better example. - - - - - b5213542 by Matthew Pickering at 2023-11-27T12:53:59-05:00 testsuite: Add mechanism to collect generic metrics * Generalise the metric logic by adding an additional field which allows you to specify how to query for the actual value. Previously the method of querying the baseline value was abstracted (but always set to the same thing). * This requires rejigging how the stat collection works slightly but now it's more uniform and hopefully simpler. * Introduce some new "generic" helper functions for writing generic stats tests. - collect_size ( deviation, path ) Record the size of the file as a metric - stat_from_file ( metric, deviation, path ) Read a value from the given path, and store that as a metric - collect_generic_stat ( metric, deviation, get_stat) Provide your own `get_stat` function, `lambda way: <Int>`, which can be used to establish the current value of the metric. - collect_generic_stats ( metric_info ): Like collect_generic_stat but provide the whole dictionary of metric definitions. { metric: { deviation: <Int> current: lambda way: <Int> } } * Introduce two new "size" metrics for keeping track of build products. - `size_hello_obj` - The size of `hello.o` from compiling hello.hs - `libdir` - The total size of the `libdir` folder. * Track the number of modules in the AST tests - CountDepsAst - CountDepsParser This lays the infrastructure for #24191 #22256 #17129 - - - - - 7d9a2e44 by ARATA Mizuki at 2023-11-27T12:54:39-05:00 x86: Don't require -mavx2 when using 256-bit floating-point SIMD primitives Fixes #24222 - - - - - 4e5ff6a4 by Alan Zimmerman at 2023-11-27T12:55:15-05:00 EPA: Remove SrcSpanAnn Now that we only have a single constructor for EpAnn, And it uses a SrcSpan for its location, we can do away with SrcSpanAnn completely. It only existed to wrap the original SrcSpan in a location, and provide a place for the exact print annotation. For darwin only: Metric Increase: MultiLayerModulesTH_OneShot Updates haddock submodule - - - - - e05bca39 by Krzysztof Gogolewski at 2023-11-28T08:00:55-05:00 testsuite: don't initialize testdir to '.' The test directory is removed during cleanup, if there's an interrupt that could remove the entire repository. Fixes #24219 - - - - - af881674 by Alan Zimmerman at 2023-11-28T08:01:30-05:00 EPA: Clean up mkScope in Ast.hs Now that we have HasLoc we can get rid of all the custom variants of mkScope For deb10-numa Metric Increase: libdir - - - - - 292983c8 by Ben Gamari at 2023-11-28T22:44:28-05:00 distrib: Rediscover otool and install_name_tool on Darwin In the bindist configure script we must rediscover the `otool` and `install_name_tool`s since they may be different from the build environment. Fixes #24211. - - - - - dfe1c354 by Stefan Schulze Frielinghaus at 2023-11-28T22:45:04-05:00 llvmGen: Align objects in the data section 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. - - - - - f6c486c3 by Matthew Pickering at 2023-11-29T11:08:13-05:00 metrics: Widen libdir and size_hello_obj acceptance window af8816740d9b8759be1a22af8adcb5f13edeb61d shows that the libdir size can fluctuate quite significantly even when the change is quite small. Therefore we widen the acceptance window to 10%. - - - - - 99a6a49c by Alan Zimmerman at 2023-11-29T11:08:49-05:00 EPA: Clean up TC Monad Utils 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 - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - cbc03fa0 by Sebastian Graf at 2023-11-30T12:37:21-05:00 perf tests: Move comments into new `Note [Sensitivity to unique increment]` (#19414) And additionally to T12545, link from T8095, T13386 to this new Note. - - - - - c7623b22 by Alan Zimmerman at 2023-11-30T12:37:56-05:00 EPA: EpaDelta for comment has no comments 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 - - - - - bd8acc0c by Krzysztof Gogolewski at 2023-11-30T12:38:32-05:00 Kind-check body of a required forall We now require that in 'forall a -> ty', ty has kind TYPE r for some r. Fixes #24176 - - - - - 010fb784 by Owen Shepherd at 2023-12-03T00:10:09-05:00 docs(NonEmpty/group): Remove incorrect haddock link quotes in code block - - - - - cda9c12d by Owen Shepherd at 2023-12-03T00:10:09-05:00 docs(NonEmpty/group): Remove cycle from group haddock example - - - - - 495265b9 by Owen Shepherd at 2023-12-03T00:10:09-05:00 docs(NonEmpty/group): Use repl haddock syntax in group docs - - - - - d134d1de by Owen Shepherd at 2023-12-03T00:10:09-05:00 docs(NonEmpty/group): Use list [] notation in group haddock - - - - - dfcf629c by Owen Shepherd at 2023-12-03T00:10:10-05:00 docs(NonEmpty/group): Specify final property of group function in haddock - - - - - cad3b734 by Owen Shepherd at 2023-12-03T00:10:10-05:00 fix: Add missing property of List.group - - - - - bad37656 by Matthew Pickering at 2023-12-03T00:10:46-05:00 testsuite: Fix T21097b test with make 4.1 (deb9) cee81370cd6ef256f66035e3116878d4cb82e28b recently added a test which failed on deb9 because the version of make was emitting the recipe failure to stdout rather than stderr. One way to fix this is to be more precise in the test about which part of the output we care about inspecting. - - - - - 5efdf421 by Matthew Pickering at 2023-12-03T00:11:21-05:00 testsuite: Track size of libdir in bytes For consistency it's better if we track all size metrics in bytes. Metric Increase: libdir - - - - - f5eb0f29 by Matthew Pickering at 2023-12-03T00:11:22-05:00 testsuite: Remove rogue trace in testsuite I accidentally left a trace in the generics metric patch. - - - - - d5610737 by Claudio Bley at 2023-12-06T16:13:33-05:00 Only exit ghci in -e mode when :add command fails Previously, when running `ghci -e ':add Sample.hs'` the process would exit with exit code 1 if the file exists and could be loaded. Fixes #24115 - - - - - 0f0c53a5 by Vladislav Zavialov at 2023-12-06T16:14:09-05:00 T2T in Patterns (#23739) This patch implements the T2T (term-to-type) transformation in patterns. Patterns that are checked against a visible forall can now be written without the `type` keyword: \(type t) (x :: t) -> ... -- old \t (x :: t) -> ... -- new The `t` binder is parsed and renamed as a term pattern (Pat), but then undergoes a conversion to a type pattern (HsTyPat). See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs - - - - - 10a1a6c6 by Sebastian Graf at 2023-12-06T16:14:45-05:00 Pmc: Fix SrcLoc and warning for incomplete irrefutable pats (#24234) Before, the source location would point at the surrounding function definition, causing the confusion in #24234. I also took the opportunity to introduce a new `LazyPatCtx :: HsMatchContext _` to make the warning message say "irrefutable pattern" instead of "pattern binding". - - - - - 36b9a38c by Matthew Pickering at 2023-12-06T16:15:21-05:00 libraries: Bump filepath to 1.4.200.1 and unix to 2.8.4.0 Updates filepath submodule Updates unix submodule Fixes #24240 - - - - - 91ff0971 by Matthew Pickering at 2023-12-06T16:15:21-05:00 Submodule linter: Allow references to tags We modify the submodule linter so that if the bumped commit is a specific tag then the commit is accepted. Fixes #24241 - - - - - 86f652dc by Zubin Duggal at 2023-12-06T16:15:21-05:00 hadrian: set -Wno-deprecations for directory and Win32 The filepath bump to 1.4.200.1 introduces a deprecation warning. See https://gitlab.haskell.org/ghc/ghc/-/issues/24240 https://github.com/haskell/filepath/pull/206 - - - - - 7ac6006e by Sylvain Henry at 2023-12-06T16:16:02-05:00 Zap OccInfo on case binders during StgCse #14895 #24233 StgCse can revive dead binders: case foo of dead { Foo x y -> Foo x y; ... } ===> case foo of dead { Foo x y -> dead; ... } -- dead is no longer dead So we must zap occurrence information on case binders. Fix #14895 and #24233 - - - - - 57c391c4 by Sebastian Graf at 2023-12-06T16:16:37-05:00 Cpr: Turn an assertion into a check to deal with some dead code (#23862) See the new `Note [Dead code may contain type confusions]`. Fixes #23862. - - - - - c1c8abf8 by Zubin Duggal at 2023-12-08T02:25:07-05:00 testsuite: add test for #23944 - - - - - 6329d308 by Zubin Duggal at 2023-12-08T02:25:07-05:00 driver: Only run a dynamic-too pipeline if object files are going to be generated Otherwise we run into a panic in hscMaybeWriteIface: "Unexpected DT_Dyn state when writing simple interface" when dynamic-too is enabled We could remove the panic and just write the interface even if the state is `DT_Dyn`, but it seems pointless to run the pipeline twice when `hscMaybeWriteIface` is already designed to write both `hi` and `dyn_hi` files if dynamic-too is enabled. Fixes #23944. - - - - - 28811f88 by Simon Peyton Jones at 2023-12-08T05:47:18-05:00 Improve duplicate elimination in SpecConstr This partially fixes #24229. See the new Note [Pattern duplicate elimination] in SpecConstr - - - - - fec7894f by Simon Peyton Jones at 2023-12-08T05:47:18-05:00 Make SpecConstr deal with casts better This patch does two things, to fix #23209: * It improves SpecConstr so that it no longer quantifies over coercion variables. See Note [SpecConstr and casts] * It improves the rule matcher to deal nicely with the case where the rule does not quantify over coercion variables, but the the template has a cast in it. See Note [Casts in the template] - - - - - 8db8d2fd by Zubin Duggal at 2023-12-08T05:47:54-05:00 driver: Don't lose track of nodes when we fail to resolve cycles The nodes that take part in a cycle should include both hs-boot and hs files, but when we fail to resolve a cycle, we were only counting the nodes from the graph without boot files. Fixes #24196 - - - - - c5b4efd3 by Zubin Duggal at 2023-12-08T05:48:30-05:00 testsuite: Skip MultiLayerModulesTH_OneShot on darwin See #24177 - - - - - fae472a9 by Wendao Lee at 2023-12-08T05:49:12-05:00 docs(Data.Char):Add more detailed descriptions for some functions Related changed function's docs: -GHC.Unicode.isAlpha -GHC.Unicode.isPrint -GHC.Unicode.isAlphaNum Add more details for what the function will return. Co-authored-by: Bodigrim <andrew.lelechenko at gmail.com> - - - - - ca7510e4 by Malik Ammar Faisal at 2023-12-08T05:49:55-05:00 Fix float parsing in GHC Cmm Lexer Add test case for bug #24224 - - - - - d8baa1bd by Simon Peyton Jones at 2023-12-08T15:40:37+00:00 Take care when simplifying unfoldings This MR fixes a very subtle bug exposed by #24242. See Note [Environment for simplLetUnfolding]. I also updated a bunch of Notes on shadowing - - - - - 03ca551d by Simon Peyton Jones at 2023-12-08T15:54:50-05:00 Comments only in FloatIn Relevant to #3458 - - - - - 50c78779 by Simon Peyton Jones at 2023-12-08T15:54:50-05:00 Comments only in SpecConstr - - - - - 9431e195 by Simon Peyton Jones at 2023-12-08T15:54:50-05:00 Add test for #22238 - - - - - d9e4c597 by Vladislav Zavialov at 2023-12-11T04:19:34-05:00 Make forall a keyword (#23719) Before this change, GHC used to accept `forall` as a term-level identifier: -- from constraints-0.13 forall :: forall p. (forall a. Dict (p a)) -> Dict (Forall p) forall d = ... Now it is a parse error. The -Wforall-identifier warning has served its purpose and is now a deprecated no-op. - - - - - 58d56644 by Zubin Duggal at 2023-12-11T04:20:10-05:00 driver: Ensure we actually clear the interactive context before reloading Previously we called discardIC, but immediately after set the session back to an old HscEnv that still contained the IC Partially addresses #24107 Fixes #23405 - - - - - 8e5745a0 by Zubin Duggal at 2023-12-11T04:20:10-05:00 driver: Ensure we force the lookup of old build artifacts before returning the build plan This prevents us from retaining all previous build artifacts in memory until a recompile finishes, instead only retaining the exact artifacts we need. Fixes #24118 - - - - - 105c370c by Zubin Duggal at 2023-12-11T04:20:10-05:00 testsuite: add test for #24118 and #24107 MultiLayerModulesDefsGhci was not able to catch the leak because it uses :l which discards the previous environment. Using :r catches both of these leaks - - - - - e822ff88 by Zubin Duggal at 2023-12-11T04:20:10-05:00 compiler: Add some strictness annotations to ImportSpec and related constructors This prevents us from retaining entire HscEnvs. Force these ImportSpecs when forcing the GlobalRdrEltX Adds an NFData instance for Bag Fixes #24107 - - - - - 522c12a4 by Zubin Duggal at 2023-12-11T04:20:10-05:00 compiler: Force IfGlobalRdrEnv in NFData instance. - - - - - 188b280d by Arnaud Spiwack at 2023-12-11T15:33:31+01:00 LinearTypes => MonoLocalBinds - - - - - 8e0446df by Arnaud Spiwack at 2023-12-11T15:44:28+01:00 Linear let and where bindings For expediency, the initial implementation of linear types in GHC made it so that let and where binders would always be considered unrestricted. This was rather unpleasant, and probably a big obstacle to adoption. At any rate, this was not how the proposal was designed. This patch fixes this infelicity. It was surprisingly difficult to build, which explains, in part, why it took so long to materialise. As of this patch, let or where bindings marked with %1 will be linear (respectively %p for an arbitrary multiplicity p). Unmarked let will infer their multiplicity. Here is a prototypical example of program that used to be rejected and is accepted with this patch: ```haskell f :: A %1 -> B g :: B %1 -> C h :: A %1 -> C h x = g y where y = f x ``` Exceptions: - Recursive let are unrestricted, as there isn't a clear semantics of what a linear recursive binding would be. - Destructive lets with lazy bindings are unrestricted, as their desugaring isn't linear (see also #23461). - (Strict) destructive lets with inferred polymorphic type are unrestricted. Because the desugaring isn't linear (See #18461 down-thread). Closes #18461 and #18739 Co-authored-by: @jackohughes - - - - - effa7e2d by Matthew Craven at 2023-12-12T04:37:20-05:00 Introduce `dataToTagSmall#` primop (closes #21710) ...and use it to generate slightly better code when dataToTag# is used at a "small data type" where there is no need to mess with "is_too_big_tag" or potentially look at an info table. Metric Decrease: T18304 - - - - - 35c7aef6 by Matthew Craven at 2023-12-12T04:37:20-05:00 Fix formatting of Note [alg-alt heap check] - - - - - 7397c784 by Oleg Grenrus at 2023-12-12T04:37:56-05:00 Allow untyped brackets in typed splices and vice versa. Resolves #24190 Apparently the check was essentially always (as far as I can trace back: d0d47ba76f8f0501cf3c4966bc83966ab38cac27), and while it does catch some mismatches, the type-checker will catch them too. OTOH, it prevents writing completely reasonable programs. - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - a3ee3b99 by Moritz Angermann at 2023-12-12T19:50:58-05:00 Drop hard Xcode dependency XCODE_VERSION calls out to `xcodebuild`, which is only available when having `Xcode` installed. The CommandLineTools are not sufficient. To install Xcode, you must have an apple id to download the Xcode.xip from apple. We do not use xcodebuild anywhere in our build explicilty. At best it appears to be a proxy for checking the linker or the compiler. These should rather be done with ``` xcrun ld -version ``` or similar, and not by proxy through Xcode. The CLR should be sufficient for building software on macOS. - - - - - 1c9496e0 by Vladislav Zavialov at 2023-12-12T19:51:34-05:00 docs: update information on RequiredTypeArguments Update the User's Guide and Release Notes to account for the recent progress in the implementation of RequiredTypeArguments. - - - - - d0b17576 by Ben Gamari at 2023-12-13T06:33:37-05:00 rts/eventlog: Fix off-by-one in assertion Previously we failed to account for the NULL terminator `postString` asserted that there is enough room in the buffer for the string. - - - - - a10f9b9b by Ben Gamari at 2023-12-13T06:33:37-05:00 rts/eventlog: Honor result of ensureRoomForVariableEvent is Previously we would keep plugging along, even if isn't enough room for the event. - - - - - 0e0f41c0 by Ben Gamari at 2023-12-13T06:33:37-05:00 rts/eventlog: Avoid truncating event sizes Previously ensureRoomForVariableEvent would truncate the desired size to 16-bits, resulting in #24197. Fixes #24197. - - - - - 64e724c8 by Artin Ghasivand at 2023-12-13T06:34:20-05:00 Remove the "Derived Constraint" argument of TcPluginSolver, docs - - - - - fe6d97dd by Vladislav Zavialov at 2023-12-13T06:34:56-05:00 EPA: Move tokens into GhcPs extension fields (#23447) Summary of changes * Remove Language.Haskell.Syntax.Concrete * Move all tokens into GhcPs extension fields (LHsToken -> EpToken) * Create new TTG extension fields as needed * Drop the MultAnn wrapper Updates the haddock submodule. Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 8106e695 by Zubin Duggal at 2023-12-13T06:35:34-05:00 testsuite: use copy_files in T23405 This prevents the tree from being dirtied when the file is modified. - - - - - ed0e4099 by Bryan Richter at 2023-12-14T04:30:53-05:00 Document ghc package's PVP-noncompliance This changes nothing, it just makes the status quo explicit. - - - - - 8bef8d9f by Luite Stegeman at 2023-12-14T04:31:33-05:00 JS: Mark spurious CI failures js_fragile(24259) This marks the spurious test failures on the JS platform as js_fragile(24259), so we don't hold up merge requests while fixing the underlying issues. See #24259 - - - - - 1c79526a by Finley McIlwaine at 2023-12-15T12:24:40-08:00 Late plugins - - - - - 000c3302 by Finley McIlwaine at 2023-12-15T12:24:40-08:00 withTiming on LateCCs and late plugins - - - - - be4551ac by Finley McIlwaine at 2023-12-15T12:24:40-08:00 add test for late plugins - - - - - 7c29da9f by Finley McIlwaine at 2023-12-15T12:24:40-08:00 Document late plugins - - - - - 9a52ae46 by Ben Gamari at 2023-12-20T07:07:26-05:00 Fix thunk update ordering Previously we attempted to ensure soundness of concurrent thunk update by synchronizing on the access of the thunk's info table pointer field. This was believed to be sufficient since the indirectee (which may expose a closure allocated by another core) would not be examined until the info table pointer update is complete. However, it turns out that this can result in data races in the presence of multiple threads racing a update a single thunk. For instance, consider this interleaving under the old scheme: Thread A Thread B --------- --------- t=0 Enter t 1 Push update frame 2 Begin evaluation 4 Pause thread 5 t.indirectee=tso 6 Release t.info=BLACKHOLE 7 ... (e.g. GC) 8 Resume thread 9 Finish evaluation 10 Relaxed t.indirectee=x 11 Load t.info 12 Acquire fence 13 Inspect t.indirectee 14 Release t.info=BLACKHOLE Here Thread A enters thunk `t` but is soon paused, resulting in `t` being lazily blackholed at t=6. Then, at t=10 Thread A finishes evaluation and updates `t.indirectee` with a relaxed store. Meanwhile, Thread B enters the blackhole. Under the old scheme this would introduce an acquire-fence but this would only synchronize with Thread A at t=6. Consequently, the result of the evaluation, `x`, is not visible to Thread B, introducing a data race. We fix this by treating the `indirectee` field as we do all other mutable fields. This means we must always access this field with acquire-loads and release-stores. See #23185. - - - - - f4b53538 by Vladislav Zavialov at 2023-12-20T07:08:02-05:00 docs: Fix link to 051-ghc-base-libraries.rst The proposal is no longer available at the previous URL. - - - - - f7e21fab by Matthew Pickering at 2023-12-21T14:57:40+00:00 hadrian: Build all executables in bin/ folder In the end the bindist creation logic copies them all into the bin folder. There is no benefit to building a specific few binaries in the lib/bin folder anymore. This also removes the ad-hoc logic to copy the touchy and unlit executables from stage0 into stage1. It takes <1s to build so we might as well just build it. - - - - - 0038d052 by Zubin Duggal at 2023-12-22T23:28:00-05:00 testsuite: mark jspace as fragile on i386. This test has been flaky for some time and has been failing consistently on i386-linux since 8e0446df landed. See #24261 - - - - - dfd670a0 by Ben Bellick at 2023-12-24T10:10:31-05:00 Deprecate -ddump-json and introduce -fdiagnostics-as-json 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. - - - - - 609e6225 by Ben Bellick at 2023-12-24T10:10:31-05:00 Deprecate -ddump-json and introduce -fdiagnostics-as-json 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. - - - - - 865513b2 by Ömer Sinan Ağacan at 2023-12-24T10:11:13-05:00 Fix BNF in user manual 6.6.8.2: formal syntax for instance declarations - - - - - c247b6be by Zubin Duggal at 2023-12-25T16:01:23-05:00 docs: document permissibility of -XOverloadedLabels (#24249) Document the permissibility introduced by https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0170-unrestricted-overloadedlabels.rst - - - - - e5b7eb59 by Ömer Sinan Ağacan at 2023-12-25T16:02:03-05:00 Fix a code block syntax in user manual sec. 6.8.8.6 - - - - - 2db11c08 by Ben Gamari at 2023-12-29T15:35:48-05:00 genSym: Reimplement via CAS on 32-bit platforms Previously the remaining use of the C implementation on 32-bit platforms resulted in a subtle bug, #24261. This was due to the C object (which used the RTS's `atomic_inc64` macro) being compiled without `-threaded` yet later being used in a threaded compiler. Side-step this issue by using the pure Haskell `genSym` implementation on all platforms. This required implementing `fetchAddWord64Addr#` in terms of CAS on 64-bit platforms. - - - - - 19328a8c by Xiaoyan Ren at 2023-12-29T15:36:30-05:00 Do not color the diagnostic code in error messages (#24172) - - - - - 685b467c by Krzysztof Gogolewski at 2023-12-29T15:37:06-05:00 Enforce that bindings of implicit parameters are lifted Fixes #24298 - - - - - bc4d67b7 by Matthew Craven at 2023-12-31T06:15:42-05:00 StgToCmm: Detect some no-op case-continuations ...and generate no code for them. Fixes #24264. - - - - - 5b603139 by Krzysztof Gogolewski at 2023-12-31T06:16:18-05:00 Revert "testsuite: mark jspace as fragile on i386." This reverts commit 0038d052c8c80b4b430bb2aa1c66d5280be1aa95. The atomicity bug should be fixed by !11802. - - - - - d55216ad by Krzysztof Gogolewski at 2024-01-01T12:05:49-05:00 Refactor: store [[PrimRep]] rather than [Type] in STG StgConApp stored a list of types. This list was used exclusively during unarisation of unboxed sums (mkUbxSum). However, this is at a wrong level of abstraction: STG shouldn't be concerned with Haskell types, only PrimReps. Update the code to store a [[PrimRep]]. Also, there's no point in storing this list when we're not dealing with an unboxed sum. - - - - - 8b340bc7 by Ömer Sinan Ağacan at 2024-01-01T12:06:29-05:00 Kind signatures docs: mention that they're allowed in newtypes - - - - - 989bf8e5 by Zubin Duggal at 2024-01-03T20:08:47-05:00 ci: Ensure we use the correct bindist name for the test artifact when generating release ghcup metadata Fixes #24268 - - - - - 89299a89 by Krzysztof Gogolewski at 2024-01-03T20:09:23-05:00 Refactor: remove calls to typePrimRepArgs The function typePrimRepArgs is just a thin wrapper around typePrimRep, adding a VoidRep if the list is empty. However, in StgToByteCode, we were discarding that VoidRep anyway, so there's no point in calling it. - - - - - c7be0c68 by mmzk1526 at 2024-01-03T20:10:07-05:00 Use "-V" for alex version check for better backward compatibility Fixes #24302. In recent versions of alex, "-v" is used for "--verbose" instead of "-version". - - - - - 67dbcc0a by Krzysztof Gogolewski at 2024-01-05T02:07:18-05:00 Fix VoidRep handling in ghci debugger 'go' inside extractSubTerms was giving a bad result given a VoidRep, attempting to round towards the next multiple of 0. I don't understand much about the debugger but the code should be better than it was. Fixes #24306 - - - - - 90ea574e by Krzysztof Gogolewski at 2024-01-05T02:07:54-05:00 VoidRep-related refactor * In GHC.StgToByteCode, replace bcIdPrimId with idPrimRep, bcIdArgRep with idArgRep, atomPrimRep with stgArgRep1. All of them were duplicates. * In GHC.Stg.Unarise, we were converting a PrimRep to a Type and back to PrimRep. Remove the calls to primRepToType and typePrimRep1 which cancel out. * In GHC.STG.Lint, GHC.StgToCmm, GHC.Types.RepType we were filtering out VoidRep from the result of typePrimRep. But typePrimRep never returns VoidRep - remove the filtering. - - - - - eaf72479 by brian at 2024-01-06T23:03:09-05:00 Add unaligned Addr# primops Implements CLC proposal #154: https://github.com/haskell/core-libraries-committee/issues/154 * add unaligned addr primops * add tests * accept tests * add documentation * fix js primops * uncomment in access ops * use Word64 in tests * apply suggestions * remove extra file * move docs * remove random options * use setByteArray# primop * better naming * update base-exports test * add base-exports for other architectures - - - - - d471d445 by Krzysztof Gogolewski at 2024-01-06T23:03:47-05:00 Remove VoidRep from PrimRep, introduce PrimOrVoidRep This introduces data PrimOrVoidRep = VoidRep | NVRep PrimRep changes typePrimRep1 to return PrimOrVoidRep, and adds a new function typePrimRepU to be used when the argument is definitely non-void. Details in Note [VoidRep] in GHC.Types.RepType. Fixes #19520 - - - - - 48720a07 by Matthew Craven at 2024-01-08T18:57:36-05:00 Apply Note [Sensitivity to unique increment] to LargeRecord - - - - - 9e2e180f by Sebastian Graf at 2024-01-08T18:58:13-05:00 Debugging: Add diffUFM for convenient diffing between UniqFMs - - - - - 948f3e35 by Sebastian Graf at 2024-01-08T18:58:13-05:00 Rename Opt_D_dump_stranal to Opt_D_dump_dmdanal ... and Opt_D_dump_str_signatures to Opt_D_dump_dmd_signatures - - - - - 4e217e3e by Sebastian Graf at 2024-01-08T18:58:13-05:00 Deprecate -ddump-stranal and -ddump-str-signatures ... and suggest -ddump-dmdanal and -ddump-dmd-signatures instead - - - - - 6c613c90 by Sebastian Graf at 2024-01-08T18:58:13-05:00 Move testsuite/tests/stranal to testsuite/tests/dmdanal A separate commit so that the rename is obvious to Git(Lab) - - - - - c929f02b by Sebastian Graf at 2024-01-08T18:58:13-05:00 CoreSubst: Stricten `substBndr` and `cloneBndr` Doing so reduced allocations of `cloneBndr` by about 25%. ``` T9233(normal) ghc/alloc 672,488,656 663,083,216 -1.4% GOOD T9675(optasm) ghc/alloc 423,029,256 415,812,200 -1.7% geo. mean -0.1% minimum -1.7% maximum +0.1% ``` Metric Decrease: T9233 - - - - - e3ca78f3 by Krzysztof Gogolewski at 2024-01-10T17:35:59-05:00 Deprecate -Wsemigroup This warning was used to prepare for Semigroup becoming a superclass of Monoid, and for (<>) being exported from Prelude. This happened in GHC 8.4 in 8ae263ceb3566 and feac0a3bc69fd3. The leftover logic for (<>) has been removed in GHC 9.8, 4d29ecdfcc79. Now the warning does nothing at all and can be deprecated. - - - - - 08d14925 by amesgen at 2024-01-10T17:36:42-05:00 WASM metadata: use correct GHC version - - - - - 7a808419 by Xiaoyan Ren at 2024-01-10T17:37:24-05:00 Allow SCC declarations in TH (#24081) - - - - - 28827c51 by Xiaoyan Ren at 2024-01-10T17:37:24-05:00 Fix prettyprinting of SCC pragmas - - - - - ae9cc1a8 by Matthew Craven at 2024-01-10T17:38:01-05:00 Fix loopification in the presence of void arguments This also removes Note [Void arguments in self-recursive tail calls], which was just misleading. It's important to count void args both in the function's arity and at the call site. Fixes #24295. - - - - - b718b145 by Zubin Duggal at 2024-01-10T17:38:36-05:00 testsuite: Teach testsuite driver about c++ sources - - - - - 09cb57ad by Zubin Duggal at 2024-01-10T17:38:36-05:00 driver: Set -DPROFILING when compiling C++ sources with profiling Earlier, we used to pass all preprocessor flags to the c++ compiler. This meant that -DPROFILING was passed to the c++ compiler because it was a part of C++ flags However, this was incorrect and the behaviour was changed in 8ff3134ed4aa323b0199ad683f72165e51a59ab6. See #21291. But that commit exposed this bug where -DPROFILING was no longer being passed when compiling c++ sources. The fix is to explicitly include -DPROFILING in `opt_cxx` when profiling is enabled to ensure we pass the correct options for the way to both C and C++ compilers Fixes #24286 - - - - - 2cf9dd96 by Zubin Duggal at 2024-01-10T17:38:36-05:00 testsuite: rename objcpp -> objcxx To avoid confusion with C Pre Processsor - - - - - af6932d6 by Simon Peyton Jones at 2024-01-10T17:39:12-05:00 Make TYPE and CONSTRAINT not-apart Issue #24279 showed up a bug in the logic in GHC.Core.Unify.unify_ty which is supposed to make TYPE and CONSTRAINT be not-apart. Easily fixed. - - - - - 4a39b5ff by Zubin Duggal at 2024-01-10T17:39:48-05:00 ci: Fix typo in mk_ghcup_metadata.py There was a missing colon in the fix to #24268 in 989bf8e53c08eb22de716901b914b3607bc8dd08 - - - - - 13503451 by Zubin Duggal at 2024-01-10T17:40:24-05:00 release-ci: remove release-x86_64-linux-deb11-release+boot_nonmoving_gc job There is no reason to have this release build or distribute this variation. This configuration is for testing purposes only. - - - - - afca46a4 by Sebastian Graf at 2024-01-10T17:41:00-05:00 Parser: Add a Note detailing why we need happy's `error` to implement layout - - - - - eaf8a06d by Krzysztof Gogolewski at 2024-01-11T00:43:17+01:00 Turn -Wtype-equality-out-of-scope on by default Also remove -Wnoncanonical-{monoid,monad}-instances from -Wcompat, since they are enabled by default. Refresh wcompat-warnings/ test with new -Wcompat warnings. Part of #24267 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 42bee5aa by Sebastian Graf at 2024-01-12T21:16:21-05:00 Arity: Require called *exactly once* for eta exp with -fpedantic-bottoms (#24296) In #24296, we had a program in which we eta expanded away an error despite the presence of `-fpedantic-bottoms`. This was caused by turning called *at least once* lambdas into one-shot lambdas, while with `-fpedantic-bottoms` it is only sound to eta expand over lambdas that are called *exactly* once. An example can be found in `Note [Combining arity type with demand info]`. Fixes #24296. - - - - - 7e95f738 by Andreas Klebinger at 2024-01-12T21:16:57-05:00 Aarch64: Enable -mfma by default. Fixes #24311 - - - - - e43788d0 by Jason Shipman at 2024-01-14T12:47:38-05:00 Add more instances for Compose: Fractional, RealFrac, Floating, RealFloat CLC proposal #226 https://github.com/haskell/core-libraries-committee/issues/226 - - - - - ae6d8cd2 by Sebastian Graf at 2024-01-14T12:48:15-05:00 Pmc: COMPLETE pragmas associated with Family TyCons should apply to representation TyCons as well (#24326) Fixes #24326. - - - - - c5fc7304 by sheaf at 2024-01-15T14:15:29-05:00 Use lookupOccRn_maybe in TH.lookupName When looking up a value, we want to be able to find both variables and record fields. So we should not use the lookupSameOccRn_maybe function, as we can't know ahead of time which record field namespace a record field with the given textual name will belong to. Fixes #24293 - - - - - da908790 by Krzysztof Gogolewski at 2024-01-15T14:16:05-05:00 Make the build more strict on documentation errors * Detect undefined labels. This can be tested by adding :ref:`nonexistent` to a documentation rst file; attempting to build docs will fail. Fixed the undefined label in `9.8.1-notes.rst`. * Detect errors. While we have plenty of warnings, we can at least enforce that Sphinx does not report errors. Fixed the error in `required_type_arguments.rst`. Unrelated change: I have documented that the `-dlint` enables `-fcatch-nonexhaustive-cases`, as can be verified by checking `enableDLint`. - - - - - 5077416e by Javier Sagredo at 2024-01-16T15:40:06-05:00 Profiling: Adds an option to not start time profiling at startup Using the functionality provided by d89deeba47ce04a5198a71fa4cbc203fe2c90794, this patch creates a new rts flag `--no-automatic-time-samples` which disables the time profiling when starting a program. It is then expected that the user starts it whenever it is needed. Fixes #24337 - - - - - 5776008c by Matthew Pickering at 2024-01-16T15:40:42-05:00 eventlog: Fix off-by-one error in postIPE We were missing the extra_comma from the calculation of the size of the payload of postIPE. This was causing assertion failures when the event would overflow the buffer by one byte, as ensureRoomForVariable event would report there was enough space for `n` bytes but then we would write `n + 1` bytes into the buffer. Fixes #24287 - - - - - 66dc09b1 by Simon Peyton Jones at 2024-01-16T15:41:18-05:00 Improve SpecConstr (esp nofib/spectral/ansi) This MR makes three improvements to SpecConstr: see #24282 * It fixes an outright (and recently-introduced) bug in `betterPat`, which was wrongly forgetting to compare the lengths of the argument lists. * It enhances ConVal to inclue a boolean for work-free-ness, so that the envt can contain non-work-free constructor applications, so that we can do more: see Note [ConVal work-free-ness] * It rejigs `subsumePats` so that it doesn't reverse the list. This can make a difference because, when patterns overlap, we arbitrarily pick the first. There is no "right" way, but this retains the old pre-subsumePats behaviour, thereby "fixing" the regression in #24282. Nofib results +======================================== | spectral/ansi -21.14% | spectral/hartel/comp_lab_zift -0.12% | spectral/hartel/parstof +0.09% | spectral/last-piece -2.32% | spectral/multiplier +6.03% | spectral/para +0.60% | spectral/simple -0.26% +======================================== | geom mean -0.18% +---------------------------------------- The regression in `multiplier` is sad, but it simply replicates GHC's previous behaviour (e.g. GHC 9.6). - - - - - 65da79b3 by Matthew Pickering at 2024-01-16T15:41:54-05:00 hadrian: Reduce Cabal verbosity The comment claims that `simpleUserHooks` decrease verbosity, and it does, but only for the `postConf` phase. The other phases are too verbose with `-V`. At the moment > 5000 lines of the build log are devoted to output from `cabal copy`. So I take the simple approach and just decrease the verbosity level again. If the output of `postConf` is essential then it would be better to implement our own `UserHooks` which doesn't decrease the verbosity for `postConf`. Fixes #24338 - - - - - 16414d7d by Matthew Pickering at 2024-01-17T10:54:59-05:00 Stop retaining old ModGuts throughout subsequent simplifier phases Each phase of the simplifier typically rewrites the majority of ModGuts, so we want to be able to release the old ModGuts as soon as possible. `name_ppr_ctxt` lives throught the whole optimiser phase and it was retaining a reference to `ModGuts`, so we were failing to release the old `ModGuts` until the end of the phase (potentially doubling peak memory usage for that particular phase). This was discovered using eras profiling (#24332) Fixes #24328 - - - - - 7f0879e1 by Matthew Pickering at 2024-01-17T10:55:35-05:00 Update nofib submodule - - - - - 320454d3 by Cheng Shao at 2024-01-17T23:02:40+00:00 ci: bump ci-images for updated wasm image - - - - - 2eca52b4 by Cheng Shao at 2024-01-17T23:06:44+00:00 base: treat all FDs as "nonblocking" on wasm On posix platforms, when performing read/write on FDs, we check the nonblocking flag first. For FDs without this flag (e.g. stdout), we call fdReady() first, which in turn calls poll() to wait for I/O to be available on that FD. This is problematic for wasm32-wasi: although select()/poll() is supported via the poll_oneoff() wasi syscall, that syscall is rather heavyweight and runtime behavior differs in different wasi implementations. The issue is even worse when targeting browsers, given there's no satisfactory way to implement async I/O as a synchronous syscall, so existing JS polyfills for wasi often give up and simply return ENOSYS. Before we have a proper I/O manager that avoids poll_oneoff() for async I/O on wasm, this patch improves the status quo a lot by merely pretending all FDs are "nonblocking". Read/write on FDs will directly invoke read()/write(), which are much more reliably handled in existing wasi implementations, especially those in browsers. Fixes #23275 and the following test cases: T7773 isEOF001 openFile009 T4808 cgrun025 Approved by CLC proposal #234: https://github.com/haskell/core-libraries-committee/issues/234 - - - - - 83c6c710 by Andrew Lelechenko at 2024-01-18T05:21:49-05:00 base: clarify how to disable warnings about partiality of Data.List.{head,tail} - - - - - c4078f2f by Simon Peyton Jones at 2024-01-18T05:22:25-05:00 Fix four bug in handling of (forall cv. body_ty) These bugs are all described in #24335 It's not easy to provoke the bug, hence no test case. - - - - - 119586ea by Alexis King at 2024-01-19T00:08:00-05:00 Always refresh profiling CCSes after running pending initializers Fixes #24171. - - - - - 9718d970 by Oleg Grenrus at 2024-01-19T00:08:36-05:00 Set default-language: GHC2021 in ghc library Go through compiler/ sources, and remove all BangPatterns (and other GHC2021 enabled extensions in these files). - - - - - 3ef71669 by Matthew Pickering at 2024-01-19T21:55:16-05:00 testsuite: Remove unused have_library function Also remove the hence unused testsuite option `--test-package-db`. Fixes #24342 - - - - - 5b7fa20c by Jade at 2024-01-19T21:55:53-05:00 Fix Spelling in the compiler Tracking: #16591 - - - - - 09875f48 by Matthew Pickering at 2024-01-20T12:20:44-05:00 testsuite: Implement `isInTreeCompiler` in a more robust way Just a small refactoring to avoid redundantly specifying the same strings in two different places. - - - - - 0d12b987 by Jade at 2024-01-20T12:21:20-05:00 Change maintainer email from cvs-ghc at haskell.org to ghc-devs at haskell.org. Fixes #22142 - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - 1fa1c00c by Jade at 2024-01-23T19:17:03-05:00 Enhance Documentation of functions exported by Data.Function This patch aims to improve the documentation of functions exported in Data.Function Tracking: #17929 Fixes: #10065 - - - - - ab47a43d by Jade at 2024-01-23T19:17:39-05:00 Improve documentation of hGetLine. - Add explanation for whether a newline is returned - Add examples Fixes #14804 - - - - - dd4af0e5 by Cheng Shao at 2024-01-23T19:18:17-05:00 Fix genapply for cross-compilation by nuking fragile CPP logic This commit fixes incorrectly built genapply when cross compiling (#24347) by nuking all fragile CPP logic in it from the orbit. All target-specific info are now read from DerivedConstants.h at runtime, see added note for details. Also removes a legacy Makefile and adds haskell language server support for genapply. - - - - - 0cda2b8b by Cheng Shao at 2024-01-23T19:18:17-05:00 rts: enable wasm32 register mapping The wasm backend didn't properly make use of all Cmm global registers due to #24347. Now that it is fixed, this patch re-enables full register mapping for wasm32, and we can now generate smaller & faster wasm modules that doesn't always spill arguments onto the stack. Fixes #22460 #24152. - - - - - 0325a6e5 by Greg Steuck at 2024-01-24T01:29:44-05:00 Avoid utf8 in primops.txt.pp comments They don't make it through readFile' without explicitly setting the encoding. See https://gitlab.haskell.org/ghc/ghc/-/issues/17755 - - - - - 1aaf0bd8 by David Binder at 2024-01-24T01:30:20-05:00 Bump hpc and hpc-bin submodule Bump hpc to 0.7.0.1 Bump hpc-bin to commit d1780eb2 - - - - - e693a4e8 by Ben Gamari at 2024-01-24T01:30:56-05:00 testsuite: Ignore stderr in T8089 Otherwise spurious "Killed: 9" messages to stderr may cause the test to fail. Fixes #24361. - - - - - a40f4ab2 by sheaf at 2024-01-24T14:04:33-05:00 Fix FMA instruction on LLVM We were emitting the wrong instructions for fused multiply-add operations on LLVM: - the instruction name is "llvm.fma.f32" or "llvm.fma.f64", not "fmadd" - LLVM does not support other instructions such as "fmsub"; instead we implement these by flipping signs of some arguments - the instruction is an LLVM intrinsic, which requires handling it like a normal function call instead of a machine instruction Fixes #24223 - - - - - 69abc786 by Andrei Borzenkov at 2024-01-24T14:05:09-05:00 Add changelog entry for renaming tuples from (,,...,,) to Tuple<n> (24291) - - - - - 0ac8f385 by Cheng Shao at 2024-01-25T00:27:48-05:00 compiler: remove unused GHC.Linker module The GHC.Linker module is empty and unused, other than as a hack for the make build system. We can remove it now that make is long gone; the note is moved to GHC.Linker.Loader instead. - - - - - 699da01b by Hécate Moonlight at 2024-01-25T00:28:27-05:00 Clarification for newtype constructors when using `coerce` - - - - - b2d8cd85 by Matt Walker at 2024-01-26T09:50:08-05:00 Fix #24308 Add tests for semicolon separated where clauses - - - - - 0da490a1 by Ben Gamari at 2024-01-26T17:34:41-05:00 hsc2hs: Bump submodule - - - - - 3f442fd2 by Ben Gamari at 2024-01-26T17:34:41-05:00 Bump containers submodule to 0.7 - - - - - 82a1c656 by Sebastian Nagel at 2024-01-29T02:32:40-05:00 base: with{Binary}File{Blocking} only annotates own exceptions Fixes #20886 This ensures that inner, unrelated exceptions are not misleadingly annotated with the opened file. - - - - - 9294a086 by Andreas Klebinger at 2024-01-29T02:33:15-05:00 Fix fma warning when using llvm on aarch64. On aarch64 fma is always on so the +fma flag doesn't exist for that target. Hence no need to try and pass +fma to llvm. Fixes #24379 - - - - - ced2e731 by sheaf at 2024-01-29T17:27:12-05:00 No shadowing warnings for NoFieldSelector fields This commit ensures we don't emit shadowing warnings when a user shadows a field defined with NoFieldSelectors. Fixes #24381 - - - - - 8eeadfad by Patrick at 2024-01-29T17:27:51-05:00 Fix bug wrong span of nested_doc_comment #24378 close #24378 1. Update the start position of span in `nested_doc_comment` correctly. and hence the spans of identifiers of haddoc can be computed correctly. 2. add test `HaddockSpanIssueT24378`. - - - - - a557580f by Alexey Radkov at 2024-01-30T19:41:52-05:00 Fix irrelevant dodgy-foreign-imports warning on import f-pointers by value A test *сс018* is attached (not sure about the naming convention though). Note that without the fix, the test fails with the *dodgy-foreign-imports* warning passed to stderr. The warning disappears after the fix. GHC shouldn't warn on imports of natural function pointers from C by value (which is feasible with CApiFFI), such as ```haskell foreign import capi "cc018.h value f" f :: FunPtr (Int -> IO ()) ``` where ```c void (*f)(int); ``` See a related real-world use-case [here](https://gitlab.com/daniel-casanueva/pcre-light/-/merge_requests/17). There, GHC warns on import of C function pointer `pcre_free`. - - - - - ca99efaf by Alexey Radkov at 2024-01-30T19:41:53-05:00 Rename test cc018 -> T24034 - - - - - 88c38dd5 by Ben Gamari at 2024-01-30T19:42:28-05:00 rts/TraverseHeap.c: Ensure that PosixSource.h is included first - - - - - ca2e919e by Simon Peyton Jones at 2024-01-31T09:29:45+00:00 Make decomposeRuleLhs a bit more clever This fixes #24370 by making decomposeRuleLhs undertand dictionary /functions/ as well as plain /dictionaries/ - - - - - 94ce031d by Teo Camarasu at 2024-02-01T05:49:49-05:00 doc: Add -Dn flag to user guide Resolves #24394 - - - - - 31553b11 by Ben Gamari at 2024-02-01T12:21:29-05:00 cmm: Introduce MO_RelaxedRead In hand-written Cmm it can sometimes be necessary to atomically load from memory deep within an expression (e.g. see the `CHECK_GC` macro). This MachOp provides a convenient way to do so without breaking the expression into multiple statements. - - - - - 0785cf81 by Ben Gamari at 2024-02-01T12:21:29-05:00 codeGen: Use relaxed accesses in ticky bumping - - - - - be423dda by Ben Gamari at 2024-02-01T12:21:29-05:00 base: use atomic write when updating timer manager - - - - - 8a310e35 by Ben Gamari at 2024-02-01T12:21:29-05:00 Use relaxed atomics to manipulate TSO status fields - - - - - d6809ee4 by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Add necessary barriers when manipulating TSO owner - - - - - 39e3ac5d by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Use `switch` to branch on why_blocked This is a semantics-preserving refactoring. - - - - - 515eb33d by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix synchronization on thread blocking state We now use a release barrier whenever we update a thread's blocking state. This required widening StgTSO.why_blocked as AArch64 does not support atomic writes on 16-bit values. - - - - - eb38812e by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix data race in threadPaused This only affects an assertion in the debug RTS and only needs relaxed ordering. - - - - - 26c48dd6 by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix data race in threadStatus# - - - - - 6af43ab4 by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix data race in Interpreter's preemption check - - - - - 9502ad3c by Ben Gamari at 2024-02-01T12:21:29-05:00 rts/Messages: Fix data race - - - - - 60802db5 by Ben Gamari at 2024-02-01T12:21:30-05:00 rts/Prof: Fix data race - - - - - ef8ccef5 by Ben Gamari at 2024-02-01T12:21:30-05:00 rts: Use relaxed ordering on dirty/clean info tables updates When changing the dirty/clean state of a mutable object we needn't have any particular ordering. - - - - - 76fe2b75 by Ben Gamari at 2024-02-01T12:21:30-05:00 codeGen: Use relaxed-read in closureInfoPtr - - - - - a6316eb4 by Ben Gamari at 2024-02-01T12:21:30-05:00 STM: Use acquire loads when possible Full sequential consistency is not needed here. - - - - - 6bddfd3d by Ben Gamari at 2024-02-01T12:21:30-05:00 rts: Use fence rather than redundant load Previously we would use an atomic load to ensure acquire ordering. However, we now have `ACQUIRE_FENCE_ON`, which allows us to express this more directly. - - - - - 55c65dbc by Ben Gamari at 2024-02-01T12:21:30-05:00 rts: Fix data races in profiling timer - - - - - 856b5e75 by Ben Gamari at 2024-02-01T12:21:30-05:00 Add Note [C11 memory model] - - - - - 6534da24 by Cheng Shao at 2024-02-01T12:22:07-05:00 compiler: move generic cmm optimization logic in NCG to a standalone module This commit moves GHC.CmmToAsm.cmmToCmm to a standalone module, GHC.Cmm.GenericOpt. The main motivation is enabling this logic to be run in the wasm backend NCG code, which is defined in other modules that's imported by GHC.CmmToAsm, causing a cyclic dependency issue. - - - - - 87e34888 by Cheng Shao at 2024-02-01T12:22:07-05:00 compiler: explicitly disable PIC in wasm32 NCG This commit explicitly disables the ncgPIC flag for the wasm32 target. The wasm backend doesn't support PIC for the time being. - - - - - c6ce242e by Cheng Shao at 2024-02-01T12:22:07-05:00 compiler: enable generic cmm optimizations in wasm backend NCG This commit enables the generic cmm optimizations in other NCGs to be run in the wasm backend as well, followed by a late cmm control-flow optimization pass. The added optimizations do catch some corner cases not handled by the pre-NCG cmm pipeline and are useful in generating smaller CFGs. - - - - - 151dda4e by Andrei Borzenkov at 2024-02-01T12:22:43-05:00 Namespacing for WARNING/DEPRECATED pragmas (#24396) New syntax for WARNING and DEPRECATED pragmas was added, namely namespace specifierss: namespace_spec ::= 'type' | 'data' | {- empty -} warning ::= warning_category namespace_spec namelist strings deprecation ::= namespace_spec namelist strings A new data type was introduced to represent these namespace specifiers: data NamespaceSpecifier = NoSpecifier | TypeNamespaceSpecifier (EpToken "type") | DataNamespaceSpecifier (EpToken "data") Extension field XWarning now contains this NamespaceSpecifier. lookupBindGroupOcc function was changed: it now takes NamespaceSpecifier and checks that the namespace of the found names matches the passed flag. With this change {-# WARNING data D "..." #-} pragma will only affect value namespace and {-# WARNING type D "..." #-} will only affect type namespace. The same logic is applicable to DEPRECATED pragmas. Finding duplicated warnings inside rnSrcWarnDecls now takes into consideration NamespaceSpecifier flag to allow warnings with the same names that refer to different namespaces. - - - - - 38c3afb6 by Bryan Richter at 2024-02-01T12:23:19-05:00 CI: Disable the test-cabal-reinstall job Fixes #24363 - - - - - 27020458 by Matthew Craven at 2024-02-03T01:53:26-05:00 Bump bytestring submodule to something closer to 0.12.1 ...mostly so that 16d6b7e835ffdcf9b894e79f933dd52348dedd0c (which reworks unaligned writes in Builder) and the stuff in https://github.com/haskell/bytestring/pull/631 can see wider testing. The less-terrible code for unaligned writes used in Builder on hosts not known to be ulaigned-friendly also takes less effort for GHC to compile, resulting in a metric decrease for T21839c on some platforms. The metric increase on T21839r is caused by the unrelated commit 750dac33465e7b59100698a330b44de7049a345c. It perhaps warrants further analysis and discussion (see #23822) but is not critical. Metric Decrease: T21839c Metric Increase: T21839r - - - - - cdddeb0f by Rodrigo Mesquita at 2024-02-03T01:54:02-05:00 Work around autotools setting C11 standard in CC/CXX In autoconf >=2.70, C11 is set by default for $CC and $CXX via the -std=...11 flag. In this patch, we split the "-std" flag out of the $CC and $CXX variables, which we traditionally assume to be just the executable name/path, and move it to $CFLAGS/$CXXFLAGS instead. Fixes #24324 - - - - - 5ff7cc26 by Apoorv Ingle at 2024-02-03T13:14:46-06:00 Expand `do` blocks right before typechecking using the `HsExpansion` philosophy. - Fixes #18324 #20020 #23147 #22788 #15598 #22086 #21206 - The change is detailed in - Note [Expanding HsDo with HsExpansion] in `GHC.Tc.Gen.Do` - Note [Doing HsExpansion in the Renamer vs Typechecker] in `GHC.Rename.Expr` expains the rational of doing expansions in type checker as opposed to in the renamer - Adds new datatypes: - `GHC.Hs.Expr.XXExprGhcRn`: new datatype makes this expansion work easier 1. Expansion bits for Expressions, Statements and Patterns in (`ExpandedThingRn`) 2. `PopErrCtxt` a special GhcRn Phase only artifcat to pop the previous error message in the error context stack - `GHC.Basic.Origin` now tracks the reason for expansion in case of Generated This is useful for type checking cf. `GHC.Tc.Gen.Expr.tcExpr` case for `HsLam` - Kills `HsExpansion` and `HsExpanded` as we have inlined them in `XXExprGhcRn` and `XXExprGhcTc` - Ensures warnings such as 1. Pattern match checks 2. Failable patterns 3. non-() return in body statements are preserved - Kill `HsMatchCtxt` in favor of `TcMatchAltChecker` - Testcases: * T18324 T20020 T23147 T22788 T15598 T22086 * T23147b (error message check), * DoubleMatch (match inside a match for pmc check) * pattern-fails (check pattern match with non-refutable pattern, eg. newtype) * Simple-rec (rec statements inside do statment) * T22788 (code snippet from #22788) * DoExpanion1 (Error messages for body statments) * DoExpansion2 (Error messages for bind statements) * DoExpansion3 (Error messages for let statements) Also repoint haddock to the right submodule so that the test (haddockHypsrcTest) pass Metric Increase 'compile_time/bytes allocated': T9020 The testcase is a pathalogical example of a `do`-block with many statements that do nothing. Given that we are expanding the statements into function binds, we will have to bear a (small) 2% cost upfront in the compiler to unroll the statements. - - - - - 0df8ce27 by Vladislav Zavialov at 2024-02-04T03:55:14-05:00 Reduce parser allocations in allocateCommentsP In the most common case, the comment queue is empty, so we can skip the work of processing it. This reduces allocations by about 10% in the parsing001 test. Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - cfd68290 by Simon Peyton Jones at 2024-02-05T17:58:33-05:00 Stop dropping a case whose binder is demanded This MR fixes #24251. See Note [Case-to-let for strictly-used binders] in GHC.Core.Opt.Simplify.Iteration, plus #24251, for lots of discussion. Final Nofib changes over 0.1%: +----------------------------------------- | imaginary/digits-of-e2 -2.16% | imaginary/rfib -0.15% | real/fluid -0.10% | real/gamteb -1.47% | real/gg -0.20% | real/maillist +0.19% | real/pic -0.23% | real/scs -0.43% | shootout/n-body -0.41% | shootout/spectral-norm -0.12% +======================================== | geom mean -0.05% Pleasingly, overall executable size is down by just over 1%. Compile times (in perf/compiler) wobble around a bit +/- 0.5%, but the geometric mean is -0.1% which seems good. - - - - - e4d137bb by Simon Peyton Jones at 2024-02-05T17:58:33-05:00 Add Note [Bangs in Integer functions] ...to document the bangs in the functions in GHC.Num.Integer - - - - - ce90f12f by Andrei Borzenkov at 2024-02-05T17:59:09-05:00 Hide WARNING/DEPRECATED namespacing under -XExplicitNamespaces (#24396) - - - - - e2ea933f by Simon Peyton Jones at 2024-02-06T10:12:04-05:00 Refactoring in preparation for lazy skolemisation * Make HsMatchContext and HsStmtContext be parameterised over the function name itself, rather than over the pass. See [mc_fun field of FunRhs] in Language.Haskell.Syntax.Expr - Replace types HsMatchContext GhcPs --> HsMatchContextPs HsMatchContext GhcRn --> HsMatchContextRn HsMatchContext GhcTc --> HsMatchContextRn (sic! not Tc) HsStmtContext GhcRn --> HsStmtContextRn - Kill off convertHsMatchCtxt * Split GHC.Tc.Type.BasicTypes.TcSigInfo so that TcCompleteSig (describing a complete user-supplied signature) is its own data type. - Split TcIdSigInfo(CompleteSig, PartialSig) into TcCompleteSig(CSig) TcPartialSig(PSig) - Use TcCompleteSig in tcPolyCheck, CheckGen - Rename types and data constructors: TcIdSigInfo --> TcIdSig TcPatSynInfo(TPSI) --> TcPatSynSig(PatSig) - Shuffle around helper functions: tcSigInfoName (moved to GHC.Tc.Types.BasicTypes) completeSigPolyId_maybe (moved to GHC.Tc.Types.BasicTypes) tcIdSigName (inlined and removed) tcIdSigLoc (introduced) - Rearrange the pattern match in chooseInferredQuantifiers * Rename functions and types: tcMatchesCase --> tcCaseMatches tcMatchesFun --> tcFunBindMatches tcMatchLambda --> tcLambdaMatches tcPats --> tcMatchPats matchActualFunTysRho --> matchActualFunTys matchActualFunTySigma --> matchActualFunTy * Add HasDebugCallStack constraints to: mkBigCoreVarTupTy, mkBigCoreTupTy, boxTy, mkPiTy, mkPiTys, splitAppTys, splitTyConAppNoView_maybe * Use `penv` from the outer context in the inner loop of GHC.Tc.Gen.Pat.tcMultiple * Move tcMkVisFunTy, tcMkInvisFunTy, tcMkScaledFunTys down the file, factor out and export tcMkScaledFunTy. * Move isPatSigCtxt down the file. * Formatting and comments Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com> - - - - - f5d3e03c by Andrei Borzenkov at 2024-02-06T10:12:04-05:00 Lazy skolemisation for @a-binders (#17594) This patch is a preparation for @a-binders implementation. The main changes are: * Skolemisation is now prepared to deal with @binders. See Note [Skolemisation overview] in GHC.Tc.Utils.Unify. Most of the action is in - Utils.Unify.matchExpectedFunTys - Gen.Pat.tcMatchPats - Gen.Expr.tcPolyExprCheck - Gen.Binds.tcPolyCheck Some accompanying refactoring: * I found that funTyConAppTy_maybe was doing a lot of allocation, and rejigged userTypeError_maybe to avoid calling it. - - - - - 532993c8 by Zubin Duggal at 2024-02-06T10:12:41-05:00 driver: Really don't lose track of nodes when we fail to resolve cycles This fixes a bug in 8db8d2fd1c881032b1b360c032b6d9d072c11723, where we could lose track of acyclic components at the start of an unresolved cycle. We now ensure we never loose track of any of these components. As T24275 demonstrates, a "cyclic" SCC might not really be a true SCC: When viewed without boot files, we have a single SCC ``` [REC main:T24275B [main:T24275B {-# SOURCE #-}, main:T24275A {-# SOURCE #-}] main:T24275A [main:T24275A {-# SOURCE #-}]] ``` But with boot files this turns into ``` [NONREC main:T24275B {-# SOURCE #-} [], REC main:T24275B [main:T24275B {-# SOURCE #-}, main:T24275A {-# SOURCE #-}] main:T24275A {-# SOURCE #-} [main:T24275B], NONREC main:T24275A [main:T24275A {-# SOURCE #-}]] ``` Note that this is truly not an SCC, as no nodes are reachable from T24275B.hs-boot. However, we treat this entire group as a single "SCC" because it seems so when we analyse the graph without taking boot files into account. Indeed, we must return a single ResolvedCycle element in the BuildPlan for this as described in Note [Upsweep]. However, since after resolving this is not a true SCC anymore, `findCycle` fails to find a cycle and we have a sub-optimal error message as a result. To handle this, I extended `findCycle` to not assume its input is an SCC, and to try harder to find cycles in its input. Fixes #24275 - - - - - b35dd613 by Zubin Duggal at 2024-02-06T10:13:17-05:00 GHCi: Lookup breakpoint CCs in the correct module We need to look up breakpoint CCs in the module that the breakpoint points to, and not the current module. Fixes #24327 - - - - - b09e6958 by Zubin Duggal at 2024-02-06T10:13:17-05:00 testsuite: Add test for #24327 - - - - - 569b4c10 by doyougnu at 2024-02-07T03:06:26-05:00 ts: add compile_artifact, ignore_extension flag In b521354216f2821e00d75f088d74081d8b236810 the testsuite gained the capability to collect generic metrics. But this assumed that the test was not linking and producing artifacts and we only wanted to track object files, interface files, or build artifacts from the compiler build. However, some backends, such as the JS backend, produce artifacts when compiling, such as the jsexe directory which we want to track. This patch: - tweaks the testsuite to collect generic metrics on any build artifact in the test directory. - expands the exe_extension function to consider windows and adds the ignore_extension flag. - Modifies certain tests to add the ignore_extension flag. Tests such as heaprof002 expect a .ps file, but on windows without ignore_extensions the testsuite will look for foo.exe.ps. Hence the flag. - adds the size_hello_artifact test - - - - - 75a31379 by doyougnu at 2024-02-07T03:06:26-05:00 ts: add wasm_arch, heapprof002 wasm extension - - - - - c9731d6d by Rodrigo Mesquita at 2024-02-07T03:07:03-05:00 Synchronize bindist configure for #24324 In cdddeb0f1280b40cc194028bbaef36e127175c4c, we set up a workaround for #24324 in the in-tree configure script, but forgot to update the bindist configure script accordingly. This updates it. - - - - - d309f4e7 by Matthew Pickering at 2024-02-07T03:07:38-05:00 distrib/configure: Fix typo in CONF_GCC_LINKER_OPTS_STAGE2 variable Instead we were setting CONF_GCC_LINK_OPTS_STAGE2 which meant that we were missing passing `--target` when invoking the linker. Fixes #24414 - - - - - 77db84ab by Ben Gamari at 2024-02-08T00:35:22-05:00 llvmGen: Adapt to allow use of new pass manager. We now must use `-passes` in place of `-O<n>` due to #21936. Closes #21936. - - - - - 3c9ddf97 by Matthew Pickering at 2024-02-08T00:35:59-05:00 testsuite: Mark length001 as fragile on javascript Modifying the timeout multiplier is not a robust way to get this test to reliably fail. Therefore we mark it as fragile until/if javascript ever supports the stack limit. - - - - - 20b702b5 by Matthew Pickering at 2024-02-08T00:35:59-05:00 Javascript: Don't filter out rtsDeps list This logic appears to be incorrect as it would drop any dependency which was not in a direct dependency of the package being linked. In the ghc-internals split this started to cause errors because `ghc-internal` is not a direct dependency of most packages, and hence important symbols to keep which are hard coded into the js runtime were getting dropped. - - - - - 2df96366 by Ben Gamari at 2024-02-08T00:35:59-05:00 base: Cleanup whitespace in cbits - - - - - 44f6557a by Ben Gamari at 2024-02-08T00:35:59-05:00 Move `base` to `ghc-internal` Here we move a good deal of the implementation of `base` into a new package, `ghc-internal` such that it can be evolved independently from the user-visible interfaces of `base`. While we want to isolate implementation from interfaces, naturally, we would like to avoid turning `base` into a mere set of module re-exports. However, this is a non-trivial undertaking for a variety of reasons: * `base` contains numerous known-key and wired-in things, requiring corresponding changes in the compiler * `base` contains a significant amount of C code and corresponding autoconf logic, which is very fragile and difficult to break apart * `base` has numerous import cycles, which are currently dealt with via carefully balanced `hs-boot` files * We must not break existing users To accomplish this migration, I tried the following approaches: * [Split-GHC.Base]: Break apart the GHC.Base knot to allow incremental migration of modules into ghc-internal: this knot is simply too intertwined to be easily pulled apart, especially given the rather tricky import cycles that it contains) * [Move-Core]: Moving the "core" connected component of base (roughly 150 modules) into ghc-internal. While the Haskell side of this seems tractable, the C dependencies are very subtle to break apart. * [Move-Incrementally]: 1. Move all of base into ghc-internal 2. Examine the module structure and begin moving obvious modules (e.g. leaves of the import graph) back into base 3. Examine the modules remaining in ghc-internal, refactor as necessary to facilitate further moves 4. Go to (2) iterate until the cost/benefit of further moves is insufficient to justify continuing 5. Rename the modules moved into ghc-internal to ensure that they don't overlap with those in base 6. For each module moved into ghc-internal, add a shim module to base with the declarations which should be exposed and any requisite Haddocks (thus guaranteeing that base will be insulated from changes in the export lists of modules in ghc-internal Here I am using the [Move-Incrementally] approach, which is empirically the least painful of the unpleasant options above Bumps haddock submodule. Metric Decrease: haddock.Cabal haddock.base Metric Increase: MultiComponentModulesRecomp T16875 size_hello_artifact - - - - - e8fb2451 by Vladislav Zavialov at 2024-02-08T00:36:36-05:00 Haddock comments on infix constructors (#24221) Rewrite the `HasHaddock` instance for `ConDecl GhcPs` to account for infix constructors. This change fixes a Haddock regression (introduced in 19e80b9af252) that affected leading comments on infix data constructor declarations: -- | Docs for infix constructor | Int :* Bool The comment should be associated with the data constructor (:*), not with its left-hand side Int. - - - - - 9060d55b by Ben Gamari at 2024-02-08T00:37:13-05:00 Add os-string as a boot package Introduces `os-string` submodule. This will be necessary for `filepath-1.5`. - - - - - 9d65235a by Ben Gamari at 2024-02-08T00:37:13-05:00 gitignore: Ignore .hadrian_ghci_multi/ - - - - - d7ee12ea by Ben Gamari at 2024-02-08T00:37:13-05:00 hadrian: Set -this-package-name When constructing the GHC flags for a package Hadrian must take care to set `-this-package-name` in addition to `-this-unit-id`. This hasn't broken until now as we have not had any uses of qualified package imports. However, this will change with `filepath-1.5` and the corresponding `unix` bump, breaking `hadrian/multi-ghci`. - - - - - f2dffd2e by Ben Gamari at 2024-02-08T00:37:13-05:00 Bump filepath to 1.5.0.0 Required bumps of the following submodules: * `directory` * `filepath` * `haskeline` * `process` * `unix` * `hsc2hs` * `Win32` * `semaphore-compat` and the addition of `os-string` as a boot package. - - - - - ab533e71 by Matthew Pickering at 2024-02-08T00:37:50-05:00 Use specific clang assembler when compiling with -fllvm There are situations where LLVM will produce assembly which older gcc toolchains can't handle. For example on Deb10, it seems that LLVM >= 13 produces assembly which the default gcc doesn't support. A more robust solution in the long term is to require a specific LLVM compatible assembler when using -fllvm. Fixes #16354 - - - - - c32b6426 by Matthew Pickering at 2024-02-08T00:37:50-05:00 Update CI images with LLVM 15, ghc-9.6.4 and cabal-install-3.10.2.0 - - - - - 5fcd58be by Matthew Pickering at 2024-02-08T00:37:50-05:00 Update bootstrap plans for 9.4.8 and 9.6.4 - - - - - 707a32f5 by Matthew Pickering at 2024-02-08T00:37:50-05:00 Add alpine 3_18 release job This is mainly experimental and future proofing to enable a smooth transition to newer alpine releases once 3_12 is too old. - - - - - c37931b3 by John Ericson at 2024-02-08T06:39:05-05:00 Generate LLVM min/max bound policy via Hadrian Per #23966, I want the top-level configure to only generate configuration data for Hadrian, not do any "real" tasks on its own. This is part of that effort --- one less file generated by it. (It is still done with a `.in` file, so in a future world non-Hadrian also can easily create this file.) Split modules: - GHC.CmmToLlvm.Config - GHC.CmmToLlvm.Version - GHC.CmmToLlvm.Version.Bounds - GHC.CmmToLlvm.Version.Type This also means we can get rid of the silly `unused.h` introduced in !6803 / 7dfcab2f4bcb7206174ea48857df1883d05e97a2 as temporary kludge. Part of #23966 - - - - - 9f987235 by Apoorv Ingle at 2024-02-08T06:39:42-05:00 Enable mdo statements to use HsExpansions Fixes: #24411 Added test T24411 for regression - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 762b2120 by Jade at 2024-02-08T15:17:15+00:00 Improve Monad, Functor & Applicative docs This patch aims to improve the documentation of Functor, Applicative, Monad and related symbols. The main goal is to make it more consistent and make accessible. See also: !10979 (closed) and !10985 (closed) Ticket #17929 Updates haddock submodule - - - - - 151770ca by Josh Meredith at 2024-02-10T14:28:15-05:00 JavaScript codegen: Use GHC's tag inference where JS backend-specific evaluation inference was previously used (#24309) - - - - - 2e880635 by Zubin Duggal at 2024-02-10T14:28:51-05:00 ci: Allow release-hackage-lint to fail Otherwise it blocks the ghcup metadata pipeline from running. - - - - - b0293f78 by Matthew Pickering at 2024-02-10T14:29:28-05:00 rts: eras profiling mode The eras profiling mode is useful for tracking the life-time of closures. When a closure is written, the current era is recorded in the profiling header. This records the era in which the closure was created. * Enable with -he * User mode: Use functions ghc-experimental module GHC.Profiling.Eras to modify the era * Automatically: --automatic-era-increment, increases the user era on major collections * The first era is era 1 * -he<era> can be used with other profiling modes to select a specific era If you just want to record the era but not to perform heap profiling you can use `-he --no-automatic-heap-samples`. https://well-typed.com/blog/2024/01/ghc-eras-profiling/ Fixes #24332 - - - - - be674a2c by Jade at 2024-02-10T14:30:04-05:00 Adjust error message for trailing whitespace in as-pattern. Fixes #22524 - - - - - 53ef83f9 by doyougnu at 2024-02-10T14:30:47-05:00 gitlab: js: add codeowners Fixes: - #24409 Follow on from: - #21078 and MR !9133 - When we added the JS backend this was forgotten. This patch adds the rightful codeowners. - - - - - 8bbe12f2 by Matthew Pickering at 2024-02-10T14:31:23-05:00 Bump CI images so that alpine3_18 image includes clang15 The only changes here are that clang15 is now installed on the alpine-3_18 image. - - - - - df9fd9f7 by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: handle stored null StablePtr Some Haskell codes unsafely cast StablePtr into ptr to compare against NULL. E.g. in direct-sqlite: if castStablePtrToPtr aggStPtr /= nullPtr then where `aggStPtr` is read (`peek`) from zeroed memory initially. We fix this by giving these StablePtr the same representation as other null pointers. It's safe because StablePtr at offset 0 is unused (for this exact reason). - - - - - 55346ede by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: disable MergeObjsMode test This isn't implemented for JS backend objects. - - - - - aef587f6 by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: add support for linking C sources Support linking C sources with JS output of the JavaScript backend. See the added documentation in the users guide. The implementation simply extends the JS linker to use the objects (.o) that were already produced by the emcc compiler and which were filtered out previously. I've also added some options to control the link with C functions (see the documentation about pragmas). With this change I've successfully compiled the direct-sqlite package which embeds the sqlite.c database code. Some wrappers are still required (see the documentation about wrappers) but everything generic enough to be reused for other libraries have been integrated into rts/js/mem.js. - - - - - b71b392f by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: avoid EMCC logging spurious failure emcc would sometime output messages like: cache:INFO: generating system asset: symbol_lists/424b44514e43d789148e69e4e7d1c7fdc0350b79.json... (this will be cached in "/emsdk/upstream/emscripten/cache/symbol_lists/424b44514e43d789148e69e4e7d1c7fdc0350b79.json" for subsequent builds) cache:INFO: - ok Cf https://github.com/emscripten-core/emscripten/issues/18607 This breaks our tests matching the stderr output. We avoid this by setting EMCC_LOGGING=0 - - - - - ff2c0cc9 by Simon Peyton Jones at 2024-02-12T12:19:17-05:00 Remove a dead comment Just remove an out of date block of commented-out code, and tidy up the relevant Notes. See #8317. - - - - - bedb4f0d by Teo Camarasu at 2024-02-12T18:50:33-05:00 nonmoving: Add support for heap profiling Add support for heap profiling while using the nonmoving collector. We greatly simply the implementation by disabling concurrent collection for GCs when heap profiling is enabled. This entails that the marked objects on the nonmoving heap are exactly the live objects. Note that we match the behaviour for live bytes accounting by taking the size of objects on the nonmoving heap to be that of the segment's block rather than the object itself. Resolves #22221 - - - - - d0d5acb5 by Teo Camarasu at 2024-02-12T18:51:09-05:00 doc: Add requires prof annotation to options that require it Resolves #24421 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 57bb8c92 by Cheng Shao at 2024-02-13T14:07:49-05:00 deriveConstants: add needed constants for wasm backend This commit adds needed constants to deriveConstants. They are used by RTS code in the wasm backend to support the JSFFI logic. - - - - - 615eb855 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms The pure Haskell implementation causes i386 regression in unrelated work that can be fixed by using C-based atomic increment, see added comment for details. - - - - - a9918891 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: allow JSFFI for wasm32 This commit allows the javascript calling convention to be used when the target platform is wasm32. - - - - - 8771a53b by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: allow boxed JSVal as a foreign type This commit allows the boxed JSVal type to be used as a foreign argument/result type. - - - - - 053c92b3 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: ensure ctors have the right priority on wasm32 This commit fixes the priorities of ctors generated by GHC codegen on wasm32, see the referred note for details. - - - - - b7942e0a by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: add JSFFI desugar logic for wasm32 This commit adds JSFFI desugar logic for the wasm backend. - - - - - 2c1dca76 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: add JavaScriptFFI to supported extension list on wasm32 This commit adds JavaScriptFFI as a supported extension when the target platform is wasm32. - - - - - 9ad0e2b4 by Cheng Shao at 2024-02-13T14:07:49-05:00 rts/ghc-internal: add JSFFI support logic for wasm32 This commit adds rts/ghc-internal logic to support the wasm backend's JSFFI functionality. - - - - - e9ebea66 by Cheng Shao at 2024-02-13T14:07:49-05:00 ghc-internal: fix threadDelay for wasm in browsers This commit fixes broken threadDelay for wasm when it runs in browsers, see added note for detailed explanation. - - - - - f85f3fdb by Cheng Shao at 2024-02-13T14:07:49-05:00 utils: add JSFFI utility code This commit adds JavaScript util code to utils to support the wasm backend's JSFFI functionality: - jsffi/post-link.mjs, a post-linker to process the linked wasm module and emit a small complement JavaScript ESM module to be used with it at runtime - jsffi/prelude.js, a tiny bit of prelude code as the JavaScript side of runtime logic - jsffi/test-runner.mjs, run the jsffi test cases Co-authored-by: amesgen <amesgen at amesgen.de> - - - - - 77e91500 by Cheng Shao at 2024-02-13T14:07:49-05:00 hadrian: distribute jsbits needed for wasm backend's JSFFI support The post-linker.mjs/prelude.js files are now distributed in the bindist libdir, so when using the wasm backend's JSFFI feature, the user wouldn't need to fetch them from a ghc checkout manually. - - - - - c47ba1c3 by Cheng Shao at 2024-02-13T14:07:49-05:00 testsuite: add opts.target_wrapper This commit adds opts.target_wrapper which allows overriding the target wrapper on a per test case basis when testing a cross target. This is used when testing the wasm backend's JSFFI functionality; the rest of the cases are tested using wasmtime, though the jsffi cases are tested using the node.js based test runner. - - - - - 8e048675 by Cheng Shao at 2024-02-13T14:07:49-05:00 testsuite: T22774 should work for wasm JSFFI T22774 works since the wasm backend now supports the JSFFI feature. - - - - - 1d07f9a6 by Cheng Shao at 2024-02-13T14:07:49-05:00 testsuite: add JSFFI test cases for wasm backend This commit adds a few test cases for the wasm backend's JSFFI functionality, as well as a simple README to instruct future contributors to add new test cases. - - - - - b8997080 by Cheng Shao at 2024-02-13T14:07:49-05:00 docs: add documentation for wasm backend JSFFI This commit adds changelog and user facing documentation for the wasm backend's JSFFI feature. - - - - - ffeb000d by David Binder at 2024-02-13T14:08:30-05:00 Add tests from libraries/process/tests and libraries/Win32/tests to GHC These tests were previously part of the libraries, which themselves are submodules of the GHC repository. This commit moves the tests directly to the GHC repository. - - - - - 5a932cf2 by David Binder at 2024-02-13T14:08:30-05:00 Do not execute win32 tests on non-windows runners - - - - - 500d8cb8 by Jade at 2024-02-13T14:09:07-05:00 prevent GHCi (and runghc) from suggesting other symbols when not finding main Fixes: #23996 - - - - - b19ec331 by Cheng Shao at 2024-02-13T14:09:46-05:00 rts: update xxHash to v0.8.2 - - - - - 4a97bdb8 by Cheng Shao at 2024-02-13T14:09:46-05:00 rts: use XXH3_64bits hash on all 64-bit platforms This commit enables XXH3_64bits hash to be used on all 64-bit platforms. Previously it was only enabled on x86_64, so platforms like aarch64 silently falls back to using XXH32 which degrades the hashing function quality. - - - - - ee01de7d by Cheng Shao at 2024-02-13T14:09:46-05:00 rts: define XXH_INLINE_ALL This commit cleans up how we include the xxhash.h header and only define XXH_INLINE_ALL, which is sufficient to inline the xxHash functions without symbol collision. - - - - - 0e01e1db by Alan Zimmerman at 2024-02-14T02:13:22-05:00 EPA: Move EpAnn out of extension points Leaving a few that are too tricky, maybe some other time. Also - remove some unneeded helpers from Parser.y - reduce allocations with strictness annotations Updates haddock submodule Metric Decrease: parsing001 - - - - - de589554 by Andreas Klebinger at 2024-02-14T02:13:59-05:00 Fix ffi callbacks with >6 args and non-64bit args. Check for ptr/int arguments rather than 64-bit width arguments when counting integer register arguments. The old approach broke when we stopped using exclusively W64-sized types to represent sub-word sized integers. Fixes #24314 - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 325b7613 by Ben Gamari at 2024-02-14T14:27:45-05:00 rts/EventLog: Place eliminate duplicate strlens Previously many of the `post*` implementations would first compute the length of the event's strings in order to determine the event length. Later we would then end up computing the length yet again in `postString`. Now we instead pass the string length to `postStringLen`, avoiding the repeated work. - - - - - 8aafa51c by Ben Gamari at 2024-02-14T14:27:46-05:00 rts/eventlog: Place upper bound on IPE string field lengths The strings in IPE events may be of unbounded length. Limit the lengths of these fields to 64k characters to ensure that we don't exceed the maximum event length. - - - - - 0e60d52c by Zubin Duggal at 2024-02-14T14:27:46-05:00 rts: drop unused postString function - - - - - d8d1333a by Cheng Shao at 2024-02-14T14:28:23-05:00 compiler/rts: fix wasm unreg regression This commit fixes two wasm unreg regressions caught by a nightly pipeline: - Unknown stg_scheduler_loopzh symbol when compiling scheduler.cmm - Invalid _hs_constructor(101) function name when handling ctor - - - - - 264a4fa9 by Owen Shepherd at 2024-02-15T09:41:06-05:00 feat: Add sortOn to Data.List.NonEmpty Adds `sortOn` to `Data.List.NonEmpty`, and adds comments describing when to use it, compared to `sortWith` or `sortBy . comparing`. The aim is to smooth out the API between `Data.List`, and `Data.List.NonEmpty`. This change has been discussed in the [clc issue](https://github.com/haskell/core-libraries-committee/issues/227). - - - - - b57200de by Fendor at 2024-02-15T09:41:47-05:00 Prefer RdrName over OccName for looking up locations in doc renaming step Looking up by OccName only does not take into account when functions are only imported in a qualified way. Fixes issue #24294 Bump haddock submodule to include regression test - - - - - 8ad02724 by Luite Stegeman at 2024-02-15T17:33:32-05:00 JS: add simple optimizer The simple optimizer reduces the size of the code generated by the JavaScript backend without the complexity and performance penalty of the optimizer in GHCJS. Also see #22736 Metric Decrease: libdir size_hello_artifact - - - - - 20769b36 by Matthew Pickering at 2024-02-15T17:34:07-05:00 base: Expose `--no-automatic-time-samples` in `GHC.RTS.Flags` API This patch builds on 5077416e12cf480fb2048928aa51fa4c8fc22cf1 and modifies the base API to reflect the new RTS flag. CLC proposal #243 - https://github.com/haskell/core-libraries-committee/issues/243 Fixes #24337 - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 08031ada by Teo Camarasu at 2024-02-16T13:37:00-05:00 base: export System.Mem.performBlockingMajorGC The corresponding C function was introduced in ba73a807edbb444c49e0cf21ab2ce89226a77f2e. As part of #22264. Resolves #24228 The CLC proposal was disccused at: https://github.com/haskell/core-libraries-committee/issues/230 Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 1f534c2e by Florian Weimer at 2024-02-16T13:37:42-05:00 Fix C output for modern C initiative GCC 14 on aarch64 rejects the C code written by GHC with this kind of error: error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion] 68 | *(ffi_arg*)resp = cret; | ^ Add the correct cast. For more information on this see: https://fedoraproject.org/wiki/Changes/PortingToModernC Tested-by: Richard W.M. Jones <rjones at redhat.com> - - - - - 5d3f7862 by Matthew Craven at 2024-02-16T13:38:18-05:00 Bump bytestring submodule to 0.12.1.0 - - - - - 902ebcc2 by Ian-Woo Kim at 2024-02-17T06:01:01-05:00 Add missing BCO handling in scavenge_one. - - - - - 97d26206 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Make cast between words and floats real primops (#24331) First step towards fixing #24331. Replace foreign prim imports with real primops. - - - - - a40e4781 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: add constant folding for bitcast between float and word (#24331) - - - - - 5fd2c00f by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: replace stack checks with assertions in casting primops There are RESERVED_STACK_WORDS free words (currently 21) on the stack, so omit the checks. Suggested by Cheng Shao. - - - - - 401dfe7b by Sylvain Henry at 2024-02-17T06:01:44-05:00 Reexport primops from GHC.Float + add deprecation - - - - - 4ab48edb by Ben Gamari at 2024-02-17T06:02:21-05:00 rts/Hash: Don't iterate over chunks if we don't need to free data When freeing a `HashTable` there is no reason to walk over the hash list before freeing it if the user has not given us a `dataFreeFun`. Noticed while looking at #24410. - - - - - bd5a1f91 by Cheng Shao at 2024-02-17T06:03:00-05:00 compiler: add SEQ_CST fence support 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 - - - - - 2ce2a493 by Cheng Shao at 2024-02-17T06:03:38-05:00 testsuite: fix hs_try_putmvar002 for targets without pthread.h 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. - - - - - 1fb3974e by Cheng Shao at 2024-02-17T06:03:38-05:00 ci: bump ci-images to use updated wasm image This commit bumps our ci-images revision to use updated wasm image. - - - - - 56e3f097 by Andrew Lelechenko at 2024-02-17T06:04:13-05:00 Bump submodule text to 2.1.1 T17123 allocates less because of improvements to Data.Text.concat in 1a6a06a. Metric Decrease: T17123 - - - - - a7569495 by Cheng Shao at 2024-02-17T06:04:51-05:00 rts: remove redundant rCCCS initialization 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. - - - - - 7a0293cc by Ben Gamari at 2024-02-19T07:11:00-05:00 Drop dependence on `touch` 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 - - - - - 0dbd729e by Andrei Borzenkov at 2024-02-19T07:11:37-05:00 Parser, renamer, type checker for @a-binders (#17594) 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 2afbddb0f24, 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 f5d3e03c56f. 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 - - - - - 486979b0 by Jade at 2024-02-19T07:12:13-05:00 Add specialized sconcat implementation for Data.Monoid.First and Data.Semigroup.First Approved CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/246 Fixes: #24346 - - - - - 17e309d2 by John Ericson at 2024-02-19T07:12:49-05:00 Fix reST in users guide It appears that aef587f65de642142c1dcba0335a301711aab951 wasn't valid syntax. - - - - - 35b0ad90 by Brandon Chinn at 2024-02-19T07:13:25-05:00 Fix searching for errors in sphinx build - - - - - 4696b966 by Cheng Shao at 2024-02-19T07:14:02-05:00 hadrian: fix wasm backend post linker script permissions The post-link.mjs script was incorrectly copied and installed as a regular data file without executable permission, this commit fixes it. - - - - - a6142e0c by Cheng Shao at 2024-02-19T07:14:40-05:00 testsuite: mark T23540 as fragile on i386 See #24449 for details. - - - - - 249caf0d by Matthew Craven at 2024-02-19T20:36:09-05:00 Add @since annotation to Data.Data.mkConstrTag - - - - - cdd939e7 by Jade at 2024-02-19T20:36:46-05:00 Enhance documentation of Data.Complex - - - - - d04f384f by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian/bindist: Ensure that phony rules are marked as such Otherwise make may not run the rule if file with the same name as the rule happens to exist. - - - - - efcbad2d by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian: Generate HSC2HS_EXTRAS variable in bindist installation We must generate the hsc2hs wrapper at bindist installation time since it must contain `--lflag` and `--cflag` arguments which depend upon the installation path. The solution here is to substitute these variables in the configure script (see mk/hsc2hs.in). This is then copied over a dummy wrapper in the install rules. Fixes #24050. - - - - - c540559c by Matthew Pickering at 2024-02-21T04:59:23-05:00 ci: Show --info for installed compiler - - - - - ab9281a2 by Matthew Pickering at 2024-02-21T04:59:23-05:00 configure: Correctly set --target flag for linker opts Previously we were trying to use the FP_CC_SUPPORTS_TARGET with 4 arguments, when it only takes 3 arguments. Instead we need to use the `FP_PROG_CC_LINKER_TARGET` function in order to set the linker flags. Actually fixes #24414 - - - - - 9460d504 by Rodrigo Mesquita at 2024-02-21T04:59:59-05:00 configure: Do not override existing linker flags in FP_LD_NO_FIXUP_CHAINS - - - - - 77629e76 by Andrei Borzenkov at 2024-02-21T05:00:35-05:00 Namespacing for fixity signatures (#14032) Namespace specifiers were added to syntax of fixity signatures: - sigdecl ::= infix prec ops | ... + sigdecl ::= infix prec namespace_spec ops | ... To preserve namespace during renaming MiniFixityEnv type now has separate FastStringEnv fields for names that should be on the term level and for name that should be on the type level. makeMiniFixityEnv function was changed to fill MiniFixityEnv in the right way: - signatures without namespace specifiers fill both fields - signatures with 'data' specifier fill data field only - signatures with 'type' specifier fill type field only Was added helper function lookupMiniFixityEnv that takes care about looking for a name in an appropriate namespace. Updates haddock submodule. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 84357d11 by Teo Camarasu at 2024-02-21T05:01:11-05:00 rts: only collect live words in nonmoving census when non-concurrent This avoids segfaults when the mutator modifies closures as we examine them. Resolves #24393 - - - - - 9ca56dd3 by Ian-Woo Kim at 2024-02-21T05:01:53-05:00 mutex wrap in refreshProfilingCCSs - - - - - 1387966a by Cheng Shao at 2024-02-21T05:02:32-05:00 rts: remove unused HAVE_C11_ATOMICS macro This commit removes the unused HAVE_C11_ATOMICS macro. We used to have a few places that have fallback paths when HAVE_C11_ATOMICS is not defined, but that is completely redundant, since the FP_CC_SUPPORTS__ATOMICS configure check will fail when the C compiler doesn't support C11 style atomics. There are also many places (e.g. in unreg backend, SMP.h, library cbits, etc) where we unconditionally use C11 style atomics anyway which work in even CentOS 7 (gcc 4.8), the oldest distro we test in our CI, so there's no value in keeping HAVE_C11_ATOMICS. - - - - - 0f40d68f by Andreas Klebinger at 2024-02-21T05:03:09-05:00 RTS: -Ds - make sure incall is non-zero before dereferencing it. Fixes #24445 - - - - - e5886de5 by Ben Gamari at 2024-02-21T05:03:44-05:00 rts/AdjustorPool: Use ExecPage abstraction This is just a minor cleanup I found while reviewing the implementation. - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 09941666 by Adam Gundry at 2024-02-21T13:53:12+00:00 Define GHC2024 language edition (#24320) See https://github.com/ghc-proposals/ghc-proposals/pull/613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail at joachim-breitner.de> - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 5121a4ed by Ben Gamari at 2024-02-23T06:40:55-05:00 Allow docstrings after exports 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. - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 0eb2265d by Hécate Moonlight at 2024-02-24T16:02:16-05:00 Improve the synopsis and description of base - - - - - 2e36f5d2 by Jade at 2024-02-24T16:02:51-05:00 Error Messages: Properly align cyclic module error Fixes: #24476 - - - - - bbfb051c by Ben Gamari at 2024-02-24T19:10:23-05:00 Allow docstrings after exports 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. - - - - - d8d6ad8c by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Move modules into GHC.Internal.* namespace Bumps haddock submodule due to testsuite output changes. - - - - - a82af7cd by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Rewrite `@since ` to `@since base-` These will be incrementally moved to the export sites in `base` where possible. - - - - - ca3836e1 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Migrate Haddock `not-home` pragmas from `ghc-internal` This ensures that we do not use `base` stub modules as declarations' homes when not appropriate. - - - - - c8cf3e26 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Partially freeze exports of GHC.Base Sadly there are still a few module reexports. However, at least we have decoupled from the exports of `GHC.Internal.Base`. - - - - - 272573c6 by Ben Gamari at 2024-02-24T19:10:23-05:00 Move Haddock named chunks - - - - - 2d8a881d by Ben Gamari at 2024-02-24T19:10:23-05:00 Drop GHC.Internal.Data.Int - - - - - 55c4c385 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler: Fix mention to `GHC....` modules in wasm desugaring Really, these references should be via known-key names anyways. I have fixed the proximate issue here but have opened #24472 to track the additional needed refactoring. - - - - - 64150911 by Ben Gamari at 2024-02-24T19:10:23-05:00 Accept performance shifts from ghc-internal restructure As expected, Haddock now does more work. Less expected is that some other testcases actually get faster, presumably due to less interface file loading. As well, the size_hello_artifact test regressed a bit when debug information is enabled due to debug information for the new stub symbols. Metric Decrease: T12227 T13056 Metric Increase: haddock.Cabal haddock.base MultiLayerModulesTH_OneShot size_hello_artifact - - - - - 317a915b by Ben Gamari at 2024-02-24T19:10:23-05:00 Expose GHC.Wasm.Prim from ghc-experimental Previously this was only exposed from `ghc-internal` which violates our agreement that users shall not rely on things exposed from that package. Fixes #24479. - - - - - 3bbd2bf2 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Small optimisation of evCallStack Don't lookupIds unless we actually need them. - - - - - 3e5c9e3c by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Use toException instead of SomeException - - - - - 125714a6 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Factor out errorBelch This was useful when debugging - - - - - 3d6aae7c by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Clean up imports of GHC.Stack.CloneStack - - - - - 6900306e by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move PrimMVar to GHC.Internal.MVar - - - - - 28f8a148 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move prettyCallStack to GHC.Internal.Stack - - - - - 4892de47 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Explicit dependency to workaround #24436 Currently `ghc -M` fails to account for `.hs-boot` files correctly, leading to issues with cross-package one-shot builds failing. This currently manifests in `GHC.Exception` due to the boot file for `GHC.Internal.Stack`. Work around this by adding an explicit `import`, ensuring that `GHC.Internal.Stack` is built before `GHC.Exception`. See #24436. - - - - - 294c93a5 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Use displayException in top-level exception handler Happily this also allows us to eliminate a special case for Deadlock exceptions. Implements [CLC #198](https://github.com/haskell/core-libraries-committee/issues/198). - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - cf756a25 by Ben Gamari at 2024-02-24T22:11:53-05:00 rts: Fix symbol references in Wasm RTS - - - - - 4e4d47a0 by Jade at 2024-02-26T15:17:20-05:00 GHCi: Improve response to unloading, loading and reloading modules Fixes #13869 - - - - - f3de8a3c by Zubin Duggal at 2024-02-26T15:17:57-05:00 rel-eng/fetch-gitlab.py: Fix name of aarch64 alpine 3_18 release job - - - - - c71bfdff by Cheng Shao at 2024-02-26T15:18:35-05:00 hadrian/hie-bios: pass -j to hadrian This commit passes -j to hadrian in the hadrian/hie-bios scripts. When the user starts HLS in a fresh clone that has just been configured, it takes quite a while for hie-bios to pick up the ghc flags and start actual indexing, due to the fact that the hadrian build step defaulted to -j1, so -j speeds things up and improve HLS user experience in GHC. Also add -j flag to .ghcid to speed up ghcid, and sets the Windows build root to .hie-bios which also works and unifies with other platforms, the previous build root _hie-bios was missing from .gitignore anyway. - - - - - 50bfdb46 by Cheng Shao at 2024-02-26T15:18:35-05:00 ci: enable parallelism in hadrian/ghci scripts This commit enables parallelism when the hadrian/ghci scripts are called in CI. The time bottleneck is in the hadrian build step, but previously the build step wasn't parallelized. - - - - - 61a78231 by Felix Yan at 2024-02-26T15:19:14-05:00 m4: Correctly detect GCC version When calling as `cc`, GCC does not outputs lowercased "gcc" at least in 13.2.1 version here. ``` $ cc --version cc (GCC) 13.2.1 20230801 ... ``` This fails the check and outputs the confusing message: `configure: $CC is not gcc; assuming it's a reasonably new C compiler` This patch makes it check for upper-cased "GCC" too so that it works correctly: ``` checking version of gcc... 13.2.1 ``` - - - - - 001aa539 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Fix formatting in whereFrom docstring Previously it used markdown syntax rather than Haddock syntax for code quotes - - - - - e8034d15 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Move ClosureType type to ghc-internal - Use ClosureType for InfoProv.ipDesc. - Use ClosureType for CloneStack.closureType. - Now ghc-heap re-exports this type from ghc-internal. See the accompanying CLC proposal: https://github.com/haskell/core-libraries-committee/issues/210 Resolves #22600 - - - - - 3da0a551 by Matthew Craven at 2024-02-27T13:27:22-05:00 StgToJS: Simplify ExprInline constructor of ExprResult Its payload was used only for a small optimization in genAlts, avoiding a few assignments for programs of this form: case NormalDataCon arg1 arg2 of x { NormalDataCon x1 x2 -> ... ; } But when compiling with optimizations, this sort of code is generally eliminated by case-of-known-constructor in Core-to-Core. So it doesn't seem worth tracking and cleaning up again in StgToJS. - - - - - 61bc92cc by Cheng Shao at 2024-02-27T16:58:42-05:00 rts: add missing ccs_mutex guard to internal_dlopen See added comment for details. Closes #24423. - - - - - dd29d3b2 by doyougnu at 2024-02-27T16:59:23-05:00 cg: Remove GHC.Cmm.DataFlow.Collections In pursuit of #15560 and #17957 and generally removing redundancy. - - - - - d3a050d2 by Cheng Shao at 2024-02-27T17:00:00-05:00 utils: remove unused lndir from tree Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 74b24a9b by Teo Camarasu at 2024-02-28T16:32:58+00:00 rts: avoid checking bdescr of value outside of Haskell heap In nonmovingTidyWeaks we want to check if the key of a weak pointer lives in the non-moving heap. We do this by checking the flags of the block the key lives in. But we need to be careful with values that live outside the Haskell heap, since they will lack a block descriptor and looking for one may lead to a segfault. In this case we should just accept that it isn't on the non-moving heap. Resolves #24492 - - - - - b4cae4ec by Simon Peyton Jones at 2024-02-29T02:10:08-05:00 In mkDataConRep, ensure the in-scope set is right A small change that fixes #24489 - - - - - 3836a110 by Cheng Shao at 2024-02-29T21:25:45-05:00 testsuite: fix T23540 fragility on 32-bit platforms T23540 is fragile on 32-bit platforms. The root cause is usage of `getEvidenceTreesAtPoint`, which internally relies on `Name`'s `Ord` instance, which is indeterministic. The solution is adding a deterministic `Ord` instance for `EvidenceInfo` and sorting the evidence trees before pretty printing. Fixes #24449. - - - - - 960c8d47 by Teo Camarasu at 2024-02-29T21:26:20-05:00 Reduce AtomicModifyIORef increment count This test leads to a lot of contention when N>2 and becomes very slow. Let's reduce the amount of work we do to compensate. Resolves #24490 - - - - - 2e46c8ad by Matthew Pickering at 2024-03-01T05:48:06-05:00 hadrian: Improve parallelism in binary-dist-dir rule I noticed that the "docs" target was needed after the libraries and executables were built. We can improve the parallelism by needing everything at once so that documentation can be built immediately after a library is built for example. - - - - - cb6c11fe by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Bump windows and freebsd boot compilers to 9.6.4 We have previously bumped the docker images to use 9.6.4, but neglected to bump the windows images until now. - - - - - 30f06996 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: darwin: Update to 9.6.2 for boot compiler 9.6.4 is currently broken due to #24050 Also update to use LLVM-15 rather than LLVM-11, which is out of date. - - - - - d9d69e12 by Matthew Pickering at 2024-03-01T05:48:07-05:00 Bump minimum bootstrap version to 9.6 - - - - - 67ace1c5 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Enable more documentation building Here we enable documentation building on 1. Darwin: The sphinx toolchain was already installed so we enable html and manpages. 2. Rocky8: Full documentation (toolchain already installed) 3. Alpine: Full documetnation (toolchain already installed) 4. Windows: HTML and manpages (toolchain already installed) Fixes #24465 - - - - - 39583c39 by Matthew Pickering at 2024-03-01T05:48:42-05:00 ci: Bump ci-images to allow updated aarch64-alpine image with llvm15 and clang15 - - - - - d91d00fc by Torsten Schmits at 2024-03-01T15:01:50-05:00 Introduce ListTuplePuns extension 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: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8820 Tracking ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/21294 - - - - - bbdb6286 by Sylvain Henry at 2024-03-01T15:01:50-05:00 JS linker: filter unboxed tuples - - - - - dec6d8d3 by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Improve error messages coming from non-linear patterns 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). - - - - - 6612388e by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Adjust documentation of linear lets according to committee decision - - - - - 1c064ef1 by Cheng Shao at 2024-03-02T17:11:19-05:00 compiler: start deprecating cmmToRawCmmHook cmmToRawCmmHook was added 4 years ago in d561c8f6244f8280a2483e8753c38e39d34c1f01. Its only user is the Asterius project, which has been archived and deprecated in favor of the ghc wasm backend. This patch starts deprecating cmmToRawCmmHook by placing a DEPRECATED pragma, and actual removal shall happen in a future GHC major release if no issue to oppose the deprecation has been raised in the meantime. - - - - - 9b74845f by Andrew Lelechenko at 2024-03-02T17:11:55-05:00 Data.List.NonEmpty.unzip: use WARNING with category instead of DEPRECATED CLC proposal: https://github.com/haskell/core-libraries-committee/issues/258 - - - - - 61bb5ff6 by Finley McIlwaine at 2024-03-04T09:01:40-08:00 add -fprof-late-overloaded and -fprof-late-overloaded-calls * Refactor late cost centre insertion for extensibility * Add two more late cost centre insertion methods that add SCCs to overloaded top level bindings and call sites with dictionary arguments. * Some tests for the basic functionality of the new insertion methods Resolves: #24500 - - - - - 82ccb801 by Andreas Klebinger at 2024-03-04T19:59:14-05:00 x86-ncg: Fix fma codegen when arguments are globals Fix a bug in the x86 ncg where results would be wrong when the desired output register and one of the input registers were the same global. Also adds a tiny optimization to make use of the memory addressing support when convenient. Fixes #24496 - - - - - 18ad1077 by Matthew Pickering at 2024-03-05T14:22:31-05:00 rel_eng: Update hackage docs upload scripts This adds the upload of ghc-internal and ghc-experimental to our scripts which upload packages to hackage. - - - - - bf47c9ba by Matthew Pickering at 2024-03-05T14:22:31-05:00 docs: Remove stray module comment from GHC.Profiling.Eras - - - - - 37d9b340 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix ghc-internal cabal file The file mentioned some artifacts relating to the base library. I have renamed these to the new ghc-internal variants. - - - - - 23f2a478 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix haddock source links and hyperlinked source There were a few issues with the hackage links: 1. We were using the package id rather than the package name for the package links. This is fixed by now allowing the template to mention %pkg% or %pkgid% and substituing both appropiatly. 2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage` as the new base link works on a local or remote hackage server. 3. The "src" path including too much stuff, so cross-package source links were broken as the template was getting double expanded. Fixes #24086 - - - - - 2fa336a9 by Ben Gamari at 2024-03-05T14:23:07-05:00 filepath: Bump submodule to 1.5.2.0 - - - - - 31217944 by Ben Gamari at 2024-03-05T14:23:07-05:00 os-string: Bump submodule to 2.0.2 - - - - - 4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00 base: Reflect new era profiling RTS flags in GHC.RTS.Flags * -he profiling mode * -he profiling selector * --automatic-era-increment CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254 - - - - - a8c0e31b by Sylvain Henry at 2024-03-05T21:45:14-05:00 JS: faster implementation for some numeric primitives (#23597) Use faster implementations for the following primitives in the JS backend by not using JavaScript's BigInt: - plusInt64 - minusInt64 - minusWord64 - timesWord64 - timesInt64 Co-authored-by: Josh Meredith <joshmeredith2008 at gmail.com> - - - - - 21e3f325 by Cheng Shao at 2024-03-05T21:45:52-05:00 rts: add -xr option to control two step allocator reserved space size This patch adds a -xr RTS option to control the size of virtual memory address space reserved by the two step allocator on a 64-bit platform, see added documentation for explanation. Closes #24498. - - - - - dedcf102 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: expose HeapAlloc.h as public header This commit exposes HeapAlloc.h as a public header. The intention is to expose HEAP_ALLOCED/HEAP_ALLOCED_GC, so they can be used in assertions in other public headers, and they may also be useful for user code. - - - - - d19441d7 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: assert pointer is indeed heap allocated in Bdescr() This commit adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs that attempt to access non-existent block descriptor of a static closure, #24492 being one such example. - - - - - 9a656a04 by Ben Gamari at 2024-03-06T13:39:39-05:00 ghc-experimental: Add dummy dependencies to work around #23942 This is a temporary measure to improve CI reliability until a proper solution is developed. Works around #23942. - - - - - 1e84b924 by Simon Peyton Jones at 2024-03-06T13:39:39-05:00 Three compile perf improvements with deep nesting These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425 - - - - - c4b13113 by Hécate Moonlight at 2024-03-06T13:40:17-05:00 Use "module" instead of "library" when applicable in base haddocks - - - - - 9cd9efb4 by Vladislav Zavialov at 2024-03-07T13:01:54+03:00 Rephrase error message to say "visible arguments" (#24318) * 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. - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - d523a6a7 by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump array submodule - - - - - 7e55003c by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump stm submodule - - - - - 32d337ef by Ben Gamari at 2024-03-07T19:40:45-05:00 Introduce exception context Here we introduce the `ExceptionContext` type and `ExceptionAnnotation` class, allowing dynamically-typed user-defined annotations to be attached to exceptions. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 - - - - - 39f3d922 by Ben Gamari at 2024-03-07T19:40:46-05:00 testsuite/interface-stability: Update documentation - - - - - fdea7ada by Ben Gamari at 2024-03-07T19:40:46-05:00 ghc-internal: comment formatting - - - - - 4fba42ef by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Default and warn ExceptionContext constraints - - - - - 3886a205 by Ben Gamari at 2024-03-07T19:40:46-05:00 base: Introduce exception backtraces Here we introduce the `Backtraces` type and associated machinery for attaching these via `ExceptionContext`. These has a few compile-time regressions (`T15703` and `T9872d`) due to the additional dependencies in the exception machinery. As well, there is a surprisingly large regression in the `size_hello_artifact` test. This appears to be due to various `Integer` and `Read` bits now being reachable at link-time. I believe it should be possible to avoid this but I have accepted the change for now to get the feature merged. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 Metric Increase: T15703 T9872d size_hello_artifact - - - - - 18c5409f by Ben Gamari at 2024-03-07T19:40:46-05:00 users guide: Release notes for exception backtrace work - - - - - f849c5fc by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Don't show ExceptionContext of GhcExceptions Most GhcExceptions are user-facing errors and therefore the ExceptionContext has little value. Ideally we would enable it in the DEBUG compiler but I am leaving this for future work. - - - - - dc646e6f by Sylvain Henry at 2024-03-07T19:40:46-05:00 Disable T9930fail for the JS target (cf #19174) - - - - - bfc09760 by Alan Zimmerman at 2024-03-07T19:41:22-05:00 Update showAstData to honour blanking of AnnParen Also tweak rendering of SrcSpan to remove extra blank line. - - - - - 50454a29 by Ben Gamari at 2024-03-08T03:32:42-05:00 ghc-internal: Eliminate GHC.Internal.Data.Kind This was simply reexporting things from `ghc-prim`. Instead reexport these directly from `Data.Kind`. Also add build ordering dependency to work around #23942. - - - - - 38a4b6ab by Ben Gamari at 2024-03-08T03:33:18-05:00 rts: Fix SET_HDR initialization of retainer set This fixes a regression in retainer set profiling introduced by b0293f78cb6acf2540389e22bdda420d0ab874da. Prior to that commit the heap traversal word would be initialized by `SET_HDR` using `LDV_RECORD_CREATE`. However, the commit added a `doingLDVProfiling` check in `LDV_RECORD_CREATE`, meaning that this initialization no longer happened. Given that this initialization was awkwardly indirectly anyways, I have fixed this by explicitly initializating the heap traversal word to `NULL` in `SET_PROF_HDR`. This is equivalent to the previous behavior, but much more direct. Fixes #24513. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 2859a637 by Ben Gamari at 2024-03-08T18:26:47-05:00 base: Use strerror_r instead of strerror As noted by #24344, `strerror` is not necessarily thread-safe. Thankfully, POSIX.1-2001 has long offered `strerror_r`, which is safe to use. Fixes #24344. CLC discussion: https://github.com/haskell/core-libraries-committee/issues/249 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - edb9bf77 by Jade at 2024-03-09T03:39:38-05:00 Error messages: Improve Error messages for Data constructors in type signatures. This patch improves the error messages from invalid type signatures by trying to guess what the user did and suggesting an appropriate fix. Partially fixes: #17879 - - - - - cfb197e3 by Patrick at 2024-03-09T03:40:15-05:00 HieAst: add module name #24493 The main purpose of this is to tuck the module name `xxx` in `module xxx where` into the hieAst. It should fix #24493. The following have been done: 1. Renamed and update the `tcg_doc_hdr :: Maybe (LHsDoc GhcRn)` to `tcg_hdr_info :: (Maybe (LHsDoc GhcRn), Maybe (XRec GhcRn ModuleName))` To store the located module name information. 2. update the `RenamedSource` and `RenamedStuff` with extra `Maybe (XRec GhcRn ModuleName)` located module name information. 3. add test `testsuite/tests/hiefile/should_compile/T24493.hs` to ensure the module name is added and update several relevent tests. 4. accompanied submodule haddoc test update MR in https://gitlab.haskell.org/ghc/haddock/-/merge_requests/53 - - - - - 2341d81e by Vaibhav Sagar at 2024-03-09T03:40:54-05:00 GHC.Utils.Binary: fix a couple of typos - - - - - 5580e1bd by Ben Gamari at 2024-03-09T03:41:30-05:00 rts: Drop .wasm suffix from .prof file names This replicates the behavior on Windows, where `Hi.exe` will produce profiling output named `Hi.prof` instead of `Hi.exe.prof`. While in the area I also fixed the extension-stripping logic, which incorrectly rewrote `Hi.exefoo` to `Hi.foo`. Closes #24515. - - - - - 259495ee by Cheng Shao at 2024-03-09T03:41:30-05:00 testsuite: drop exe extension from .hp & .prof filenames See #24515 for details. - - - - - c477a8d2 by Ben Gamari at 2024-03-09T03:42:05-05:00 rts/linker: Enable GOT support on all platforms There is nothing platform-dependent about our GOT implementation and GOT support is needed by `T24171` on i386. - - - - - 2e592857 by Vladislav Zavialov at 2024-03-09T03:42:41-05:00 Drop outdated comment on TcRnIllformedTypePattern This should have been done in 0f0c53a501b but I missed it. - - - - - c554b4da by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Bounds check array write - - - - - 15c590a5 by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Don't expose helper functions in header - - - - - e831ce31 by Ben Gamari at 2024-03-09T09:39:20-05:00 base: Move internals of GHC.InfoProv into GHC.InfoProv.Types Such that we can add new helpers into GHC.InfoProv.Types without breakage. - - - - - 6948e24d by Ben Gamari at 2024-03-09T09:39:20-05:00 rts: Lazily decode IPE tables Previously we would eagerly allocate `InfoTableEnt`s for each info table registered in the info table provenance map. However, this costs considerable memory and initialization time. Instead we now lazily decode these tables. This allows us to use one-third the memory *and* opens the door to taking advantage of sharing opportunities within a module. This required considerable reworking since lookupIPE now must be passed its result buffer. - - - - - 9204a04e by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Don't expose helper in header - - - - - 308926ff by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Share module_name within a Node This allows us to shave a 64-bit word off of the packed IPE entry size. - - - - - bebdea05 by Ben Gamari at 2024-03-09T09:39:20-05:00 IPE: Expose unit ID in InfoTableProv Here we add the unit ID to the info table provenance structure. - - - - - 6519c9ad by Ben Gamari at 2024-03-09T09:39:35-05:00 rts: Refactor GHC.Stack.CloneStack.decode Don't allocate a Ptr constructor per frame. - - - - - ed0b69dc by Ben Gamari at 2024-03-09T09:39:35-05:00 base: Do not expose whereFrom# from GHC.Exts - - - - - 2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00 docs: Update info on TypeAbstractions * Mention TypeAbstractions in 9.10.1-notes.rst * Set the status to "Experimental". * Add a "Since: GHC 9.x" comment to each section. - - - - - f8b88918 by Ben Gamari at 2024-03-09T21:21:46-05:00 ci-images: Bump Alpine image to bootstrap with 9.8.2 - - - - - 705e6927 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark T24171 as fragile due to #24512 I will fix this but not in time for 9.10.1-alpha1 - - - - - c74196e1 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark linker_unload_native as fragile In particular this fails on platforms without `dlinfo`. I plan to address this but not before 9.10.1-alpha1. - - - - - f4d87f7a by Ben Gamari at 2024-03-09T21:21:46-05:00 configure: Bump version to 9.10 - - - - - 88df9a5f by Ben Gamari at 2024-03-09T21:21:46-05:00 Bump transformers submodule to 0.6.1.1 - - - - - 8176d5e8 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Increase ulimit for T18623 1 MByte was just too tight and failed intermittently on some platforms (e.g. CentOS 7). Bumping the limit to 8 MByte should provide sufficient headroom. Fixes #23139. - - - - - c74b38a3 by Ben Gamari at 2024-03-09T21:21:46-05:00 base: Bump version to 4.20.0.0 - - - - - b2937fc3 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-internal: Set initial version at 9.1001.0 This provides PVP compliance while maintaining a clear correspondence between GHC releases and `ghc-internal` versions. - - - - - 4ae7d868 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-prim: Bump version to 0.11.0 - - - - - 50798dc6 by Ben Gamari at 2024-03-09T21:21:46-05:00 template-haskell: Bump version to 2.22.0.0 - - - - - 8564f976 by Ben Gamari at 2024-03-09T21:21:46-05:00 base-exports: Accommodate spurious whitespace changes in 32-bit output It appears that this was - - - - - 9d4f0e98 by Ben Gamari at 2024-03-09T21:21:46-05:00 users-guide: Move exception backtrace relnotes to 9.10 This was previously mistakenly added to the GHC 9.8 release notes. - - - - - 145eae60 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix name of Rocky8 artifact - - - - - 39c2a630 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix path of generate_jobs_metadata - - - - - aed034de by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/upload: Rework recompression The old `combine` approach was quite fragile due to use of filename globbing. Moreover, it didn't parallelize well. This refactoring makes the goal more obvious, parallelizes better, and is more robust. - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - dc207d06 by Ben Gamari at 2024-03-10T08:56:08-04:00 configure: Bump GHC version to 9.11 Bumps haddock submodule. - - - - - 8b2513e8 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload code when profiling is enabled The heap census may contain references (e.g. `Counter.identity`) to static data which must be available when the census is reported at the end of execution. Fixes #24512. - - - - - 7810b4c3 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload native objects when dlinfo isn't available To do so is unsafe as we have no way of identifying references to symbols provided by the object. Fixes #24513. Fixes #23993. - - - - - 0590764c by Ben Gamari at 2024-03-11T01:20:39-04:00 rel_eng/upload: Purge both $rel_name/ and $ver/ This is necessary for prereleases, where GHCup accesses the release via `$ver/` - - - - - b85a4631 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Remove duplicate code normalising slashes - - - - - c91946f9 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Simplify regexes with raw strings - - - - - 1a5f53c6 by Brandon Chinn at 2024-03-12T19:25:57-04:00 Don't normalize backslashes in characters - - - - - 7ea971d3 by Andrei Borzenkov at 2024-03-12T19:26:32-04:00 Fix compiler crash caused by implicit RHS quantification in type synonyms (#24470) - - - - - 39f3ac3e by Cheng Shao at 2024-03-12T19:27:11-04:00 Revert "compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms" This reverts commit 615eb855416ce536e02ed935ecc5a6f25519ae16. It was originally intended to fix #24449, but it was merely sweeping the bug under the rug. 3836a110577b5c9343915fd96c1b2c64217e0082 has properly fixed the fragile test, and we no longer need the C version of genSym. Furthermore, the C implementation causes trouble when compiling with clang that targets i386 due to alignment warning and libatomic linking issue, so it makes sense to revert it. - - - - - e6bfb85c by Cheng Shao at 2024-03-12T19:27:11-04:00 compiler: fix out-of-bound memory access of genSym on 32-bit This commit fixes an unnoticed out-of-bound memory access of genSym on 32-bit. ghc_unique_inc is 32-bit sized/aligned on 32-bit platforms, but we mistakenly treat it as a Word64 pointer in genSym, and therefore will accidentally load 2 garbage higher bytes, or with a small but non-zero chance, overwrite something else in the data section depends on how the linker places the data segments. This regression was introduced in !11802 and fixed here. - - - - - 77171cd1 by Ben Orchard at 2024-03-14T09:00:40-04:00 Note mutability of array and address access primops Without an understanding of immutable vs. mutable memory, the index primop family have a potentially non-intuitive type signature: indexOffAddr :: Addr# -> Int# -> a readOffAddr :: Addr# -> Int# -> State# d -> (# State# d, a #) indexOffAddr# might seem like a free generality improvement, which it certainly is not! This change adds a brief note on mutability expectations for most index/read/write access primops. - - - - - 7da7f8f6 by Alan Zimmerman at 2024-03-14T09:01:15-04:00 EPA: Fix regression discarding comments in contexts Closes #24533 - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file 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. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals 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 - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) 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. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation 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] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects 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. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface 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 https://gitlab.haskell.org/ghc/ghc/-/issues/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 ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` 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. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig 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.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) 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) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 72b54c07 by Rodrigo Mesquita at 2024-08-01T00:47:29-04:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - bfe4b3d3 by doyougnu at 2024-08-01T00:48:06-04:00 Rts linker: add case for pc-rel 64 relocation part of the upstream haskell.nix patches - - - - - 5843c7e3 by doyougnu at 2024-08-01T00:48:42-04:00 RTS linker: aarch64: better debug information Dump better debugging information when a symbol address is null. Part of the haskell.nix patches upstream project Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - c2e9c581 by Rodrigo Mesquita at 2024-08-01T00:49:18-04:00 base: Add haddocks to HasExceptionContext Fixes #25091 - - - - - f954f428 by Sylvain Henry at 2024-08-01T00:49:59-04:00 Only lookup ghcversion.h file in the RTS include-dirs by default. The code was introduced in 3549c952b535803270872adaf87262f2df0295a4. It used `getPackageIncludePath` which name doesn't convey that it looks into all include paths of the preload units too. So this behavior is probably unintentional and it should be ok to change it. Fix #25106 - - - - - 951ce3d5 by Matthew Pickering at 2024-08-01T00:50:35-04:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - bae1fea4 by sheaf at 2024-08-01T00:51:15-04:00 PMC: suggest in-scope COMPLETE sets when possible This commit modifies GHC.HsToCore.Pmc.Solver.generateInhabitingPatterns to prioritise reporting COMPLETE sets in which all of the ConLikes are in scope. This avoids suggesting out of scope constructors when displaying an incomplete pattern match warning, e.g. in baz :: Ordering -> Int baz = \case EQ -> 5 we prefer: Patterns of type 'Ordering' not matched: LT GT over: Patterns of type 'Ordering' not matched: OutOfScope Fixes #25115 - - - - - ff158fcd by Tommy Bidne at 2024-08-02T01:14:32+12:00 Print exception metadata in default handler CLC proposals 231 and 261: - Add exception type metadata to SomeException's displayException. - Add "Exception" header to default exception handler. See: https://github.com/haskell/core-libraries-committee/issues/231 https://github.com/haskell/core-libraries-committee/issues/261 Update stm submodule for test fixes. - - - - - 8b2f70a2 by Andrei Borzenkov at 2024-08-01T23:00:46-04:00 Type syntax in expressions (#24159, #24572, #24226) This patch extends the grammar of expressions with syntax that is typically found only in types: * function types (a -> b), (a ->. b), (a %m -> b) * constrained types (ctx => t) * forall-quantification (forall tvs. t) The new forms are guarded behind the RequiredTypeArguments extension, as specified in GHC Proposal #281. Examples: {-# LANGUAGE RequiredTypeArguments #-} e1 = f (Int -> String) -- function type e2 = f (Int %1 -> String) -- linear function type e3 = f (forall a. Bounded a => a) -- forall type, constraint The GHC AST and the TH AST have been extended as follows: syntax | HsExpr | TH.Exp ---------------+----------+-------------- a -> b | HsFunArr | ConE (->) a %m -> b | HsFunArr | ConE FUN ctx => t | HsQual | ConstrainedE forall a. t | HsForAll | ForallE forall a -> t | HsForAll | ForallVisE Additionally, a new warning flag -Wview-pattern-signatures has been introduced to aid with migration to the new precedence of (e -> p :: t). Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com> - - - - - 66e7f57d by Brandon Chinn at 2024-08-01T21:50:58-07:00 Implement MultilineStrings (#24390) This commit adds support for multiline strings, proposed at https://github.com/ghc-proposals/ghc-proposals/pull/569. Multiline strings can now be written as: myString = """ this is a multiline string """ The multiline string will have leading indentation stripped away. Full details of this post-processing may be found at the new GHC.Parser.String module. In order to cleanly implement this and maximize reusability, I broke out the lexing logic for strings out of Lexer.x into a new GHC.Parser.String module, which lexes strings with any provided "get next character" function. This also gave us the opportunity to clean up this logic, and even optimize it a bit. With this change, parsing string literals now takes 25% less time and 25% less space. - - - - - cf47b96f by Rodrigo Mesquita at 2024-08-03T05:59:40-04:00 hi: Stable sort avails Sorting the Avails in DocStructures is required to produce fully deterministic interface files in presence of re-exported modules. Fixes #25104 - - - - - af2ae742 by M. Taimoor Zaeem at 2024-08-03T18:52:50+05:00 haddock: decrease margin on top of small headings - - - - - a1e42e7a by Rodrigo Mesquita at 2024-08-05T21:03:04-04:00 hi: Deterministic ImportedMods in Usages The `mi_usages` field of the interface files must use a deterministic list of `Usage`s to guarantee a deterministic interface. However, this list was, in its origins, constructed from a `ModuleEnv` which uses a non-deterministic ordering that was leaking into the interface. Specifically, ImportedMods = ModuleEnv ... would get converted to a list and then passed to `mkUsageInfo` to construct the Usages. The solution is simple. Back `ImportedMods` with a deterministic map. `Map Module ...` is enough, since the Ord instance for `Module` already uses a stable, deterministic, comparison. Fixes #25131 - - - - - eb1cb536 by Serge S. Gulin at 2024-08-06T08:54:55+00:00 testsuite: extend size performance tests with gzip (fixes #25046) The main purpose is to create tests for minimal app (hello world and its variations, i.e. unicode used) distribution size metric. Many platforms support distribution in compressed form via gzip. It would be nice to collect information on how much size is taken by the executional bundle for each platform at minimal edge case. 2 groups of tests are added: 1. We extend javascript backend size tests with gzip-enabled versions for all cases where an optimizing compiler is used (for now it is google closure compiler). 2. We add trivial hello world tests with gzip-enabled versions for all other platforms at CI pipeline where no external optimizing compiler is used. - - - - - d94410f8 by Rodrigo Mesquita at 2024-08-07T11:49:19-04:00 ghc-internal: @since for backtraceDesired Fixes point 1 in #25052 - - - - - bfe600f5 by Rodrigo Mesquita at 2024-08-07T11:49:19-04:00 ghc-internal: No trailing whitespace in exceptions Fixes #25052 - - - - - 62650d9f by Andreas Klebinger at 2024-08-07T11:49:54-04:00 Add since annotation for -fkeep-auto-rules. This partially addresses #25082. - - - - - 5f0e23fd by Andreas Klebinger at 2024-08-07T11:49:54-04:00 Mention `-fkeep-auto-rules` in release notes. It was added earlier but hadn't appeared in any release notes yet. Partially addresses #25082. - - - - - 7446a09a by Sylvain Henry at 2024-08-07T11:50:35-04:00 Cmm: don't perform unsound optimizations on 32-bit compiler hosts - beef61351b240967b49169d27a9a19565cf3c4af enabled the use of MO_Add/MO_Sub for 64-bit operations in the C and LLVM backends - 6755d833af8c21bbad6585144b10e20ac4a0a1ab did the same for the x86 NCG backend However we store some literal values as `Int` in the compiler. As a result, some Cmm optimizations transformed target 64-bit literals into compiler `Int`. If the compiler is 32-bit, this leads to computing with wrong literals (see #24893 and #24700). This patch disables these Cmm optimizations for 32-bit compilers. This is unsatisfying (optimizations shouldn't be compiler-word-size dependent) but it fixes the bug and it makes the patch easy to backport. A proper fix would be much more invasive but it shall be implemented in the future. Co-authored-by: amesgen <amesgen at amesgen.de> - - - - - d59faaf2 by Vladislav Zavialov at 2024-08-07T11:51:11-04:00 docs: Update info on RequiredTypeArguments Add a section on "types in terms" that were implemented in 8b2f70a202 and remove the now outdated suggestion of using `type` for them. - - - - - 39fd6714 by Sylvain Henry at 2024-08-07T11:51:52-04:00 JS: fix minor typo in base's jsbits - - - - - e7764575 by Sylvain Henry at 2024-08-07T11:51:52-04:00 RTS: remove hack to force old cabal to build a library with only JS sources Need to extend JSC externs with Emscripten RTS definitions to avoid JSC_UNDEFINED_VARIABLE errors when linking without the emcc rts. Fix #25138 Some recompilation avoidance tests now fail. This is tracked with the other instances of this failure in #23013. My hunch is that they were working by chance when we used the emcc linker. Metric Decrease: T24602_perf_size - - - - - d1a40233 by Brandon Chinn at 2024-08-07T11:53:08-04:00 Support multiline strings in type literals (#25132) - - - - - 610840eb by Sylvain Henry at 2024-08-07T11:53:50-04:00 JS: fix callback documentation (#24377) Fix #24377 - - - - - 6ae4b76a by Zubin Duggal at 2024-08-13T13:36:57-04:00 haddock: Build haddock-api and haddock-library using hadrian We build these two packages as regular boot library dependencies rather than using the `in-ghc-tree` flag to include the source files into the haddock executable. The `in-ghc-tree` flag is moved into haddock-api to ensure that haddock built from hackage can still find the location of the GHC bindist using `ghc-paths`. Addresses #24834 This causes a metric decrease under non-release flavours because under these flavours libraries are compiled with optimisation but executables are not. Since we move the bulk of the code from the haddock executable to the haddock-api library, we see a metric decrease on the validate flavours. Metric Decrease: haddock.Cabal haddock.base haddock.compiler - - - - - 51ffba5d by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Add an extension field to HsRecFields This is the Right Thing to Do™. And it prepares for storing a multiplicity coercion there. First step of the plan outlined here and below https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12947#note_573091 - - - - - 4d2faeeb by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Add test for #24961 - - - - - 623b4337 by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Ensures that omitted record fields in pattern have multiplicity Many Omitted fields were simply ignored in the type checker and produced incorrect Core code. Fixes #24961 Metric Increase: RecordUpdPerf - - - - - c749bdfd by Sylvain Henry at 2024-08-13T13:38:41-04:00 AARCH64 linker: skip NONE relocations This patch is part of the patches upstreamed from haskell.nix. See https://github.com/input-output-hk/haskell.nix/pull/1960 for the original report/patch. - - - - - 682a6a41 by Brandon Chinn at 2024-08-13T13:39:17-04:00 Support multiline strings in TH - - - - - ee0a9c18 by Matthew Pickering at 2024-08-14T14:27:39-04:00 Extend -reexported-module flag to support module renaming The -reexported-module flag now supports renaming -rexported-modules. ``` -rexported-module "A as B" ``` This feature is only relevant to multi-component sessions. Fixes #25139 - - - - - e9496000 by Arnaud Spiwack at 2024-08-14T14:28:20-04:00 Don't restrict eta-reduction of linear functions This commit simply removes code. All the supporting implementation has been done as part of !12883. Closes #25129 - - - - - 2bb4156e by sheaf at 2024-08-14T14:28:56-04:00 Allow @ character in C labels Generated symbol names can include the '@' character, for example when using `__attribute__((vectorcall))`. - - - - - 7602ca23 by Sylvain Henry at 2024-08-14T14:29:36-04:00 Linker: replace blind tuple with a datatype + docs - - - - - bdd77b9e by sheaf at 2024-08-16T12:47:11-04:00 isIrrefutableHsPat: look up ConLikes in the HscEnv At GhcRn stage, in isIrrefutableHsPat we only looked up data constructors in the RdrEnv, which meant that we lacked fallibility information for out-of-scope constructors (which can arise from Template Haskell splices). Instead, we use 'lookupGREInfo', which looks up the information in the type environment. This was the correct function to call all along, but was not used in 572fbc44 due to import cycle reasons. The appropriate functions, 'irrefutableConLike{Rn,Tc}' have been moved to 'GHC.Rename.Env', which avoids import cycles. Fixes #25164 - - - - - 4bee377c by Sylvain Henry at 2024-08-16T12:47:53-04:00 Linker: some refactoring to prepare for #24886 - Rename LoadedBCOs into LazyBCOs - Bundle SptEntries with CompiledByteCode and removed [SptEntry] field from the BCOs constructor - Rename Linkable's LM constructor into Linkable: in the past we had LM and LP for Module and Package, now we only have the former. - Rename Unlinked into LinkablePart (and linkableUnlinked into linkableParts) - Use NonEmpty to encode invariant in Linkable's linkableParts type - Add helpers: linkableLibs, linkableBCOs, etc. - Add documentation - Remove partial nameOfObject - Rename nameOfObject_maybe into linkablePartPath - Rename byteCodeOfObject into linkablePartAllBCOs. - Refactor linkablePartAllBCOs to avoid a panic if a LazyBCO has a C stub. Document the fact that LazyBCOs are returned in this case (contrary to linkableBCOs which only returns non-lazy ones) Refactoring done while trying to understand how to adapt the linker code to support the JS backend too (cf #24886). - - - - - fa0dbaca by Mario Blažević at 2024-08-17T03:31:32+00:00 Implements the Exportable Named Default proposal (#24305) This squashed commit adds support for exportable named defaults, the accepted GHC proposal at https://github.com/ghc-proposals/ghc-proposals/pull/409 The proposal extends the Haskell '98 declarations default (Int, Double) which were implicitly always applying to Num class alone, to allow specifying an arbitrary single-parameter class: default IsString (Text, String) The effect of this declaration would be to eliminate the ambiguous type errors around string literals when OverloadedStrings extension is active. The declaration by itself has effect only in its module, so the proposal also adds the ability to export class defaults: module MyModule (default IsIstring) Once the language extension is published and established, we can consider using it in base and other libraries. See Note [Named default declarations] in GHC.Tc.Gen.Default for implementation details. - - - - - 1deba6b2 by Simon Peyton Jones at 2024-08-17T13:58:13-04:00 Make kick-out more selective This MR revised the crucial kick-out criteria in the constraint solver. Ticket #24984 showed an example in which * We were kicking out unnecessarily * That gave rise to extra work, of course * But it /also/ led to exponentially-sized coercions due to lack of sharing in coercions (something we want to fix separately #20264) This MR sharpens up the kick-out criteria; specifially in (KK2) we look only under type family applications if (fs>=fw). This forced me to understand the existing kick-out story, and I ended up rewriting many of the careful Notes in GHC.Tc.Solver.InertSet. Especially look at the new `Note [The KickOut Criteria]` The proof of termination is not air-tight, but it is better than before, and both Richard and I think it's correct :-). - - - - - 88488847 by Cheng Shao at 2024-08-18T04:44:01+02:00 testsuite: remove undesired -fasm flag from test ways This patch removes the -fasm flag from test ways, except ways like optasm that explicitly state they are meant to be compiled with NCG backend. Most test ways should use the default codegen backend, and the precense of -fasm can cause stderr mismatches like this when GHC is configured with the unregisterised backend: ``` --- /dev/null +++ /tmp/ghctest-3hydwldj/test spaces/testsuite/tests/profiling/should_compile/prof-late-cc.run/prof-late-cc.comp.stderr.normalised @@ -0,0 +1,2 @@ +when making flags consistent: warning: [GHC-74335] [-Winconsistent-flags (in -Wdefault)] + Target platform uses unregisterised ABI, so compiling via C *** unexpected failure for prof-late-cc(prof_no_auto) ``` This has been breaking the wasm unreg nightly job since !12595 landed. - - - - - 3a145315 by Cheng Shao at 2024-08-18T13:05:45-04:00 ghci: fix isMinTTY.h casing for Windows targets This commit fixes isMinTTY.h casing in isMinTTY.c that's compiled for Windows targets. While this looks harmless given Windows filesystems are case-insensitive by default, it does cause a compilation warning with recent versions of clang, so we might as well fix the casing: ``` driver\ghci\isMinTTY.c:10:10: error: warning: non-portable path to file '"isMinTTY.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] | 10 | #include "isMINTTY.h" | ^ #include "isMINTTY.h" ^~~~~~~~~~~~ "isMinTTY.h" 1 warning generated. ``` - - - - - 5f972bfb by Zubin Duggal at 2024-08-21T03:18:15-04:00 compiler: Fix pretty printing of ticked prefix constructors (#24237) - - - - - ef0a08e7 by Mike Pilgrem at 2024-08-21T03:18:57-04:00 Fix #15773 Clarify further -rtsopts 'defaults' in docs - - - - - 05a4be58 by Sebastian Graf at 2024-08-21T03:19:33-04:00 Improve efficiency of `assertError` (#24625) ... by moving `lazy` to the exception-throwing branch. It's all documented in `Note [Strictness of assertError]`. - - - - - c29b2b5a by sheaf at 2024-08-21T13:11:30-04:00 GHCi debugger: drop record name spaces for Ids When binding new local variables at a breakpoint, we should create Ids with variable namespace, and not record field namespace. Otherwise the rest of the compiler falls over because the IdDetails are wrong. Fixes #25109 - - - - - bd82ac9f by Hécate Kleidukos at 2024-08-21T13:12:12-04:00 base: Final deprecation of GHC.Pack The timeline mandated by #21461 has come to its term and after two years and four minor releases, we are finally removing GHC.Pack from base. Closes #21536 - - - - - 5092dbff by Sylvain Henry at 2024-08-21T13:12:54-04:00 JS: support rubbish static literals (#25177) Support for rubbish dynamic literals was added in #24664. This patch does the same for static literals. Fix #25177 - - - - - b5a2c061 by Phil de Joux at 2024-08-21T13:13:33-04:00 haddock docs: prefix comes before, postfix comes after - - - - - 6fde3685 by Marcin Szamotulski at 2024-08-21T23:15:39-04:00 haddock: include package info with --show-interface - - - - - 7e02111b by Andreas Klebinger at 2024-08-21T23:16:15-04:00 Document the (x86) SIMD macros. Fixes #25021. - - - - - 05116c83 by Rodrigo Mesquita at 2024-08-22T10:37:44-04:00 ghc-internal: Derive version from ghc's version Fixes #25005 - - - - - 73f5897d by Ben Gamari at 2024-08-22T10:37:44-04:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.14. - - - - - 821d0a9a by Cheng Shao at 2024-08-22T10:38:22-04:00 compiler: Store ForeignStubs and foreign C files in interfaces This data is used alongside Core bindings to reconstruct intermediate build products when linking Template Haskell splices with bytecode. Since foreign stubs and files are generated in the pipeline, they were lost with only Core bindings stored in interfaces. The interface codec type `IfaceForeign` contains a simplified representation of `ForeignStubs` and the set of foreign sources that were manually added by the user. When the backend phase writes an interface, `mkFullIface` calls `encodeIfaceForeign` to read foreign source file contents and assemble `IfaceForeign`. After the recompilation status check of an upstream module, `initWholeCoreBindings` calls `decodeIfaceForeign` to restore `ForeignStubs` and write the contents of foreign sources to the file system as temporary files. The restored foreign inputs are then processed by `hscInteractive` in the same manner as in a regular pipeline. When linking the stub objects for splices, they are excluded from suffix adjustment for the interpreter way through a new flag in `Unlinked`. For details about these processes, please consult Note [Foreign stubs and TH bytecode linking]. Metric Decrease: T13701 - - - - - f0408eeb by Cheng Shao at 2024-08-23T10:37:10-04:00 git: remove a.out and include it in .gitignore a.out is a configure script byproduct. It was mistakenly checked into the tree in !13118. This patch removes it, and include it in .gitignore to prevent a similar error in the future. - - - - - 1f95c5e4 by Matthew Pickering at 2024-08-23T10:37:46-04:00 docs: Fix code-block syntax on old sphinx version This code-block directive breaks the deb9 sphinx build. Fixes #25201 - - - - - 27dceb42 by Sylvain Henry at 2024-08-26T11:05:11-04:00 JS: add basic support for POSIX *at functions (#25190) openat/fstatat/unlinkat/dup are now used in the recent release of the `directory` and `file-io` packages. As such, these functions are (indirectly) used in the following tests one we'll bump the `directory` submodule (see !13122): - openFile008 - jsOptimizer - T20509 - bkpcabal02 - bkpcabal03 - bkpcabal04 - - - - - c68be356 by Matthew Pickering at 2024-08-26T11:05:11-04:00 Update directory submodule to latest master The primary reason for this bump is to fix the warning from `ghc-pkg check`: ``` Warning: include-dirs: /data/home/ubuntu/.ghcup/ghc/9.6.2/lib/ghc-9.6.2/lib/../lib/aarch64-linux-ghc-9.6.2/directory-1.3.8.1/include doesn't exist or isn't a directory ``` This also requires adding the `file-io` package as a boot library (which is discussed in #25145) Fixes #23594 #25145 - - - - - 4ee094d4 by Matthew Pickering at 2024-08-26T11:05:47-04:00 Fix aarch64-alpine target platform description We are producing bindists where the target triple is aarch64-alpine-linux when it should be aarch64-unknown-linux This is because the bootstrapped compiler originally set the target triple to `aarch64-alpine-linux` which is when propagated forwards by setting `bootstrap_target` from the bootstrap compiler target. In order to break this chain we explicitly specify build/host/target for aarch64-alpine. This requires a new configure flag `--enable-ignore-` which just switches off a validation check that the target platform of the bootstrap compiler is the same as the build platform. It is the same, but the name is just wrong. These commits can be removed when the bootstrap compiler has the correct target triple (I looked into patching this on ci-images, but it looked hard to do correctly as the build/host platform is not in the settings file). Fixes #25200 - - - - - e0e0f2b2 by Matthew Pickering at 2024-08-26T11:05:47-04:00 Bump nixpkgs commit for gen_ci script - - - - - 63a27091 by doyougnu at 2024-08-26T20:39:30-04:00 rts: win32: emit additional debugging information -- migration from haskell.nix - - - - - aaab3d10 by Vladislav Zavialov at 2024-08-26T20:40:06-04:00 Only export defaults when NamedDefaults are enabled (#25206) This is a reinterpretation of GHC Proposal #409 that avoids a breaking change introduced in fa0dbaca6c "Implements the Exportable Named Default proposal" Consider a module M that has no explicit export list: module M where default (Rational) Should it export the default (Rational)? The proposal says "yes", and there's a test case for that: default/DefaultImport04.hs However, as it turns out, this change in behavior breaks existing programs, e.g. the colour-2.3.6 package can no longer be compiled, as reported in #25206. In this patch, we make implicit exports of defaults conditional on the NamedDefaults extension. This fix is unintrusive and compliant with the existing proposal text (i.e. it does not require a proposal amendment). Should the proposal be amended, we can go for a simpler solution, such as requiring all defaults to be exported explicitly. Test case: testsuite/tests/default/T25206.hs - - - - - 3a5bebf8 by Matthew Pickering at 2024-08-28T14:16:42-04:00 simplifier: Fix space leak during demand analysis The lazy structure (a list) in a strict field in `DmdType` is not fully forced which leads to a very large thunk build-up. It seems there is likely still more work to be done here as it seems we may be trading space usage for work done. For now, this is the right choice as rather than using all the memory on my computer, compilation just takes a little bit longer. See #25196 - - - - - c2525e9e by Ryan Scott at 2024-08-28T14:17:17-04:00 Add missing parenthesizeHsType in cvtp's InvisP case We need to ensure that when we convert an `InvisP` (invisible type pattern) to a `Pat`, we parenthesize it (at precedence `appPrec`) so that patterns such as `@(a :: k)` will parse correctly when roundtripped back through the parser. Fixes #25209. - - - - - 1499764f by Sjoerd Visscher at 2024-08-29T16:52:56+02:00 Haddock: Add no-compilation flag This flag makes sure to avoid recompilation of the code when generating documentation by only reading the .hi and .hie files, and throw an error if it can't find them. - - - - - 768fe644 by Andreas Klebinger at 2024-09-03T13:15:20-04:00 Add functions to check for weakly pinned arrays. This commit adds `isByteArrayWeaklyPinned#` and `isMutableByteArrayWeaklyPinned#` primops. These check if a bytearray is *weakly* pinned. Which means it can still be explicitly moved by the user via compaction but won't be moved by the RTS. This moves us one more stop closer to nailing down #22255. - - - - - b16605e7 by Arsen Arsenović at 2024-09-03T13:16:05-04:00 ghc-toolchain: Don't leave stranded a.outs when testing for -g0 This happened because, when ghc-toolchain tests for -g0, it does so by compiling an empty program. This compilation creates an a.out. Since we create a temporary directory, lets place the test program compilation in it also, so that it gets cleaned up. Fixes: 25b0b40467d0a12601497117c0ad14e1fcab0b74 Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/25203 - - - - - 83e70b14 by Torsten Schmits at 2024-09-03T13:16:41-04:00 Build foreign objects for TH with interpreter's way when loading from iface Fixes #25211 When linking bytecode for TH from interface core bindings with `-fprefer-byte-code`, foreign sources are loaded from the interface as well and compiled to object code in an ad-hoc manner. The results are then loaded by the interpreter, whose way may differ from the current build's target way. This patch ensures that foreign objects are compiled with the interpreter's way. - - - - - 0d3bc2fa by Cheng Shao at 2024-09-04T07:20:06-04:00 rts: fix checkClosure error message This patch fixes an error message in checkClosure() when the closure has already been evacuated. The previous logic was meant to print the evacuated closure's type in the error message, but it was completely wrong, given info was not really an info table, but a tagged pointer that points to the closure's new address. - - - - - fb0a4e5c by Sven Tennie at 2024-09-04T07:20:43-04:00 MO_AcquireFence: Less restrictive barrier GCC and CLang translate the built-in `atomic_thread_fence(memory_order_acquire)` to `dmb ishld`, which is a bit less restrictive than `dmb ish` (which also implies stores.) - - - - - a45f1488 by Fendor at 2024-09-04T20:22:00-04:00 testsuite: Add support to capture performance metrics via 'perf' Performance metrics collected via 'perf' can be more accurate for run-time performance than GHC's rts, due to the usage of hardware counters. We allow performance tests to also record PMU events according to 'perf list'. - - - - - ce61fca5 by Fendor at 2024-09-04T20:22:00-04:00 gitlab-ci: Add nightly job for running the testsuite with perf profiling support - - - - - 6dfb9471 by Fendor at 2024-09-04T20:22:00-04:00 Enable perf profiling for compiler performance tests - - - - - da306610 by sheaf at 2024-09-04T20:22:41-04:00 RecordCon lookup: don't allow a TyCon This commit adds extra logic when looking up a record constructor. If GHC.Rename.Env.lookupOccRnConstr returns a TyCon (as it may, due to the logic explained in Note [Pattern to type (P2T) conversion]), we emit an error saying that the data constructor is not in scope. This avoids the compiler falling over shortly thereafter, in the call to 'lookupConstructorInfo' inside 'GHC.Rename.Env.lookupRecFieldOcc', because the record constructor would not have been a ConLike. Fixes #25056 - - - - - 9c354beb by Matthew Pickering at 2024-09-04T20:23:16-04:00 Use deterministic names for temporary files When there are multiple threads they can race to create a temporary file, in some situations the thread will create ghc_1.c and in some it will create ghc_2.c. This filename ends up in the debug info for object files after compiling a C file, therefore contributes to object nondeterminism. In order to fix this we store a prefix in `TmpFs` which serves to namespace temporary files. The prefix is populated from the counter in TmpFs when the TmpFs is forked. Therefore the TmpFs must be forked outside the thread which consumes it, in a deterministic order, so each thread always receives a TmpFs with the same prefix. This assumes that after the initial TmpFs is created, all other TmpFs are created from forking the original TmpFs. Which should have been try anyway as otherwise there would be file collisions and non-determinism. Fixes #25224 - - - - - 59906975 by Hécate Kleidukos at 2024-09-05T10:57:15-04:00 Silence x-partial in Haddock.Backends.Xhtml This is an unfortunate consequence of two mechanisms: * GHC provides (possibly-empty) lists of names * The functions that retrieve those names are not equipped to do error reporting, and thus accept these lists at face value. They will have to be attached an effect for error reporting in a later refactoring - - - - - 8afbab62 by Hécate Kleidukos at 2024-09-05T10:57:15-04:00 hadrian: Support loading haddock in ghci There is one tricky aspect with wired-in packages where the boot package is built with `-this-unit-id ghc` but the dependency is reported as `-package-id ghc-9.6...`. This has never been fixed in GHC as the situation of loading wired-in packages into the multi-repl seems like quite a niche feature that is always just easier to workaround. - - - - - 6cac9eb8 by Matthew Pickering at 2024-09-05T10:57:15-04:00 hadrian/multi: Load all targets when ./hadrian/ghci-multi is called This seems to make a bit more sense than just loading `ghc` component (and dependencies). - - - - - 7d84df86 by Matthew Pickering at 2024-09-05T10:57:51-04:00 ci: Beef up determinism interface test There have recently been some determinism issues with the simplifier and documentation. We enable more things to test in the ABI test to check that we produce interface files deterministically. - - - - - 5456e02e by Sylvain Henry at 2024-09-06T11:57:01+02:00 Transform some StgRhsClosure into StgRhsCon after unarisation (#25166) Before unarisation we may have code like: Test.foo :: Test.D [GblId, Unf=OtherCon []] = \u [] case (# |_| #) [GHC.Types.(##)] of sat_sAw [Occ=Once1] { __DEFAULT -> Test.D [GHC.Types.True sat_sAw]; }; After unarisation we get: Test.foo :: Test.D [GblId, Unf=OtherCon []] = {} \u [] Test.D [GHC.Types.True 2#]; Notice that it's still an Updatable closure for no reason anymore. This patch transforms appropriate StgRhsClosures into StgRhsCons after unarisation, allowing these closures to be statically allocated. Now we get the expected: Test.foo :: Test.D [GblId, Unf=OtherCon []] = Test.D! [GHC.Types.True 2#]; Fix #25166 To avoid duplicating code, this patch refactors the mk(Top)StgRhs functions and put them in a GHC.Stg.Make module alongside the new mk(Top)StgRhsCon_maybe functions. - - - - - 958b4518 by Hécate Kleidukos at 2024-09-06T16:40:56-04:00 haddock: Add missing requirements.txt for the online manual - - - - - 573f9833 by Sven Tennie at 2024-09-08T09:58:21+00:00 AArch64: Implement takeRegRegMoveInstr This has likely been forgotten. - - - - - 20b0de7d by Hécate Kleidukos at 2024-09-08T14:19:28-04:00 haddock: Configuration fix for ReadTheDocs - - - - - 03055c71 by Sylvain Henry at 2024-09-09T14:58:15-04:00 JS: fake support for native adjustors (#25159) The JS backend doesn't support adjustors (I believe) and in any case if it ever supports them it will be a native support, not one via libffi. - - - - - 5bf0e6bc by Sylvain Henry at 2024-09-09T14:58:56-04:00 JS: remove redundant h$lstat It was introduced a second time by mistake in 27dceb42376c34b99a38e36a33b2abc346ed390f (cf #25190) - - - - - ffbc2ab0 by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Refactor only newSysLocalDs * Change newSysLocalDs to take a scaled type * Add newSysLocalMDs that takes a type and makes a ManyTy local Lots of files touched, nothing deep. - - - - - 7124e4ad by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Don't introduce 'nospec' on the LHS of a RULE This patch address #25160. The main payload is: * When desugaring the LHS of a RULE, do not introduce the `nospec` call for non-canonical evidence. See GHC.Core.InstEnv Note [Coherence and specialisation: overview] The `nospec` call usually introdued in `dsHsWrapper`, but we don't want it on the LHS of a RULE (that's what caused #25160). So now `dsHsWrapper` takes a flag to say if it's on the LHS of a RULE. See wrinkle (NC1) in `Note [Desugaring non-canonical evidence]` in GHC.HsToCore.Binds. But I think this flag will go away again when I have finished with my (entirely separate) speciaise-on-values patch (#24359). All this meant I had to re-understand the `nospec` stuff and coherence, and that in turn made me do some refactoring, and add a lot of new documentation The big change is that in GHC.Core.InstEnv, I changed the /type synonym/ `Canonical` into a /data type/ `CanonicalEvidence` and documented it a lot better. That in turn made me realise that CalLStacks were being treated with a bit of a hack, which I documented in `Note [CallStack and ExecptionContext hack]`. - - - - - 663daf8d by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Add defaulting of equalities This MR adds one new defaulting strategy to the top-level defaulting story: see Note [Defaulting equalities] in GHC.Tc.Solver. This resolves #25029 and #25125, which showed that users were accidentally relying on a GHC bug, which was fixed by commit 04f5bb85c8109843b9ac2af2a3e26544d05e02f4 Author: Simon Peyton Jones <simon.peytonjones at gmail.com> Date: Wed Jun 12 17:44:59 2024 +0100 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. This fix gave rise to a number of user complaints; but the improved defaulting story of this MR largely resolves them. On the way I did a bit of refactoring, of course * Completely restructure the extremely messy top-level defaulting code. The new code is in GHC.Tc.Solver.tryDefaulting, and is much, much, much esaier to grok. - - - - - e28cd021 by Andrzej Rybczak at 2024-09-10T00:41:18-04:00 Don't name a binding pattern It's a keyword when PatternSynonyms are set. - - - - - b09571e2 by Simon Peyton Jones at 2024-09-10T00:41:54-04:00 Do not use an error thunk for an absent dictionary In worker/wrapper we were using an error thunk for an absent dictionary, but that works very badly for -XDictsStrict, or even (as #24934 showed) in some complicated cases involving strictness analysis and unfoldings. This MR just uses RubbishLit for dictionaries. Simple. No test case, sadly because our only repro case is rather complicated. - - - - - 8bc9f5f6 by Hécate Kleidukos at 2024-09-10T00:42:34-04:00 haddock: Remove support for applehelp format in the Manual - - - - - 9ca15506 by doyougnu at 2024-09-10T10:46:38-04:00 RTS linker: add support for hidden symbols (#25191) Add linker support for hidden symbols. We basically treat them as weak symbols. Patch upstreamed from haskell.nix Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 3b2dc826 by Sven Tennie at 2024-09-10T10:47:14-04:00 Fix C warnings (#25237) GCC 14 treats the fixed warnings as errors by default. I.e. we're gaining GCC 14 compatibility with these fixes. - - - - - 05715994 by Sylvain Henry at 2024-09-10T10:47:55-04:00 JS: fix codegen of static string data Before this patch, when string literals are made trivial, we would generate `h$("foo")` instead of `h$str("foo")`. This was introduced by mistake in 6bd850e887b82c5a28bdacf5870d3dc2fc0f5091. - - - - - 949ebced by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Re-organise cross-OS compatibility layer - - - - - 84ac9a99 by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Remove CPP for obsolete GHC and Cabal versions - - - - - 370d1599 by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Move the changelog file to the 'extra-doc-files' section in the cabal file - - - - - cfbff65a by Simon Peyton Jones at 2024-09-10T19:20:16-04:00 Add ZonkAny and document it This MR fixed #24817 by adding ZonkAny, which takes a Nat argument. See Note [Any types] in GHC.Builtin.Types, especially wrinkle (Any4). - - - - - 0167e472 by Matthew Pickering at 2024-09-11T02:41:42-04:00 hadrian: Make sure ffi headers are built before using a compiler When we are using ffi adjustors then we rely on `ffi.h` and `ffitarget.h` files during code generation when compiling stubs. Therefore we need to add this dependency to the build system (which this patch does). Reproducer, configure with `--enable-libffi-adjustors` and then build "_build/stage1/libraries/ghc-prim/build/GHC/Types.p_o". Observe that this fails before this patch and works afterwards. Fixes #24864 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 0f696958 by Rodrigo Mesquita at 2024-09-11T02:42:18-04:00 base: Deprecate BCO primops exports from GHC.Exts See https://github.com/haskell/core-libraries-committee/issues/212. These reexports will be removed in GHC 9.14. - - - - - cf0e7729 by Alan Zimmerman at 2024-09-11T02:42:54-04:00 EPA: Remove Anchor = EpaLocation synonym This just causes confusion. - - - - - 8e462f4d by Andrew Lelechenko at 2024-09-11T22:20:37-04:00 Bump submodule deepseq to 1.5.1.0 - - - - - aa4500ae by Sebastian Graf at 2024-09-11T22:21:13-04:00 User's guide: Fix the "no-backtracking" example of -XOrPatterns (#25250) Fixes #25250. - - - - - 1c479c01 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add Native Code Generator (NCG) This architecture wasn't supported before. Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 51b678e1 by Sven Tennie at 2024-09-12T10:39:38+00:00 Adjust test timings for slower computers Increase the delays a bit to be able to run these tests on slower computers. The reference was a Lichee Pi 4a RISCV64 machine. - - - - - a0e41741 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add RTS linker This architecture wasn't supported before. Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - d365b1d4 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Ignore divbyzero test The architecture's behaviour differs from the test's expectations. See comment in code why this is okay. - - - - - abf3d699 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Enable MulMayOflo_full test It works and thus can be tested. - - - - - 38c7ea8c by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: LibffiAdjustor: Ensure code caches are flushed RISCV64 needs a specific code flushing sequence (involving fence.i) when new code is created/loaded. - - - - - 7edc6965 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add additional linker symbols for builtins We're relying on some GCC/Clang builtins. These need to be visible to the linker (and not be stripped away.) - - - - - 92ad3d42 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add GHCi support As we got a RTS linker for this architecture now, we can enable GHCi for it. - - - - - a145f701 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Set codeowners of the NCG - - - - - 8e6d58cf by Sven Tennie at 2024-09-12T10:39:38+00:00 Add test for C calling convention Ensure that parameters and return values are correctly processed. A dedicated test (like this) helps to get the subtleties of calling conventions easily right. The test is failing for WASM32 and marked as fragile to not forget to investigate this (#25249). - - - - - fff55592 by Torsten Schmits at 2024-09-12T21:50:34-04:00 finder: Add `IsBootInterface` to finder cache keys - - - - - cdf530df by Alan Zimmerman at 2024-09-12T21:51:10-04:00 EPA: Sync ghc-exactprint to GHC - - - - - 1374349b by Sebastian Graf at 2024-09-13T07:52:11-04:00 DmdAnal: Fast path for `multDmdType` (#25196) This is in order to counter a regression exposed by SpecConstr. Fixes #25196. - - - - - 80769bc9 by Andrew Lelechenko at 2024-09-13T07:52:47-04:00 Bump submodule array to 0.5.8.0 - - - - - 49ac3fb8 by Sylvain Henry at 2024-09-16T10:33:01-04:00 Linker: add support for extra built-in symbols (#25155) See added Note [Extra RTS symbols] and new user guide entry. Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie at gmail.com> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 3939a8bf by Samuel Thibault at 2024-09-16T10:33:44-04:00 GNU/Hurd: Add getExecutablePath support GNU/Hurd exposes it as /proc/self/exe just like on Linux. - - - - - d3b19851 by Sylvain Henry at 2024-09-17T11:03:28-04:00 RTS: expose closure_sizeW_ (#25252) C code using the closure_sizeW macro can't be linked with the RTS linker without this patch. It fails with: ghc-9.11.20240911: Failed to lookup symbol: closure_sizeW_ Fix #25252 Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie at gmail.com> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 137bf74d by Sebastian Graf at 2024-09-17T11:04:05-04:00 HsExpr: Inline `HsWrap` into `WrapExpr` This nice refactoring was suggested by Simon during review: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13261#note_583374 Fixes #25264. - - - - - 7fd9e5e2 by Sebastian Graf at 2024-09-17T11:04:05-04:00 Pmc: Improve Desugaring of overloaded list patterns (#25257) This actually makes things simpler. Fixes #25257. - - - - - e4169ba9 by Ben Gamari at 2024-09-18T07:55:28-04:00 configure: Correctly report when subsections-via-symbols is disabled As noted in #24962, currently subsections-via-symbols is disabled on AArch64/Darwin due to alleged breakage. However, `configure` reports to the user that it is enabled. Fix this. - - - - - 9d20a787 by Mario Blažević at 2024-09-18T07:56:08-04:00 Modified the default export implementation to match the amended spec - - - - - 35eb4f42 by Sylvain Henry at 2024-09-18T07:57:00-04:00 FFI: don't ppr Id/Var symbols with debug info (#25255) Even if `-dpp-debug` is enabled we should still generate valid C code. So we disable debug info printing when rendering with Code style. - - - - - 9e96dad8 by Sebastian Graf at 2024-09-21T17:47:59-04:00 Demand: Combine examples into Note (#25107) Just a leftover from !13060. Fixes #25107. - - - - - 21aaa34b by sheaf at 2024-09-21T17:48:36-04:00 Use x86_64-unknown-windows-gnu target for LLVM on Windows - - - - - 992a7624 by sheaf at 2024-09-21T17:48:36-04:00 LLVM: use -relocation-model=pic on Windows This is necessary to avoid the segfaults reported in #22487. Fixes #22487 - - - - - c50d29be by Ryan Hendrickson at 2024-09-21T17:49:15-04:00 compiler: Use type abstractions when deriving For deriving newtype and deriving via, in order to bring type variables needed for the coercions into scope, GHC generates type signatures for derived class methods. As a simplification, drop the type signatures and instead use type abstractions to bring method type variables into scope. - - - - - f04fd0ae by Zubin Duggal at 2024-09-21T17:49:51-04:00 driver: Ensure we run driverPlugin for staticPlugins (#25217) driverPlugins are only run when the plugin state changes. This meant they were never run for static plugins, as their state never changes. We need to keep track of whether a static plugin has been initialised to ensure we run static driver plugins at least once. This necessitates an additional field in the `StaticPlugin` constructor as this state has to be bundled with the plugin itself, as static plugins have no name/identifier we can use to otherwise reference them - - - - - 620becd7 by Andreas Klebinger at 2024-09-21T17:50:27-04:00 Allow unknown fd device types for setNonBlockingMode. This allows fds with a unknown device type to have blocking mode set. This happens for example for fds from the inotify subsystem. Fixes #25199. - - - - - c76e25b3 by Hécate Kleidukos at 2024-09-21T17:51:07-04:00 Use Hackage version of Cabal 3.14.0.0 for Hadrian. We remove the vendored Cabal submodule. Also update the bootstrap plans Fixes #25086 - - - - - 6c83fd7f by Zubin Duggal at 2024-09-21T17:51:07-04:00 ci: Ensure we source ci.sh in any jobs that run commands outside of ci.sh ci.sh sets up the toolchain environment, including paths for the cabal directory, the toolchain binaries etc. If we run any commands outside of ci.sh, unless we source ci.sh we will use the wrong values for these environment variables. In particular, I ran into an issue where the cabal invocation `hadrian/ghci` was using an old index state despite `ci.sh setup` updating and setting the correct index state. This is because `ci.sh` sets the `CABAL_DIR` to a different place, which is where the index was downloaded to, but we were using the default cabal directory outside ci.sh The solution is to source the correct environment `ci.sh` using `. ci.sh setup` - - - - - 9586998d by Sven Tennie at 2024-09-21T17:51:43-04:00 ghc-toolchain: Set -fuse-ld even for ld.bfd This reflects the behaviour of the autoconf scripts. - - - - - d7016e0d by Sylvain Henry at 2024-09-21T17:52:24-04:00 Parser: be more careful when lexing extended literals (#25258) Previously we would lex invalid prefixes like "8#Int3" as [8#Int, 3]. A side-effect of this patch is that we now allow negative unsigned extended literals. They trigger an overflow warning later anyway. - - - - - ca67d7cb by Zubin Duggal at 2024-09-22T02:34:06-04:00 rts: Ensure we dump new Cost Centres added by freshly loaded objects to the eventlog. To do this, we keep track of the ID of the last cost centre we dumped in DUMPED_CC_ID, and call dumpCostCentresToEventLog from refreshProfilingCCSs, which will dump all the new cost centres up to the one we already dumped in DUMPED_CC_ID. Fixes #24148 - - - - - c0df5aa9 by Alan Zimmerman at 2024-09-22T02:34:42-04:00 EPA: Replace AnnsModule am_main with EpTokens Working towards removing `AddEpAnn` - - - - - 2a551cd5 by Matthew Pickering at 2024-09-24T16:33:50+05:30 ci: Run abi-test on test-abi label - - - - - ab4039ac by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 testsuite: Add a test for object determinism Extends the abi_test with an object determinism check Also includes a standalone test to be run by developers manually when debugging issues with determinism. - - - - - d62c18d8 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Sampling uniques in the CG To achieve object determinism, the passes processing Cmm and the rest of the code generation pipeline musn't create new uniques which are non-deterministic. This commit changes occurrences of non-deterministic unique sampling within these code generation passes by a deterministic unique sampling strategy by propagating and threading through a deterministic incrementing counter in them. The threading is done implicitly with `UniqDSM` and `UniqDSMT`. Secondly, the `DUniqSupply` used to run a `UniqDSM` must be threaded through all passes to guarantee uniques in different passes are unique amongst them altogether. Specifically, the same `DUniqSupply` must be threaded through the CG Streaming pipeline, starting with Driver.Main calling `StgToCmm.codeGen`, `cmmPipeline`, `cmmToRawCmm`, and `codeOutput` in sequence. To thread resources through the `Stream` abstraction, we use the `UniqDSMT` transformer on top of `IO` as the Monad underlying the Stream. `UniqDSMT` will thread the `DUniqSupply` through every pass applied to the `Stream`, for every element. We use @type CgStream = Stream (UniqDSMT IO)@ for the Stream used in code generation which that carries through the deterministic unique supply. See Note [Deterministic Uniques in the CG] - - - - - 3bbe4af4 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Cmm unique renaming pass To achieve object determinism, we need to prevent the non-deterministic uniques from leaking into the object code. We can do this by deterministically renaming the non-external uniques in the Cmm groups that are yielded right after StgToCmm. The key to deterministic renaming is observing that the order of declarations, instructions, and data in the Cmm groups are already deterministic (modulo other determinism bugs), regardless of the uniques. We traverse the Cmm AST in this deterministic order and rename the uniques, incrementally, in the order they are found, thus making them deterministic. This renaming is guarded by -fobject-determinism which is disabled by default for now. This is one of the key passes for object determinism. Read about the overview of object determinism and a more detailed explanation of this pass in: * Note [Object determinism] * Note [Renaming uniques deterministically] Significantly closes the gap to #12935 - - - - - 8357ed50 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: DCmmGroup vs CmmGroup Part of our strategy in producing deterministic objects, namely, renaming all Cmm uniques in order, depend on the object code produced having a deterministic order (say, A_closure always comes before B_closure). However, the use of LabelMaps in the Cmm representation invalidated this requirement because the LabelMaps elements would already be in a non-deterministic order (due to the original uniques), and the renaming in sequence wouldn't work because of that non-deterministic order. Therefore, we now start off with lists in CmmGroup (which preserve the original order), and convert them into LabelMaps (for performance in the code generator) after the uniques of the list elements have been renamed. See Note [DCmmGroup vs CmmGroup or: Deterministic Info Tables] and #12935. Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 0e675fb8 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Don't print unique in pprFullName This unique was leaking as part of the profiling description in info tables when profiling was enabled, despite not providing information relevant to the profile. - - - - - 340f58b0 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: UDFM for distinct-constructor-tables In order to produce deterministic objects when compiling with -distinct-constructor-tables, we also have to update the data constructor map to be backed by a deterministic unique map (UDFM) rather than a non-deterministic one (UniqMap). - - - - - 282f37a0 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: InfoTableMap uniques in generateCgIPEStub Fixes object determinism when using -finfo-table-map Make sure to also deterministically rename the IPE map (as per Note [Renaming uniques deterministically]), and to use a deterministic unique supply when creating new labels for the IPE information to guarantee deterministic objects when IPE information is requested. Note that the Cmm group produced in generateCgIPEStub must /not/ be renamed because renaming uniques is not idempotent, and the references to the previously renamed code in the IPE Cmm group would be renamed twice and become invalid references to non-existent symbols. We do need to det-rename the InfoTableMap that is created in the conversion from Core to Stg. This is not a problem since that map won't refer any already renamed names (since it was created before the renaming). - - - - - 7b37afc9 by Zubin Duggal at 2024-09-24T16:33:50+05:30 ci: Allow abi-test to fail. We are not fully deterministic yet, see #12935 for work that remains to be done. - - - - - a63ee33a by Simon Peyton Jones at 2024-09-25T17:08:24-04:00 Add Given injectivity for built-in type families Ticket #24845 asks (reasonably enough) that if we have [G] a+b ~ 0 then we also know [G] a ~ 0, b ~ 0 and similar injectivity-like facts for other built-in type families. The status quo was that we never generate evidence for injectivity among Givens -- but it is quite reasonnable to do so. All we need is to have /evidence/ for the new constraints This MR implements that goal. I also took the opportunity to * Address #24978: refactoring UnivCo * Fix #25248, which was a consequences of the previous formulation of UnivCo As a result this MR touches a lot of code. The big things are: * Coercion constructor UnivCo now takes a [Coercion] as argument to express the coercions on which the UnivCo depends. A nice consequence is that UnivCoProvenance now has no free variables, simpler in a number of places. * Coercion constructors AxiomInstCo and AxiomRuleCo are combined into AxiomCo. The new AxiomCo, carries a (slightly oddly named) CoAxiomRule, which itself is a sum type of the various forms of built-in axiom. See Note [CoAxiomRule] in GHC.Core.Coercion.Axiom A merit of this is that we can separate the case of open and closed type families, and eliminate the redundant `BranchIndex` in the former case. * Much better representation for data BuiltInSynFamily, which means we no longer need to enumerate built-in axioms as well as built-in tycons. * There is a massive refactor in GHC.Builtin.Types.Literals, which contains all the built-in axioms for type-level operations (arithmetic, append, cons etc). A big change is that instead of redundantly having (a) a hand-written matcher, and (b) a template-based "proves" function, which were hard to keep in sync, the two are derive from one set of human-supplied info. See GHC.Builtin.Types.Literals.mkRewriteAxiom, and friends. * Significant changes in GHC.Tc.Solver.Equality to account for the new opportunity for Given/Given equalities. Smaller things * Improve pretty-printing to avoid parens around atomic coercions. * Do proper eqType in findMatchingIrreds, not `eqTypeNoKindCheck`. Looks like a bug, Richard agrees. * coercionLKind and coercionRKind are hot functions. I refactored the implementation (which I had to change anyway) to increase sharing. See Note [coercionKind performance] in GHC.Core.Coercion * I wrote a new Note [Finding orphan names] in GHC.Core.FVs about orphan names * I improved the `is_concrete` flag in GHC.Core.Type.buildSynTyCon, to avoid calling tyConsOfType. I forget exactly why I did this, but it's definitely better now. * I moved some code from GHC.Tc.Types.Constraint into GHC.Tc.Types.CtLocEnv and I renamed the module GHC.Tc.Types.CtLocEnv to GHC.Tc.Types.CtLoc - - - - - dd8ef342 by Ryan Scott at 2024-09-25T17:09:01-04:00 Resolve ambiguous method-bound type variables in vanilla defaults and GND When defining an instance of a class with a "vanilla" default, such as in the following example (from #14266): ```hs class A t where f :: forall x m. Monoid x => t m -> m f = <blah> instance A [] ``` We have to reckon with the fact that the type of `x` (bound by the type signature for the `f` method) is ambiguous. If we don't deal with the ambiguity somehow, then when we generate the following code: ```hs instance A [] where f = $dmf @[] -- NB: the type of `x` is still ambiguous ``` Then the generated code will not typecheck. (Issue #25148 is a more recent example of the same problem.) To fix this, we bind the type variables from the method's original type signature using `TypeAbstractions` and instantiate `$dmf` with them using `TypeApplications`: ```hs instance A [] where f @x @m = $dmf @[] @x @m -- `x` is no longer ambiguous ``` Note that we only do this for vanilla defaults and not for generic defaults (i.e., defaults using `DefaultSignatures`). For the full details, see `Note [Default methods in instances] (Wrinkle: Ambiguous types from vanilla method type signatures)`. The same problem arose in the code generated by `GeneralizedNewtypeDeriving`, as we also fix it here using the same technique. This time, we can take advantage of the fact that `GeneralizedNewtypeDeriving`-generated code _already_ brings method-bound type variables into scope via `TypeAbstractions` (after !13190), so it is very straightforward to visibly apply the type variables on the right-hand sides of equations. See `Note [GND and ambiguity]`. Fixes #14266. Fixes #25148. - - - - - 0a4da5d2 by ARATA Mizuki at 2024-09-25T17:09:41-04:00 Document primitive string literals and desugaring of string literals Fixes #17474 and #17974 Co-authored-by: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - ad0731ad by Zubin Duggal at 2024-09-25T17:10:18-04:00 rts: Fix segfault when using non-moving GC with profiling `nonMovingCollect()` swaps out the `static_flag` value used as a sentinel for `gct->scavenged_static_objects`, but the subsequent call `resetStaticObjectForProfiling()` sees the old value of `static_flag` used as the sentinel and segfaults. So we must call `resetStaticObjectForProfiling()` before calling `nonMovingCollect()` as otherwise it looks for the incorrect sentinel value Fixes #25232 and #23958 Also teach the testsuite driver about nonmoving profiling ways and stop disabling metric collection when nonmoving GC is enabled. - - - - - e7a26d7a by Sylvain Henry at 2024-09-25T17:11:00-04:00 Fix interaction between fork and kqueue (#24672) A kqueue file descriptor isn't inherited by a child created with fork. As such we mustn't try to close this file descriptor as we would close a random one, e.g. the one used by timerfd. Fix #24672 - - - - - 6863503c by Simon Peyton Jones at 2024-09-25T17:11:37-04:00 Improve GHC.Tc.Solver.defaultEquality This MR improves GHC.Tc.Solver.defaultEquality to solve #25251. The main change is to use checkTyEqRhs to check the equality, so that we do promotion properly. But within that we needed a small enhancement to LC_Promote. See Note [Defaulting equalites] (DE4) and (DE5) The tricky case is (alas) hard to trigger, so I have not added a regression test. - - - - - 97a6c6c3 by Sylvain Henry at 2024-09-25T17:12:18-04:00 JS: fix h$withCStringOnHeap helper (#25288) strlen returns the length of the string without the \0 terminating byte, hence CString weren't properly allocated on the heap (ending \0 byte was missing). - - - - - 5f7c20bc by Ben Gamari at 2024-09-26T04:14:05-04:00 base: Propagate `error` CallStack to thrown exception Previously `errorCallWithCallStackException` failed to propagate its `CallStack` argument, which represents the call-chain of the preceding `error` call, to the exception that it returned. Consequently, the call-stack of `error` calls were quite useless. Unfortunately, this is the second time that I have fixed this but it seems the first must have been lost in rebasing. Fixes a bug in the implementation of CLC proposal 164 <https://github.com/haskell/core-libraries-committee/issues/164> Fixes #24807. - - - - - c20d5186 by Matthew Pickering at 2024-09-26T04:14:42-04:00 driver: Fix -working-dir for foreign files -working-dir definitely needs more serious testing, there are some easy ways to test this. * Modify Cabal to call ghc using -working-dir rather than changing directory. * Modify the testsuite to run ghc using `-working-dir` rather than running GHC with cwd = temporary directory. However this will have to wait until after 9.12. Fixes #25150 - - - - - 88eaa7ac by Sylvain Henry at 2024-09-26T04:15:24-04:00 Enum deriving: reuse predError, succError, toEnumError Reuse predError, succError, and toEnumError when deriving Enum instances to avoid generating different error strings per instance. E.g. before this patch for every instance for a type FOO we would generate a string: "pred{FOO}: tried to take `pred' of first tag in enumeration"# - - - - - e9fa1163 by Sylvain Henry at 2024-09-26T04:15:24-04:00 Enum deriving: generate better code (#16364) Generate better code for Enum.toEnum: check both the lower and the upper bounds at once with an unsigned comparison. Initially I've used a type ascription with a call to 'fromIntegral', hence the slight refactoring of nlAscribe. Using 'fromIntegral' was problematic (too low in the module hierarchy) so 'enumIntToWord' was introduced instead. Combined with the previous commit, T21839c ghc/alloc decrease by 5% Metric Decrease: T21839c - - - - - 383af074 by Sylvain Henry at 2024-09-26T04:16:06-04:00 Core: add absorb rules for binary or/and (#16351) Rules: x or (x and y) ==> x x and (x or y) ==> x - - - - - 783c8b29 by Matthew Pickering at 2024-09-26T12:07:44-04:00 Don't compile `asBox` with -fprof-late The `asBox` function is intended to store exactly the closure which the user passes to it. Placing a cost centre on asBox introduces a thunk, which violates this expectation and can change the result of using asBox when profiling is enabled. See #25212 for more details and ample opportunity to discuss if this is a bug or not. - - - - - 0967dcc7 by Matthew Pickering at 2024-09-26T12:07:44-04:00 Fix normalisation of .prof files Fix 1: If a cost centre contained CAF then the normalisation was corrupted, now only check if CAF is at the start of a line. Fix 2: "no location info" contain a space, which messed up the next normalisation logic which assumed that columns didn't have spaced in. - - - - - 9eda1cb9 by Matthew Pickering at 2024-09-26T12:07:44-04:00 testsuite: Fix normalisation of prof_files removing newlines These normalisation steps were collapsing lines together, which made subsequent normalisation steps fail. ``` foo x y z CAF x y z qux x y z ``` was getting normalised to ``` foo x y z qux x y z ``` which means that subsequent line based filters would not work correctly. - - - - - 2b25f9e2 by Matthew Pickering at 2024-09-26T12:07:44-04:00 packaging: Enable late-ccs for release flavour This enables late cost centres when building profiled libraries and subsequently greatly improves the resolution of cost centre stacks when profiling. This patch also introduces the `grep_prof` test modifier which is used to apply a further filter to the .prof file before they are compared. Fixes #21732 ------------------------- Metric Increase: libdir ------------------------- - - - - - bb030d0d by Brandon Chinn at 2024-09-26T12:08:21-04:00 Replace manual string lexing (#25158) Metric Increase: MultilineStringsPerf This commit replaces the manual string lexing logic with native Alex lexing syntax. This aligns the lexer much closer to the Haskell Report, making it easier to see how the implementation and spec relate. This slightly increases memory usage when compiling multiline strings because we now have two distinct phases: lexing the multiline string with Alex and post-processing the string afterwards. Before, these were done at the same time, but separating them allows us to push as much logic into normal Alex lexing as possible. Since multiline strings are a new feature, this regression shouldn't be too noticeable. We can optimize this over time. - - - - - 16742987 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Revert !4655: Stop 'import "base" Prelude' removing implicit Prelude import This behaviour is problematic for the principle reason that `import Prelude` may not refer to the `base` package, and in which case importing an entirely unrelated module causing your implicit prelude to leave the scope is extremely surprising. See the added test for this example. Discussion on #17045. The secondary reason for reverting this patch is that "base" can't be a wired in package any more (see #24903), so we have to remove special logic which singles out base from the compiler. The rule for implicit shadowing is now simply: * If you write import Prelude (..) then you don't get an implicit prelude import * If you write import "foobar" Prelude (..) for all pkgs foobar, you get an implicit import of prelude. If you want to write a package import of Prelude, then you can enable `NoImplicitPrelude` for the module in question to recover the behaviour of ghc-9.2-9.10. Fixes #17045 - - - - - 57c50f41 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Rename COMPILING_BASE_PACKAGE to COMPILING_GHC_INTERNAL_PACKAGE The COMPILING_BASE_PACKAGE macro is concerned with issues defining symbols and using symbols in the same compilation unit. However, these symbols now exist in ghc-internal rather than base, so we should rename the macro accordingly. The code is guards is likely never used as we never produce windows DLLs but it is simpler to just perform the renaming for now. These days there is little doubt that this macro defined in this ad-hoc manner would be permitted to exist, but these days are not those days. Fixes #25221 - - - - - 70764243 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Preload ghc-internal rather than base This occurence of baseUnitId was missed when moving the bulk of internal definitions into `ghc-internal`. We need to remove this preloading of `base` now because `base` should not be wired in. Towards #24903 - - - - - 12915609 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Remove Data.List compat warning There is currently a warning implemented in -Wcompat which warns you when importing Data.List in a non-qualified manner. ``` A.hs:3:8: warning: [-Wcompat-unqualified-imports] To ensure compatibility with future core libraries changes imports to Data.List should be either qualified or have an explicit import list. | 3 | import Data.List | ^^^^^^^^^ Ok, one module loaded. ``` GHC ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/17244 CLC discussion: https://groups.google.com/g/haskell-core-libraries/c/q3zHLmzBa5E This warning was implemented as part of the migration to making Data.List monomorphic again (and to be used like Data.Set, Data.Map etc). That doesn't seem like it happened, and I imagine that the current CLC would require a new proposal anyway in order to do that now. It's not clear in any case what "future core libraries changes" we are waiting to happen before this warning can be removed. Given the first phase of the proposal has lasted 5 years it doesn't seem that anyone is motivated to carry the proposal to completion. It does seem a bit unnecessary to include a warning in the compiler about "future changes to the module" when there's no timeline or volunteer to implement these changes. The removal of this warning was discussed again at: https://github.com/haskell/core-libraries-committee/issues/269 During the discussion there was no new enthusiasm to move onto the next stages of the proposal so we are removing the warning to unblock the reinstallable "base" project (#24903) Fixes #24904 - - - - - d4e4d498 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Move Control.Monad.Zip into ghc-internal mzip is wired in and therefore needs to be in ghc-internal. Fixes #25222 Towards #24903 - - - - - d3dacdfb by Matthew Pickering at 2024-09-26T12:08:57-04:00 Unwire the base package This patch just removes all the functions related to wiring-in the base package and the `-this-unit-id=base` flag from the cabal file. After this commit "base" becomes just like any other package and the door is opened to moving base into an external repo and releasing base on a separate schedule to the rest of ghc. Closes #24903 - - - - - 1b39363b by Patrick at 2024-09-27T06:10:19-04:00 Add entity information to HieFile #24544 Enhanced HieFile to capture entity information for identifiers, enabling better support for language tools and protocols. See issue #24544 for more details. Work have been done: * Introduction of new data type `EntityInfo` in `GHC.Iface.Ext.Types`. * Add extra field `hie_entity_infos :: NameEntityInfo` to `HieFile` to store the mapping from entity name to corresponding entity infos in `GHC.Iface.Ext.Types`. * Compute `EntityInfo` for each entity name in the HieAst from `TyThing, Id, OccName` when generating the `HieFile` in `GHC.Iface.Ext.Ast`. * Add test T24544 to test the generation of `EntityInfo`. - - - - - 4f3618d8 by sheaf at 2024-09-27T06:10:57-04:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 10e431ef by sheaf at 2024-09-27T06:10:57-04:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 8238fb2d by sheaf at 2024-09-27T06:10:57-04:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 2cb7b748 by sheaf at 2024-09-27T06:10:57-04:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 0d2428d6 by sheaf at 2024-09-27T06:10:57-04:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - e6c19a41 by sheaf at 2024-09-27T06:10:57-04:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - f496ff7f by sheaf at 2024-09-27T06:10:57-04:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 5dd2a423 by sheaf at 2024-09-27T06:10:57-04:00 Add test for C calls & SIMD vectors - - - - - f824e1ee by sheaf at 2024-09-27T06:10:58-04:00 Add test for #25169 - - - - - d54db7f3 by sheaf at 2024-09-27T06:10:58-04:00 Fix #25169 using Plan A from the ticket We now compile certain low-level Cmm functions in the RTS multiple times, with different levels of vector support. We then dispatch at runtime in the RTS, based on what instructions are supported. See Note [realArgRegsCover] in GHC.Cmm.CallConv. Fixes #25169 ------------------------- Metric Increase: T10421 T12425 T18730 T1969 T9198 ------------------------- - - - - - d5f8778a by sheaf at 2024-09-27T06:10:58-04:00 Fix C calls with SIMD vectors This commit fixes the code generation for C calls, to take into account the calling convention. This is particularly tricky on Windows, where all vectors are expected to be passed by reference. See Note [The Windows X64 C calling convention] in GHC.CmmToAsm.X86.CodeGen. - - - - - f64bd564 by sheaf at 2024-09-27T06:10:58-04:00 X86 CodeGen: refactor getRegister CmmLit This refactors the code dealing with loading literals into registers, removing duplication and putting all the code in a single place. It also changes which XOR instruction is used to place a zero value into a register, so that we use VPXOR for a 128-bit integer vector when AVX is supported. - - - - - ab12de6b by sheaf at 2024-09-27T06:10:58-04:00 X86 genCCall: promote arg before calling evalArgs The job of evalArgs is to ensure each argument is put into a temporary register, so that it can then be loaded directly into one of the argument registers for the C call, without the generated code clobbering any other register used for argument passing. However, if we promote arguments after calling evalArgs, there is the possibility that the code used for the promotion will clobber a register, defeating the work of evalArgs. To avoid this, we first promote arguments, and only then call evalArgs. - - - - - 8fd12429 by sheaf at 2024-09-27T06:10:58-04:00 X86 genCCall64: simplify loadArg code This commit simplifies the argument loading code by making the assumption that it is safe to directly load the argument into register, because doing so will not clobber any previous assignments. This assumption is borne from the use of 'evalArgs', which evaluates any arguments which might necessitate non-trivial code generation into separate temporary registers. - - - - - 12504a9f by sheaf at 2024-09-27T06:10:58-04:00 LLVM: propagate GlobalRegUse information This commit ensures we keep track of how any particular global register is being used in the LLVM backend. This informs the LLVM type annotations, and avoids type mismatches of the following form: argument is not of expected type '<2 x double>' call ccc <2 x double> (<2 x double>) (<4 x i32> arg) - - - - - 2bb1e8df by Cheng Shao at 2024-09-27T06:11:35-04:00 Link bytecode from interface-stored core bindings in oneshot mode !13042 Part of #T25090 If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use Core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). When an interface is loaded into the EPS in `loadInterface` that has dehydrated Core bindings, an entry is added to the new field `eps_iface_bytecode`, containing an IO action that produces a bytecode `Linkable`, lazily processing the `mi_extra_decls` by calling `loadIfaceByteCode`. When Template Haskell dependencies are resolved in `getLinkDeps`, this action is looked up after loading a module's interface. If it exists, the action is evaluated and the bytecode is added to the set of `Linkable`s used for execution of the splice; otherwise it falls back on the traditional object file. Metric Decrease: MultiLayerModules T13701 - - - - - 7cb7172e by Matthew Pickering at 2024-09-27T06:12:12-04:00 ci: Fix variable inheritence for ghcup-metadata testing job Downstream in ghcup-ci we use the CONFIGURE_ARGS variable to determine how to setup all the different jobs. On the downstream trigger this was being inherited from the default setting in .gitlab.yml file. Therefore this led to job failures as the necessary CONFIGURE_ARGS were not being passed to the configure script when installing the bindist. See docs: * https://docs.gitlab.com/ee/ci/yaml/#inherit * https://docs.gitlab.com/ee/ci/yaml/#triggerforward 1. inherit:variables:fals - This stops the global variables being inherited into the job and hence forwarded onto the downstream job. 2. trigger:forward:* - yaml_variables: true (default) pass yaml variables to downstream, this is important to pass the upstream pipeline id to downstream. - pipeline_variables: false (default) but don't pass pipeline variables (normal environment variables). Fixes #25294 - - - - - 9ffd6163 by Leo at 2024-09-27T16:26:01+05:30 Fix typo in Prelude doc for (>>=) Fix a minor typo ("equivialent" instead of "equivalent") in the documentation for (>>=) in the prelude. - - - - - 5745dbd3 by Vladislav Zavialov at 2024-09-27T16:26:52+05:30 Wildcard binders in type declarations (#23501) Add support for wildcard binders in type declarations: type Const a b = a -- BEFORE: the `b` had to be named -- even if unused on the RHS type Const a _ = a -- AFTER: the compiler accepts -- a wildcard binder `_` The new feature is part of GHC Proposal #425 "Invisible binders in type declarations", and more specifically its amendment #641. Just like a named binder, a wildcard binder `_` may be: * plain: _ * kinded: (_ :: k -> Type) * invisible, plain: @_ * invisible, kinded: @(_ :: k -> Type) Those new forms of binders are allowed to occur on the LHSs of data, newtype, type, class, and type/data family declarations: data D _ = ... newtype N _ = ... type T _ = ... class C _ where ... type family F _ data family DF _ (Test case: testsuite/tests/typecheck/should_compile/T23501a.hs) However, we choose to reject them in forall telescopes and type family result variable binders (the latter being part of the TypeFamilyDependencies extension): type family Fd a = _ -- disallowed (WildcardBndrInTyFamResultVar) fn :: forall _. Int -- disallowed (WildcardBndrInForallTelescope) (Test case: testsuite/tests/rename/should_fail/T23501_fail.hs) See the new Notes: * Note [Type variable binders] * Note [Wildcard binders in disallowed contexts] To accommodate the new forms of binders, HsTyVarBndr was changed as follows (demonstrated without x-fields for clarity) -- BEFORE (ignoring x-fields and locations) data HsTyVarBndr flag = UserTyVar flag Name | KindedTyVar flag Name HsKind -- AFTER (ignoring x-fields and locations) data HsTyVarBndr flag = HsTvb flag HsBndrVar HsBndrKind data HsBndrVar = HsBndrVar Name | HsBndrWildCard data HsBndrKind = HsBndrNoKind | HsBndrKind LHsKind The rest of the patch is downstream from this change. To avoid a breaking change to the TH AST, we generate fresh names to replace wildcard binders instead of adding a dedicated representation for them (as discussed in #641). And to put a cherry on top of the cake, we now allow wildcards in kind-polymorphic type variable binders in constructor patterns, see Note [Type patterns: binders and unifiers] and the tyPatToBndr function in GHC.Tc.Gen.HsType; example: fn (MkT @(_ :: forall k. k -> Type) _ _) = ... (Test case: testsuite/tests/typecheck/should_compile/T23501b.hs) - - - - - ff2bdca2 by Matthew Pickering at 2024-09-27T16:27:08+05:30 ci: Push perf notes from wasm jobs It was observed in #25299 that we were failing to push performance numbers from the wasm jobs. In future we might want to remove this ad-hoc check but for now it's easier to add another special case. Towards #25299 - - - - - 4c76f75c by Zubin Duggal at 2024-09-27T16:44:00+05:30 Bump GHC version to 9.12 - - - - - e4ac1b0d by Zubin Duggal at 2024-09-27T19:12:24+05:30 Bump GHC version to 9.13 - - - - - da20cac1 by Andreas Klebinger at 2024-10-02T22:18:48-04:00 SpecConstr: Introduce a separate argument limit for forced specs. We used to put no limit at all on specializations forced via the SPEC argument. This isn't always reasonable so we introduce a very high limit that applies to forced specializations, a flag to control it, and we now emit a warning if we fail a specialization because we exceed the warning. Fixes #25197 - - - - - 39497eed by Andreas Klebinger at 2024-10-02T22:19:24-04:00 ghc-experimental: Expose primops and ghc extensions via GHC.PrimOps This will be the new place for functions that would have gone into GHC.Exts in the past but are not stable enough to do so now. Addresses #25242 - - - - - e9dc2690 by Sylvain Henry at 2024-10-02T22:20:06-04:00 RTS: cleanup timerfd file descriptors after a fork (#25280) When we init a timerfd-based ticker, we should be careful to cleanup the old file descriptors (e.g. after a fork). - - - - - 64e876bc by Rodrigo Mesquita at 2024-10-02T22:20:43-04:00 determinism: Deterministic MonadGetUnique LlvmM Update LlvmM to thread a unique deterministic supply (using UniqDSMT), and use it in the MonadGetUnique instance. This makes uniques sampled from LlvmM deterministic, which guarantees object determinism with -fllvm. Fixes #25274 - - - - - 36bbb167 by Matthew Pickering at 2024-10-02T22:21:18-04:00 Bump LLVM upper bound to allow LLVM 19 Also bumps the ci-images commit so that the deb12 images uses LLVM 19 for testing. ------------------------- Metric Decrease: size_hello_artifact_gzip size_hello_unicode_gzip ------------------------- Fixes #25295 - - - - - 0029ca91 by Matthew Pickering at 2024-10-02T22:21:54-04:00 configure: Allow happy-2.0.2 happy-2.0.2 can be used to compile GHC. happy-2.0 and 2.0.1 have bugs which make it unsuitable to use. The version bound is now == 1.20.* || >= 2.0.2 && < 2.1 Fixes #25276 - - - - - 92976985 by ARATA Mizuki at 2024-10-02T22:22:35-04:00 Use bundled llc/opt on Windows (#22438) - - - - - af59749a by Matthew Pickering at 2024-10-02T22:23:11-04:00 Fix registerArch for riscv64 The register allocator doesn't support vector registers on riscv64, therefore advertise as NoVectors. Fixes #25314 - - - - - a49e66fc by Matthew Pickering at 2024-10-02T22:23:11-04:00 riscv: Avoid using csrr instruction to test for vector registers The csrr instruction isn't allowed in qemu user-mode, and raises an illegal instruction error when it is encountered. Therefore for now, we just hard-code that there is no support for vector registers since the rest of the compiler doesn't support vector registers for riscv. Fixes #25312 - - - - - 115a30e9 by Andreas Klebinger at 2024-10-02T22:23:11-04:00 Add support for fp min/max to riscv Fixes #25313 - - - - - f28b5992 by Ben Gamari at 2024-10-02T22:23:47-04:00 testsuite/perf: Report better error message on malformed note Previously a malformed perf note resulted in very poor errors. Here we slight improve this situation. - - - - - 51377508 by Ben Gamari at 2024-10-02T22:23:47-04:00 testsuite: Handle division-by-zero more gracefully Previously we would fail with an ZeroDivisionError. Fixes #25321 - - - - - 50490075 by Matthew Pickering at 2024-10-03T05:55:13-04:00 ci: Add nightly & release ubuntu-22.04 jobs This adds build of bindists on ubuntu-22.04 on nightly and release pipelines. We also update ghcup-metadata to provide ubuntu-22.04 bindists on ubuntu-22.04. Fixes #25317 - - - - - 9cf1cef5 by Zubin Duggal at 2024-10-03T05:55:49-04:00 haddock: Bump binary interface version to 46. This allows haddock to give good error messages when being used on mismatched interface files. We bump to 46 since GHC 9.12 uses version 45: https://gitlab.haskell.org/ghc/ghc/-/commit/362afd632032ee8f174690c3ffe0015076b83ce6 This should have been done in e4ac1b0d281b85a0144d1ef6f84a1df00e236052 but was overlooked. - - - - - 2293c0b7 by Andreas Klebinger at 2024-10-03T05:56:25-04:00 Change versionig of ghc-experimental to follow ghc versions. Just like ghc-internal it will now use the @ProjectVersionForLib@ macro for versioning. This means for ghc=9.10.1, ghc-experimental's version will be 9.1001.0 and so on. This fixes #25289 - - - - - 876d6e0e by Ben Gamari at 2024-10-04T15:07:53+01:00 base: Add `HasCallStack` constraint to `ioError` As proposed in core-libraries-committee#275. - - - - - 9bfd9fd0 by Matthew Pickering at 2024-10-04T15:08:03+01:00 Fix toException method for ExceptionWithContext Fixes #25235 - - - - - ac004028 by Matthew Pickering at 2024-10-04T15:09:07+01:00 Exception rethrowing Basic changes: * Change `catch` function to propagate exceptions using the WhileHandling mechanism. * Introduce `catchNoPropagate`, which does the same as before, but passes an exception which can be rethrown. * Introduce `rethrowIO` combinator, which rethrows an exception with a context and doesn't add a new backtrace. * Introduce `tryWithContext` for a variant of `try` which can rethrow the exception with it's original context. * onException is modified to rethrow the original error rather than creating a new callstack. * Functions which rethrow in GHC.Internal.IO.Handle.FD, GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and GHC.Internal.System.IO.Error are modified to not add a new callstack. Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202> - - - - - bcb293f2 by Cheng Shao at 2024-10-04T17:59:28-04:00 testsuite: remove accidentally checked in debug print logic - - - - - 68e2da5a by Rodrigo Mesquita at 2024-10-05T10:36:15-04:00 Deprecation for WarnCompatUnqualifiedImports Fixes #25330 - - - - - 4327f0e8 by Andrew Lelechenko at 2024-10-05T10:36:52-04:00 Restrict Data.List.NonEmpty.unzip to NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) Implementing the final phase of CLC proposal https://github.com/haskell/core-libraries-committee/issues/86 - - - - - ceca9efb by Cheng Shao at 2024-10-06T02:18:31+00:00 driver: fix runWorkerLimit on wasm This commit fixes link-time unresolved symbol errors for sem_open etc on wasm, by making runWorkerLimit always behave single-threaded. This avoids introducing the jobserver logic into the final wasm module and thus avoids referencing the posix semaphore symbols. - - - - - 135fd1ac by Torsten Schmits at 2024-10-06T02:18:31+00:00 Parallelize getRootSummary computations in dep analysis downsweep This reuses the upsweep step's infrastructure to process batches of modules in parallel. I benchmarked this by running `ghc -M` on two sets of 10,000 modules; one with a linear dependency chain and the other with a binary tree. Comparing different values for the number of modules per thread suggested an optimum at `length targets `div` (n_cap * 2)`, with results similar to this one (6 cores, 12 threads): ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 1.775 s ± 0.026 s [User: 1.377 s, System: 0.399 s] Range (min … max): 1.757 s … 1.793 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 876.2 ms ± 20.9 ms [User: 1833.2 ms, System: 518.6 ms] Range (min … max): 856.2 ms … 898.0 ms 3 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 793.5 ms ± 23.2 ms [User: 2318.9 ms, System: 718.6 ms] Range (min … max): 771.9 ms … 818.0 ms 3 runs ``` Results don't differ much when the batch size is reduced to a quarter of that, but there's significant thread scheduling overhead for a size of 1: ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 2.611 s ± 0.029 s [User: 2.851 s, System: 0.783 s] Range (min … max): 2.591 s … 2.632 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 1.189 s ± 0.007 s [User: 2.707 s, System: 1.103 s] Range (min … max): 1.184 s … 1.194 s 2 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 1.097 s ± 0.006 s [User: 2.938 s, System: 1.300 s] Range (min … max): 1.093 s … 1.101 s 2 runs ``` Larger batches also slightly worsen performance. - - - - - 535a2117 by Daniel Díaz at 2024-10-06T09:51:46-04:00 Clarify the meaning of "exactly once" in LinearTypes Solves documentaion issue #25084. - - - - - 92f8939a by Krzysztof Gogolewski at 2024-10-06T09:52:22-04:00 Only allow (a => b) :: Constraint rather than CONSTRAINT rep Fixes #25243 - - - - - 4a2f0f13 by Alan Zimmerman at 2024-10-07T05:16:54-04:00 EPA: Remove unused hsCaseAnnsRest We never populate it, so remove it. - - - - - 5099057b by John Paul Adrian Glaubitz at 2024-10-07T05:17:40-04:00 rts: Fix invocation of __ieee_set_fp_control() on alpha-linux Fixes the following error when building GHC on alpha-linux: rts/posix/Signals.c: In function ‘initDefaultHandlers’: rts/posix/Signals.c:709:5: error: error: implicit declaration of function ‘ieee_set_fp_control’ [-Wimplicit-function-declaration] 709 | ieee_set_fp_control(0); | ^~~~~~~~~~~~~~~~~~~ | 709 | ieee_set_fp_control(0); | - - - - - c9590ba0 by Teo Camarasu at 2024-10-07T05:18:17-04:00 Add changelog entries for !12479 - - - - - bf9c9566 by Matthew Pickering at 2024-10-07T13:19:30-04:00 javascript: Read fields of ObjectBlock lazily When linking a module with a large dependency footprint too much of the object files were forced during linking. This lead to a large amount of memory taken up by thunks which would never be forced On the PartialDownsweep test this halves the memory required (from 25G to 13G). Towards #25324 ------------------------- Metric Increase: size_hello_obj ------------------------- - - - - - 571329df by Matthew Pickering at 2024-10-07T13:20:06-04:00 ci: Run the i386 validation job when i386 label is set This is helpful when making changes to base and must update the javascript and i386 base exports files. - - - - - e68f9aaf by Matthew Pickering at 2024-10-07T13:20:42-04:00 Rewrite partitionByWorkerSize to avoid pattern match checker bug With `-g3` the pattern match checker would warn about these incomplete patterns. This affects the debug_info builds on CI. ``` Pattern match(es) are non-exhaustive In an equation for ‘go’: Patterns of type ‘[a]’, ‘[a]’, ‘[SpecFailWarning]’ not matched: (_:_) _ _ | 2514 | go [] small warnings = (small, warnings) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ``` Workaround for #25338 - - - - - d915dc8b by Arnaud Spiwack at 2024-10-07T19:23:00-04:00 Remove the wrapper/coercion-passing logic for submultiplicity checks Instead, we use a dedicated DelayedError, which is emitted systematically on submultiplicity checks, but is suppressed if we can indeed solve the submultiplicity constraint with a reflexivity coercion. This way, we don't have to return anything from `tcSubMult`, which now looks like a regular constraint check, the rest is implementation detail. This removes all of the strange boilerplate that I'd been struggling with under the previous implementation. Even if submultiplicity checks are not properly constraints, this way it's contained entirely within a `WantedConstraint`. Much more pleasant. Closes #25128. - - - - - 1d226116 by Sven Tennie at 2024-10-07T19:23:37-04:00 AArch64: Implement switch/jump tables (#19912) This improves the performance of Cmm switch statements (compared to a chain of if statements.) - - - - - 3fe621dd by Mario Blažević at 2024-10-07T19:24:18-04:00 Fixes #25256, missing parens inside TH-printed pattern type signature - - - - - ea4b4391 by ARATA Mizuki at 2024-10-07T19:24:59-04:00 Better documentation for floatRange function Closes #16479 - - - - - ff09205c by Andreas Klebinger at 2024-10-07T19:25:35-04:00 Adjust progress message for hadrian to include cwd. Fixes #25335 - - - - - 5fd320da by Sven Tennie at 2024-10-07T19:26:12-04:00 CCallConv test: Align argument types The C calling convention / standard requires that arguments and their values are of the same type. - - - - - c6e5fd3d by Cheng Shao at 2024-10-07T19:26:47-04:00 hadrian: remove unused ghciWithDebugger field from flavour config This patch removes the ghciWithDebugger field from flavour config since it's actually not used anywhere. - - - - - 9c9c790d by sheaf at 2024-10-07T19:27:23-04:00 user's guide: update docs for X86 CPU flags This commit updates the section of the user's guide pertaining to X86 feature flags with the following changes: - the NCG backend now supports SIMD, so remove all text that says the contrary, - the LLVM backend does not "automatically detect" features, so remove any text that makes that claim. - - - - - a1ecc826 by Sven Tennie at 2024-10-08T13:36:03-04:00 ci: RISCV64 cross-compile testing This adds a validation job which tests that we can build a riscv64 cross compiler and build a simple program using it. We do not currently run the whole testsuite. Towards #25254 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - d5c2577f by Arnaud Spiwack at 2024-10-08T13:36:44-04:00 Remove unused accumulators in partition_errors - - - - - 55609880 by Andrzej Rybczak at 2024-10-09T16:41:46-04:00 Fix typo in the @since annotation of annotateIO - - - - - ef481813 by Alan Zimmerman at 2024-10-09T16:42:23-04:00 EPA: Remove [AddEpAnn] from (most of) HsExpr EPA: introduce EpAnnLam for lambda annotationsi, and remove `glAA` from `Parser.y`, it is the same as `glR` EPA: Remove unused annotation from XOpApp EPA: Use EpToken for XNPat and XNegApp EPA: specific anns for XExplicitTuple / XTuplePat / sumPatParens. EPA: Use specific annotation for MultiIf EPA: Move annotations into FunRhs EPA: Remove [AddEpAnn] from SigPat and ExprWithTySig EPA: Remove [AddEpAnn] from ArithSeq EPA: Remove [AddEpAnn] from HsProc EPA: Remove [AddEpAnn] from HsStatic EPA: Remove [AddEpAnn] from BindStmt EPA: Remove [AddEpAnn] from TransStmt EPA: Remove [AddEpAnn] from HsTypedSplice EPA: Remove [AddEpAnn] from HsUntypedSpliceExpr - - - - - 69960230 by Fabian Thorand at 2024-10-10T19:03:59+00:00 Handle exceptions from IO manager backend If an IO manager backend throws, it will not actually have registered the file descriptor. However, at that point, the IO manager state was already updated to assume the file descriptor is being tracked, leading to errors and an eventual deadlock down the line as documented in the issue #21969. The fix for this is to undo the IO manager state change in case the backend throws (just as we already do when the backend signals that the file type is not supported). The exception then bubbles up to user code. That way we make sure that 1. the bookkeeping state of the IO manager is consistent with the actions taken by the backend, even in the presence of unexpected failures, and 2. the error is not silent and visible to user code, making failures easier to debug. - - - - - 1587cccf by Hassan Al-Awwadi at 2024-10-11T03:52:36-04:00 Put RdrName in the foExt field of FieldOcc The main purpose of this commit is to rip RdrName out of FieldOcc, in accordance with #21592, and as a side note it has simplified the method we use to deal with ambiguity somewhat. To do the first, we make FieldOccs store (LIdP p) instead of always storing Located RdrName, and moved the readername to the extension points where necessary. For the second, well, we just turn an ambiguous RdrName into a unbound Name through mkUnboundName. Later during disambiguateRecordBinds of the type checking phase, we will try and do type-directed disambiguation based on the rdrName field (for now), so this hack works out fine. See Note [Ambiguous FieldOcc in record updates] for more details. There are two additional minor changes in this commit: * The HsRecSel constructor of HsExpr has been moved to the extension constuctors, since its really GHC specific. * HsProjection no longer has a Located DotFieldOcc as a field, but just a regular DotFieldOcc, since DotFieldOcc already wraps a located FieldLabelString co-authored by: @Jade <Jade512 at proton.me> @alt-romes <rodrigo.m.mesquita at gmail.com> - - - - - 2338a971 by Cheng Shao at 2024-10-11T03:53:13-04:00 driver: bail out when -fllvm is passed to GHC not configured with LLVM This patch makes GHC bail out with an proper error message when it's not configured with LLVM but users attempt to pass -fllvm, see #25011 and added comment for details. Fixes #25011 Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - 78ad81ec by Cristiano Moraes at 2024-10-11T03:53:55-04:00 configure: Find C++ probing when GCC version is the latest but G++ is old #23118 - - - - - 083703a1 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Consider Wanteds with rewriters as insoluble This MR fixes #25325 See GHC.Tc.Types.Constraint, Note [Insoluble Wanteds], especially (IW2) There is a small change in the error message for T14172, but it looks entirely acceptable to me. - - - - - 0dfaeb66 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Wibbles - - - - - 09d24d82 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Spelling errors - - - - - 694489ed by sheaf at 2024-10-11T03:55:14-04:00 LLVM: use sse4.2 instead of sse42 LLVM expects the former instead of the latter since version 3.4. Fixes #25019 - - - - - 06ae8507 by sheaf at 2024-10-11T03:55:14-04:00 LLVM: make SSE4.2 imply +popcnt For consistency with the NCG as well as with Clang and GCC, we make the SSE4.2 feature flag imply +popcnt when using the LLVM backend. Fixes #25353 - - - - - 3fe843c7 by Cheng Shao at 2024-10-11T03:55:50-04:00 Drop obsolete libffi Makefile This patch drops obsolete libffi Makefile from the tree, given it's completely unused since removal of make build system in !7094. - - - - - df70405c by Ben Gamari at 2024-10-11T03:56:26-04:00 ghc-internal: Fix incomplete matches on IOError As noted in #25362, these incomplete matches were previously not being warned about. They were easily addressed by use of `GHC.Internal.Event.Windows.withException`. Closes #25362. - - - - - 8584504b by Matthew Pickering at 2024-10-11T03:57:02-04:00 compiler: Fix orientation of GHC.Hs.Doc boot file We should be free to import things from Language.Haskell.Syntax in GHC modules. Therefore the the boot file for the loop between ImpExp and GHC.Hs.Doc was in the wrong place. Issue #21592 - - - - - d029f170 by Ben Gamari at 2024-10-11T23:43:17-04:00 testsuite: Normalise trailing digits from hole fits output The type variables in the holes fit output from `abstract_refinement_hole_fits` is quite sensitive to compiler configuration. Specifically, a slight change in the inlining behavior of `throw` changes type variable naming in `(>>=)` and a few others. Ideally we would make hole fits output more deterministic but in the meantime we simply normalise this difference away as it not relevant to the test's goal. - - - - - da5d7d0d by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Add test for #25066 - - - - - eb7ddae1 by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Fix #25066 As noted in #25066, the exception backtrace proposal introduced a rather subtle performance regression due to simplification producing Core which the demand analyser concludes may diverge with a precise exception. The nature of the problem is more completely described in the new Note [Hiding precise exception signature in throw]. The (rather hacky) solution we use here hides the problematic optimisation through judicious use of `noinline`. Ultimately however we will want a more principled solution (e.g. #23847). Fixes #255066 CLC proposal: https://github.com/haskell/core-libraries-committee/issues/290 Metric Decrease: T9872d - - - - - 0060ece7 by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Improve documentation of Control.Exception.Backtrace - - - - - 18f532f3 by Ben Gamari at 2024-10-11T23:43:53-04:00 Bump process submodule to v1.6.25.0 - - - - - a9a3badf by Hassan Al-Awwadi at 2024-10-11T23:44:29-04:00 Move HsInteger and HsRat to an extension constructor These constructors were only used during the TC stage, or during template haskell. It seemed clear that it was independent of the source syntax represented in L.H.S, and thus we removed it according to #21592. - - - - - 4dd30cba by Artem Pelenitsyn at 2024-10-11T23:45:09-04:00 Docs: Linear types: link Strict Patterns subsection Also, fix a bug in RST with missing newline before a listing. Co-authored-by: Arnaud Spiwack <arnaud at spiwack.net> - - - - - adca5f2b by Ben Gamari at 2024-10-11T23:45:45-04:00 users guide: Address remaining TODOs in eventlog format docs Closes #25296. - - - - - 9291c125 by Sylvain Henry at 2024-10-11T23:46:26-04:00 Fix z-encoding of tuples (#25364) Tuples with prefix/suffix strings weren't always properly encoded with their shortcut notations. Fix this. - - - - - c08b68bc by Sven Tennie at 2024-10-11T23:47:01-04:00 Delete constants that can be deduced There are macros in MachRegs.h to figure those out. - - - - - 8b402da2 by Zubin Duggal at 2024-10-12T20:36:57+00:00 hadrian: Handle broken symlinks properly when creating source dist directories If we have a broken symlink in the repository, don't try to `need` the symlink or the target of the symlink. Attempting to do so has `shake` attempt to read the target to compute its hash, which fails because the target doesn't exist. - - - - - 16f97667 by Zubin Duggal at 2024-10-12T20:36:57+00:00 hadrian: exclude cabal.project.symlink.broken from source archives Cabal 3.14 introduced a broken symlink in its testsuite. Unfortunately, this broke our source distribution as we use use `tar --dereference` to avoid issues with symlink compatibility on windows, and `tar --dereference` chokes when it encounters any broken symlinks. We can't get rid of `--dereference` because symlinks are generally broken on windows, so the only option is to exclude this file from source archives. see also https://github.com/haskell/cabal/issues/10442 - - - - - f1a2c9fc by Zubin Duggal at 2024-10-12T20:36:57+00:00 Bump Cabal submodule to 3.14 Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: haddock.Cabal - - - - - 745dd590 by Ben Gamari at 2024-10-14T09:13:12-04:00 users-guide: Document GHCi :where command Resolve #24509. - - - - - e9cc4699 by Alan Zimmerman at 2024-10-14T09:13:48-04:00 EPA: Remove [AddEpAnn] from IE, Pat and some Tys EPA: Remove [AddEpAnn] from LazyPat EPA: Remove [AddEpAnn] from RecordCon/RecordUpd/ConPat EPA: Remove [AddEpAnn] from HsFieldBind EPA: Remove [AddEpAnn] from PatSynBind EPA: Remove [AddEpAnn] from IPBind EPA: Remove [AddEpAnn] from FixSig EPA: Remove [AddEpAnn] from activation rules EPA: Remove [AddEpann] from SpecInstSig EPA: Remove [AddEpAnn] from MinimalSig EPA: Remove [AddEpAnn] from SCCFunSig EPA: Remove [AddEpAnn] from CompleteMatchSig EPA: Remove [AddEpAnn] from AnnSig, as used in PatSynSig, ClassOpSig, TypeSig EPA: Remove [AddEpAnn] from IEThingAbs EPA: Remove [AddEpAnn] from IEThingAll / IEThingWith EPA: Remove [AddEpAnn] from IEModuleContents EPA: Remove [AddEpAnn] from HsOpTy EPA: Remove [AddEpAnn] for various binders EPA: Remove [AddEpAnn] for HsIParamTy - - - - - 81a570bf by Sebastian Graf at 2024-10-14T22:15:31-04:00 Desugaring, plus -Wincomplete-record-selectors This commit does several related things: * Major refactor of the handling of applications in the desugarer. Now all applications are handled in `dsApp`, `ds_app` and related functions. This dramatically simplifies the code and removes complicated cruft that had accumulated. Hooray. Fixes #25281. * Improve the handling of -Wincomplete-record-selectors. We now incorporate the result type of unsaturated record selector applications as well as consider long-distance information in getField applications. Plus, the implmentation now builds the improved `dsApp` stuff above, so it is much easier to understand. Plus, incorporates improved error message wording suggested by Adam Gundry in !12685. Fixes #24824, #24891 See the long Note [Detecting incomplete record selectors] * Add -Wincomplete-record-selectors to -Wall, as specified in GHC Proposal 516. To do this, I also had to add -Wno-incomplete-record-selectors to the build flags for Cabal in GHC's CI. See hadrian/src/Settings/Warnings.hs. We can remove this when Cabal is updated so that it doesn't trigger the warning: https://github.com/haskell/cabal/issues/10402 2.6% decrease in compile time allocation in RecordUpPerf Metric Decrease: RecordUpdPerf - - - - - ae7bc08e by Simon Peyton Jones at 2024-10-14T22:15:31-04:00 Elmininate incomplete record selectors This patch is a pure refactor of GHC's source code, to avoid the use of partial record selectors. It was provoked by adding -Wincomplete-record-selectors to -Wall (as the GHC Proposal specified), which in turn showed up lots of places where GHC was using incomplete record selectors. This patch does mostly-simple refactoring to make it clear to the pattern match checker that there is in fact no partiality. There is one externally-visible change: I changed the data type HoleFit to split out the two cases data HoleFit = TcHoleFit TcHoleFit | RawHoleFit SDoc data TcHoleFit = HoleFit { ...lots of fields } There are large swathes of code that just deal with `TcHoleFit`, and having it as a separate data types makes it apparent that `RawHoleFit` can't occur. This makes it much better -- but the change is visible in the HolePlugin interface. I decided that there are so few clients of this API that it's worth the change. I moved several functions from Language.Haskell.Syntax to GHC.Hs. Reason, when instantiated at (GhcPass _), the extension data construtcor is guaranteed unused, and that justifies omitted patterns in these functions. By putting them in GHC.Hs.X I can specialise the type for (GhcPass _) and thereby make the function total. An interesting side-light is that there were a few local function definitions without a type signature, like this one in GHC.Parser.Header convImport (L _ i) = (ideclPkgQual i, reLoc $ ideclName i) This is fully closed, and so is generalised; but that generalises it to any old pass, not (GhcPass _), so GHC rightly complains about the use of the selector `ideclPkgQual`. I added a type signature to `i`, thus convImport (L _ (i::ImportDecl GhcPs)) = (ideclPkgQual i, reLoc $ ideclName i) which specialised the function enough to make the record selector complete. Quite a surprising consequence of local let-generalisation! - - - - - 6a067226 by Simon Peyton Jones at 2024-10-14T22:15:31-04:00 Add -Werror=-Wno-error=incomplete-record-selectors to hadrian-multi In the main MR, -Wall now includes -Wincomplete-record-selectors. However `hadrian-multi` has many, many warnings about incomplete record selectors, so this patch stops those warnings being treated as errors. (See discussion on !13308.) A better fix would be to remove the use of incomplete record selectors, since each of them represents a potential crash. - - - - - edeafc14 by Ben Gamari at 2024-10-14T22:16:08-04:00 users-guide: Document field coalescence - - - - - 55b83587 by ARATA Mizuki at 2024-10-14T22:16:49-04:00 LLVM backend: Use correct rounding for Float literals Fixes #22033 - - - - - e59fe5c6 by Hassan Al-Awwadi at 2024-10-15T08:25:33+00:00 Changed import from Ghc. module to L.H.S module Progresses #21592 For some reason we still imported GHC.Types.Fixity when the definitino of Fixity and LexicalFixity have already been moved to Language.Haskell.Syntax.Basic. This fixes that for - - - - - ab1767d5 by Simon Peyton Jones at 2024-10-15T23:45:04-04:00 Add a release-notes entry for -Wincomplete-record-selectors - - - - - 6f0a62db by ur4t at 2024-10-16T15:33:43+00:00 GHCi: fix improper location of ghci_history file Fixes #24266 - - - - - 5f67db48 by Alan Zimmerman at 2024-10-17T05:18:43-04:00 EPA: Remove [AddEpAnn] commit 3 EPA: Remove [AddEpAnn] from HsDocTy EPA: Remove [AddEpAnn] from HsBangTy EPA: Remove [AddEpAnn] from HsExplicitListTy EPA: Remove [AddEpAnn] from HsExplicitTupleTy EPA: Remove [AddEpAnn] from HsTypedBracket EPA: Remove [AddEpAnn] from HsUntypedBracket EPA: Remove [AddEpAnn] from PatBuilderOpApp EPA: break out 'EpToken "|"' from ClassDecl anns EPA: Remove [AddEpAnn] from ClassDecl EPA: Remove [AddEpAnn] from SynDecl - - - - - fbbbd010 by Daan Rijks at 2024-10-17T05:19:19-04:00 Expand the haddocks for Control.Category - - - - - 076c1a10 by Andrew Lelechenko at 2024-10-17T05:19:19-04:00 documentation: more examples for Control.Category - - - - - 90891962 by Cheng Shao at 2024-10-17T16:41:18+00:00 ghci: mitigate host/target word size mismatch in BCOByteArray serialization This patch mitigates a severe host/target word size mismatch issue in BCOByteArray serialization logic introduced since !12142, see added note for detailed explanation. - - - - - 839ac52e by Cheng Shao at 2024-10-17T16:41:18+00:00 ghci: use plain malloc for mkConInfoTable on non-TNTC platforms This patch avoids using mmap() to allocate executable memory for mkConInfoTable on platforms without tables-next-to-code, see added comment for explanation. - - - - - a998f69d by Cheng Shao at 2024-10-17T16:41:18+00:00 ghc-internal: add missing CPPs for wasm This patch adds some missing CPP guards to ghc-internal, given those functions are non existent on wasm and would cause linking issues. - - - - - 71a471e7 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: rename prelude.js to prelude.mjs This commit renames prelude.js to prelude.mjs for wasm backend rts jsbits, and slightly adjusts the jsbits contents. This is for preparing the implementation of dyld.mjs that contains wasm dynamic linker logic, which needs to import prelude.mjs as a proper ESM module. - - - - - 33d9db17 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: add __wrapped_freeJSVal This commit wraps imported freeJSVal in a __wrapped_freeJSVal C function for wasm backend RTS. In general, wasm imports are only supposed to be directly called by C; they shouldn't be used as function pointers, which confuses wasm-ld at link-time when generating shared libraries. - - - - - 0d0a16a8 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: correct stale link in comment - - - - - 90a35c41 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: drop interpretBCO support from non-dyn ways on wasm This commit drops interpretBCO support from non dynamic rts ways on wasm. The bytecode interpreter is only useful when the RTS linker also works, and on wasm it only works for dynamic ways anyway. An additional benefit of dropping interpretBCO is reduction in code size of linked wasm modules, especially since interpretBCO references ffi_call which is an auto-generated large function in libffi-wasm and unused by most user applications. - - - - - 98a32ec5 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: don't build predefined GloblRegs for wasm PIC mode This commit wraps the predefined GlobalRegs in Wasm.S under a CPP guard to prevent building for PIC mode. When building dynamic ways of RTS, the wasm globals that represent STG GlobalRegs will be created and supplied by dyld.mjs. The current wasm dylink convention doesn't properly support exporting relocatable wasm globals at all, any wasm global exported by a .so is assumed to be a GOT.mem entry. - - - - - bef94bde by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: fix conflicting StgRun definitions on wasm This commit fixes conflicting StgRun definition when building dynamic ways of RTS for wasm in unregisterised mode. - - - - - a6a82cdb by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: use targetSupportsRPaths predicate This commit changes the hostSupportsRPaths predicate to targetSupportsRPaths and use that to decide whether to pass RPATH-related link-time options. It's not applied to stage0, we should just use the default link-time options of stageBoot ghc. - - - - - f232c872 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: disable internal-interpreter of ghc library when cross compiling This commit disable the internal-interpreter flag of ghc library when cross compiling, only external interpreter works in such cases. - - - - - 577c1819 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: enable internal-interpreter for ghc-bin stage0 This commit enables internal-interpreter flag for ghc-bin even when compiling stage0, as long as target supports ghci. It enables ghci functionality for cross targets that support ghci, since cross ghc-bin is really stage0. - - - - - c247f2ee by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: fix CFLAGS for gmp shared objs on wasm This commit adds -fvisibility=default to CFLAGS of gmp when building for wasm. This is required to generate the ghc-bignum shared library without linking errors. Clang defaults to -fvisibility=hidden for wasm targets, which will cause issues when a symbol is expected to be exported in a shared library but without explicit visibility attribute annotation. - - - - - 775410fd by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: re-enable PIC for gmp on wasm This commit re-enables --with-pic=yes configuration option of gmp when building for wasm, given we're about to include support for shared libraries, TH and ghci. - - - - - b45080a3 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: add the host_fully_static flavour transformer This commit adds the host_fully_static flavour transformer to hadrian, which ensures stage0 is fully statically linked while still permitting stage1 libdir to contain shared libraries. This is intended to be used by the wasm backend to build portable linux bindists that contain wasm shared libraries. - - - - - 5043507c by Cheng Shao at 2024-10-17T16:41:18+00:00 ci: update wasm jobs configuration This commit bumps ci-image revision to use updated wasm toolchain, and use host_fully_static instead of fully_static for wasm jobs so to ensure wasm shared libraries can be properly built. - - - - - 2956a3f7 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian/testsuite: implement config.cross logic This commit implements the config.cross field in the testsuite driver. It comes from the "cross compiling" ghc info field for both in-tree/out-of-tree GHC, and is an accurate predicate of whether we're cross-compiling or not (compared to the precense of target emulator), and is useful to implement predicates to assert the precense of internal interpreter (only available on non-cross GHC) for tests that do require it (e.g. plugins). - - - - - 8c74a0ed by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian/compiler: implement targetRTSLinkerOnlySupportsSharedLibs This patch implements the targetRTSLinkerOnlySupportsSharedLibs predicate in hadrian. Its definition in hadrian is the single source of truth, and the information propagates to ghc settings file, ghc driver and testsuite driver. It is used in various places to ensure dynamic dependency is selected when the target RTS linker only supports loading dynamic code. - - - - - b4c3c340 by Cheng Shao at 2024-10-17T16:41:18+00:00 testsuite: don't use host cpu features when testing cross ghc This patch disables CPU feature detection logic when testing cross GHC, since those features don't make sense for the target anyway. - - - - - 3c21b696 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: implement & use req_plugins predicate This commit implements req_plugins predicate to indicate that the test requires plugin functionality. Currently this means cross GHC is disabled since internal-interpreter doesn't work in cross GHC yet. - - - - - 93b8af80 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: make use of config.interp_force_dyn This commit takes config.interp_force_dyn into consideration when setting up TH/ghci way flags. - - - - - 94673d41 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: bump T17572 timeout - - - - - 2b5efc2d by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: bump T22744 pre_cmd timeout - - - - - 45102e2a by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip terminfo_so for cross ghc - - - - - 05e40406 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: fix shared library size tests for cross ghc This commit fixes shared library size tests (e.g. array_so in testsuite/tests/perf/size/all.T) when testing cross ghc. Previously, if shared library file extension of host and target differs, those tests will fail with framework errors due to not finding the right files. - - - - - fa68f833 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip ghc api tests that attempt to spawn processes inside wasm This commit skips a few ghc api tests on wasm, since they would attempt to spawn processes inside wasm, which is not supported at all. - - - - - 1241c04e by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip T22840 due to broken -dtag-inference-checks on wasm - - - - - 78c8b900 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: ensure $(ghciWayFlags) can be overridden This commit revises boilerplate.mk in testsuite as well as a few other places, to ensure the tests that do make use of $(ghciWayFlags) can receive the right $(ghciWayFlags) from testsuite driver config. - - - - - 47989ecc by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: skip rdynamic on wasm - - - - - fefb4ea1 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: skip T2615 on wasm This commit marks T2615 as skip on wasm, given LD_* environment variables aren't supported on wasm anyway. - - - - - 77c79762 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: mark MultiLayerModulesTH_Make/MultiLayerModulesTH_OneShot as fragile on wasm - - - - - 69bb4745 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: fix T16180 on wasm This commit fixes T16180 on wasm once TH support is flipped on. The fix is simply adding right asm code for wasm. - - - - - 621c753d by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: fix -fexternal-interpreter flag for JS backend Previously, -fexternal-interpreter is broken for JS backend, since GHC would attempt to launch a non-existent ghc-iserv* executable. This commit fixes it by adjusting pattern matching order in setTopSessionDynFlags. - - - - - 80aa8983 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: use interpreterDynamic predicate in preloadLib This commit use the interpreterDynamic predicate in preloadLib to decide if we should do dynLoadObjs instead of loadObj. Previously we used hostIsDynamic which was only written with non-cross internal interpreter in mind. The testsuite is also adjusted to remove hard-wired -fPIC flag for cbits (doesn't work in i386 RTS linker in vanilla way, #25260) and properly pass ghc_th_way_flags to ghc. - - - - - 74411461 by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix Cmm dynamic CLabels for wasm This commit fixes the handling of dynamic CLabels for the wasm backend. Just do the simplest handling: preserve the original CLabel, both unreg/NCG backends can handle them properly without issue. - - - - - f6abaf13 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: add necessary compile-time flags for wasm PIC mode This commit adds necessary compile-time flags when compiling for wasm PIC mode, see added comment for detailed explanation. - - - - - 9745fcfb by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: add necessary link-time flags for wasm shared libs This commit adds necessary link-time flags for wasm shared libs, see added comments for detailed explanation. - - - - - 649aae00 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: enforce -fno-use-rpaths for wasm This commit ensures the GHC driver never passes any RPATH-related link-time flags on wasm, which is not supported at all. - - - - - 47baa904 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: ensure static archives are picked when linking static .wasm modules This commit ensures static archives are picked when linking .wasm modules which are supposed to be fully static, even when ghc may be invoked with -dynamic, see added comment for explanation. - - - - - fc3a5591 by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix dynamic_too_enable for targets that require dynamic libraries This commit fixes dynamic_too_enable for targets whose RTS linker can only load dynamic code. - - - - - 94ef949e by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix checkNonStdWay for targets that require dynamic libraries This commit fixes checkNonStdWay to ensure that for targets whose RTS linker can only load dynamic code, the dynamic way of object is selected. - - - - - 88e99248 by Cheng Shao at 2024-10-17T16:41:24+00:00 ghc-bin: enforce dynamic way when the target requires so This commit makes ghc-bin use dynamic way when it is doing interactive stuff on certain targets whose RTS linker can only handle dynamic code. - - - - - 549582ef by Cheng Shao at 2024-10-17T16:41:24+00:00 hadrian/ghci: add wasm dyld This commit adds the wasm dynamic linker implementation, as well as ghci logic to call it and hadrian logic to install it to the correct location. See the top-level note in utils/jsffi/dyld.mjs for more details. - - - - - b562e3a6 by Cheng Shao at 2024-10-17T16:41:29+00:00 driver: fix getGccSearchDirectory for wasm target This commit fixes getGccSearchDirectory logic for wasm target, ensures the correct search directory containing libc.so etc can be found by GHC. getGccSearchDirectory is also exported so it can be used elsewhere to obtain the wasi-sdk libdir and pass to the dyld script. - - - - - 2d6107dc by Cheng Shao at 2024-10-17T16:41:29+00:00 driver: add wasm backend iserv logic This commit adds wasm backend iserv logic to the driver, see added comments for explanation. - - - - - 61f5baa5 by Cheng Shao at 2024-10-17T16:41:29+00:00 compiler: add PIC support to wasm backend NCG This commit adds support for generating PIC to the wasm backend NCG. - - - - - 652e7239 by Cheng Shao at 2024-10-17T16:41:29+00:00 hadrian/compiler: flip on support for shared libs & ghci for wasm This commit flips on the support for shared libs and ghci for the wasm target, given all required support logic has been added in previous commits. - - - - - 74a1f681 by Cheng Shao at 2024-10-17T16:41:29+00:00 testsuite: flip on support for shared libs, TH & ghci for wasm This commit flips on support for shared libs, TH & ghci for wasm in the testsuite, given support has been landed in previous commits. - - - - - 525d451e by Cheng Shao at 2024-10-17T23:03:34-04:00 Revert "compiler: start deprecating cmmToRawCmmHook" This reverts commit 1c064ef1f3e1aa2afc996e962ad53effa99ec5f4. Turns out the GHC-WPC project does use it to observe Cmm in the pipeline, see #25363. - - - - - 5bcfefd5 by Cheng Shao at 2024-10-17T23:04:09-04:00 rts: fix pointer overflow undefined behavior in bytecode interpreter This patch fixes an unnoticed undefined behavior in the bytecode interpreter. It can be caught by building `rts/Interpreter.c` with `-fsanitize=pointer-overflow`, the warning message is something like: ``` rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13 rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13 rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13 ``` Whenever we do something like `SpW(-1)`, the negative argument is implicitly converted to an unsigned integer type and causes pointer arithmetic overflow. It happens to be harmless for most targets since overflowing would wrap the result to desired value, but it's still coincidental and undefined behavior. Furthermore, it causes real damage to the wasm backend, given clang-20 will emit invalid wasm code that crashes at run-time for this kind of C code! (see https://github.com/llvm/llvm-project/issues/108770) The fix here is adding some explicit casts to ensure we always use the signed `ptrdiff_t` type as right hand operand of pointer arithmetic. - - - - - eb67875f by Matthew Craven at 2024-10-18T12:18:35+00:00 Bump transformers submodule The svg image files mentioned in transformers.cabal were previously not checked in, which broke sdist generation. - - - - - 366a1109 by Matthew Craven at 2024-10-18T12:18:35+00:00 Remove reference to non-existent file in haddock.cabal - - - - - 826852e9 by Matthew Craven at 2024-10-18T12:18:35+00:00 Move tests T11462 and T11525 into tests/tcplugins - - - - - dbe27152 by Matthew Craven at 2024-10-18T12:18:35+00:00 Repair the 'build-cabal' hadrian target Fixes #23117. Fixes #23281. Fixes #23490. This required: * Updating the bit-rotted compiler/Setup.hs and its setup-depends * Listing a few recently-added libraries and utilities in cabal.project-reinstall * Setting allow-boot-library-installs to 'True' since Cabal now considers the 'ghc' package itself a boot library for the purposes of this flag Additionally, the allow-newer block in cabal.project-reinstall was removed. This block was probably added because when the libraries/Cabal submodule is too new relative to the cabal-install executable, solving the setup-depends for any package with a custom setup requires building an old Cabal (from Hackage) against the in-tree version of base, and this can fail un-necessarily due to tight version bounds on base. However, the blind allow-newer can also cause the solver to go berserk and choose a stupid build plan that has no business succeeding, and the failures when this happens are dreadfully confusing. (See #23281 and #24363.) Why does setup-depends solving insist on an old version of Cabal? See: https://github.com/haskell/cabal/blob/0a0b33983b0f022b9697f7df3a69358ee9061a89/cabal-install/src/Distribution/Client/ProjectPlanning.hs#L1393-L1410 The right solution here is probably to use the in-tree cabal-install from libraries/Cabal/cabal-install with the build-cabal target rather than whatever the environment happens to provide. But this is left for future work. - - - - - b3c00c62 by Matthew Craven at 2024-10-18T12:18:35+00:00 Revert "CI: Disable the test-cabal-reinstall job" This reverts commit 38c3afb64d3ffc42f12163c6f0f0d5c414aa8255. - - - - - a04959b8 by Daneel Yaitskov at 2024-10-19T09:34:15-04:00 base: speed up traceEventIO and friends when eventlogging is turned off #17949 Check the RTS flag before doing any work with the given lazy string. Fix #17949 Co-authored-by: Michael Peyton Jones <me at michaelpj.com> Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - eff16c22 by Matthew Pickering at 2024-10-19T21:55:55-04:00 ci: Add support for ONLY_JOBS variable to trigger any validation pipeline By setting the ONLY_JOBS variable to the name of the job (or multiple jobs), the resulting pipeline will include a validation job for that pipeline. For example - if you set ONLY_JOBS="x86_64-linux-ubuntu22_04-validate" then a ubuntu22_04 job will be included in the validation pipeline. This is useful for testing specific jobs. Fixes #25332 - - - - - 280b6278 by Zubin Duggal at 2024-10-19T21:56:31-04:00 rel-eng: ghcup metadata generation: generated yaml anchors with meaningful names (cherry picked from commit d83f5bd730a8aef37d8a38b3560590d9798f8e45) - - - - - 25edf849 by Alan Zimmerman at 2024-10-19T21:57:08-04:00 EPA: Remove [AddEpAnn] Commit 4 EPA: Remove [AddEpAnn] from DataDecl This is quite a big change. The most important part is moving the annotations into HsDataDefn, using a specific annotation data type. It has a knock-on to everything that uses HsDataDefn EPA: Remove [AddEpAnn] for FunDep EPA: Remove [AddEpann] from FamilyDecl EPA: Remove [AddEpAnn] From InjectivityAnn EPA: Remove [AddEpAnn] from DefaultDecl EPA: Remove [AddEpAnn] from RuleDecls EPA: Remove [AddEpAnn] from Warnings - - - - - d5f42045 by Luite Stegeman at 2024-10-20T16:34:47-04:00 Interpreter: Add locking for communication with external interpreter This adds locking to communication with the external interpreter to prevent concurrent tasks interfering with each other. This fixes Template Haskell with the external interpreter in parallel (-j) builds. Fixes #25083 - - - - - d6bfea76 by Matthew James Kraai at 2024-10-20T16:35:29-04:00 Use monospace font for "Either a b" in fmap docs The documentation for fmap shows "`Either a b`" in the default font instead of showing "Either a b" in a monospace font. - - - - - 4bc7f9c8 by Luite Stegeman at 2024-10-20T16:36:15-04:00 Parser: remove non-ASCII characters from Parser.y Non-ASCII characters in the source causes a problem with the default Haskell Language Server setup in VSCode. Two characters seems to have been left in by accident. Workaround for #25396 - - - - - 7f61ed4e by Alan Zimmerman at 2024-10-21T06:39:45-04:00 EPA: Remove [AddEpAnn] Commit 5 EPA: Remove [AddEpAnn] from AnnPragma EPA: Remove [AddEpAnn] From ForeignDecl EPA: Remove [AddEpAnn] from RoleAnnotDecl EPA: Remove [AddEpAnn] from StandaloneKindSig EPA: Remove [AddEpAnn] From HsDeriving EPA: Remove [AddEpAnn] from ConDeclField EPA: Remove [AddEpAnn] from ConDeclGADT EPA: Remove [AddEpAnn] from ConDeclH98 EPA: Remove [AddEpAnn] from ClsInstDecl - - - - - f8694fe7 by Cheng Shao at 2024-10-21T06:40:21-04:00 wasm: bump dyld v8 heap size limit This patch adds `--max-old-space-size=8192` to wasm dyld shebang arguments to bump V8 heap size limit. The default limit (`heap_size_limit` returned by `v8.getHeapStatistics()`) is dynamically determined and a bit too low under certain workloads, and V8 would waste too much CPU time to garbage collect old generation heap more aggressively. Bumping the limit to 8G doesn't imply dyld would really take that much memory at run-time, but it lessens V8 heap stress significantly. - - - - - d328d173 by Luite Stegeman at 2024-10-21T12:39:18+00:00 Add requestTickyCounterSamples to GHC.Internal.Profiling This allows the user to request ticky counters to be written to the eventlog at specific times. See #24645 - - - - - 71765b1d by Simon Peyton Jones at 2024-10-21T20:55:00-04:00 Move defaulting code into a new module GHC.Tc.Solver had reached 4,000 lines -- although quite a lot of them are comments. This MR * Adds the new module GHC.Tc.Solver.Default, which has all the complex, but well modularised, defaulting code * Moves a bit of code from GHC.Tc.Solver into the existing GHC.Tc.Solver.Solve. Notably solveWanteds and simplifyWantedsTcM, which are called from GHC.Tc.Solver.Default It's a pure refactor. No code changes. - - - - - a398227b by Simon Peyton Jones at 2024-10-21T20:55:00-04:00 Improve the generalisation code in Solver.simplifyInfer The code in `decideQuantification` has become quite complicated. This MR straightens it out, adds a new Note, and on the way fixes #25266. See especially Note [decideAndPromoteTyVars] which is is where all the action happens in this MR. - - - - - 148059fe by Andrzej Rybczak at 2024-10-21T20:55:40-04:00 Adjust catches to properly rethrow exceptions https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13302 implemented exception rethrowing proposal, but it didn't adjust `catches`. This fixes it. - - - - - 25121dbc by doyougnu at 2024-10-22T09:38:18-04:00 linker: add --optimistic-linking flag This patch adds: - the --optimistic-linking flag which binds unknown symbols in the runtime linker to 0xDEADBEEF instead of exiting with failure - The test T25240 which tests these flags using dead code in the FFI system. - closes #25240 This patch is part of the upstreaming haskell.nix patches project. - - - - - f19e076d by doyougnu at 2024-10-22T09:38:18-04:00 ghc-internal: hide linkerOptimistic in MiscFlags - - - - - edc02197 by Cheng Shao at 2024-10-22T09:38:54-04:00 hadrian: fix bindist executable wrapper logic for cross targets This commit fixes an oversight of hadrian wrapper generation logic: when doing cross compilation, `wrapper` is called on executable names with cross prefix, therefore we must use `isSuffixOf` when matching to take the cross prefix into account. Also add missing cross prefix to ghci wrapper content and fix hsc2hs wrapper logic. - - - - - edf3bdf5 by Andreas Klebinger at 2024-10-22T16:30:42-04:00 mkTick: Push ticks through unsafeCoerce#. unsafeCoerce# doesn't exist at runtime so we should treat it like a Cast for the purpose of mkTick. This means if we have `{-# SCC foo #-} (unsafeCoerce# trivial_expr))` we now push the scope part of the cost centre up to `trivial_expr` at which point we can discard it completely if the expression is trivial enough. This fixes #25212. - - - - - 1bdb1317 by Cheng Shao at 2024-10-22T16:31:17-04:00 hadrian: enable late-CCS for perf flavour as well This patch enables late-CCS for perf flavour so that the testsuite can pass for perf as well. Fixes #25308. - - - - - fde12aba by Cheng Shao at 2024-10-22T16:31:54-04:00 hadrian: make sure ghc-bin internal-interpreter is disabled for stage0 when not cross compiling This patch disables internal-interpreter flag for stage0 ghc-bin when not cross compiling, see added comment for explanation. Fixes #25406. - - - - - 6ab8d751 by ignatiusm at 2024-10-24T01:23:35-04:00 Improve heap overflow exception message (#25198) Catch heap overflow exceptions and suggest using `+RTS -M<size>`. Fix #25198 - - - - - b3f7fb80 by Rodrigo Mesquita at 2024-10-24T01:24:12-04:00 determinism: Interface re-export list det In 'DocStructureItem' we want to make sure the 'Avails' are sorted, for interface file determinism. This commit introduces 'DetOrdAvails', a newtype that should only be constructed by sorting Avails with 'sortAvails' unless the avails are known to be deterministically ordered. This newtype is used by 'DocStructureItem' where 'Avails' was previously used to ensure the list of avails is deterministically sorted by construction. Note: Even though we order the constructors and avails in the interface file, the order of constructors in the haddock output is still determined from the order of declaration in the source. This was also true before, when the list of constructors in the interface file <docs> section was non-deterministic. Some haddock tests such as "ConstructorArgs" observe this (check the order of constructors in out/ConstructorArgs.html vs src/ConstructorArgs.hs vs its interface file) The updated tests are caused by haddock corners where the order in the source is not preserved (and was non-deterministic before this PR): * Module header in the latex backend * Re-export of pattern synonyms associated to a datatype (#25342) Fixes #25304 - - - - - e39c8c99 by Rodrigo Mesquita at 2024-10-24T01:24:12-04:00 Revert "ci: Allow abi-test to fail." After #25304, the abi-test with interface and object determinism succeeds. This reverts commit 7b37afc9f3e79559055488998ee73187886a0e00. - - - - - 7b1b0c6d by Alan Zimmerman at 2024-10-24T13:07:02-04:00 EPA: reduce [AddEpann] in AnnList Remove it from the `al_rest` field, and make `AnnList` parameterized on a type to be used in `al_rest`, for the various use cases. - - - - - 4a00731e by Rodrigo Mesquita at 2024-10-24T13:07:38-04:00 Fix -fobject-determinism flag definition The flag should be defined as an fflag to make sure the -fno-object-determinism flag is also an available option. Fixes #25397 - - - - - 55e4b9f2 by Sebastian Graf at 2024-10-25T07:01:54-04:00 CorePrep: Attach evaldUnfolding to floats to detect more values See `Note [Pin evaluatedness on floats]`. - - - - - 9f57c96d by Sebastian Graf at 2024-10-25T07:01:54-04:00 Make DataCon workers strict in strict fields (#20749) This patch tweaks `exprIsConApp_maybe`, `exprIsHNF` and friends, and Demand Analysis so that they exploit and maintain strictness of DataCon workers. See `Note [Strict fields in Core]` for details. Very little needed to change, and it puts field seq insertion done by Tag Inference into a new perspective: That of *implementing* strict field semantics. Before Tag Inference, DataCon workers are strict. Afterwards they are effectively lazy and field seqs happen around use sites. History has shown that there is no other way to guarantee taggedness and thus the STG Strict Field Invariant. Knock-on changes: * I reworked the whole narrative around "Tag inference". It's now called "EPT enforcement" and I recycyled the different overview Notes into `Note [EPT enforcement]`. * `exprIsHNF` previously used `exprOkForSpeculation` on unlifted arguments instead of recursing into `exprIsHNF`. That regressed the termination analysis in CPR analysis (which simply calls out to `exprIsHNF`), so I made it call `exprOkForSpeculation`, too. * There's a small regression in Demand Analysis, visible in the changed test output of T16859: Previously, a field seq on a variable would give that variable a "used exactly once" demand, now it's "used at least once", because `dmdTransformDataConSig` accounts for future uses of the field that actually all go through the case binder (and hence won't re-enter the potential thunk). The difference should hardly be observable. * The Simplifier's fast path for data constructors only applies to lazy data constructors now. I observed regressions involving Data.Binary.Put's `Pair` data type. * Unfortunately, T21392 does no longer reproduce after this patch, so I marked it as "not broken" in order to track whether we regress again in the future. Fixes #20749, the satisfying conclusion of an annoying saga (cf. the ideas in #21497 and #22475). Compiler perf generally improves, sometimes drastically: Baseline Test Metric value New value Change -------------------------------------------------------------------------------- ManyConstructors(normal) ghc/alloc 3,629,760,116 3,711,852,800 +2.3% BAD MultiLayerModulesTH_OneShot(normal) ghc/alloc 2,502,735,440 2,565,282,888 +2.5% BAD T12707(normal) ghc/alloc 804,399,798 791,807,320 -1.6% GOOD T17516(normal) ghc/alloc 964,987,744 1,008,383,520 +4.5% T18140(normal) ghc/alloc 75,381,152 49,860,560 -33.9% GOOD T18698b(normal) ghc/alloc 232,614,457 184,262,736 -20.8% GOOD T18923(normal) ghc/alloc 62,002,368 58,301,408 -6.0% GOOD T20049(normal) ghc/alloc 75,719,168 70,494,368 -6.9% GOOD T3294(normal) ghc/alloc 1,237,925,833 1,157,638,992 -6.5% GOOD T9233(normal) ghc/alloc 686,490,105 635,166,688 -7.5% GOOD geo. mean -0.7% minimum -33.9% maximum +4.5% I looked at T17516. It seems we do a few more simplifier iterations and end up with a larger program. It seems that some things inline more, while other things inline less. I don't see low-hanging fruit. I also looked at MultiLayerModulesTH_OneShot. It appears we generate a strange join point in the `getUnique` method of `Uniquable GHC.Unit.Types.Module` that should better call-site inline, but does not. Perhaps with !11492. NoFib does not seem affected much either: +-------------------------------++--+------------+-----------+---------------+-----------+ | || | base/ | std. err. | T20749/ (rel) | std. err. | +===============================++==+============+===========+===============+===========+ | spectral/last-piece || | 7.263e8 | 0.0% | +0.62% | 0.0% | +===============================++==+============+===========+===============+===========+ | geom mean || | +0.00% | | | | +-------------------------------++--+------------+-----------+---------------+-----------+ I had a look at last-piece. Nothing changes in stg-final, but there is a bit of ... movement around Data.Map.insert's use of GHC.Exts.lazy that is gone in stg-final. Co-Authored-By: Jaro Reinders <jaro.reinders at gmail.com> Metric Decrease: T12707 T18140 T18698b T18923 T19695 T20049 T3294 T9233 T21839c Metric Increase: ManyConstructors MultiLayerModulesTH_OneShot - - - - - 0225249a by Simon Peyton Jones at 2024-10-25T07:02:32-04:00 Some renaming This is a pure refactor, tidying up some inconsistent naming: isEqPred --> isEqClassPred isEqPrimPred --> isEqPred isReprEqPrimPred --> isReprEqPred mkPrimEqPred --> mkNomEqPred mkReprPrimEqPred --> mkReprEqPred mkPrimEqPredRold --> mkEqPredRole Plus I moved mkNomEqPred, mkReprEqPred, mkEqPredRolek from GHC.Core.Coercion to GHC.Core.Predicate where they belong. That means that Coercion imports Predicate rather than vice versa -- better. - - - - - 15a3456b by Ryan Hendrickson at 2024-10-25T07:02:32-04:00 compiler: Fix deriving with method constraints See Note [Inferred contexts from method constraints] Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com> - - - - - dbc77ce8 by Alan Zimmerman at 2024-10-25T18:20:13+01:00 EPA: Remove AddEpann commit 7 EPA: Remove [AddEpAnn] from HYPHEN in Parser.y The return value is never used, as it is part of the backpack configuration parsing. EPA: Remove last [AddEpAnn] usages Remove residual usage in GHC. It is still used - In haddock TTG extension point definitions (to be removed) - Some check-exact residual, to be removed - Comments around DisambECP in PostProcess EPA: Clean up [AddEpAnn] from check-exact There is one left, to be cleaned up when we remove AddEpann itself EPA: Remove [AddEpAnn] from haddock The TTG extension points need a value, it is not critical what that value is, in most cases. EPA: Remove AddEpAnn from HsRuleAnn EPA: Remove AddEpAnn from HsCmdArrApp - - - - - 23ddcc01 by Simon Peyton Jones at 2024-10-26T12:44:34-04:00 Fix optimisation of InstCo It turned out (#25387) that the fix to #15725 was not quite right: commit 48efbc04bd45d806c52376641e1a7ed7278d1ec7 Date: Mon Oct 15 10:25:02 2018 +0200 Fix #15725 with an extra Sym Optimising InstCo is quite subtle, and the invariants surrounding the LiftingContext in the coercion optimiser were not stated explicitly. This patch refactors the InstCo optimisation, and documents these invariants. See * Note [Optimising InstCo] * Note [The LiftingContext in optCoercion] I also did some refactoring of course: * Instead of a Bool swap-flag, I am not using GHC.Types.Basic.SwapFlag * I added some invariant-checking the coercion-construction functions in GHC.Core.Coercion.Opt. (Sadly these invariants don't hold during typechecking, becuase the types are un-zonked, so I can't put these checks in GHC.Core.Coercion.) - - - - - 589fea7f by Cheng Shao at 2024-10-27T05:36:38-04:00 ghcid: use multi repl for ghcid - - - - - d52a0475 by Andrew Lelechenko at 2024-10-27T05:37:13-04:00 documentation: add motivating section to Control.Monad.Fix - - - - - 301c3b54 by Cheng Shao at 2024-10-27T05:37:49-04:00 wasm: fix safari console error message related to import("node:timers") This patch fixes the wasm backend JSFFI prelude script to avoid calling `import("node:timers")` on non-deno hosts. Safari doesn't like it and would print an error message to the console. Fixes https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/issues/13. - - - - - 9f02dfb5 by Simon Peyton Jones at 2024-10-27T15:10:08-04:00 Add a missing tidy in UnivCo We were failing to tidy the argument coercions of a UnivCo, which led directly to #25391. The fix is, happily, trivial. I don't have a small repro case (it came up when building horde-ad, which uses typechecker plugins). It should be possible to make a repro case, by using a plugin (which builds a UnivCo) but I decided it was not worth the bother. The bug is egregious and easily fixed. - - - - - 853050c3 by Andrew Lelechenko at 2024-10-27T15:10:44-04:00 Bump text submodule to 2.1.2 - - - - - 90746a59 by Andrew Lelechenko at 2024-10-27T15:10:44-04:00 hadrian: allow -Wunused-imports for text package - - - - - 8a6691c3 by Alan Zimmerman at 2024-10-27T19:44:48+00:00 EPA: Remove AddEpAnn Commit 8/final EPA: Remove AddEpAnn from AnnList EPA: Remove AddEpAnn from GrhsAnn This is the last actual use EPA: Remove NameAdornment from NameAnn Also rework AnnContext to use EpToken, and AnnParen EPA: Remove AddEpAnn. Final removal There are now none left, except for in a large note/comment in PostProcess, describing the historical transition to the disambiguation infrastructure - - - - - d5e7990c by Alan Zimmerman at 2024-10-28T21:41:05+00:00 EPA: Remove AnnKeywordId. This was used as part of AddEpAnn, and is no longer needed. Also remove all the haddock comments about which of are attached to the various parts of the AST. This is now clearly captured in the appropriate TTG extension points, and the `ExactPrint.hs` file. - - - - - e08b8370 by Serge S. Gulin at 2024-10-29T23:17:01-04:00 JS: Re-add optimization for literal strings in genApp (fixes #23479) Based on https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10588/ Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Andrei Borzenkov <root at sandwitch.dev> Co-authored-by: Danil Berestov <goosedb at yandex.ru> ------------------------- Metric Decrease: T25046_perf_size_gzip size_hello_artifact size_hello_artifact_gzip size_hello_unicode size_hello_unicode_gzip ------------------------- - - - - - e3496ef6 by Cheng Shao at 2024-10-29T23:17:37-04:00 compiler: remove unused hscDecls/hscDeclsWithLocation This patch removes unused `hscDecls`/`hscDeclsWithLocation` functions from the compiler, to reduce maintenance burden when doing refactorings related to ghci. - - - - - b1eed26f by Cheng Shao at 2024-10-29T23:18:13-04:00 testsuite: add T25414 test case marked as broken This commit adds T25414 test case to demonstrate #25414. It is marked as broken and will be fixed by the next commit. - - - - - e70009bc by Cheng Shao at 2024-10-29T23:18:13-04:00 driver: fix foreign stub handling logic in hscParsedDecls This patch fixes foreign stub handling logic in `hscParsedDecls`. Previously foreign stubs were simply ignored here, so any feature that involve foreign stubs would not work in ghci (e.g. CApiFFI). The patch reuses `generateByteCode` logic and eliminates a large chunk of duplicate logic that implements Core to bytecode generation pipeline here. Fixes #25414. - - - - - 1d7cd7fe by Andreas Klebinger at 2024-10-30T19:14:28-04:00 Add since tag for -fwrite-if-compression in user guide. Partial fix for #25395 - - - - - b349fd1b by Alan Zimmerman at 2024-10-30T19:15:04-04:00 EPA: Remove some unused functions - - - - - f859d61c by Alan Zimmerman at 2024-10-30T19:15:04-04:00 EPA: use explicit vertical bar token for ExplicitSum / SumPat - - - - - 721ac00d by Ben Gamari at 2024-10-31T08:37:38-04:00 rts/Disassembler: Fix encoding of BRK_FUN instruction The offset of the CC field was not updated after the encoding change in b85b11994e0130ff2401dd4bbdf52330e0bcf776. Fix this. Fixes #25374. - - - - - 0bc94360 by Alan Zimmerman at 2024-10-31T08:38:15-04:00 EPA: Bring in last EpToken usages For import declarations, NameAnnCommas and NPlusKPat. And remove anchor, it is the same as epaLocationRealSrcSpan. - - - - - 0b11cdc0 by sheaf at 2024-10-31T08:38:55-04:00 Assert that ctEvCoercion is called on an equality Calling 'ctEvCoercion' on non-equality constraints is always incorrect. We add an assertion to this function to detect such cases; for example a type-checking plugin might erroneously do this. - - - - - ea458779 by doyougnu at 2024-11-01T18:11:33-04:00 ghc-internal: strict, unboxed src loc ranges - closes: #20449 - See CLC proposal: #55 - - - - - 778ac793 by Kazuki Okamoto at 2024-11-01T18:12:13-04:00 No haddock markup in doctest line - - - - - cf0deeaf by Andreas Klebinger at 2024-11-02T17:54:52-04:00 Reword -fexpose-overloaded-unfoldings docs. This should make them slightly clearer. Fixes #24844 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 1c21e7d4 by Andreas Klebinger at 2024-11-02T17:55:29-04:00 Compile T25062 simd tests even if we can't run them. Helps avoid them being utterly broken. Fixes #25341 - - - - - 573cad4b by Cheng Shao at 2024-11-02T17:56:04-04:00 Remove unused USE_REPORT_PRELUDE code paths from the tree This patch removes unused `USE_REPORT_PRELUDE` code paths from the tree. They have been present since the first git revision 4fb94ae5e5d632748fa2e6c35e259eccc5a1a3f4, and might have been useful for debugging purposes many years ago, but these code paths are never actually built. Removing these ease maintenance of relevant modules in the future, and also allows us to get rid of `CPP` extension in those modules as a nice byproduct. - - - - - 97f600c6 by Hassan Al-Awwadi at 2024-11-04T15:52:12+00:00 Refactored BooleanFormula to be in line with TTG (#21592) There are two parts to this commit. * We moved the definition of BooleanFormula over to L.H.S.BooleanFormula * We parameterized the BooleanFormula over the pass The GHC specific details of BooleanFormula remain in Ghc.Data.BooleanFormula. Because its parameterized over the pass its no longer a functor or traversable, but we defined bfMap and bfTraverse for the cases where we needed fmap and traverse originally. Most other changes are just churn. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - d4fd3580 by Andreas Klebinger at 2024-11-05T07:36:16-05:00 ghc-heap: Fix incomplete selector warnings. Use utility functions instead of selectors to read partial attributes. Part of fixing #25380. - - - - - fdd9f62a by Peter Trommler at 2024-11-05T07:36:51-05:00 PPC NCG: Implement fmin and fmax - - - - - 8e217256 by Mike Pilgrem at 2024-11-07T04:34:20-05:00 Re CLC #293 - Don't specify Data.List.NonEmpty in terms of partial See https://github.com/haskell/core-libraries-committee/issues/293 `List.init` had already been driven out of `tails1` by 21fc180bec93d964a7f4ffdf2429ef6f74b49ab6 but this specification also avoided partial `fromList`, so I preferred it. The `changelog.md` for `base` is updated, with an entry added under `base-4.22.0.0`. - - - - - 346e4cd1 by Zubin Duggal at 2024-11-07T04:34:57-05:00 release: copy zip files into the correct directory Fixes #25446 - - - - - bbdbe225 by Zubin Duggal at 2024-11-07T04:34:57-05:00 release: Sign .gz bindists too Fixes #25447 - - - - - 0c722e14 by Hécate Kleidukos at 2024-11-07T04:35:37-05:00 hadrian: Enforce the usage of GHC >=9.8.1 for ghci-multi GHC 9.6 no good when it comes to multi-repl stuff, despite being well within the range of n-2 releases for bootstrapping, when the script was adapted to load haddock, in !12851 - - - - - d8f8a1c3 by Sylvain Henry at 2024-11-07T19:27:46-05:00 Handle the special ghc-prim:GHC.Prim module in the compiler Before this patch, some custom hacks were necessary in ghc-prim's Setup.hs to register the GHC.Prim (virtual) module and in Hadrian to generate haddocks properly. In this patch we special-case this module in the compiler itself instead (which it already is, see ghcPrimIface in GHC.Iface.Load). From Cabal/Hadrian's perspective GHC.Prim is now just a normal autogenerated module. This simplification is worthwhile on its own. It was found while looking into the work needed for #24453 which aims to merge ghc-prim, ghc-bignum, and ghc-internal. It's also one step closer to remove ghc-prim's custom setup. - - - - - a55adc8e by Cheng Shao at 2024-11-07T19:28:22-05:00 Clean up obsolete CPP guarded code paths from the tree This patch cleans up obsolete CPP guarded code paths from the tree. The minimum supported boot GHC version is 9.6, and all the pre-9.6 era code paths can be removed. - - - - - 9ede97f3 by Cheng Shao at 2024-11-07T19:28:58-05:00 Remove obsolete executable wrappers from the tree The executable wrappers are handled by hadrian and bindist Makefile. The various .wrapper scripts in the tree are unused since removal of Make build system, so this patch removes them all. - - - - - 7d42b2df by tristian at 2024-11-07T19:29:40-05:00 TcRnDuplicateDecls now suggests to use the DuplicateRecordFields extension. Fixes: !24627 - - - - - e56ed179 by Zubin Duggal at 2024-11-11T15:16:35+05:30 testsuite: normalise some versions in callstacks (cherry picked from commit f230e29f30d0c1c566d4dd251807fcab76a2710e) - - - - - a28fc903 by Zubin Duggal at 2024-11-11T15:16:35+05:30 testsuite: use -fhide-source-paths to normalise some backpack tests (cherry picked from commit b19de476bc5ce5c7792e8af1354b94a4286a1a13) - - - - - ed16d303 by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite/haddock: strip version identifiers and unit hashes from html tests (cherry picked from commit fbf0889eadc410d43dd5c1657e320634b6738fa5) - - - - - e45e5836 by Zubin Duggal at 2024-11-11T15:16:36+05:30 haddock: oneshot tests can drop files if they share modtimes. Stop this by including the filename in the key. Ideally we would use `ghc -M` output to do a proper toposort Partially addresses #25372 (cherry picked from commit e78c7ef96e395f1ef41f04790aebecd0409b92b9) - - - - - 9104e6eb by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite: fix normalisation of T9930fail so that it doesn't get tripped up by ghc executable (ARGV[0]) differences (cherry picked from commit a79a587e025d42d34bb30e115fc5c7cab6c1e030) - - - - - 2c31264a by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite: normalise windows file seperators (cherry picked from commit f858875e03b9609656b542aaaaff85ad0a83878a) - - - - - 2807f91b by Zubin Duggal at 2024-11-11T15:21:30+05:30 testsuite: Also match <VERSION> placeholders when normalising callsites - - - - - c02add17 by Ben Gamari at 2024-11-12T01:22:11-05:00 configure: Check version number validity Here we verify the previously informal invariant that stable release version numbers must have three components, preventing costly failed releases. Specifically, the check fails in the following scenarios: * `version=9.13` while `RELEASE=YES` since this would imply a release made from an unstable branch * `version=9.13.0` since unstable versions should only have two components * `version=9.12` since this has the wrong number of version components for a stable branch Fixes #25390. - - - - - 747fd322 by Teo Camarasu at 2024-11-12T01:22:49-05:00 docs: link to #14474 in the template-haskell docs - - - - - 6d96bb62 by Zubin Duggal at 2024-11-12T01:23:25-05:00 testsuite: normalise execvp vs exec differences in process tests Fixes #25431 - - - - - 502e6711 by Torsten Schmits at 2024-11-12T01:24:01-05:00 fix test lint that accumulated while the checks were broken I didn't fix the issues flagged by the #ifdef linter because it were so many that it seemed like the rule has become obsolete. - - - - - 223a4cb5 by Torsten Schmits at 2024-11-12T01:24:02-05:00 test driver: fix file collection for regex linters When a testsuite linter is executed with the `tracked` strategy, the driver runs `git ls-tree` to collect eligible files. This appears to have ceased producing any paths – `ls-tree` restricts its results to the current working directory, which is `testsuite/tests/linters` in this case. As a quick fix, this patch changes the working directory to match expectations. - - - - - 9ad9ac63 by Alan Zimmerman at 2024-11-12T01:24:39-05:00 EPA: Capture location of '_' for wild card type binder And keep track of promotion status in HsExplicitTupleTy, so the round-trip ppr test works for it. Updates Haddock output too, using the PromotionFlag in HsExplicitTupleTy. Closes #25454 - - - - - c37b96fa by Cheng Shao at 2024-11-12T01:25:15-05:00 wasm: fix setImmediate() implementation for Cloudflare Workers This patch fixes setImmediate() implementation for Cloudflare Workers in the wasm backend's js prelude script. Cloudflare Workers doesn't support the MessageChannel API, and we use a setTimeout() based fallback implementation in this case. - - - - - bea8ea4c by Cheng Shao at 2024-11-12T01:25:15-05:00 wasm: fix FinalizationRegistry logic for Cloudflare Workers This patch fixes FinalizationRegistry related logic for Cloudflare Workers in wasm backend js post linker. Cloudflare Workers doesn't support FinalizationRegistry, in this case we use a dummy implementation that doesn't do anything. - - - - - 00d551bf by Cheng Shao at 2024-11-13T08:48:21-05:00 Remove obsolete cross-port script This patch removes the obsolete cross-port script in the tree. The script was based on the legacy Make build system which has been pruned from the tree long ago. For hadrian, proper support for two-stage bootstrapping onto a new unsupported platform is a work in progress in !11444. - - - - - 75a2eae4 by Cheng Shao at 2024-11-13T08:48:58-05:00 hadrian: fix bindist makefile for wasm32-wasi target This patch fixes one incoherent place between bindist makefile and hadrian logic: I forgot to include wasi/wasm32 in OsSupportsGHCi/ArchSupportsGHCi as well. And this results in incorrect settings file generated after installing the bindist, and "Use interpreter"/"Have interpreter" fields incorrectly have "NO" values where they should be "YES" like --info output of in-tree version. - - - - - 0614abef by Alan Zimmerman at 2024-11-13T08:49:34-05:00 EPA: Correctly capture leading semis in decl list Closes #25467 - - - - - 00d58ae1 by Sebastian Graf at 2024-11-13T15:21:23-05:00 DmdAnal: Make `prompt#` lazy (#25439) This applies the same treatment to `prompt#` as for `catch#`. See `Note [Strictness for mask/unmask/catch/prompt]`. Fixes #25439. - - - - - 93233a66 by Ben Gamari at 2024-11-13T15:21:59-05:00 boot: Do not attempt to update config.sub While Apple ARM hardware was new we found that the autoconf scripts included in some boot packages were too old. As a mitigation for this, we introduced logic in the `boot` script to update the `config.sub` with that from the GHC tree. However, this causes submodules which have `config.sub` committted to appear to be dirty. This is a considerable headache. Now since `config.sub` with full platform support is more common we can remove `boot`'s `config.sub` logic. Fixes #19574. - - - - - fa66fa64 by Ryan Scott at 2024-11-14T19:05:00-05:00 Add regression test for #16234 Issue #16234 was likely fixed by !9765. This adds a regression test to ensure that it remains fixed. Fixes #16234. - - - - - bfe64df8 by Matthew Pickering at 2024-11-14T19:05:36-05:00 ghc-internal: Update to Unicode 16 This patch updates the automatically generated code for querying unicode properties to unicode 16. Fixes #25402 - - - - - 1fd83f86 by Ben Gamari at 2024-11-14T19:06:13-05:00 configure: Accept happy-2.1.2 happy-2.1 was released in late Oct 2024. I have confirmed that master bootstraps with it. Here we teach configure to accept this tool. Fixes #25438. - - - - - aa58fc5b by Ben Gamari at 2024-11-14T19:06:49-05:00 rts: Tighten up invariants of PACK - - - - - 8aa4c10a by Ben Gamari at 2024-11-14T19:06:49-05:00 testsuite: Fix badly escaped literals Use raw string literals to ensure that `\s` is correctly interpreted as a character class. - - - - - 0e084029 by Ben Gamari at 2024-11-14T19:06:49-05:00 rts: Improve documentation of SLIDE bytecode instruction - - - - - 9bf3663b by Ben Gamari at 2024-11-14T19:06:49-05:00 rts/Interpreter: Assert that TEST*_P discriminators are valid - - - - - 1f668511 by Ben Gamari at 2024-11-14T19:06:49-05:00 rts/Interpreter: Improve documentation of TEST*_P instructions - - - - - 59e0a770 by Cheng Shao at 2024-11-14T19:07:25-05:00 misc: improve clangd compile_flags.txt flags This patch improves the compile_flags.txt config used to power clangd for the rts C codebase. The flags in the file are sampled & deduped from a real stage1 build with clang-19 and vastly improves the IDE accuracy when hacking the rts. For maximum code coverage under the default settings, compile_flags.txt defaults to threaded+profiled+dynamic+debug way. This does not mean profdyn needs to be actually built in _build/stage1 for IDE to work. To activate IDE for other RTS ways, simply remove one of the -D flags at the end of compile_flags.txt and restart clangd. - - - - - c2c562e0 by Ben Gamari at 2024-11-14T19:08:01-05:00 testsuite: Don't consider untracked files in dirtiness check Considering trees containing untracked files as dirty is a bridge too far. The chance of an untracked file significantly affecting measured performanced metrics is quite small whereas not collecting measurements is quite inconvenient for some workflows. We now ignore untracked files in the dirtiness check. Fixes #25471. - - - - - ed2ed6c5 by Cheng Shao at 2024-11-14T19:08:37-05:00 testsuite: add regression test T25473 This commit adds regression test T25473 marked as broken due to #25473. It will be fixed in the subsequent commit. - - - - - bd0a8b7e by Cheng Shao at 2024-11-14T19:08:37-05:00 wasm: fix foreign import javascript "wrapper" in TH/ghci This patch fixes foreign import javascript "wrapper" in wasm backend's TH/ghci by fixing the handling of dyld/finalization_registry magic variables. Fixes T25473 and closes #25473. - - - - - f1b0bc32 by Ben Gamari at 2024-11-14T19:09:13-05:00 rts/linker: Make FreeBSD declarations proper prototypes The iconv declarations for FreeBSD were previously not prototypes, leading to warnings. - - - - - 086cbbc1 by Ben Gamari at 2024-11-14T19:09:13-05:00 base: Drop redundant import in FreeBSD ExecutablePath implementation - - - - - 79ecd199 by Ben Gamari at 2024-11-14T19:09:13-05:00 compiler: Fix partial selector warnings in GHC.Runtime.Heap.Inspect - - - - - 1acb73bf by Andrew Lelechenko at 2024-11-15T06:10:47-05:00 gitlab: mention CLC in MR template - - - - - 8f2e0832 by Ben Gamari at 2024-11-15T06:11:24-05:00 rts: Allow use of GNU-stack notes on FreeBSD Previously we gated use of GNU-style non-executable stack notes to only apply on Linux. However, these are also supported by FreeBSD, which also uses ELF. Fix this. Fixes #25475. - - - - - 2c427cb0 by Ben Gamari at 2024-11-16T05:27:40-05:00 rts: Fix EINTR check in timerfd ticker When `poll` failed we previously checked that `errno == -EINTR` to silence the failure warning. However, this is wrong as `errno` values are generally not negated error codes (in contrast to many system call results, which is likely what the original author had in mind). Fixes #25477. - - - - - a0fa4941 by Ben Gamari at 2024-11-16T05:28:16-05:00 rts: Increase gen_workspace alignment to 128 bytes on AArch64 Increase to match the 128-byte cache-line size of Apple's ARMv8 implementation. Closes #25459. - - - - - 142d8afa by Ben Gamari at 2024-11-16T16:20:47-05:00 rts/RtsFlags: Refactor size parsing This makes a number of improvements mentioned in #20201: * fail if the argument cannot be parsed as a number (`-Mturtles`) * fail if an unrecognized unit is given (e.g. `-M1x`) - - - - - b7a146e5 by Ben Gamari at 2024-11-16T16:20:47-05:00 testsuite: Add tests for RTS flag parsing error handling See #20201. - - - - - ddb7afa6 by Ben Gamari at 2024-11-16T16:21:23-05:00 users guide: Mention language extensions in equality constraints discussion As suggested in #24127, mention the language extensions necessary for usage of equality constriants in their documentation. Closes #24127. - - - - - 36133dac by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide/9.14.1-notes: Fix list syntax - - - - - 888de658 by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide/debug-info: Fix duplicate flag descriptions - - - - - f120e427 by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide: Fix reference to 9.14.1 release notes - - - - - 8e975032 by Ben Gamari at 2024-11-16T16:21:59-05:00 Introduce GHC.Tc.Plugin.lookupTHName This makes it significantly more convenient (and less GHC-version-dependent) to resolve a template-haskell name into a GHC Name. As proposed in #24741. - - - - - a0e168ec by ARATA Mizuki at 2024-11-16T16:22:40-05:00 x86 NCG SIMD: Lower packFloatX4#, insertFloatX4# and broadcastFloatX4# to SSE1 instructions Fixes #25441 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 3936bf1b by sheaf at 2024-11-16T16:23:22-05:00 X86 NCG: allow VXOR at scalar floating-point types The NCG can emit VXOR instructions at scalar floating-point types, but the pretty-printer would panic instead of emitting the appropriate VXORPS/VXORPD instructions. This patch rectifies that oversight. Fixes #25455 - - - - - d9dff93a by Ben Gamari at 2024-11-16T16:23:58-05:00 rts: Fix platform-dependent pointer casts Previously we had unnecessary (and incorrect) platform-dependent casts to turn `OSThreadIds`s into a integer. We now just uniformly cast first to a `uintptr_t` (which is always safe, regardless of whether `OSThreadId` is a pointer), and then cast to the desired integral type. This fixes a warning on musl platforms. - - - - - 6d95cdb8 by Ben Gamari at 2024-11-16T16:24:34-05:00 testsuite: Mark encoding004 as broken on FreeBSD Due to #22003, CP936 fails to roundtrip: ```diff == CP936 +Failed to roundtrip given mutant byte at index 891 (251 /= 123 at index 891) +Failed to roundtrip given mutant byte at index 1605 (197 /= 69 at index 1605) +Failed to roundtrip given mutant byte at index 2411 (235 /= 107 at index 2411) +Failed to roundtrip given mutant byte at index 6480 (208 /= 80 at index 6480) +Failed to roundtrip given mutant byte at index 6482 (210 /= 82 at index 6482) +Failed to roundtrip given mutant byte at index 6484 (212 /= 84 at index 6484) +Failed to roundtrip given mutant byte at index 6496 (224 /= 96 at index 6496) +Failed to roundtrip given mutant byte at index 7243 (203 /= 75 at index 7243) +Failed to roundtrip given mutant byte at index 7277 (237 /= 109 at index 7277) +Failed to roundtrip given mutant byte at index 8027 (219 /= 91 at index 8027) +Failed to roundtrip given mutant byte at index 8801 (225 /= 97 at index 8801) ``` - - - - - 26e86984 by Ben Gamari at 2024-11-18T04:05:31-05:00 hadrian: Allow haddock options to be passed via key-value settings - - - - - 6e68b117 by Matthew Pickering at 2024-11-18T04:06:07-05:00 Exception rethrowing Basic changes: * Change `catch` function to propagate exceptions using the WhileHandling mechanism. * Introduce `catchNoPropagate`, which does the same as before, but passes an exception which can be rethrown. * Introduce `rethrowIO` combinator, which rethrows an exception with a context and doesn't add a new backtrace. * Introduce `tryWithContext` for a variant of `try` which can rethrow the exception with it's original context. * onException is modified to rethrow the original error rather than creating a new callstack. * Functions which rethrow in GHC.Internal.IO.Handle.FD, GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and GHC.Internal.System.IO.Error are modified to not add a new callstack. Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202> - - - - - a4e0d235 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00 exceptions: Improve the message layout as per #285 This commit fixes the layout of the additional information included when displaying an exception, namely the type of the exception. It also fixes the default handler's heading message to work well together with the improved display message of SomeException. CLC proposal#285 - - - - - 284ffab3 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00 Display type and callstack of exception on handler This commit changes the Exception instance of SomeException to *simply* display the underlying exception in `displayException`. The augmented exception message that included the type and backtrace of the exception are now only printed on a call to `displayExceptionWithInfo`. At a surface level, existing programs should behave the same since the `uncaughtExceptionHandler`, which is responsible for printing out uncaught exceptions to the user, will use `displayExceptionWithInfo` by default. However, unlike the instance's `displayException` method, the `uncaughtExceptionHandler` can be overriden with `setUncaughtExceptionHandler`. This makes the extra information opt-in without fixing it the instance, which can be valuable if your program wants to display uncaught exceptions to users in a user-facing way (ie without backtraces). This is what was originally agreed for CLC#231 or CLC#261 with regard to the type of the exception information. The call stack also becoming part of the default handler rather than the Exception instance is an ammendment to CLC#164. Discussion of the ammendment is part of CLC#285. - - - - - 36cddd2c by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Remove redundant CallStack from exceptions Before the exception backtraces proposal was implemented, ErrorCall accumulated its own callstack via HasCallStack constraints, but ExceptionContext is now accumulated automatically. The original ErrorCall mechanism is now redundant and we get a duplicate CallStack Updates Cabal submodule to fix their usage of ErrorCallWithLocation to ErrorCall CLC proposal#285 Fixes #25283 - - - - - 7a74330b by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Freeze call stack in error throwing functions CLC proposal#285 - - - - - 3abf31a4 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 De-duplicate displayContext and displayExceptionContext The former was unused except for one module where it was essentially re-defining displayExceptionContext. Moreover, this commit extends the fix from bfe600f5bb3ecd2c8fa71c536c63d3c46984e3f8 to displayExceptionContext too, which was missing. - - - - - c0d783f8 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Re-export NoBacktrace from Control.Exception This was originally proposed and accepted in section "2.7 Capturing Backtraces on Exceptions" of the CLC proposal for exception backtraces. However, the implementation missed this re-export, which this commit now fixes. - - - - - 802b5c3e by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Fix exception backtraces from GHCi When running the program with `runhaskell`/`runghc` the backtrace should match the backtrace one would get by compiling and running the program. But currently, an exception thrown in a program interpreted with `runhaskell` will: * Not include the original exception backtrace at all * Include the backtrace from the internal GHCi/ghc rethrowing of the original exception This commit fixes this divergence by not annotating the ghc(i) backtrace (with NoBacktrace) and making sure that the backtrace of the original exception is serialized across the boundary and rethrown with the appropriate context. Fixes #25116 The !13301 MR (not this commit in particular) improves performance of MultiLayerModules. Unfortunately, T3294 regresses on aarch64-linux-deb12 by 1% allocations. Since this patch must be merged for 9.12 ASAP, we will not be able to investigate the slight regression on this platform in time. ------------------------- Metric Decrease: MultiLayerModulesRecomp MultiLayerModulesTH_OneShot Metric Increase: T3294 ------------------------- - - - - - 3e89eb65 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 base: Add to changelog.md CLC #285 - - - - - d9326a48 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Bump array and stm submodules for testsuite The testsuites of array and stm had to be updated according to !13301. Updates submodule array and stm. - - - - - 325fcb5d by Ben Gamari at 2024-11-18T04:06:45-05:00 rts/adjustor: Clean up code style of Nativei386 adjustor - - - - - 39bb6e58 by Ben Gamari at 2024-11-18T04:06:45-05:00 rts/adjustor: Fix stack overrun error in Nativei386 adjustor We were reserving the wrong kind of adjustor context (the generic `AdjustorContext` used by other adjustor implementations, rather than the i386-specific `CCallContext`) to return the adjustor context while freeing, resulting in #25485. Fixes #25485. - - - - - 831aab22 by sheaf at 2024-11-18T21:22:36-05:00 Include diagnostic reason in -fdiagnostics-as-json This commit ensures that the -fdiagnostics-as-json output includes the diagnostic reason. This allows the full error message produced by GHC to be re-constructed from the JSON output. Fixes #25403 - - - - - 3e5bfdd3 by Ben Gamari at 2024-11-18T21:23:12-05:00 rts: Introduce printIPE This is a convenience utility for use in GDB. - - - - - 44d909a3 by Sjoerd Visscher at 2024-11-19T14:38:24-05:00 Don't store boot locations in finder cache Partially reverts commit fff55592a7b Amends add(Home)ModuleToFinder so that locations for boot files are not stored in the finder cache. Removes InstalledModule field from InstalledFound constructor since it's the same as the key that was searched for. - - - - - 64c95292 by Sjoerd Visscher at 2024-11-19T14:38:24-05:00 Concentrate boot extension logic in Finder With new mkHomeModLocation that takes an extra HscSource to add boot extensions if required. - - - - - 11bad98d by ARATA Mizuki at 2024-11-19T14:39:08-05:00 Better documentation for floating-point min/max and SIMD primitives See #25350 for floating-point min/max Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 791a47b2 by Arnaud Spiwack at 2024-11-20T14:00:05+00:00 Add test for #25185 - - - - - 374e18e5 by Arnaud Spiwack at 2024-11-20T14:09:30+00:00 Quick look: emit the multiplicity of app heads in tcValArgs Otherwise it's not scaled properly by the context, allowing unsound expressions. Fixes #25185. - - - - - 1fc02399 by sheaf at 2024-11-20T18:11:03-05:00 x86 NCG: fix regUsageOfInstr for VMOVU & friends This commit fixes the implementation of 'regUsageOfInstr' for vector operations that take an 'Operand' as the destination, by ensuring that when the destination is an address then the address should be *READ*, and not *WRITTEN*. Getting this wrong is a disaster, as it means the register allocator has incorrect information, which can lead to it discard stores to registers, segfaults ensuing. Fixes #25486 - - - - - 7bd407a6 by Brandon Chinn at 2024-11-21T14:08:15-05:00 Fix CRLF in multiline strings (#25375) - - - - - 7575709b by Rodrigo Mesquita at 2024-11-21T14:08:52-05:00 Improve reachability queries on ModuleGraph Introduces `ReachabilityIndex`, an index constructed from a `GHC.Data.Graph.Directed` `Graph` that supports fast reachability queries (in $O(1)$). This abstract data structure is exposed from `GHC.Data.Graph.Directed.Reachability`. This index is constructed from the module graph nodes and cached in `ModuleGraph`, enabling efficient reachability queries on the module graph. Previously, we'd construct a Map of Set of ModuleGraph nodes which used a lot of memory (`O(n^2)` in the number of nodes) and cache that in the `ModuleGraph`. By using the reachability index we get rid of this space leak in the module graph -- even though the index is still quadratic in the number of modules, it is much, much more space efficient due to its representation using an IntMap of IntSet as opposed to the transitive closure we previously cached. In a memory profile of MultiLayerModules with 100x100 modules, memory usage improved from 6GB residency to 2.8GB, out of which roughly 1.8GB are caused by a second space leak related to ModuleGraph. On the same program, it brings compile time from 7.5s to 5.5s. Note how we simplify `checkHomeUnitsClosed` in terms of `isReachableMany` and by avoiding constructing a second graph with the full transitive closure -- it suffices to answer the reachability query on the full graph without collapsing the transitive closure completely into nodes. Unfortunately, solving this leak means we have to do a little bit more work since we can no longer cache the result of turning vertex indices into nodes. This results in a slight regression in MultiLayerModulesTH_Make, but results in large performance and memory wins when compiling large amounts of modules. ------------------------- Metric Decrease: mhu-perf Metric Increase: MultiLayerModulesTH_Make ------------------------- - - - - - bcbcdaaf by Cheng Shao at 2024-11-21T14:09:28-05:00 driver: fix hpc undefined symbol issue in TH with -fprefer-byte-code This commit fixes an undefined symbol error in RTS linker when attempting to compile home modules with -fhpc and -fbyte-code-and-object-code/-fprefer-byte-code, see #25510 for detailed description and analysis of the bug. Also adds T25510/T25510c regression tests to test make mode/oneshot mode of the bug. - - - - - 970ada5a by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Bump ci-images For introduction of Alpine/i386 image. Thanks to Julian for the base image. Co-Authored-By: Julian Ospald <hasufell at hasufell.de> - - - - - 8115abc2 by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Add release job for i386/Alpine As requested by Mikolaj and started by Julian. Co-Authored-By: Julian Ospald <hasufell at hasufell.de> - - - - - 639f0149 by Ben Gamari at 2024-11-22T23:32:06-05:00 rts/linker/Elf: Resolve _GLOBAL_OFFSET_TABLE_ - - - - - 490d4d0a by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Mark i386 Alpine test breakages Marks the following tests as broken on i386/Alpine: * T22033 due to #25497 * simd009, T25062_V16, T25169, T22187_run due to #25498 - - - - - 536cdf09 by Cheng Shao at 2024-11-22T23:32:42-05:00 compiler: remove unused GHC.Linker.Loader.loadExpr This patch removes the unused `GHC.Linker.Loader.loadExpr` function. It was moved from `GHC.Runtime.Linker.linkExpr` in `ghc-9.0` to `GHC.Linker.Loader.loadExpr` in `ghc-9.2`, and remain completely unused and untested ever since. There's also no third party user of this function to my best knowledge, so let's remove this. Anyone who wants to write their own GHC API function to load bytecode can consult the source code in older release branches. - - - - - 6ee35024 by Drew Fenwick at 2024-11-22T23:33:26-05:00 Fix a non-compiling example in the type abstractions docs This patch adds a missing Show constraint to a code example in the User Guide's type abstractions docs to fix issue #25422. - - - - - d1172e20 by Rodrigo Mesquita at 2024-11-22T23:34:02-05:00 Re-introduce ErrorCallWithLocation with a deprecation pragma With the removal of the duplicate backtrace, part of CLC proposal #285, the constructor `ErrorCallWithLocation` was removed from base. This commit re-introduces it with a deprecation. - - - - - 1187a60a by Ben Gamari at 2024-11-22T23:34:39-05:00 testsuite: Skip tests requiring Hadrian deps in out-of-tree testsuite runs Some testsuite tests require specific tools (e.g. `check-ppr` and `check-exact`) beyond those shipped in the binary distribution. Skip these tests. Fixes #13897. - - - - - c37d7a2e by Ben Gamari at 2024-11-22T23:34:39-05:00 testsuite: Declare exactprint tests' dependency on check-exact - - - - - 454ce957 by Ben Gamari at 2024-11-22T23:35:15-05:00 ghc-internal: Fix a few cases of missing Haddock markup - - - - - a249649b by Ben Gamari at 2024-11-22T23:35:51-05:00 testsuite/GHCiPrimCall : Add missing Makefile includes - - - - - a021a493 by Ben Gamari at 2024-11-22T23:35:51-05:00 testsuite/IpeStats: Use Make rather than shell interpolation - - - - - 6e1fbda7 by Ben Gamari at 2024-11-25T03:55:44-05:00 hadrian-ghci-multi: Pass -this-package-name in unit response files As noted in #25509, the `-this-package-name` must be passed for each package to ensure that GHC can response references to the packages' exposed modules via package-qualified imports. Fix this. Closes #25509. - - - - - a05e4a9b by Simon Hengel at 2024-11-25T03:56:33-05:00 Refactoring: Use `OnOff` more consistently for `Extension` - - - - - 7536181d by Matthew Pickering at 2024-11-25T14:00:07-05:00 driver: Always link against "base" package when one shot linking The default value for base-unit-id is stored in the settings file. At install time, this can be set by using the BASE_UNIT_ID environment variable. At runtime, the value can be set by `-base-unit-id` flag. For whether all this is a good idea, see #25382 Fixes #25382 - - - - - 7f90f319 by Andreas Klebinger at 2024-11-25T14:00:44-05:00 Compacting GC: Handle black holes in large objects. As #14497 showed black holes can appear inside large objects when we capture a computation and later blackhole it like we do for AP_STACK closures. Fixes #24791 - - - - - 291388e1 by Cheng Shao at 2024-11-25T14:01:19-05:00 ci: minor nix-in-docker improvements This patch makes some minor improvements re nix-in-docker logic in the ci configuration: - Update `nixos/nix` to the latest version - Apply $CPUS to `cores`/`max-jobs` to avoid oversubscribing while allowing a reasonable degree of parallelism - Remove redundant `--extra-experimental-features nix-command` in later `nix shell` invocations, it's already configured in `/etc/nix/nix.conf` - - - - - e684c406 by Cheng Shao at 2024-11-25T14:01:57-05:00 ci: avoid depending on stack job for test-bootstrap jobs This patch makes test-bootstrap related ci jobs only depend on hadrian-ghc-in-ghci job to finish, consistent with other jobs in the full-build stage generated by gen_ci.hs. This allows the jobs to be spawned earlier and improve overall pipeline parallelism. - - - - - caaf5388 by Simon Hengel at 2024-11-25T14:02:41-05:00 Refactoring: Remove `pSupportedExts` from `ParserOpts` This is never used for lexing / parsing. It is only used by `GHC.Parser.Header.getOptions`. - - - - - 41f8365c by Arnaud Spiwack at 2024-11-25T14:03:23-05:00 Add test for #25515 - - - - - 9279619f by Arnaud Spiwack at 2024-11-25T14:03:23-05:00 Desugar record notation with correct multiplicities Simply uses the multiplicity as stored in the field. As I'm writing this commit, the only possible multiplicity is 1, but !13525 is changing this. It's actually easier to take !13525 into account. Fixes #25515. - - - - - fcc3ae6e by Andreas Klebinger at 2024-11-26T08:24:58-05:00 Clarify INLINE unfolding optimization docs. Fixes #24660 - - - - - 88c4fe1d by Cheng Shao at 2024-11-26T08:25:34-05:00 rts: remove -Wl,-U,___darwin_check_fd_set_overflow hack This patch bumps macOS minimum SDK version to 11.0 for x86_64-darwin to align it with aarch64-darwin. This allows us to get rid of the horrible -Wl,-U,___darwin_check_fd_set_overflow hack, which is causing linker warnings and testsuite failures on macOS 15. Fixes #25504. - - - - - 53f978c0 by doyougnu at 2024-11-26T16:07:26-05:00 ghc-experimental: expose GHC.RTS.Flags, GHC.Stats See this CLC proposal: - https://github.com/haskell/core-libraries-committee/issues/289 and this CLC proposal for background: - https://github.com/haskell/core-libraries-committee/issues/288 Metric Decrease: MultiLayerModulesTH_OneShot - - - - - e70d4140 by Wang Xin at 2024-11-26T16:08:10-05:00 Add -mcmodel=medium moduleflag to generated LLVM IR on LoongArch platform With the Medium code model, the jump range of the generated jump instruction is larger than that of the Small code model. It's a temporary fix of the problem descriped in https://gitlab.haskell .org/ghc/ghc/-/issues/25495. This commit requires that the LLVM used contains the code of commit 9dd1d451d9719aa91b3bdd59c0c6679 83e1baf05, i.e., version 8.0 and later. Actually we should not rely on LLVM, so the only way to solve this problem is to implement the LoongArch backend. Add new type for codemodel - - - - - df42ba16 by Andreas Klebinger at 2024-11-27T11:40:49-05:00 Cmm constant folding: Narrow results to operations bitwidth. When constant folding ensure the result is still within bounds for the given type by explicitly narrowing the results. Not doing so results in a lot of spurious assembler warnings especially when testing primops. - - - - - bf3db97e by Ben Gamari at 2024-11-27T11:41:26-05:00 ghc-toolchain: Introduce basic flag validation We verify that required flags (currently `--output` and `--triple`) are provided. The implementation is truly awful, but so is getopt. Begins to address #25500. - - - - - a104508d by Ben Gamari at 2024-11-27T11:42:03-05:00 rts: Allow ExecPage to allocate anywhere in address space Currently the ExecPage facility has two users: * GHCi, for constructing info tables, and * the adjustor allocation path Despite neither of these have any spatial locality constraints ExecPage was using the linker's `mmapAnonForLinker`, which tries hard to ensure that mappings end up nearby the executable image. This makes adjustor allocation needlessly subject to fragmentation concerns. We now instead return less constrained mappings, improving the robustness of the mechanism. Addresses #25503. - - - - - c3fc9b86 by Ben Gamari at 2024-11-27T11:42:39-05:00 base: Fix incorrect mentions of GHC.Internal.Numeric These were incorrectly changed by the automated refactoring of the `ghc-internal` migration. Fixes #25521. - - - - - a362b943 by sheaf at 2024-11-27T23:44:28-05:00 Add checkExact to toolTargets This change means that the Hadrian multi target will include exactprint. In particular, this means that HLS will work on exactprint inside the GHC tree. - - - - - e6c957e4 by Arnaud Spiwack at 2024-11-27T23:45:09-05:00 Add test for #25428 - - - - - 52d97f4e by Arnaud Spiwack at 2024-11-27T23:45:09-05:00 Don't bypass MonoLocalBind in empty patterns Fixes #25428 - - - - - 7890f2d8 by Ben Gamari at 2024-11-28T10:26:46-05:00 hadrian: Bump directory bound to >=1.3.9 Earlier versions of `directory` are racy on Windows due to #24382. Also includes necessary Hadrian bootstrap plan bump. Fixes #24382. - - - - - 0fd43ea6 by Adam Sandberg Ericsson at 2024-11-28T10:27:22-05:00 mention -Iw in +RTS -? - - - - - 6cf579b9 by Ben Gamari at 2024-11-28T10:27:59-05:00 gitlab-ci: Set GIT_SUBMODULE_FORCE_HTTPS GitLab recommends using `https://` to clone submodules and provides the `GIT_SUBMODULE_FORCE_HTTPS` variable to force this. Fixes #25528. - - - - - 5b4774f9 by sheaf at 2024-12-03T15:22:07+01:00 Remove TcRnDeprecatedInvisTyArgInConPat mechanism The combination of ScopedTypeVariables + TypeApplications now no longer enables the use of type applications in constructor patterns, as per GHC proposal #448. This completes the deprecation that begun with GHC 9.8. We also remove the -Wdeprecated-type-abstractions flag, which was introduced in GHC 9.10. - - - - - f813c8d7 by sheaf at 2024-12-03T17:10:15-05:00 Hadrian: use / when making filepaths absolute In Hadrian, we are careful to use -/- rather than </>, in order to use / instead of \ in filepaths. However, this gets ruined by the use of makeAbsolute from System.Directory, which, on Windows, changes back forward slashes to backslashes. - - - - - 292ed74e by Ben Gamari at 2024-12-03T17:10:52-05:00 rts/linker: Fix out-of-bounds mapping logic Previously the structure of `mmapInRegion` concealed a subtle bug concerning handling of `mmap` returning mappings below the beginning of the desired region. Specifically, we would reset `p = result + bytes` and then again reset `p = region->start` before looping around for another iteration. This resulted in an infinite loop on FreeBSD. Fixes #25492. - - - - - 20912f5b by Ben Gamari at 2024-12-03T17:10:52-05:00 rts/linker: Clarify debug output - - - - - f98b3ac0 by Simon Hengel at 2024-12-03T17:11:30-05:00 SysTools: Avoid race conditions when processing output (fixes #16450) - - - - - 03851b64 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 mg: Drop unnecessary HasCallStack This HasCallStack was a debugging artifact from a previous commit. - - - - - 01d213b5 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 Improve haddock of graphReachabilityCyclic - - - - - f7cbffe2 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 Refactor ModuleGraph interface The 'ModuleGraph' abstraction represents the relationship and strucutre of the modules being compiled. This structure is meant to be constructed once at the start of compilation, and never changed again. However, it's exposed interface was confusing and exposed too many footguns which led to inneficient usages of the ModuleGraph. This commit improves significantly the exported interface of ModuleGraph, taking into consideration the recent improvements around reachability queries. Since the ModuleGraph graphs and related structures (HPT, EPS) are performance critical in the sense that somewhat simple mistakes can cause bad leaks and non-linear memory usage, we want to have proper APIs that guide efficient usage. This is a good step in that direction. - - - - - b69a7f3c by David Binder at 2024-12-04T18:37:42-05:00 Use consistent capitalization for "GHC Proposal" in user guide - - - - - 18d9500d by David Binder at 2024-12-04T18:37:42-05:00 Fix reference to GHC proposal 193 in user guide - - - - - dd959406 by Ben Gamari at 2024-12-04T18:38:18-05:00 Revert "rts/Interpreter: Assert that TEST*_P discriminators are valid" This assertion was based on the misconception that `GET_TAG` was returning the pointer tag whereas it is actually returning the constructor tag. This reverts commit 9bf3663b9970851e7b5701d68147450272823197. Fixes #25527. - - - - - cad6fede by Ben Gamari at 2024-12-04T18:38:54-05:00 rts/IOManager: Drop dead code This assignment is dead code as it occurs after all branches have returned. Moreover, it can't possibly be relevant since the "available" branch already sets `flag`. Potentially fixes #25542. - - - - - 55d8304e by Ben Gamari at 2024-12-06T16:56:00-05:00 ghc-internal: Drop GHC.Internal.Data.Enum This module consists only of reexports and consequently there is no reason for it to exist. - - - - - 56b9f484 by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Introduce Data.Bounded As proposed in [CLC#208] but unfortunately `Data.Enum` was already incorrectly introduced in the `ghc-internal` refactor. [CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208 - - - - - 336d392e by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Deprecate export of Bounded from Data.Enum This begins the process of bringing us into compliance with [CLC#208]. [CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208 - - - - - dd7ca939 by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Mention incorrect Data.Enum addition in changelog - - - - - dfd1db48 by Ben Gamari at 2024-12-06T16:56:36-05:00 base: Reintroduce {Show,Enum} IoSubSystem These instances were dropped in !9676 but not approved by the CLC. Addresses #25549. - - - - - 090fc7c1 by Peter Trommler at 2024-12-07T03:41:21-05:00 Fix requirements on T25240 T25240 doesn't need RTS linker, GHCi is sufficient and GHCi can also be dynamically linked. - - - - - 3fb5d399 by Peter Trommler at 2024-12-07T03:41:21-05:00 Fix requirements for T25155 Loading C objects requires RTS linker. - - - - - 4c58bdf6 by Leary at 2024-12-07T03:42:07-05:00 TH: Add typed variants of dataToExpQ and liftData This commit introduces to template-haskell (via ghc-internal) two functions `dataToCodeQ` and `liftDataTyped`, typed variants of `dataToExpQ` and `liftData` respectively. Tested in: `dataToCodeQUnit`. - - - - - 63027593 by Serge S. Gulin at 2024-12-08T13:52:05+03:00 JS: Basic cleanup for unused stuff to simplify things. 1. Make `staticInitStat`, `staticDeclStat`, `allocUnboxedConStatic`, `allocateStaticList`, `jsStaticArg` local to modules. 2. Remove unused `hdRawStr`, `hdStrStr` from Haskell and JavaScript (`h$pstr`, `h$rstr`, `h$str`). 3. Introduce a special type `StaticAppKind` enumeration and `StaticApp` to represent boxed scalar static applications. Originally, StaticThunk supported to pass Maybe when it became Nothing for initializied thunks in an alternatie way but it is not used anymore. - - - - - a9f8f1fb by Serge S. Gulin at 2024-12-08T14:10:45+03:00 JS: Add trivial optimizations for `unpackCString` and `unpackCStringUtf8`. It became possible due of introduction strings unfloating at Sinker pass (#13185). Earns few more bytes at optimizations. - - - - - b519c06b by Serge S. Gulin at 2024-12-08T15:50:26+03:00 JS: Specialize unpackCString# CAFs (fixes #24744) Code analysis shown that such optimization would be possible out of the box if `cachedIdentForId` allowed to do that for Haskell `Id`s which are represented by few JavaScript `Ident`s. It is a usual for strings which are represented at JavaScript as a pair of 2 values: the string content and the offset where to start reading actual string from the full content. Usually offset is 0 but technically we need to allow such complex structures to be treated as "global". Enabling it there shown that `genToplevelRhs` and `globalOccs` had inaccuracies in their implementations: 1. `globalOccs` operated over JavaScript's `Ident`s but for complex structures it didn't pay attention to the fact that different Idents actually could be pointed to same Id. Now the algo is changed to calculate occurencies for Ids. 2. `genToplevelRhs` didn't assume that different Idents pointed to same Id can have mixed order of occurence. But actually the order is important. Strings are encoded into 2 variables where first is content and second is offset and their order are not interchangeable. It is fixed by regeneration Idents from collected Ids which is fine because all Idents generation is passed through the Cache and they are quasi-stable. - - - - - a8ceccf3 by Brandon Chinn at 2024-12-09T16:25:43-05:00 Fix panic in multiline string with unterminated gap (#25530) - - - - - 9e464ad0 by Brandon Chinn at 2024-12-09T16:25:43-05:00 Add test case for unterminated multiline string - - - - - ed1ed5c6 by Rodrigo Mesquita at 2024-12-09T16:26:19-05:00 Revert mapMG renaming We had previously renamed this function for consistency, but that caused unnecessary breakage - - - - - 158261f7 by Sylvain Henry at 2024-12-09T16:27:01-05:00 RTS: make Cabal flags manual Cabal shouldn't automatically try to set them. We set them explicitly. - - - - - a83b7ed6 by Matthew Stephenson at 2024-12-10T14:01:22-05:00 Add missing @since documentation for (!?) function - - - - - e745e3a3 by Ben Gamari at 2024-12-10T14:01:59-05:00 compiler: Don't attempt to TSAN-instrument SIMD operations TSAN only provides instrumentation for 8, 16, 32, and 64-bit memory loads/stores. Don't attempt to instrument wider operations. Fixes #25563. - - - - - 684c0018 by Ben Gamari at 2024-12-10T14:02:35-05:00 gitlab/ci: Don't clobber RUNTEST_ARGS Previously the logic handling `IGNORE_PERF_FAILURES` clobbered the user's `RUNTEST_ARGS`. Fix this. - - - - - 41dae5b8 by Ben Gamari at 2024-12-10T14:03:11-05:00 hadrian: Mitigate mktexfmt race At least some versions of Texlive's `mktexfmt` utility cannot be invoked concurrently in their initial run since they fail to handle failure of `mkdir` due to racing. Specifically, we see ``` | Run Xelatex: users_guide.tex => /tmp/extra-dir-9616886274866 | Run Xelatex: Haddock.tex => /tmp/extra-dir-9616886274869 This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex) restricted \write18 enabled. kpathsea: Running mktexfmt xelatex.fmt mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order): mktexfmt: /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes: mktexfmt: /builds/ghc/ghc/tmp-home/.texlive2020/texmf-config/web2c/fmtutil.cnf /usr/bin/mktexfmt: mkdir(/builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c/) failed for tree /builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c: File exists at /usr/share/texlive/tlpkg/TeXLive/TLUtils.pm line 937. I can't find the format file `xelatex.fmt'! ``` That is two `mktexfmt` invocations (for the user's guide and haddock builds) attempted to create `$HOME/texlive2020/texmf-var/web2c` and raced. One of the two `mkdir`'s consequently failed, bringing down the entire build. We avoid this by ensuring that the first `xelatex` invocation is always performed serially. Fixes #25564. - - - - - 9efbc51f by Ben Gamari at 2024-12-10T14:03:48-05:00 rts/CheckUnload: Reset old_objects if unload is skipped Previously `checkUnload` failed to reset `old_objects` when it decided not to unload (e.g. due to heap profiling being enabled). Fixes #24935. - - - - - 5192a75f by Ben Gamari at 2024-12-11T04:28:11-05:00 rts: Annotate BCOs with their Name This introduces a new bytecode instruction, `BCO_NAME`, to aid in debugging bytecode execution. This instruction is injected by `mkProtoBCO` and captures the Haskell name of the BCO. It is then printed by the disassembler, allowing ready correlation with STG dumps. - - - - - 99225996 by Ben Gamari at 2024-12-11T04:28:48-05:00 configure: Implement ld override whitelist Bring `configure` into alignment with `ghc-toolchain`, ensuring that the ld-override logic will only take effect on Linux and Windows. Fixes #25501. - - - - - 4a8fc928 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Unmark T14028 as broken on FreeBSD This now appears to pass on FreeBSD 14. Closes #19723. - - - - - d7c0eb5a by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Migrate FreeBSD runner tag to FreeBSD 14 - - - - - 7246dacc by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Reintroduce FreeBSD 14 job - - - - - 4af936da by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Allow use of newer cabal-install bindists Newer cabal-install bindists have internal directory structure. Here we detect and account for the presence of such structure. - - - - - cbf38c1b by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Enable documentation build on FreeBSD 14 - - - - - d68107fb by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Use system libffi on FreeBSD - - - - - fea3b590 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark linker_unload as broken on FreeeBSD Due to #25491. - - - - - ccf171ee by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Prefer system toolchain on FreeBSD It's not uncommon to find machines with gcc installed via ports. We should be using the system's default clang-based toolchain instead. - - - - - cfb34738 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark T21969 as broken on FreeBSD Due to #25512. - - - - - 0b64e37c by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark RestartEventLogging as broken on FreeBSD I am seeing this fail quite reproducibly. Due to #19724. - - - - - 3b412019 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark T16180 as "broken" on FreeBSD Sadly we in fact need to skip it as it merely times out during compilation. See #14012. - - - - - 57e3cab5 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Skip T16992 unless in slow speed This test has extraordinary memory requirements and tests a rather niche aspect of the compact region mechanism. It has been suggested multiple times that we shouldn't run it in the default testsuite configuration. Finally implement this. See #21890. See #21892. - - - - - f08a72eb by Ben Gamari at 2024-12-11T19:30:54-05:00 rts(setNumCapabilities): Assert that n_caps < MAX_N_CAPS It was noticed in #25560 that this would previously be allowed, resulting in a segfault. I will add a proper exception in `base` in a future commit. - - - - - e10d31ad by Ben Gamari at 2024-12-11T19:30:55-05:00 ghc-internal: Fix inconsistent FFI import types The foreign imports of `enabled_capabilities` and `getNumberOfProcessors` were declared as `CInt` whereas they are defined as `uint32_t`. - - - - - 06265655 by Ben Gamari at 2024-12-11T19:30:55-05:00 rts: Mention maximum capability count in users guide Addresses #25560. - - - - - d488470b by Ben Gamari at 2024-12-11T19:30:55-05:00 rts/Capability: Move induction variable declaration into `for`s Just a stylistic change. - - - - - 71f050b7 by Ben Gamari at 2024-12-11T19:30:55-05:00 rts: Determine max_n_capabilities at RTS startup Previously the maximum number of capabilities supported by the RTS was statically capped at 256. However, this bound is uncomfortably low given the size of today's machine. While supporting unbounded, fully-dynamic adjustment would be nice, it is complex and so instead we do something simpler: Probe the logical core count at RTS startup and use this as the static bound for the rest of our execution. This should avoid users running into the capability limit on large machines while avoiding wasting memory on a large capabilities array for most users and keeping complexity at bay. Addresses #25560. - - - - - 1e84b411 by Ben Gamari at 2024-12-11T19:30:55-05:00 testsuite: Introduce req_c_rts As suggested by @hsyl20, this is intended to mark tests that rely on the behavior of the C RTS. - - - - - 683115a4 by Ben Gamari at 2024-12-11T19:30:55-05:00 testsuite: Add test for #25560 - - - - - ef2052a8 by Ben Gamari at 2024-12-12T04:42:32-05:00 testsuite: Only run T14497_compact in normal way This test targets the compacting GC so it makes little sense to run it across all ways. Moreover, it outright conflicts with the `nonmoving` way. - - - - - 34d3e8e6 by Ben Gamari at 2024-12-12T04:43:08-05:00 rts/CheckUnload: Don't prepare to unload if we can't unload Previously `prepareUnloadCheck` would move the `objects` list to `old_objects` even when profiling (where we cannot unload). This caused us to vacate the `objects` list during major GCs, losing track of loaded objects. Fix this by ensuring that `prepareUnloadCheck` and `checkUnload` both use the same short-cutting logic. - - - - - 9c53489d by Andrei Borzenkov at 2024-12-12T15:06:42-05:00 Update GHCi :info type declaration printing (#24459) - Do not print result's kind in type families because we have full kind in SAKS and we display invisible arity using @-binders - Do not suppress significant invisible binders An invisible binder is considered significant when it meets at least one of the following two criteria: - It visibly occurs in the declaration's body - It is followed by a significant binder, so it affects positioning For non-generative type declarations (type synonyms and type families) there is one additional criterion: - It is not followed by a visible binder, so it affects the arity of a type synonym See Note [Print invisible binders in interface declarations] for more information about what is "visibly occurs" - - - - - 13fe48d4 by Matthew Pickering at 2024-12-12T15:07:19-05:00 typechecker: Perform type family consistency checks in topological order Consider a module M importing modules A, B and C. We can waste a lot of work depending on the order that the modules are checked for family consistency. Consider that C imports A and B. When compiling C we must have already checked A and B for consistency, therefore if C is processed first then A and B will not need to be checked for consistency again. If A and B are compared first, then the consistency checks will be performed against (wasted as we already performed them for C). At the moment the order which modules are checked is non-deterministic. Clearly we should engineer that C is checked before B and A, but by what scheme? A simple one is to observe that if a module M is in the transitive closure of X then the size of the consistent family set of M is less than or equal to size of the consistent family set of X. Therefore by sorting the imports by the size of the consistent family set and processing the largest first, you make sure to process modules in topological order. In practice we have observed that this strategy has reduced the amount of consistency checks performed. One solution to #25554 - - - - - 62a2b25f by Sylvain Henry at 2024-12-14T04:31:09-05:00 TNTC: set CmmProc entry_label properly (#25565) Before this patch we were renaming the entry label of a CmmProc late in the CmmToAsm pass. It led to inconsistencies and to some labels being used in info tables but not being emitted (#25565). Now we set the CmmProc entry label earlier in the StgToCmm monad and we don't renamed it afterwards. - - - - - b339e7c3 by Simon Hengel at 2024-12-14T04:31:47-05:00 Make filter functionality for system tools line-based This is more efficient as: - All existing filter functions were line-based anyway. They broke up the input into lines and then joined it back together. - We already break up the output from system tools into lines when processing it. Splitting up the output of system tools once and then filtering and processing it reduces both code and runtime complexity. - - - - - 39669077 by Simon Hengel at 2024-12-14T04:31:47-05:00 Refactoring: Don't use a `Chan` when parsing SysTools output - - - - - 64756530 by Simon Peyton Jones at 2024-12-14T22:28:04-05:00 Tidy up the handling of `assert` Fixes #25493 - - - - - 8658fbc1 by Rodrigo Mesquita at 2024-12-14T22:28:41-05:00 base: displayException for SomeAsyncException Provide a better implementation of `SomeException` for `SomeAsyncException`. The previous, implicit, implementation, would not use the `displayException` of the exception wrapped by `SomeAsyncException`. Implements CLC-Proposal#309 Closes #25513 - - - - - 2d3a0a70 by ARATA Mizuki at 2024-12-15T18:35:30-05:00 LLVM: When emitting a vector literal with ppTypeLit, include the type information Fixes #25561 - - - - - bfacc086 by Simon Peyton Jones at 2024-12-15T18:36:05-05:00 Fix signature lookup in instance declarations This fixes a bug introduced by the fix to #16610 - - - - - 80f0e02d by Simon Peyton Jones at 2024-12-16T17:13:52+00:00 Improve GHC build times Two small changes * In GHC.Data.Unboxed, never omit interface pragmas. In "fast builds" one might omit them generally, but doing so gives very bad performance for code that imports this module. * In GHC.Hs.Dump don't do type-class specialisation. For some reason it goes mad and generates vast amounts of useless code. See #25463. - - - - - 175a1355 by Simon Peyton Jones at 2024-12-16T17:13:52+00:00 Refactor Lint Refactor Lint for two reasons: * To improve performance * To prepare for type-lets The big changes are all in GHC.Core.Lint: * Change the main APIs: * `lintType` returns nothing rather than returning a `LintedType`; * `lintCoercion` return nothing rather than returning a `LintedCoercion` Reason: these functions did a lot of allocation to return a substituted type/coercion that was often discarded, or used only to extract its kind. Instead we now return nothing, and, when needed, extract the kind and substitute. * Applications are treated as a whole, by `lintApp`. By treating multiple arguments all at once we avoid performing multiple substitutions, each substituting a single type variable. This can make an absolutely huge difference. Overall this led to a pretty massive rewrite of Lint, with many smaller changes. Smaller chnages elsewhere * Rename `GHC.Core.TyCo.Subst.getSubstInScope` to `substInScopeSet` for consistency * Define and use `GHC.Core.Type.liftedTypeOrConstraintKind` Performance. This MR someimtes gives gives a very large improvement in compile time, when Lint is on. here is a selection of changes over 5% in perf/compiler (with -dcore-lint) T25196 -97.0% T14766 -89.7% T14683 -74.4% T5631 -60.9% T20261 -56.7% T18923 -17.6% T13035 -15.8% T6048 -15.8% CoOpt_Read -14.4% T9630 -10.9% T5642 -7.3% Eliminating the egregious offenders is a big win. However, in some cases the compiler allocation /increases/. Here ae the changes over 1%: T9961 1.5% T8095 2.8% T14052 3.9% T12545 4.5% T14052Type 5.5% T5030 8.0% T5321Fun 8.3% T3064 12.7% CoOpt_Singletons 15.6% T9198 16.0% LargeRecord 18.1% I looked at the two biggest increases in compile-time bytes allocated. Interestingly, they both show substantial *decreases* in actual compile time, due to much smaller GC times. I'm honestly not sure either why the allocation increases, or why the GC time decreases; but I'm going to take the win! T9198 Baseline With patch No Lint Alloc 44.6M 44.6M Mut time 0.23s 0.22s GC time 0.21s 0.21s With Lint Alloc 309M 360M Mut time 1.51s 0.85s GC time 2.97s 0.25s ------------------- LargeRecord Baseline With patch No Lint Alloc 1.37G 1.37G Mut time 2.33s 2.33s GC time 2.40s 2.42s With Lint Alloc 3.4G 4.0G Mut time 6.02s 5.68s GC time 3.67s 3.03s IMPORTANT NOTE: These changes don't show up in CI because in CI the tests in perf/compiler are all run with -dcore-lint switched off. I gathered this data with some manual runs. - - - - - 8ef2dad6 by Simon Peyton Jones at 2024-12-17T02:48:09-05:00 Add Note [Typechecking overloaded literals] See #25494. - - - - - e86b1b20 by Ben Gamari at 2024-12-17T13:51:39-05:00 testsuite: Use math.inf instead of division-by-zero This both more directly captures the intent and also fixes #25580. - - - - - 430d965a by Ben Gamari at 2024-12-17T13:52:15-05:00 rts: Fix incorrect format specifiers in era profiling Fixes #25581. - - - - - 267098ad by Andreas Klebinger at 2024-12-18T23:43:13-05:00 Document `-prof` and non `-prof` code being incompatible. Fixes #25518. - - - - - 04433916 by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metadata: output metadata fragment in CI (cherry picked from commit 52b58a660e735b20961d792d8fa9267f01247a50) - - - - - 7c78804e by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metatdata: use fedora33 for redhat Redhat 9 doesn't have libtinfo.so.5 anymore (cherry picked from commit dc86785eb43afd1bd292287c064fb5ad94fe8c7f) - - - - - 1d72cfb2 by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metadata: still use centos for redhat <9 - - - - - 3f7ebc58 by Sylvain Henry at 2024-12-19T20:40:14-05:00 Merge ghc-bignum into ghc-internal (#24453) First step towards merging ghc-bignum and ghc-prim into ghc-internal. After this patch, ghc-bignum is deprecated and is just a shallow package reexporting modules from ghc-internal and base. Use those directly instead. Move `gmp` submodule into ghc-internal directory. - - - - - ee0150c2 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00 Improve performance of deriving Show Significantly improves performance of deriving Show instances by avoiding using the very polymorphic `.` operator in favour of inlining its definition. We were generating tons of applications of it, each which had 3 type arguments! Improves on #9557 ------------------------- Metric Decrease: InstanceMatching T12707 T3294 ------------------------ - - - - - 8b266671 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00 Don't eta expand cons when deriving Data This eta expansion was introduced with the initial commit for Linear types. I believe this isn't needed any longer. My guess is it is an artifact from the initial linear types implementation: data constructors are linear, but they shouldn't need to be eta expanded to be used as higher order functions. I suppose in the early days this wasn't true. For instance, this works now: data T x = T x f = \(x :: forall y. y -> T y) -> x True f T -- ok! T is linear, but can be passed where an unrestricted higher order function is expected. I recall there being some magic around to make this work for data constructors... Since this works, there's no need to eta_expand the data constructors in the derived Data instances. - - - - - 1f67ad21 by Andrei Borzenkov at 2024-12-25T01:42:31-05:00 Flip the order of arguments of setField (#24668) GHC Proposal 583 "HasField redesign" specifies the following order of a setField function arguments as this: setField :: forall fld a b. SetField fld a b. b -> a -> a This patch flips the application order to match the spec. - - - - - 3e0c948d by Ben Gamari at 2024-12-25T01:43:08-05:00 rel-eng/upload: Add set_symlink mode This slightly eases updating of the `latest` symlinks. - - - - - 63d63f9d by Simon Peyton Jones at 2024-12-25T01:43:45-05:00 Preserve orientation when unifying kinds This MR fixes yet another manifestation of the trickiness caused by Note [Fundeps with instances, and equality orientation]. I wish there was a more robust way to do this, but this fix is a definite improvement. Fixes #25597 - - - - - 94ba9a6a by ARATA Mizuki at 2024-12-26T10:47:57-05:00 x86 NCG SIMD: Support pack/insert/broadcast/unpack of 128-bit integer vectors - - - - - 6bf0d587 by Andrew Lelechenko at 2024-12-26T10:48:33-05:00 docs: fix haddock formatting in Control.Monad.Fix - - - - - feb14af1 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Remove unnecessary irrefutable patterns from NonEmpty functions Implementation of https://github.com/haskell/core-libraries-committee/issues/107 - - - - - 6a0d91b4 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Make cons, Semigroup, IsList, and Monad instances stricter - - - - - 1249e597 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Restore some laziness in <| and Semigroup instance, improve Monad instance The Monad instance shouldn't produce the outer :| unless f a reduces to WHNF. (Notice that the b :| bs match is implicitly lazy.) - - - - - 8699d826 by Sergey Vinokurov at 2024-12-27T15:12:30+00:00 Add comment outlining Data.List.NonEmpty implementation guiding principles - - - - - 7febe00e by Sergey Vinokurov at 2024-12-27T22:24:43+00:00 Fix tests since location of ‘>>=’ changed - - - - - a928c326 by ARATA Mizuki at 2024-12-28T03:06:14-05:00 Fix LLVM version detection With a recent LLVM, `llc -version` emits the version on the first line if the vendor is set. It emits the version on the second line otherwise. Therefore, we need to check the both lines to detect the version. GHC now emits a warning if it fails to detect the LLVM version, so we can notice if the output of `llc -version` changes in the future. Also, the warning for using LLVM < 10 on s390x is removed, because we assume LLVM >= 13 now. This fixes the definition of __GLASGOW_HASKELL_LLVM__ macro. Fixes #25606 - - - - - 7f79257a by Zubin Duggal at 2024-12-29T13:04:35+00:00 Bump base, ghc-prim and template-haskell versions for 9.12 Also bump various submodules. (cherry picked from commit 6fc1fa3bdc8f53acdb19e47145789274060e498f) Bump base bound to 4.21 for GHC 9.12 (cherry picked from commit 473a201c6b55aea5bf9c9db0836a66ea1b657e04) Bump binary submodule to 0.8.9.2 (cherry picked from commit 7199869a52ab45e8856658248bf807954d58cc20) (cherry picked from commit ec2f40b45c1a3d82d17a2fc07e9ddb9218bc3940) Bump exceptions submodule to 0.10.9 (cherry picked from commit f5b5d1dc2d326368e5b173d622630d77f019b629) Bump file-io submodule to 0.1.4 (cherry picked from commit ba786681de6ac5fa49938e2cd71a5988f0f40d1f) bump os-string submodule to 2.0.6 (cherry picked from commit 3a7ffdbb832c045a55fd1ef24f546abdd9d9e30f) bump transformers submodule to 0.6.1.2 (cherry picked from commit 53b46fd437421b9e5a001edc6d1c427439d7714f) Bump directory submodule to v1.3.9.0 (cherry picked from commit 27dc2664c5404bb462092bb216c2c37b418fd1f8) Bump Win32 submodule to v2.14.1.0 (cherry picked from commit 80df88086180f5e39212b2feacf70a9d2b263c6c) Bump filepath submodule to 1.5.3.0 (cherry picked from commit 29bfae2c58a7303a081a6e7956b9f55e5faf3eeb) Bump file-io submodule to avoid usage of QuasiQuotes (cherry picked from commit 97b0dff223a6c4cc003adec448104c277f214645) Bump unix submodule to 2.8.6.0 (cherry picked from commit a1f56d6d6a99c100f88ef0a8b4d51298cf24a42d) Bump os-string submodule to 2.0.8 (cherry picked from commit 0121b76fd52ea0c0ce5d07085bc195666b63c625) Bump file-io submodule to avoid usage of QuasiQuotes (cherry picked from commit 962ceb50c8a6fc370e1c0a267f5cd5562a8cf759) Bump filepath submodule to 1.5.4.0 (cherry picked from commit 7bc6877fd5d41c6d5900678ad5e73ed30f366569) Bump file-io submodule to 0.1.5 (cherry picked from commit 9478b5aefe2877d58baf527edcf936dddbb955b7) Bump Cabal submodule to 3.14.1.0 (cherry picked from commit 5c9c3e3f79a79bb6d9a77a17c716dc3a0bcbd2aa) Bump directory submodule to 0.12.2.0 (cherry picked from commit 897906265db37af34ae2aaa016cec417f263407b) Bump array submodule for base bump Bump stm submodule for base bump Bump process submodule for base bump - - - - - f6079408 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Fix ghc-e005 after HasCallstack changes (cherry picked from commit 77f340a24561cea8a6f2ada296b3ea356ab1823c) - - - - - 3e10fa75 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Add haskeline to stage0Packages Otherwise we link against boot inplace and boot unix as boot haskeline depends on boot unix. (cherry picked from commit 90b493769ebdf3cd7be404d18462dc20ac1044df) - - - - - 4ad6aec4 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Fix TH changelog - - - - - ea3f7fd5 by Zubin Duggal at 2024-12-29T13:04:35+00:00 release: copy index.html from correct directory (cherry picked from commit cbfd0829cd61928976c9eb17ba4af18272466063) - - - - - fafb70db by Zubin Duggal at 2024-12-29T13:04:35+00:00 hadrian-multi: warn on unused imports os-string has redundant imports (cherry picked from commit dde3796be689ea57543936e22aa5ea4ef7ed995e) - - - - - c02b1e46 by Simon Peyton Jones at 2024-12-29T17:04:30-05:00 Fix in-scope set for CSE Ticket #25468 showed an assertion failure in CSE because a top-level Id was being used before it was defined. Reason: Note [Glomming] in GHC.Core.Opt.OccurAnal. Solution (used in many places): just put all the top-level bindings in scope at the beginning of CSE. Compile-time allocation wobbles up and down a tiny bit; geo mean is zero. But MultiLayerModulesTH_OneShot and hard_hole_fits increase (on some architectures only) by a bit oever 2% . I think these are just a random fluctuations. Metric Increase: MultiLayerModulesTH_OneShot hard_hole_fits - - - - - 559d4f84 by Krzysztof Gogolewski at 2024-12-30T11:53:19-05:00 Add tests for #23883 The issue has been fixed by commit f5d3e03c56ffc63. Only T23883a is the actual regression test, the remaining ones are tricky cases found during development of an independent fix !11313. - - - - - 278a53ee by Sergey Vinokurov at 2024-12-30T11:53:59-05:00 Update changelog for CLC proposal #107 (NonEmpty laziness) - - - - - f56558be by Matthew Pickering at 2025-01-07T13:53:03-05:00 warnings: Find out if a qualified name is in the interactive scope directly There were two ad-hoc mechanisms used to determine which modules were in the interactive scope. 1. Look at everything in the GRE, to see what is imported qualified. 2. Look at the last loaded module in the HPT. (1) Is very inefficient, GlobalRdrEnvs can be very big. (2) is incorrect, there is no reason to assume the "last" thing added to the HPT has any relevance to module loading order. Happily, the same checks can be implemented directly by looking at the interactive imports from the interactive context. This mirrors what happens for normal imports. Arguably, the error reporting code shouldn't be doing this kind of processing and it should be an option is set when rendering the error message. However, this just improves the situation and doesn't block progress on that front in future. See #14225 and #15611 Fixes #25600 - - - - - 84155cdb by Simon Peyton Jones at 2025-01-07T13:53:40-05:00 Tidy up kcConDecls Addresses #25630 In particular, * Introduce ConArgKind and use it. * Make kcConDecls and tcConDecls work the same way concerning the kind of argument types - - - - - 6c12b6cf by Bryan Richter at 2025-01-07T18:15:02-05:00 Remove tmp files after toolchain check Fixes #25620 - - - - - 42826a89 by Cheng Shao at 2025-01-07T18:15:39-05:00 xxhash: bump to v0.8.3 - - - - - 185f17e4 by sheaf at 2025-01-07T18:16:15-05:00 Fix typo in GHC.Tc.Solver.Solve.runTcPluginsWanted - - - - - 23099752 by Luite Stegeman at 2025-01-08T00:33:33+01:00 Add flags for switching off speculative evaluation. We found that speculative evaluation can increase the amount of allocations in some circumstances. This patch adds new flags for selectively disabling speculative evaluation, allowing us to test the effect of the optimization. The new flags are: -fspec-eval globally enable speculative evaluation -fspec-eval-dictfun enable speculative evaluation for dictionary functions (no effect if speculative evaluation is globally disabled) The new flags are on by default for all optimisation levels. See #25284 - - - - - 0161badc by Ben Gamari at 2025-01-09T17:30:05-05:00 rts/printClosure: Print IPE information for thunks and functions This makes it considerably easier to grok the structure of the heap when IPE information is available. - - - - - 023f36f5 by Rodrigo Mesquita at 2025-01-10T14:57:48-05:00 user_guide: Note -pgmP/-optP are for /Haskell/-CPP Fixes #25574 - - - - - e1c133f2 by Ben Gamari at 2025-01-10T14:58:25-05:00 dump-decls: Suppress unit-ids While the testsuite driver already normalizes these away, they are nevertheless a severe nuisance when diffing outside of the testsuite. Intriguingly, this doesn't completely eliminate the unit IDs; some wired-in names are still printed. However, this is a cheap and helpful improvement over the status quo so I am simply going to accept this. Fixes #25334. - - - - - 2e7bf446 by sheaf at 2025-01-13T10:55:26+01:00 Remove SDocs from ErrCtxt & ErrInfo This commit: - turns the SDoc used in ErrCtxt into a proper error datatype, ErrCtxtMsg, which contains all the different error contexts that can be added, - replaces ErrInfo with [ErrCtxt]. ErrInfo used to contain two SDocs; the first is replaced with [ErrCtxt], and the second is removed, with the relevant information being put in the appropriate error message constructors. Fixes #23436 - - - - - 2d62b970 by Mike Pilgrem at 2025-01-13T12:59:10-05:00 Re CLC #300 - Specify fmap for NonEmpty as map See: * https://github.com/haskell/core-libraries-committee/issues/300 Seeks to: * move existing instances for NonEmpty (except of Eq and Ord) out of GHC.Internal.Base into new GHC.Internal.Data.NonEmpty (to avoid otherwise unavoidable cycles in the module graph); * move map out of Data.List.NonEmpty (base package) into GHC.Internal.Data.NonEmpty; * define fmap as map for NonEmpty instance of Functor, avoiding code duplication; * re-export map from existing GHC.Internal.Data.List.NonEmpty; and * re-export map from Data.List.NonEmpty (base package); without breaking anything in the GHC repository. Various tests *.stdout and *.stderr files are amended also. - - - - - ab3ab3e3 by Luite Stegeman at 2025-01-13T12:59:58-05:00 compiler/coreprep: Turn off dictionary speculation by default Speculative evaluation can cause performance regressions, therefore we turn it off by default. It can be enabled again with the -fspec-eval-dictfun flag See #25284 - - - - - 3d9cacd5 by Patrick at 2025-01-14T02:34:46+08:00 Enhance kind inference for data family instances This commit improves kind inference for data family instances by kind-checking the constructors, for H98 and newtype declarations (ONLY), as well as kind-checking the result kind signature (when using GADT syntax). This fixes #25611. Typechecker changes: In `tcDataFamInstHeader`, we now kind-check the constructors using `kcConDecls`, for H98-style decls and newtype decls ONLY. See Note [Kind inference for data family instances]. Testsuite changes: - The T25611{a,b,c,d} tests test the new kind inference implementation. - a,b: infer result kind from constructors (H98 case) - c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail, which now passes - d: GADT case, checking that we don't infer overly rigid kinds when kind-checking the constructors in data family instances. - DataInstanceKindsDefaults tests defaulting data instance kinds without UnliftedNewtypes or UnliftedDatatypes, as outlined in Note [Defaulting result kind of newtype/data family instance]. Also a few notes are updated to reflect the changes. Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones at gmail.com> - - - - - f6493dbc by amesgen at 2025-01-15T18:47:23-05:00 wasm: prevent bundlers from resolving import("node:timers") This fixes the following esbuild error: ✘ [ERROR] Could not resolve "node:timers" www/ghc_wasm_jsffi.js:66:25: 66 │ return (await import("node:timers")).setImmediate; ╵ ~~~~~~~~~~~~~ The package "node:timers" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "--platform=node" to do that, which will remove this error. Previously (i.e. after !13503), one had to work around this by passing `--external:node:timers`. - - - - - 87e82e2e by sheaf at 2025-01-16T14:51:45+01:00 Use checkTyEqRhs to make types concrete This commit refactors makeTypeConcrete to call checkTyEqRhs with the appropriate parameters. This avoids duplicating subtle logic in two places in the compiler. Changes: 1. Refactor of 'TyEqFlags'. Now 'TyEqFlags' stores a 'TEFTask', which is a description of which of the following checks we want to perform in 'checkTyEqRhs': - occurs check - level check - concreteness check In the process, the 'AreUnifying' datatype has been removed, as it is no longer needed. 2. Refactor of 'checkTyVar': a. Make use of the new 'TEFTask' data type to decide which checks to perform. In particular, this ensures that we perform **both** a concreteness check and a level check when both are required; previously we only did a concreteness check (that was a bug!). b. Recursively call 'checkTyVar' on the kind of unfilled metavariables. This deals with a bug in which we failed to uphold the invariant that the kind of a concrete type must itself be concrete. See test cases T23051, T23176. 3. Re-write of 'makeTypeConcrete', which now simply calls 'checkTyEqRhs' with appropriate 'TyEqFlags'/'TEFTask'. This gets rid of code duplication and risk for the two code paths going out-of-sync. Fixes #25616. See also #23883. - - - - - 5a8f35bd by ARATA Mizuki at 2025-01-17T11:17:49-05:00 x86 NCG: Use correct format for MOVD in the implementation of unpackInt64X2# MOVD takes the input format. Fixes #25658 - - - - - 14f8a7ec by Mateusz Goślinowski at 2025-01-17T22:49:09+00:00 Allow multiline strings in JS FFI (#25633) - - - - - 854c2f75 by Simon Peyton Jones at 2025-01-18T02:54:08-05:00 Fix a buglet in tcSplitForAllTyVarsReqTVBindersN The problem was that an equation in `split` had two guards (one about visiblity and one about `n_req`). So it fell thorugh if /either/ was False. But the next equation then assumed an invisible binder. Simple bug, easily fixed. Fixes #25661. - - - - - 264a1186 by sheaf at 2025-01-18T10:05:56+00:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - bf4f5ad3 by Jade at 2025-01-18T10:05:56+00:00 Add structured errors to GHCi (#23338) This patch creates the 'GhciCommandErrorMessage' data type which implents the 'Diagnostic' class and also provides error code for these error conditions. - - - - - b6f54188 by Ben Gamari at 2025-01-18T12:38:46-05:00 Revert "Division by constants optimization" This appears to be responsible for the regression described in #25653. This reverts commit daff1e30219d136977c71f42e82ccc58c9013cfb. - - - - - 0fd90de8 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Introduce div2 test This is a useful test from !8392 which is worth keeping around. - - - - - 32680979 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Test shift correctness in mul2 test - - - - - 163aa50a by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Add regression test for #25653 - - - - - 44778963 by Matthew Pickering at 2025-01-20T11:23:08+00:00 driver: Store an ExternalModuleGraph in the EPS We now store an ExternalModuleGraph in the EPS. When an new interface is loaded, the module graph is extended with a node for the loaded interface. The result is a partial module graph. If you want to run a transitive closure query on the graph you must first force the transitive closure to be loaded by using `loadExternalGraphBelow`. The primary advantage (for now) is that the transitive dependency calculation does not have to be repeated in getLinkDeps. If your module had many dependencies and many splices, performing this calculation at every splice site took a significant amount of time. We might also want to use this module graph in future for considering questions such as reachability of rules or accessibilty of instance imported by levelled imported. This patch removes another place in the compiler where transitive dependency is calculated in an ad-hoc manner. In general, the transitive dependency calculation should be cached and computed using a ModuleGraph abstraction. The transitive dependency query required by getLinkDeps operates on a graph without hs-boot nodes. If a linkable from a module in a loop is needed, then all modules in the loop are necessary to be available to execute that module. Therefore there is a query in `ModuleGraph` and `ExternalModuleGraph` which allows a transitive closure query to be performed on a graph without loops. Fixes #25634 ------------------------- Metric Decrease: MultiLayerModulesTH_Make MultiLayerModulesTH_OneShot Metric Increase: mhu-perf ------------------------- Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - b3c0acfc by Cheng Shao at 2025-01-20T11:53:10-05:00 hie: fix hie.yaml to use default hie-bios script !13778 accidentally changed hie.yaml to use hie-bios.bat as the default hie-bios script, which completely breaks hie support on non-Windows platforms. This patch reverts that change. - - - - - 595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. - - - - - 09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00 Fix :info pretty-printing of UNPACKed fields This patch: * Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int` as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the `:info` command. * Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one unpacks a newtype) from being printed in `:info` output unless `-dppr-debug` is enabled. Fixes #25651. - - - - - 6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00 driver: Store the HomePackageTable in a mutable reference This commit refactors the HomePackageTable and HomeUnitGraph: (1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511) (2) And it reworks these structures into their own modules to simplify the driver. The refactor is driven by the introduction of IO in the HPT interface, but is a bit more aggressive in simplifying the interfaces to enforce correct usage (ie to avoid performance pitfalls). Specifically: - The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph` - The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable` - The HPT now stores an `IORef` with the table of loaded home package modules. - The interface to the HPT now requires IO - The interface now enforces that the HPT is a datastructure that only grows - This is not enforced in the interface, but, clients of the HPT should never care about there being more or less entries in the HPT when these additional entries are not relevant to their result. - The exception to the invariant that the HPT is monotonically increasing is `restrictHpt`, a function which is called at a "barrier point" (during which there are no other threads inspecting or inserting in the HPT). The invariant can be temporarily broken at this point (currently, after upsweep). This is safe because a single thread holds control over the structure (thus the invariant being broken is never observed). The hug_var and associated structures in the driver, which aimed to improve memory usage in the driver by updating in place a HUG during upsweep, are no longer required as the HPT entries in the HUG are now themselves mutable by construction. This was previously explained in Note [ModuleNameSet, efficiency and space leaks], which is no longer relevant and was deleted. Fixes #25511 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> ------------------------- Metric Decrease: MultiComponentModulesRecomp MultiLayerModulesRecomp ------------------------- - - - - - f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 Fix build with gcc-15 which defaults to C23 standard (-std=gnu23) Fixes #25662 ``` utils/hp2ps/Utilities.c:6:14: error: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c:5:1: error: note: ‘malloc’ is declared in header ‘<stdlib.h>’ 4 | #include "Error.h" +++ |+#include <stdlib.h> 5 | | 5 | | ^ utils/hp2ps/Utilities.c: In function ‘xmalloc’: utils/hp2ps/Utilities.c:80:17: error: error: too many arguments to function ‘malloc’; expected 0, have 1 80 | r = (void*) malloc(n); | ^~~~~~ ~ | 80 | r = (void*) malloc(n); | ^ utils/hp2ps/Utilities.c:6:14: error: note: declared here 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c: In function ‘xrealloc’: utils/hp2ps/Utilities.c:92:18: error: warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:92:18: error: note: ‘realloc’ is declared in header ‘<stdlib.h>’ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:94:9: error: error: too many arguments to function ‘realloc’; expected 0, have 2 94 | r = realloc(p, n); | ^~~~~~~ ~ | 94 | r = realloc(p, n); | ^ utils/hp2ps/Utilities.c:92:18: error: note: declared here 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ ``` - - - - - 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - 6f380d99 by Alan Zimmerman at 2025-01-27T19:46:38+00:00 GHC-CPP: first rough proof of concept Processes #define FOO #ifdef FOO x = 1 #endif Into [ITcppIgnored [L loc ITcppDefine] ,ITcppIgnored [L loc ITcppIfdef] ,ITvarid "x" ,ITequal ,ITinteger (IL {il_text = SourceText "1", il_neg = False, il_value = 1}) ,ITcppIgnored [L loc ITcppEndif] ,ITeof] In time, ITcppIgnored will be pushed into a comment - - - - - 7ec375ca by Alan Zimmerman at 2025-01-27T19:46:42+00:00 Tidy up before re-visiting the continuation mechanic - - - - - 9fe0f7b8 by Alan Zimmerman at 2025-01-27T19:46:42+00:00 Switch preprocessor to continuation passing style Proof of concept, needs tidying up - - - - - fe8fd14c by Alan Zimmerman at 2025-01-27T19:46:42+00:00 Small cleanup - - - - - a0ed5e71 by Alan Zimmerman at 2025-01-27T19:46:42+00:00 Get rid of some cruft - - - - - b9a996ae by Alan Zimmerman at 2025-01-27T19:51:40+00:00 Starting to integrate. Need to get the pragma recognised and set - - - - - aa08ecf0 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Make cppTokens extend to end of line, and process CPP comments - - - - - 9ceb0b64 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Remove unused ITcppDefined - - - - - 662ce874 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Allow spaces between # and keyword for preprocessor directive - - - - - fb03b588 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Process CPP continuation lines They are emited as separate ITcppContinue tokens. Perhaps the processing should be more like a comment, and keep on going to the end. BUT, the last line needs to be slurped as a whole. - - - - - 409392b5 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Accumulate CPP continuations, process when ready Can be simplified further, we only need one CPP token - - - - - e9c7b357 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Simplify Lexer interface. Only ITcpp We transfer directive lines through it, then parse them from scratch in the preprocessor. - - - - - b5980c41 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Deal with directive on last line, with no trailing \n - - - - - c4f4db95 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Start parsing and processing the directives - - - - - db0d02a8 by Alan Zimmerman at 2025-01-27T19:51:45+00:00 Prepare for processing include files - - - - - b09c9b84 by Alan Zimmerman at 2025-01-27T20:01:36+00:00 Move PpState into PreProcess And initParserState, initPragState too - - - - - 773a75e2 by Alan Zimmerman at 2025-01-27T20:03:26+00:00 Process nested include files Also move PpState out of Lexer.x, so it is easy to evolve it in a ghci session, loading utils/check-cpp/Main.hs - - - - - 2d900657 by Alan Zimmerman at 2025-01-27T20:03:28+00:00 Split into separate files - - - - - b63c0701 by Alan Zimmerman at 2025-01-27T20:03:28+00:00 Starting on expression parser. But it hangs. Time for Text.Parsec.Expr - - - - - 8b15b9e2 by Alan Zimmerman at 2025-01-27T20:03:28+00:00 Start integrating the ghc-cpp work >From https://github.com/alanz/ghc-cpp - - - - - 3262a45f by Alan Zimmerman at 2025-01-27T20:03:28+00:00 WIP - - - - - 1d152514 by Alan Zimmerman at 2025-01-27T21:25:34+00:00 Fixup after rebase - - - - - a89ac1bd by Alan Zimmerman at 2025-01-27T22:07:55+00:00 WIP - - - - - b4134b73 by Alan Zimmerman at 2025-02-01T10:45:33+00:00 Fixup after rebase, including all tests pass - - - - - 13 changed files: - .ghcid - + .git-blame-ignore-revs - .gitattributes - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/flake.lock - .gitlab/generate-ci/gen_ci.hs - .gitlab/hello.hs - .gitlab/issue_templates/bug.md → .gitlab/issue_templates/default.md The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/01f6c1eb7cf6fbb55d902f3d76f0a2b2707d2741...b4134b73432211cb9a8a306cd318765b532bcdac -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/01f6c1eb7cf6fbb55d902f3d76f0a2b2707d2741...b4134b73432211cb9a8a306cd318765b532bcdac You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 10:51:22 2025 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Sat, 01 Feb 2025 05:51:22 -0500 Subject: [Git][ghc/ghc][wip/supersven/riscv-vectors] 3 commits: Compile vector helper files with vector support Message-ID: <679dfcaad3a0b_12e1e37ba3f49293a@gitlab.mail> Sven Tennie pushed to branch wip/supersven/riscv-vectors at Glasgow Haskell Compiler / GHC Commits: f2c4ae33 by Sven Tennie at 2025-02-01T09:47:30+01:00 Compile vector helper files with vector support - - - - - 8ab58512 by Sven Tennie at 2025-02-01T11:12:32+01:00 -mriscv-vlen makes more sense to RISC-V people VLEN is a well defined term. - - - - - c1667712 by Sven Tennie at 2025-02-01T11:50:58+01:00 Simplify expressions - - - - - 4 changed files: - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/Driver/Session.hs - docs/users_guide/using.rst - hadrian/src/Settings/Packages.hs Changes: ===================================== compiler/GHC/CmmToAsm/RV64/CodeGen.hs ===================================== @@ -483,11 +483,11 @@ assertVectorRegWidth expr = do if isVecFormat format then case mbRegMinBits of Nothing -> pprPanic - "CmmExpr results in vector format, but no vector register configured (see -mvector-min-width-bits in docs)" + "CmmExpr results in vector format, but no vector register configured (see -mriscv-vlen in docs)" (pdoc platform expr) Just regMinBits | (formatInBytes format) * 8 <= regMinBits -> pure () | otherwise -> pprPanic - "CmmExpr results in vector format which is bigger than the configured vector register size (see -mvector-min-width-bits in docs)" + "CmmExpr results in vector format which is bigger than the configured vector register size (see -mriscv-vlen in docs)" (pdoc platform expr) else pure () @@ -680,7 +680,6 @@ getRegister' config plat expr = case (width, format) of (_w, f) | isVecFormat f -> - -- TODO: Check for configured vectorMinBits pure ( Any format @@ -866,23 +865,8 @@ getRegister' config plat expr = -- TODO: MO_V_Broadcast with immediate: If the right value is a literal, -- it may use vmv.v.i (simpler) - -- TODO: Duplication with MO_VF_Broadcast - MO_V_Broadcast length w -> do - (reg_val, format_val, code_val) <- getSomeReg e - let toFmt = VecFormat length (intScalarFormat w) - pure $ Any toFmt $ \dst -> - code_val - `snocOL` annExpr - expr - (VMV (OpReg toFmt dst) (OpReg format_val reg_val)) - MO_VF_Broadcast length w -> do - (reg_val, format_val, code_val) <- getSomeReg e - let toFmt = VecFormat length (floatScalarFormat w) - pure $ Any (vecFormat (cmmVec length (cmmFloat w))) $ \dst -> - code_val - `snocOL` annExpr - expr - (VMV (OpReg toFmt dst) (OpReg format_val reg_val)) + MO_V_Broadcast length w ->vectorBroadcast (intVecFormat length w) + MO_VF_Broadcast length w -> vectorBroadcast (floatVecFormat length w) -- TODO: NO MO_V_Neg? Why? MO_VF_Neg length w -> do @@ -934,6 +918,15 @@ getRegister' config plat expr = where shift = 64 - (widthInBits from - widthInBits to) + vectorBroadcast :: Format -> NatM Register + vectorBroadcast targetFormat = do + (reg_val, format_val, code_val) <- getSomeReg e + pure $ Any targetFormat $ \dst -> + code_val + `snocOL` annExpr + expr + (VMV (OpReg targetFormat dst) (OpReg format_val reg_val)) + -- Dyadic machops: -- -- The general idea is: @@ -1260,60 +1253,21 @@ getRegister' config plat expr = MO_U_Shr w -> intOp False w (\d x y -> unitOL $ annExpr expr (SRL d x y)) MO_S_Shr w -> intOp True w (\d x y -> unitOL $ annExpr expr (SRA d x y)) - -- TODO: Use vecOp here - MO_VF_Extract length w -> do - (reg_v, format_v, code_v) <- getSomeReg x - (reg_idx, format_idx, code_idx) <- getSomeReg y - let format_dst = floatFormat w - tmp <- getNewRegNat format_v - pure $ Any format_dst $ \dst -> - code_v - `appOL` code_idx - `snocOL` - -- Setup - -- TODO: Use width - annExpr - expr - -- Move selected element to index 0 - -- vslidedown.vi v8, v9, 2 - (VSLIDEDOWN (OpReg format_v tmp) (OpReg format_v reg_v) (OpReg format_idx reg_idx)) - `snocOL` - -- Move to float register - -- vmv.x.s a0, v8 - VMV (OpReg format_dst dst) (OpReg format_v tmp) - - -- TODO: Duplication with MO_VF_Extract - MO_V_Extract length w -> do - (reg_v, format_v, code_v) <- getSomeReg x - (reg_idx, format_idx, code_idx) <- getSomeReg y - tmp <- getNewRegNat format_v - let format_dst = floatFormat w - pure $ Any format_dst $ \dst -> - code_v - `appOL` code_idx - `snocOL` - -- Setup - -- TODO: Use width - annExpr - expr - -- Move selected element to index 0 - -- vslidedown.vi v8, v9, 2 - (VSLIDEDOWN (OpReg format_v tmp) (OpReg format_v reg_v) (OpReg format_idx reg_idx)) - `snocOL` - -- Move to float register - -- vmv.x.s a0, v8 - VMV (OpReg format_dst dst) (OpReg format_v tmp) - MO_VF_Add length w -> vecOp (floatVecFormat length w) (\d x y -> (VADD d x y)) - MO_VF_Sub length w -> vecOp (floatVecFormat length w) (\d x y -> (VSUB d x y)) - MO_VF_Mul length w -> vecOp (floatVecFormat length w) (\d x y -> (VMUL d x y)) - MO_VF_Quot length w -> vecOp (floatVecFormat length w) (\d x y -> (VQUOT d x y)) + -- Vector operations + MO_VF_Extract length w -> vecOp (floatVecFormat length w) VSLIDEDOWN + MO_V_Extract length w -> vecOp (intVecFormat length w) VSLIDEDOWN + + MO_VF_Add length w -> vecOp (floatVecFormat length w) VADD + MO_VF_Sub length w -> vecOp (floatVecFormat length w) VSUB + MO_VF_Mul length w -> vecOp (floatVecFormat length w) VMUL + MO_VF_Quot length w -> vecOp (floatVecFormat length w) VQUOT -- See https://godbolt.org/z/PvcWKMKoW - MO_VS_Min length w -> vecOp (intVecFormat length w) (\d x y -> (VSMIN d x y)) - MO_VS_Max length w -> vecOp (intVecFormat length w) (\d x y -> (VSMAX d x y)) - MO_VU_Min length w -> vecOp (intVecFormat length w) (\d x y -> (VUMIN d x y)) - MO_VU_Max length w -> vecOp (intVecFormat length w) (\d x y -> (VUMAX d x y)) - MO_VF_Min length w -> vecOp (floatVecFormat length w) (\d x y -> (VFMIN d x y)) - MO_VF_Max length w -> vecOp (floatVecFormat length w) (\d x y -> (VFMAX d x y)) + MO_VS_Min length w -> vecOp (intVecFormat length w) VSMIN + MO_VS_Max length w -> vecOp (intVecFormat length w) VSMAX + MO_VU_Min length w -> vecOp (intVecFormat length w) VUMIN + MO_VU_Max length w -> vecOp (intVecFormat length w) VUMAX + MO_VF_Min length w -> vecOp (floatVecFormat length w) VFMIN + MO_VF_Max length w -> vecOp (floatVecFormat length w) VFMAX _e -> panic $ "Missing operation " ++ show expr -- Vectors ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -1685,7 +1685,7 @@ dynamic_flags_deps = [ , make_ord_flag defGhcFlag "mavx512f" (noArg (\d -> d { avx512f = True })) , make_ord_flag defGhcFlag "mavx512pf" (noArg (\d -> d { avx512pf = True })) - , make_ord_flag defGhcFlag "mvector-min-width-bits" + , make_ord_flag defGhcFlag "mriscv-vlen" (word64SuffixM setVectorMinBits) , make_ord_flag defGhcFlag "mfma" (noArg (\d -> d { fma = True })) ===================================== docs/users_guide/using.rst ===================================== @@ -1743,7 +1743,7 @@ Some flags only make sense for particular target platforms. multiply-add, which might perform non-IEEE-compliant software emulation on some platforms (depending on the implementation of the C standard library). -.. ghc-flag:: -mvector-min-width-bits +.. ghc-flag:: -mriscv-vlen :shortdesc: (RISC-V NCG only) Minimal width of vector registers in bits :type: dynamic :category: platform-options ===================================== hadrian/src/Settings/Packages.hs ===================================== @@ -325,6 +325,7 @@ rtsPackageArgs = package rts ? do libzstdLibraryDir <- getSetting LibZstdLibDir x86 <- queryTarget (\ tgt -> archOS_arch (tgtArchOs tgt) `elem` [ ArchX86, ArchX86_64 ]) + riscv64 <- queryTarget (\ tgt -> archOS_arch (tgtArchOs tgt) == ArchRISCV64) -- Arguments passed to GHC when compiling C and .cmm sources. let ghcArgs = mconcat @@ -340,11 +341,13 @@ rtsPackageArgs = package rts ? do -- -- In particular, we **do not** pass -mavx when compiling -- AutoApply_V16.cmm, as that would lock out targets with SSE2 but not AVX. - , inputs ["**/AutoApply_V32.cmm"] ? pure [ "-mavx2" | x86 ] - , inputs ["**/AutoApply_V64.cmm"] ? pure [ "-mavx512f" | x86 ] + , inputs ["**/AutoApply_V16.cmm"] ? pure [ "-mriscv-vlen 128" | riscv64] + , inputs ["**/AutoApply_V32.cmm"] ? pure ([ "-mavx2" | x86 ] ++ [ "-mriscv-vlen 256" | riscv64]) + , inputs ["**/AutoApply_V64.cmm"] ? pure ([ "-mavx512f" | x86 ] ++ [ "-mriscv-vlen 512" | riscv64]) - , inputs ["**/Jumps_V32.cmm"] ? pure [ "-mavx2" | x86 ] - , inputs ["**/Jumps_V64.cmm"] ? pure [ "-mavx512f" | x86 ] + , inputs ["**/Jumps_V16.cmm"] ? pure [ "-mriscv-vlen 128" | riscv64] + , inputs ["**/Jumps_V32.cmm"] ? pure ([ "-mavx2" | x86 ] ++ [ "-mriscv-vlen 256" | riscv64]) + , inputs ["**/Jumps_V64.cmm"] ? pure ([ "-mavx512f" | x86 ] ++ [ "-mriscv-vlen 512" | riscv64]) ] let cArgs = mconcat @@ -420,11 +423,13 @@ rtsPackageArgs = package rts ? do , "**/AutoApply_V64.c" ] ? pure ["-fno-PIC", "-static"] -- See Note [AutoApply.cmm for vectors] in genapply/Main.hs - , inputs ["**/AutoApply_V32.c"] ? pure [ "-mavx2" | x86 ] - , inputs ["**/AutoApply_V64.c"] ? pure [ "-mavx512f" | x86 ] + , inputs ["**/AutoApply_V16.c"] ? pure [ "-march=rv64g_zvl128b" | riscv64] + , inputs ["**/AutoApply_V32.c"] ? pure ([ "-mavx2" | x86 ] ++ [ "-march=rv64g_zvl256b" | riscv64]) + , inputs ["**/AutoApply_V64.c"] ? pure ([ "-mavx512f" | x86 ] ++ [ "-march=rv64g_zvl512b" | riscv64]) - , inputs ["**/Jumps_V32.c"] ? pure [ "-mavx2" | x86 ] - , inputs ["**/Jumps_V64.c"] ? pure [ "-mavx512f" | x86 ] + , inputs ["**/Jumps_V16.c"] ? pure [ "-mriscv-vlen 128" | riscv64] + , inputs ["**/Jumps_V32.c"] ? pure ([ "-mavx2" | x86 ] ++ [ "-march=rv64g_zvl256b" | riscv64]) + , inputs ["**/Jumps_V64.c"] ? pure ([ "-mavx512f" | x86 ] ++ [ "-march=rv64g_zvl512b" | riscv64]) -- inlining warnings happen in Compact , inputs ["**/Compact.c"] ? arg "-Wno-inline" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fa321f9c00874feb7900690feb90cf991c4e5c63...c166771226e3d4be115b5aaaffe0af81d7b80d27 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fa321f9c00874feb7900690feb90cf991c4e5c63...c166771226e3d4be115b5aaaffe0af81d7b80d27 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 10:55:24 2025 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Sat, 01 Feb 2025 05:55:24 -0500 Subject: [Git][ghc/ghc][wip/T24359] WIP: another approach to 'fully solving' for tcSpecPrag Message-ID: <679dfd9c6b71a_12e1e37ba39093316@gitlab.mail> sheaf pushed to branch wip/T24359 at Glasgow Haskell Compiler / GHC Commits: 4c9dc29c by sheaf at 2025-02-01T11:55:15+01:00 WIP: another approach to 'fully solving' for tcSpecPrag - - - - - 2 changed files: - compiler/GHC/Tc/Gen/Sig.hs - testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs Changes: ===================================== compiler/GHC/Tc/Gen/Sig.hs ===================================== @@ -39,7 +39,7 @@ import GHC.Tc.Gen.HsType import GHC.Tc.Solver( reportUnsolvedEqualities, pushLevelAndSolveEqualitiesX , emitResidualConstraints ) import GHC.Tc.Solver.Solve( solveWanteds ) -import GHC.Tc.Solver.Monad( runTcS, runTcSSpecPragWithEvBinds ) +import GHC.Tc.Solver.Monad( runTcS, runTcSWithEvBinds ) import GHC.Tc.Validity ( checkValidType ) import GHC.Tc.Utils.Monad @@ -57,6 +57,7 @@ import GHC.Tc.Zonk.TcType import GHC.Tc.Zonk.Type import GHC.Core( hasSomeUnfolding ) +import GHC.Core.FVs (exprSomeFreeVars) import GHC.Core.Type import GHC.Core.Multiplicity import GHC.Core.Predicate @@ -71,6 +72,7 @@ import GHC.Types.Basic import GHC.Types.Name import GHC.Types.Name.Env import GHC.Types.SrcLoc +import GHC.Types.Unique.Set import GHC.Builtin.Names( mkUnboundName ) import GHC.Unit.Module( Module, getModule ) @@ -80,12 +82,14 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Data.Bag -import GHC.Data.Maybe( orElse, whenIsJust ) +import GHC.Data.Maybe( orElse, whenIsJust, expectJust ) import Control.Monad( unless ) import Data.Foldable ( toList ) +import qualified Data.Graph as Graph import qualified Data.List.NonEmpty as NE import Data.Maybe( mapMaybe ) +import qualified Data.Semigroup as S {- ------------------------------------------------------------- @@ -976,27 +980,67 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) let skol_info_anon = SpecESkol nm ; traceTc "tcSpecPrag SpecSigE 1" (ppr nm $$ ppr spec_e) ; skol_info <- mkSkolemInfo skol_info_anon - ; (rhs_tclvl, wanted, (rule_bndrs', (tc_spec_e, _rho))) + ; (rhs_tclvl, spec_e_wanted, (rule_bndrs', (tc_spec_e, _rho))) <- tcRuleBndrs skol_info rule_bndrs $ tcInferRho spec_e - -- (2) Simplify the constraints, in special TcSSpecPrag mode + -- (2) Solve the Wanteds that arose from typechecking spec_e, but + -- in a special way: every original Wanted should be either fully solved + -- or left untouched. + -- + -- We achieve this by: + -- + -- 2.1. Clone the wanteds that arose from typechecking spec_e. + -- + -- 2.2 Try to solve them, and look through the evidence to see which + -- ones we could fully solve. + -- + -- 2.3 Separate the original Wanteds into two groups, those that + -- we could fully solve and those that we couldn't + -- + -- The fully soluble ones get solved again (a bit wasteful). + -- The other ones either get quantified or emitted as residuals, + -- depending on whether they can be quantified (see 'getRuleQuantCts'.) + ; ev_binds_var_clone <- newTcEvBinds + ; spec_e_wanted_clone <- cloneWC spec_e_wanted + ; simpl_spec_e_wanted_clone <- setTcLevel rhs_tclvl $ + runTcSWithEvBinds ev_binds_var_clone $ + solveWanteds spec_e_wanted_clone + ; not_fully_solved <- + notFullySolvedWanteds ev_binds_var_clone simpl_spec_e_wanted_clone + + ; spec_e_wanted <- liftZonkM $ zonkWC spec_e_wanted + + ; let (fully_soluble1, other1) = + partitionWC + (\ ev_id -> not (ev_id `elemVarSet` not_fully_solved)) + spec_e_wanted + ; ev_binds_var <- newTcEvBinds - ; wanted <- setTcLevel rhs_tclvl $ - runTcSSpecPragWithEvBinds ev_binds_var $ - solveWanteds wanted + ; simpl_fully_soluble1 <- setTcLevel rhs_tclvl $ + runTcSWithEvBinds ev_binds_var $ + solveWanteds fully_soluble1 + ; massertPpr (isSolvedWC simpl_fully_soluble1) $ + vcat [ text "tcSpecPrag: fully soluble Wanteds couldn't be fully solved?" + , text "spec_e_wanted:" <+> ppr spec_e_wanted + , text "spec_e_wanted_clone:" <+> ppr spec_e_wanted_clone + , text "simpl_spec_e_wanted_clone:" <+> ppr simpl_spec_e_wanted_clone + , text "not_fully_solved:" <+> ppr not_fully_solved + , text "fully_soluble1:" <+> ppr fully_soluble1 + , text "other1:" <+> ppr other1 + , text "simpl_fully_soluble1:" <+> ppr simpl_fully_soluble1 + ] -- (3) Quantify over the constraints - ; qevs <- mapM newEvVar $ - ctsPreds $ - approximateWC False wanted + ; (quant_cts, residual) <- getRuleQuantCts other1 + ; let qevs = map ctEvId $ bagToList quant_cts -- (4) Emit the residual (non-quantified) constraints, -- and wrap the expression in the evidence let bindings ; let tv_bndrs = filter isTyVar rule_bndrs' ; emitResidualConstraints rhs_tclvl skol_info_anon ev_binds_var emptyVarSet tv_bndrs qevs - wanted + residual ; let lhs_call = mkLHsWrap (WpLet (TcEvBinds ev_binds_var)) tc_spec_e ; traceTc "tcSpecPrag:SpecSigE" $ @@ -1004,7 +1048,19 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) , text "rule_bndrs':" <+> ppr rule_bndrs' , text "qevs:" <+> ppr qevs , text "spec_e:" <+> ppr tc_spec_e - , text "inl:" <+> ppr inl ] + , text "inl:" <+> ppr inl + , text (replicate 40 '=') + , text "spec_e_wanted:" <+> ppr spec_e_wanted + , text "spec_e_wanted_clone:" <+> ppr spec_e_wanted_clone + , text "simpl_spec_e_wanted_clone:" <+> ppr simpl_spec_e_wanted_clone + , text "not_fully_solved:" <+> ppr not_fully_solved + , text "fully_soluble1:" <+> ppr fully_soluble1 + , text "other1:" <+> ppr other1 + , text "simpl_fully_soluble1:" <+> ppr simpl_fully_soluble1 + , text (replicate 40 '-') + , text "quant_cts:" <+> ppr quant_cts + , text "residual:" <+> ppr residual + ] ; return [SpecPragE { spe_fn_nm = nm , spe_fn_id = poly_id @@ -1015,6 +1071,73 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) tcSpecPrag _ prag = pprPanic "tcSpecPrag" (ppr prag) +-- | Figure out the 'EvId's of all the Wanted constraints that +-- are not fully solved, by inspecting their evidence terms. +notFullySolvedWanteds :: EvBindsVar -> WantedConstraints -> TcM VarSet +notFullySolvedWanteds ev_binds_var wc + = do { (unsolved_ids, ev_deps_edges) <- ev_binds_edges ev_binds_var wc + ; let (ev_graph, node_from_vertex, vertex_from_key) = Graph.graphFromEdges ev_deps_edges + evid_from_vertex v = case node_from_vertex v of ( ev_id, _, _ ) -> ev_id + reachable = mkVarSet + $ concatMap (map evid_from_vertex . toList) + $ Graph.dfs + (Graph.transposeG ev_graph) + (map (expectJust "tcSpecPrag (computing fully solved)" . vertex_from_key) unsolved_ids) + ; return reachable + } + +ev_binds_edges :: EvBindsVar -> WantedConstraints -> TcM ([EvId], [(EvId, EvId, [EvId])]) +ev_binds_edges ev_binds_var0 ( WC { wc_simple = cts, wc_impl = implics } ) + = do { ev_binds <- getTcEvBindsMap ev_binds_var0 + ; edges1 <- foldMapM ev_bind_edges (evBindMapBinds ev_binds) + ; let edges2 = foldMap (\ ct -> let i = ctEvId ct in ([i], [(i,i,[])])) cts + ; (insols3, edges3) <- foldMapM go_implic implics + ; return $ + edges2 S.<> ( insols3, edges1 S.<> edges3 ) + } + where + ev_bind_edges :: EvBind -> TcM [(EvId, EvId, [EvId])] + ev_bind_edges (EvBind { eb_lhs = ev_id, eb_rhs = body }) = do + ev_deps <- evVarsOfTerm' body + return [(ev_id, ev_id, nonDetEltsUniqSet ev_deps)] + go_implic :: Implication -> TcM ([EvId], [(EvId, EvId, [EvId])]) + go_implic ( Implic { ic_binds = ev_binds_var, ic_wanted = wc }) = + ev_binds_edges ev_binds_var wc + +-- Like 'GHC.Tc.Types.Evidence.evVarsOfTerm', except that it properly computes +-- the 'VarSet' for an 'EvFun'. +evVarsOfTerm' :: EvTerm -> TcM VarSet +evVarsOfTerm' (EvExpr e) = return $ exprSomeFreeVars isEvVar e +evVarsOfTerm' (EvTypeable _ ev) = + case ev of + EvTypeableTyCon _ e -> foldMapM evVarsOfTerm' e + EvTypeableTyApp e1 e2 -> foldMapM evVarsOfTerm' [e1,e2] + EvTypeableTrFun e1 e2 e3 -> foldMapM evVarsOfTerm' [e1,e2,e3] + EvTypeableTyLit e -> evVarsOfTerm' e +evVarsOfTerm' (EvFun { et_given = givens, et_binds = tcev_binds, et_body = body_id }) = do + ev_binds <- + bagToList <$> + case tcev_binds of + TcEvBinds var -> evBindMapBinds <$> getTcEvBindsMap var + EvBinds binds -> return binds + let lhs_evvars = map evBindVar ev_binds + rhs_evvars <- foldMapM (evVarsOfTerm' . eb_rhs) ev_binds + return $ + ( ( rhs_evvars `extendVarSet` body_id ) + `delVarSetList` lhs_evvars + ) `delVarSetList` givens + +partitionWC :: (EvId -> Bool) -> WantedConstraints -> (WantedConstraints, WantedConstraints) +partitionWC f wc@(WC { wc_simple = cts, wc_impl = implics }) = + let (yes_cts, no_cts) = partitionBag (f . ctEvId) cts + (yes_impls, no_impls) = unzipBag $ mapBag f_impl implics + in ( wc { wc_simple = yes_cts, wc_impl = yes_impls } + , wc { wc_simple = no_cts, wc_impl = no_impls } ) + where + f_impl i@(Implic { ic_wanted = wc' }) = + let (yes, no) = partitionWC f wc' + in (i { ic_wanted = yes }, i { ic_wanted = no }) + -------------- tcSpecWrapper :: UserTypeCtxt -> TcType -> TcType -> TcM HsWrapper -- A simpler variant of tcSubType, used for SPECIALISE pragmas ===================================== testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs ===================================== @@ -78,6 +78,6 @@ f6 z = z == z -- Quantify over this same quantified constraint, but discharge the -- other dictionary constraints. -{-# SPECIALISE f6 :: ( forall x. ( Eq x, Eq ( T x ) ) => Eq ( f x ) ) => f Int -> Bool #-} +{-# SPECIALISE f6 :: ( forall y. ( Eq y, Eq ( T y ) ) => Eq ( g y ) ) => g Int -> Bool #-} -------------------------------------------------------------------------------- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4c9dc29cd3b4c8612ea03f36ea35ba7d9579fba3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4c9dc29cd3b4c8612ea03f36ea35ba7d9579fba3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 15:23:10 2025 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Sat, 01 Feb 2025 10:23:10 -0500 Subject: [Git][ghc/ghc][wip/T24603] 21 commits: hadrian: fix bootstrap with 9.12.1 Message-ID: <679e3c5e709f9_12e1e333ed6b01121f3@gitlab.mail> Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC Commits: e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 0aa27d8c by Serge S. Gulin at 2025-02-01T17:16:08+03:00 Support for ARM64 Windows (LLVM-enabled) (fixes #24603) submodule Co-authored-by: Cheng Shao <terrorjack at type.dance> Co-authored-by: Dmitrii Egorov <egorov.d.i at icloud.com> Co-authored-by: Andrei Borzenkov <root at sandwitch.dev> - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/Core/Subst.hs - compiler/GHC/Core/TyCo/Tidy.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToStg/Prep.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1e5285963863bac9191ddf7e5f247b2d60699601...0aa27d8c5aecd5d3baf01171e831209f6a726989 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1e5285963863bac9191ddf7e5f247b2d60699601...0aa27d8c5aecd5d3baf01171e831209f6a726989 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 16:42:00 2025 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Sat, 01 Feb 2025 11:42:00 -0500 Subject: [Git][ghc/ghc][wip/T24603] Support for ARM64 Windows (LLVM-enabled) (fixes #24603) Message-ID: <679e4ed83b3ed_1ace6c6a4b0443443@gitlab.mail> Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC Commits: 9f8176f1 by Serge S. Gulin at 2025-02-01T19:41:28+03:00 Support for ARM64 Windows (LLVM-enabled) (fixes #24603) submodule Co-authored-by: Cheng Shao <terrorjack at type.dance> Co-authored-by: Dmitrii Egorov <egorov.d.i at icloud.com> Co-authored-by: Andrei Borzenkov <root at sandwitch.dev> - - - - - 17 changed files: - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs - compiler/GHC/Driver/Backend.hs - libraries/Cabal - libraries/Win32 - libraries/base/src/System/CPUTime/Windows.hsc - libraries/base/tests/perf/encodingAllocations.hs - libraries/directory - libraries/haskeline - libraries/process - libraries/unix - llvm-targets - m4/ghc_tables_next_to_code.m4 - rts/StgCRun.c - rts/win32/veh_excn.c - utils/hsc2hs - utils/llvm-targets/gen-data-layout.sh Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE CPP #-} module GHC.CmmToAsm.AArch64.Instr @@ -217,7 +218,11 @@ regUsageOfInstr platform instr = case instr of -- TODO: The zero register is currently mapped to -1 but should get it's own separate number. callerSavedRegisters :: [Reg] callerSavedRegisters +#if defined(mingw32_HOST_OS) + = map regSingle [0..17] +#else = map regSingle [0..18] +#endif ++ map regSingle [32..39] ++ map regSingle [48..63] ===================================== compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + module GHC.CmmToAsm.Reg.Linear.AArch64 where import GHC.Prelude @@ -118,7 +120,11 @@ getFreeRegs :: RegClass -> FreeRegs -> [RealReg] getFreeRegs cls (FreeRegs g f) = case cls of RcFloatOrVector -> go 32 f 31 +#if defined(mingw32_HOST_OS) + RcInteger -> go 0 g 17 +#else RcInteger -> go 0 g 18 +#endif where go _ _ i | i < 0 = [] go off x i | testBit x i = RealRegSingle (off + i) : (go off x $! i - 1) ===================================== compiler/GHC/Driver/Backend.hs ===================================== @@ -211,7 +211,7 @@ platformNcgSupported platform = if ArchX86_64 -> True ArchPPC -> True ArchPPC_64 {} -> True - ArchAArch64 -> True + ArchAArch64 -> platformOS platform /= OSMinGW32 ArchWasm32 -> True ArchRISCV64 -> True _ -> False ===================================== libraries/Cabal ===================================== @@ -1 +1 @@ -Subproject commit 269fd808e5d80223a229b6b19edfe6f5b109007a +Subproject commit 682c54a9e8127c79e714545dbf493bb5de470945 ===================================== libraries/Win32 ===================================== @@ -1 +1 @@ -Subproject commit 027cbcf0de25d681823ea92fb545a2604c3a6a8b +Subproject commit f340d2c3d846fce73117dd2548ad1bf0c56ceb9d ===================================== libraries/base/src/System/CPUTime/Windows.hsc ===================================== @@ -60,7 +60,7 @@ type HANDLE = () #if defined(i386_HOST_ARCH) foreign import stdcall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE) foreign import stdcall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt -#elif defined(x86_64_HOST_ARCH) +#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) foreign import ccall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE) foreign import ccall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt #else ===================================== libraries/base/tests/perf/encodingAllocations.hs ===================================== @@ -13,13 +13,13 @@ import Distribution.Simple.Utils main :: IO () -main = withTempFile "." "encodingAllocations.tmp" (const $ loop 1000000) +main = withTempFile "encodingAllocations.tmp" (loop 1000000) -loop :: Int -> Handle -> IO () -loop 0 !_ = pure () -loop !n !h = do +loop :: Int -> FilePath -> Handle -> IO () +loop 0 !_ !_ = pure () +loop !n !fp !h = do hPutChar h $! dummy_char n - loop (n-1) h + loop (n-1) fp h -- unsafe efficient version of `chr` my_chr :: Int -> Char ===================================== libraries/directory ===================================== @@ -1 +1 @@ -Subproject commit 005fa061171a55d35ce8dfe936cf3703525a8616 +Subproject commit eb40bbebcaf86153bbc60772fb2e0466d35c95c4 ===================================== libraries/haskeline ===================================== @@ -1 +1 @@ -Subproject commit 5f4bf62bf1f4846ad0b8d1fa9d45f902e3934511 +Subproject commit 5f1a790a5db1cb3708d105d4f532c32fcbeb4296 ===================================== libraries/process ===================================== @@ -1 +1 @@ -Subproject commit 9c3bfc214c72bbd0c8a30a1c41465deed0feaf47 +Subproject commit fbbe60718736999db701c12528c85cbc605ab4fb ===================================== libraries/unix ===================================== @@ -1 +1 @@ -Subproject commit 74ae1c0d9dd1518434f7d6cd3e63d7769599e0f9 +Subproject commit 9208d3a5809476e64b9a387a6000821083d1ebfd ===================================== llvm-targets ===================================== @@ -1,4 +1,5 @@ [("x86_64-unknown-windows-gnu", ("e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", "x86-64", "")) +,("aarch64-unknown-windows-gnu", ("e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32", "generic", "+v8a +fp-armv8 +neon")) ,("arm-unknown-linux-gnueabi", ("e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "arm7tdmi", "+strict-align")) ,("arm-unknown-linux-gnueabihf", ("e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align")) ,("arm-unknown-linux-musleabihf", ("e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align")) ===================================== m4/ghc_tables_next_to_code.m4 ===================================== @@ -22,8 +22,13 @@ AC_DEFUN([GHC_TABLES_NEXT_TO_CODE], AC_MSG_RESULT([no]) ;; *) - TablesNextToCodeDefault=YES - AC_MSG_RESULT([yes]) + if test "$TargetOS" = "mingw32" && test "$TargetArch" = "aarch64"; then + TablesNextToCodeDefault=NO + AC_MSG_RESULT([no]) + else + TablesNextToCodeDefault=YES + AC_MSG_RESULT([yes]) + fi ;; esac ;; ===================================== rts/StgCRun.c ===================================== @@ -863,8 +863,12 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { */ "br %1\n\t" +#if defined(mingw32_HOST_OS) + ".globl " STG_RETURN "\n" +#else ".globl " STG_RETURN "\n\t" -#if !defined(ios_HOST_OS) && !defined(darwin_HOST_OS) +#endif +#if !defined(ios_HOST_OS) && !defined(darwin_HOST_OS) && !defined(mingw32_HOST_OS) ".type " STG_RETURN ", %%function\n" #endif STG_RETURN ":\n\t" ===================================== rts/win32/veh_excn.c ===================================== @@ -287,6 +287,16 @@ void generateStack (EXCEPTION_POINTERS* pExceptionPointers) stackFrame.AddrStack.Offset = context->Rsp; stackFrame.AddrStack.Mode = AddrModeFlat; +#elif defined(aarch64_HOST_ARCH) + machineType = IMAGE_FILE_MACHINE_ARM64; + stackFrame.AddrPC.Offset = context->Pc; + stackFrame.AddrPC.Mode = AddrModeFlat; + + stackFrame.AddrFrame.Offset = context->Fp; + stackFrame.AddrFrame.Mode = AddrModeFlat; + + stackFrame.AddrStack.Offset = context->Sp; + stackFrame.AddrStack.Mode = AddrModeFlat; #endif fprintf (stderr, "\n Attempting to reconstruct a stack trace...\n\n"); if (!SymInitialize (GetCurrentProcess (), NULL, true)) ===================================== utils/hsc2hs ===================================== @@ -1 +1 @@ -Subproject commit c3b21800a67366c9591dc85a471d1dfdb1efcf29 +Subproject commit 2fab2f4cdffef12afe561ef03f5ebdace7dbae67 ===================================== utils/llvm-targets/gen-data-layout.sh ===================================== @@ -27,6 +27,7 @@ TARGETS=( # Windows "x86_64-unknown-windows-gnu" + "aarch64-unknown-windows-gnu" ######################### # Linux View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9f8176f11878a0fbf637b1f4c9a640d6771c17b1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9f8176f11878a0fbf637b1f4c9a640d6771c17b1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 21:46:35 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Sat, 01 Feb 2025 16:46:35 -0500 Subject: [Git][ghc/ghc][wip/ghc-9.10.2-submodules] 7 commits: terminfo: Bump to 0.4.1.7 Message-ID: <679e963ad7235_1e7ef11e210c075661@gitlab.mail> Ben Gamari pushed to branch wip/ghc-9.10.2-submodules at Glasgow Haskell Compiler / GHC Commits: c2ac72f3 by Ben Gamari at 2025-02-01T16:45:56-05:00 terminfo: Bump to 0.4.1.7 - - - - - 398dab07 by Ben Gamari at 2025-02-01T16:45:56-05:00 text: Bump to 2.1.2 - - - - - eca1167b by Ben Gamari at 2025-02-01T16:45:56-05:00 unix: Bump to 2.8.6.0 - - - - - 78dec51f by Ben Gamari at 2025-02-01T16:45:56-05:00 exceptions: Bump to 0.10.9 - - - - - beacc0d1 by Ben Gamari at 2025-02-01T16:45:56-05:00 Win32: Bump to 2.14.1.0 - - - - - f5c2c721 by Ben Gamari at 2025-02-01T16:45:56-05:00 directory: Bump to 1.3.8.5 - - - - - 74adf738 by Ben Gamari at 2025-02-01T16:46:17-05:00 Bump process submodule to v1.6.25.0 (cherry picked from commit 18f532f3ed021fff9529f50da2006b8a8d8b1df7) - - - - - 12 changed files: - hadrian/src/Settings/Warnings.hs - libraries/Win32 - libraries/directory - libraries/exceptions - libraries/process - libraries/terminfo - libraries/text - libraries/unix - testsuite/tests/process/process004.hs - testsuite/tests/process/process004.stdout - testsuite/tests/process/process004.stdout-javascript-unknown-ghcjs - testsuite/tests/process/process004.stdout-mingw32 Changes: ===================================== hadrian/src/Settings/Warnings.hs ===================================== @@ -56,7 +56,7 @@ ghcWarningsArgs = do , package primitive ? pure [ "-Wno-unused-imports" , "-Wno-deprecations" ] , package rts ? pure [ "-Wcpp-undef" ] - , package text ? pure [ "-Wno-deprecations" ] + , package text ? pure [ "-Wno-deprecations", "-Wno-unused-imports" ] , package terminfo ? pure [ "-Wno-unused-imports" ] , package transformers ? pure [ "-Wno-unused-matches" , "-Wno-unused-imports" ===================================== libraries/Win32 ===================================== @@ -1 +1 @@ -Subproject commit 350ebd43f9a8d9e1ca767b0000f95bdfb42a5471 +Subproject commit 027cbcf0de25d681823ea92fb545a2604c3a6a8b ===================================== libraries/directory ===================================== @@ -1 +1 @@ -Subproject commit 4b7c231d187cf253c5f446c4aed2fea26b81d5f9 +Subproject commit e8ee4d5565ec82272ca612034ba6029993e23fd0 ===================================== libraries/exceptions ===================================== @@ -1 +1 @@ -Subproject commit d9fba07b664e3c48f011baca1a8a204292ca2722 +Subproject commit 0b6abb3ac433c7d1d5c6f6a5a45b37f7c486e33b ===================================== libraries/process ===================================== @@ -1 +1 @@ -Subproject commit dfbe62c7d9fc84d2550fc7e7db993dc0aa143ef5 +Subproject commit b8c88fb5bbdebbcbb3e7c734f0c7515dd3cef84e ===================================== libraries/terminfo ===================================== @@ -1 +1 @@ -Subproject commit 500399a1497dfe1786ba67d6d2bfced4832f3fed +Subproject commit 788ce671cb1cec54c3c9b3ac1c1ba189e8424819 ===================================== libraries/text ===================================== @@ -1 +1 @@ -Subproject commit cdb9e13b39079904eed9d75cd332b66ee0cad0c0 +Subproject commit ee0a8f8b9a4bd3fdad23e9ac0db56e7f08ce35cd ===================================== libraries/unix ===================================== @@ -1 +1 @@ -Subproject commit 69552a5267c7dc5c46a8bceec5ec4b40d26b9463 +Subproject commit 6be36ed54cc035c0f095d24bf3a451638d45513c ===================================== testsuite/tests/process/process004.hs ===================================== @@ -4,8 +4,13 @@ import System.IO.Error import System.Process main :: IO () -main = do test1 `catchIOError` \e -> putStrLn ("Exc: " ++ show e) - test2 `catchIOError` \e -> putStrLn ("Exc: " ++ show e) +main = do + -- N.B. Only show the error type since the exact error text + -- may depend upon precise system call which @process@ decided + -- to use. + let printError e = putStrLn ("Exc: " ++ show (ioeGetErrorType e)) + test1 `catchIOError` printError + test2 `catchIOError` printError test1 :: IO () test1 = do ===================================== testsuite/tests/process/process004.stdout ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: chdir: does not exist (No such file or directory) -Exc: true: runProcess: chdir: does not exist (No such file or directory) +Exc: does not exist +Exc: does not exist ===================================== testsuite/tests/process/process004.stdout-javascript-unknown-ghcjs ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: does not exist (No such file or directory) -Exc: true: runProcess: does not exist (No such file or directory) +Exc: does not exist +Exc: does not exist ===================================== testsuite/tests/process/process004.stdout-mingw32 ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: invalid argument (Invalid argument) -Exc: true: runProcess: invalid argument (Invalid argument) +Exc: invalid argument +Exc: invalid argument View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d91e20b1bcd6095a34fa939cac6c82c2787ba3fa...74adf73854268462055a55514c45c6feee6ea72e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d91e20b1bcd6095a34fa939cac6c82c2787ba3fa...74adf73854268462055a55514c45c6feee6ea72e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 1 23:54:45 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sat, 01 Feb 2025 18:54:45 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/T25713 Message-ID: <679eb44537bad_1e7ef130ca6a484092@gitlab.mail> Simon Peyton Jones pushed new branch wip/T25713 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25713 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 2 14:49:32 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sun, 02 Feb 2025 09:49:32 -0500 Subject: [Git][ghc/ghc][wip/T25713] Fix inlineBoringOk again Message-ID: <679f85fcccde6_2abc5863f4ea872674@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25713 at Glasgow Haskell Compiler / GHC Commits: 98b06af7 by Simon Peyton Jones at 2025-02-02T14:49:06+00:00 Fix inlineBoringOk again This MR fixes #25713, which turned out to be a consequence of not completing #17182. I think I have now gotten it right. See the new Note [inlineBoringOk] - - - - - 7 changed files: - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Unfold.hs - compiler/GHC/Core/Unfold/Make.hs - testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr - + testsuite/tests/simplCore/should_compile/T25713.hs - + testsuite/tests/simplCore/should_compile/T25713.stderr - testsuite/tests/simplCore/should_compile/all.T Changes: ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1203,8 +1203,8 @@ Note [Floating applications to coercions] We don’t float out variables applied only to type arguments, since the extra binding would be pointless: type arguments are completely erased. But *coercion* arguments aren’t (see Note [Coercion tokens] in -"GHC.CoreToStg" and Note [Count coercion arguments in boring contexts] in -"GHC.Core.Unfold"), so we still want to float out variables applied only to +"GHC.CoreToStg" and Note [inlineBoringOk] in"GHC.Core.Unfold"), +so we still want to float out variables applied only to coercion arguments. ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -213,34 +213,110 @@ let-bound things that are dead are usually caught by preInlineUnconditionally ************************************************************************ -} +{- Note [inlineBoringOk] +~~~~~~~~~~~~~~~~~~~~~~~~ +See Note [INLINE for small functions] + +The function `inlineBoringOk` returns True (boringCxtOk) if the supplied +unfolding, which looks like (\x y z. body), is such that the result of +inlining a saturated call is no bigger than `body`. Some wrinkles: + +(IB1) An important case is + - \x. (x `cast` co) + +(IB2) If `body` looks like a data constructor worker, we become keener + to inline, by ignoring the number of arguments; we just insist they + are all trivial. Reason: in a call like `f (g x y)`, if `g` unfolds + to a data construtor, we can allocate a data constructor instead of + a thunk (g x y). + + A case in point where a GADT data constructor failed to inline (#25713) + $WK = /\a \x. K @a x + We really want to inline a boring call to $WK so that we allocate + a data constructor not a thunk ($WK @ty x). + + But not for nullary constructors! We don't want to turn + f ($WRefl @ty) + into + f (Refl @ty ) + because the latter might allocate, whereas the former shares. + (You might wonder if (Refl @ty ) should allocate, but I think + that currently it does.) So for nullary constructors, `inlineBoringOk` + returns False. + +(IB3) Types and coercions do not count towards the expression size. + They are ultimately erased. + +(IB4) If there are no value arguments, `inlineBoringOk` we have to be + careful (#17182). If we have + let y = x @Int in f y y + there’s no reason not to inline y at both use sites — no work is + actually duplicated. + + But not so for coercion arguments! Unlike type arguments, which have + no runtime representation, coercion arguments *do* have a runtime + representation (albeit the zero-width VoidRep, see Note [Coercion + tokens] in "GHC.CoreToStg"). For example: + let y = g @Int in g y y + Here `co` is a value argument, and calling it twice might duplicate + work. + + Even if `g` is a data constructor, so no work is duplicated, + inlining `y` might duplicate allocation of a data constructor object + (#17787). See also (IB2). + + TL;DR: if `is_fun` is False, so we have no value arguments, we /do/ + count coercion arguments, despite (IB3). + +(IB5) You might wonder about an unfolding like (\x y z -> x (y z)), + whose body is, in some sense, just as small as (g x y z). + But `inlineBoringOk` doesn't attempt anything fancy; it just looks + for a function call with trivial arguments, Keep it simple. +-} + inlineBoringOk :: CoreExpr -> Bool --- See Note [INLINE for small functions] -- True => the result of inlining the expression is -- no bigger than the expression itself -- eg (\x y -> f y x) --- This is a quick and dirty version. It doesn't attempt --- to deal with (\x y z -> x (y z)) --- The really important one is (x `cast` c) +-- See Note [inlineBoringOk] inlineBoringOk e = go 0 e where + is_fun = isValFun e + go :: Int -> CoreExpr -> Bool - go credit (Lam x e) | isId x = go (credit+1) e - | otherwise = go credit e - -- See Note [Count coercion arguments in boring contexts] - go credit (App f (Type {})) = go credit f - go credit (App f a) | credit > 0 - , exprIsTrivial a = go (credit-1) f - go credit (Tick _ e) = go credit e -- dubious - go credit (Cast e _) = go credit e + go credit (Lam x e) | isRuntimeVar x = go (credit+1) e + | otherwise = go credit e -- See (IB3) + + go credit (App f (Type {})) = go credit f -- See (IB3) + go credit (App f (Coercion {})) + | is_fun = go credit f -- See (IB3) + | otherwise = go (credit-1) f -- See (IB4) + go credit (App f a) | exprIsTrivial a = go (credit-1) f + go credit (Case e b _ alts) | null alts = go credit e -- EmptyCase is like e | Just rhs <- isUnsafeEqualityCase e b alts = go credit rhs -- See Note [Inline unsafeCoerce] - go _ (Var {}) = boringCxtOk - go _ (Lit l) = litIsTrivial l && boringCxtOk - go _ _ = boringCxtNotOk + + go credit (Tick _ e) = go credit e -- dubious + go credit (Cast e _) = go credit e -- See (IB3) + + go _ (Lit l) = litIsTrivial l && boringCxtOk + + -- We assume credit >= 0; literals aren't functions + go credit (Var v) | isDataConWorkId v, is_fun = boringCxtOk -- See (IB2) + | credit >= 0 = boringCxtOk + | otherwise = boringCxtNotOk + go _ _ = boringCxtNotOk + +isValFun :: CoreExpr -> Bool +-- True of functions with at least +-- one top-level value lambda +isValFun (Lam b e) | isRuntimeVar b = True + | otherwise = isValFun e +isValFun _ = False calcUnfoldingGuidance :: UnfoldingOpts @@ -398,29 +474,6 @@ Things to note: NB: you might think that PostInlineUnconditionally would do this but it doesn't fire for top-level things; see GHC.Core.Opt.Simplify.Utils Note [Top level and postInlineUnconditionally] - -Note [Count coercion arguments in boring contexts] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In inlineBoringOK, we ignore type arguments when deciding whether an -expression is okay to inline into boring contexts. This is good, since -if we have a definition like - - let y = x @Int in f y y - -there’s no reason not to inline y at both use sites — no work is -actually duplicated. It may seem like the same reasoning applies to -coercion arguments, and indeed, in #17182 we changed inlineBoringOK to -treat coercions the same way. - -However, this isn’t a good idea: unlike type arguments, which have -no runtime representation, coercion arguments *do* have a runtime -representation (albeit the zero-width VoidRep, see Note [Coercion tokens] -in "GHC.CoreToStg"). This caused trouble in #17787 for DataCon wrappers for -nullary GADT constructors: the wrappers would be inlined and each use of -the constructor would lead to a separate allocation instead of just -sharing the wrapper closure. - -The solution: don’t ignore coercion arguments after all. -} uncondInline :: Bool -> CoreExpr -> [Var] -> Arity -> CoreExpr -> Int -> Bool ===================================== compiler/GHC/Core/Unfold/Make.hs ===================================== @@ -97,7 +97,10 @@ mkDataConUnfolding expr where guide = UnfWhen { ug_arity = manifestArity expr , ug_unsat_ok = unSaturatedOk - , ug_boring_ok = False } + , ug_boring_ok = inlineBoringOk expr } + -- inineBoringOk; sometimes wrappers are very simple, like + -- \@a p q. K @a p q + -- and then we definitely want to inline it #25713 mkWrapperUnfolding :: SimpleOpts -> CoreExpr -> Arity -> Unfolding -- Make the unfolding for the wrapper in a worker/wrapper split ===================================== testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr ===================================== @@ -8,7 +8,7 @@ T22375DataFamily.$WA [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WA = T22375DataFamily.A `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -19,7 +19,7 @@ T22375DataFamily.$WB [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WB = T22375DataFamily.B `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -30,7 +30,7 @@ T22375DataFamily.$WC [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WC = T22375DataFamily.C `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -41,7 +41,7 @@ T22375DataFamily.$WD [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WD = T22375DataFamily.D `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -52,7 +52,7 @@ T22375DataFamily.$WE [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WE = T22375DataFamily.E `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -63,7 +63,7 @@ T22375DataFamily.$WF [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WF = T22375DataFamily.F `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -74,7 +74,7 @@ T22375DataFamily.$WG [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WG = T22375DataFamily.G `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -85,7 +85,7 @@ T22375DataFamily.$WH [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WH = T22375DataFamily.H `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -96,7 +96,7 @@ T22375DataFamily.$WI [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WI = T22375DataFamily.I `cast` (Sym T22375DataFamily.D:R:XUnit0 @@ -107,7 +107,7 @@ T22375DataFamily.$WJ [InlPrag=INLINE[final] CONLIKE] :: X () [GblId[DataConWrapper], Unf=Unf{Src=StableSystem, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)}] + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] T22375DataFamily.$WJ = T22375DataFamily.J `cast` (Sym T22375DataFamily.D:R:XUnit0 ===================================== testsuite/tests/simplCore/should_compile/T25713.hs ===================================== @@ -0,0 +1,49 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE TypeApplications #-} + +module Ifoldl (module Ifoldl) where + +import Data.Kind (Type) +import Data.Type.Equality +import Prelude hiding (reverse) + +data Nat = Z | S Nat + +data Vec n a where + Nil :: Vec 'Z a + (:::) :: a -> Vec n a -> Vec ('S n) a + +infixr 5 ::: + +deriving instance Show a => Show (Vec n a) + +type family a + b where + Z + b = b + S a + b = S (a + b) + +newtype Wonk k w = Wonk (S k + S w :~: S (S k) + w) + +upWonk :: Wonk k w -> Wonk (S k) w +upWonk (Wonk Refl) = Wonk Refl + +ifoldlRec :: forall b n a. (forall m. b m -> a -> b ('S m)) -> b 'Z -> Vec n a -> b n +ifoldlRec f = go Refl Refl (Wonk Refl) + where + go :: forall k m. k + Z :~: k -> k + m :~: n -> (forall w. Wonk k w) -> b k -> Vec m a -> b n + go Refl Refl (Wonk Refl) bk Nil = bk + go Refl Refl !pf bk (a ::: (as :: Vec pm a)) = go @(S k) Refl + (case pf :: Wonk k pm of Wonk Refl -> Refl) (upWonk pf) (f bk a) as +{-# INLINE ifoldlRec #-} + +newtype Flip f y x = Flip + { unFlip :: f x y + } + +reverseVec :: Vec n a -> Vec n a +reverseVec = unFlip . ifoldlRec (\(Flip xs) x -> Flip $ x ::: xs) (Flip Nil) ===================================== testsuite/tests/simplCore/should_compile/T25713.stderr ===================================== @@ -0,0 +1,1267 @@ + +==================== Tidy Core ==================== +Result size of Tidy Core + = {terms: 480, types: 774, coercions: 434, joins: 1/1} + +-- RHS size: {terms: 2, types: 3, coercions: 1, joins: 0/0} +Ifoldl.$WNil [InlPrag=INLINE[final] CONLIKE] :: forall a. Vec Z a +[GblId[DataConWrapper], + Unf=Unf{Src=StableSystem, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False) + Tmpl= \ (@a_akj) -> + Ifoldl.Nil @Z @a_akj @~(_N :: Z GHC.Internal.Prim.~# Z)}] +Ifoldl.$WNil + = \ (@a_akj) -> + Ifoldl.Nil @Z @a_akj @~(_N :: Z GHC.Internal.Prim.~# Z) + +-- RHS size: {terms: 7, types: 10, coercions: 2, joins: 0/0} +Ifoldl.$W::: [InlPrag=INLINE[final] CONLIKE] + :: forall a (n :: Nat). a %1 -> Vec n a %1 -> Vec (S n) a +[GblId[DataConWrapper], + Arity=2, + Str=, + Unf=Unf{Src=StableSystem, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=True) + Tmpl= \ (@a_akk) + (@(n_X0 :: Nat)) + (conrep_aHU [Occ=Once1] :: a_akk) + (conrep1_aHV [Occ=Once1] :: Vec n_X0 a_akk) -> + Ifoldl.::: + @(S n_X0) + @a_akk + @n_X0 + @~(_N :: S n_X0 GHC.Internal.Prim.~# S n_X0) + conrep_aHU + conrep1_aHV}] +Ifoldl.$W::: + = \ (@a_akk) + (@(n_X0 :: Nat)) + (conrep_aHU [Occ=Once1] :: a_akk) + (conrep1_aHV [Occ=Once1] :: Vec n_X0 a_akk) -> + Ifoldl.::: + @(S n_X0) + @a_akk + @n_X0 + @~(_N :: S n_X0 GHC.Internal.Prim.~# S n_X0) + conrep_aHU + conrep1_aHV + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +lvl_r1n5 :: Int +[GblId, Unf=OtherCon []] +lvl_r1n5 = GHC.Internal.Types.I# 6# + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +lvl1_r1n6 :: GHC.Internal.Prim.Addr# +[GblId, Unf=OtherCon []] +lvl1_r1n6 = "Nil"# + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +lvl2_r1n7 :: GHC.Internal.Prim.Addr# +[GblId, Unf=OtherCon []] +lvl2_r1n7 = " ::: "# + +Rec { +-- RHS size: {terms: 48, types: 39, coercions: 0, joins: 0/0} +Ifoldl.$fShowVec_$cshowsPrec [Occ=LoopBreaker] + :: forall a (n :: Nat). Show a => Int -> Vec n a -> ShowS +[GblId, + Arity=4, + Str=<1L>, + Unf=OtherCon []] +Ifoldl.$fShowVec_$cshowsPrec + = \ (@a_a11n) + (@(n_a11o :: Nat)) + ($dShow_a11p :: Show a_a11n) + (ds_d1gq :: Int) + (ds1_d1gr :: Vec n_a11o a_a11n) + (eta_B0 :: String) -> + case ds1_d1gr of { + Nil co_a11w [Dmd=B] -> + GHC.Internal.CString.unpackAppendCString# lvl1_r1n6 eta_B0; + ::: @n1_a11A co_a11B [Dmd=B] b1_aJu b2_aJv -> + case ds_d1gq of { GHC.Internal.Types.I# x_a1kQ -> + case GHC.Internal.Prim.>=# x_a1kQ 6# of { + __DEFAULT -> + showsPrec + @a_a11n + $dShow_a11p + lvl_r1n5 + b1_aJu + (GHC.Internal.CString.unpackAppendCString# + lvl2_r1n7 + (Ifoldl.$fShowVec_$cshowsPrec + @a_a11n @n1_a11A $dShow_a11p lvl_r1n5 b2_aJv eta_B0)); + 1# -> + GHC.Internal.Types.: + @Char + GHC.Internal.Show.$fShowCallStack3 + (showsPrec + @a_a11n + $dShow_a11p + lvl_r1n5 + b1_aJu + (GHC.Internal.CString.unpackAppendCString# + lvl2_r1n7 + (Ifoldl.$fShowVec_$cshowsPrec + @a_a11n + @n1_a11A + $dShow_a11p + lvl_r1n5 + b2_aJv + (GHC.Internal.Types.: + @Char GHC.Internal.Show.$fShowCallStack2 eta_B0)))) + } + } + } +end Rec } + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$fShowVec1 :: Int +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$fShowVec1 = GHC.Internal.Types.I# 0# + +-- RHS size: {terms: 11, types: 14, coercions: 0, joins: 0/0} +Ifoldl.$fShowVec_$cshowList + :: forall a (n :: Nat). Show a => [Vec n a] -> ShowS +[GblId, + Arity=3, + Str=<1L>, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [0 0 0] 70 0}] +Ifoldl.$fShowVec_$cshowList + = \ (@a_a11n) + (@(n_a11o :: Nat)) + ($dShow_a11p :: Show a_a11n) + (ls_a1hi :: [Vec n_a11o a_a11n]) + (s_a1hj :: String) -> + GHC.Internal.Show.showList__ + @(Vec n_a11o a_a11n) + (Ifoldl.$fShowVec_$cshowsPrec + @a_a11n @n_a11o $dShow_a11p Ifoldl.$fShowVec1) + ls_a1hi + s_a1hj + +-- RHS size: {terms: 9, types: 10, coercions: 0, joins: 0/0} +Ifoldl.$fShowVec_$cshow + :: forall a (n :: Nat). Show a => Vec n a -> String +[GblId, + Arity=2, + Str=<1L>, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [0 0] 50 0}] +Ifoldl.$fShowVec_$cshow + = \ (@a_a11n) + (@(n_a11o :: Nat)) + ($dShow_a11p :: Show a_a11n) + (x_a1hf :: Vec n_a11o a_a11n) -> + Ifoldl.$fShowVec_$cshowsPrec + @a_a11n + @n_a11o + $dShow_a11p + Ifoldl.$fShowVec1 + x_a1hf + (GHC.Internal.Types.[] @Char) + +-- RHS size: {terms: 10, types: 13, coercions: 0, joins: 0/0} +Ifoldl.$fShowVec [InlPrag=CONLIKE] + :: forall a (n :: Nat). Show a => Show (Vec n a) +[GblId[DFunId], + Arity=1, + Str=, + Unf=DFun: \ (@a_aAd) (@(n_aAe :: Nat)) (v_B1 :: Show a_aAd) -> + GHC.Internal.Show.C:Show TYPE: Vec n_aAe a_aAd + Ifoldl.$fShowVec_$cshowsPrec @a_aAd @n_aAe v_B1 + Ifoldl.$fShowVec_$cshow @a_aAd @n_aAe v_B1 + Ifoldl.$fShowVec_$cshowList @a_aAd @n_aAe v_B1] +Ifoldl.$fShowVec + = \ (@a_a11n) (@(n_a11o :: Nat)) ($dShow_a11p :: Show a_a11n) -> + GHC.Internal.Show.C:Show + @(Vec n_a11o a_a11n) + (Ifoldl.$fShowVec_$cshowsPrec @a_a11n @n_a11o $dShow_a11p) + (Ifoldl.$fShowVec_$cshow @a_a11n @n_a11o $dShow_a11p) + (Ifoldl.$fShowVec_$cshowList @a_a11n @n_a11o $dShow_a11p) + +-- RHS size: {terms: 7, types: 13, coercions: 0, joins: 0/0} +Ifoldl.unFlip1 + :: forall k1 k2 (f :: k1 -> k2 -> *) (y :: k2) (x :: k1). + Flip f y x -> Flip f y x +[GblId, + Arity=1, + Str=<1L>, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}] +Ifoldl.unFlip1 + = \ (@k_aJb) + (@k1_aJc) + (@(f_aJd :: k_aJb -> k1_aJc -> *)) + (@(y_aJe :: k1_aJc)) + (@(x_aJf :: k_aJb)) + (ds_d1go :: Flip f_aJd y_aJe x_aJf) -> + ds_d1go + +-- RHS size: {terms: 1, types: 0, coercions: 26, joins: 0/0} +unFlip + :: forall {k1} {k2} (f :: k1 -> k2 -> *) (y :: k2) (x :: k1). + Flip f y x -> f x y +[GblId[[RecSel]], + Arity=1, + Str=<1L>, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] +unFlip + = Ifoldl.unFlip1 + `cast` (forall (k :: <*>_N) (k1 :: <*>_N) (f :: k1 -> *>_N) (y :: _N) (x :: _N). + _R + %_N ->_R Ifoldl.N:Flip _N _N _R _N _N + :: (forall k k1 (f :: k -> k1 -> *) (y :: k1) (x :: k). + Flip f y x -> Flip f y x) + ~R# (forall k k1 (f :: k -> k1 -> *) (y :: k1) (x :: k). + Flip f y x -> f x y)) + +-- RHS size: {terms: 7, types: 37, coercions: 63, joins: 0/0} +upWonk :: forall (k :: Nat) (w :: Nat). Wonk k w -> Wonk (S k) w +[GblId, + Arity=1, + Str=<1!P(L)>, + Cpr=1, + Unf=Unf{Src=StableSystem, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True) + Tmpl= \ (@(k_aXP :: Nat)) + (@(w_aXQ :: Nat)) + (ds_d1f6 [Occ=Once1!] :: Wonk k_aXP w_aXQ) -> + case ds_d1f6 + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_aXP w_aXQ + ~R# ((S k_aXP + S w_aXQ) :~: (S (S k_aXP) + w_aXQ))) + of + { Refl co_aXU -> + (GHC.Internal.Data.Type.Equality.$WRefl + @Nat @(S (S (S (k_aXP + w_aXQ))))) + `cast` (((:~:) + _N + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N) + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] _N _N) + ; co_aXU + ; Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (S (S (S (k_aXP + w_aXQ))) :~: S (S (S (k_aXP + w_aXQ)))) + ~R# Wonk (S k_aXP) w_aXQ) + }}] +upWonk + = \ (@(k_aXP :: Nat)) + (@(w_aXQ :: Nat)) + (ds_d1f6 :: Wonk k_aXP w_aXQ) -> + case ds_d1f6 + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_aXP w_aXQ + ~R# ((S k_aXP + S w_aXQ) :~: (S (S k_aXP) + w_aXQ))) + of + { Refl co_aXU -> + (GHC.Internal.Data.Type.Equality.$WRefl + @Nat @(S (S (S (k_aXP + w_aXQ))))) + `cast` (((:~:) + _N + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N) + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] _N _N) + ; co_aXU + ; Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (S (S (S (k_aXP + w_aXQ))) :~: S (S (S (k_aXP + w_aXQ)))) + ~R# Wonk (S k_aXP) w_aXQ) + } + +-- RHS size: {terms: 43, types: 198, coercions: 150, joins: 1/1} +ifoldlRec [InlPrag=INLINE (sat-args=1)] + :: forall (b :: Nat -> *) (n :: Nat) a. + (forall (m :: Nat). b m -> a -> b (S m)) -> b Z -> Vec n a -> b n +[GblId, + Arity=3, + Str=<1L>, + Unf=Unf{Src=StableUser, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=1,unsat_ok=False,boring_ok=False) + Tmpl= \ (@(b_aY8 :: Nat -> *)) + (@(n_aY9 :: Nat)) + (@a_aYa) + (f_azT [Occ=OnceL1!] + :: forall (m :: Nat). b_aY8 m -> a_aYa -> b_aY8 (S m)) + (eta_B0 [Occ=Once1] :: b_aY8 Z) + (eta1_B1 [Occ=Once1] :: Vec n_aY9 a_aYa) -> + joinrec { + go_azU [Occ=LoopBreakerT[7]] + :: forall (k :: Nat) (m :: Nat). + ((k + Z) :~: k) + -> ((k + m) :~: n_aY9) + -> (forall (w :: Nat). Wonk k w) + -> b_aY8 k + -> Vec m a_aYa + -> b_aY8 n_aY9 + [LclId[JoinId(7)(Nothing)], + Arity=5, + Str=, + Unf=OtherCon []] + go_azU (@(k_aYT :: Nat)) + (@(m_aYU :: Nat)) + (ds_d1fg [Occ=Once1!] :: (k_aYT + Z) :~: k_aYT) + (ds1_d1fh [Occ=Once1!] :: (k_aYT + m_aYU) :~: n_aY9) + (ds2_d1fi :: forall (w :: Nat). Wonk k_aYT w) + (bk_azY [Occ=Once2] :: b_aY8 k_aYT) + (ds3_d1fj [Occ=Once1!] :: Vec m_aYU a_aYa) + = case ds_d1fg of { Refl co_aYX -> + case ds1_d1fh of { Refl co1_aYZ -> + case (ds2_d1fi @(GHC.Internal.Types.ZonkAny 0)) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_aYT (GHC.Internal.Types.ZonkAny 0) + ~R# ((S k_aYT + S (GHC.Internal.Types.ZonkAny 0)) + :~: (S (S k_aYT) + GHC.Internal.Types.ZonkAny 0))) + of + { Refl _ [Occ=Dead] -> + case ds3_d1fj of { + Nil co3_aZ5 -> + bk_azY + `cast` (_R (co_aYX + ; (_N + Sym co3_aZ5)_N + ; Sym co1_aYZ) + :: b_aY8 k_aYT ~R# b_aY8 n_aY9); + ::: @ipv_s1jk ipv1_s1jl ipv2_s1jm [Occ=Once1] + ipv3_s1jn [Occ=Once1] -> + case ds2_d1fi of ds4_X5 { __DEFAULT -> + jump go_azU + @(S k_aYT) + @ipv_s1jk + ((GHC.Internal.Data.Type.Equality.$WRefl @Nat @(S k_aYT)) + `cast` (((:~:) + _N + ((S co_aYX)_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + _N)_R + :: (S k_aYT :~: S k_aYT) ~R# ((S k_aYT + Z) :~: S k_aYT))) + (case (ds4_X5 @ipv_s1jk) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_aYT ipv_s1jk + ~R# ((S k_aYT + S ipv_s1jk) + :~: (S (S k_aYT) + ipv_s1jk))) + of + { Refl co3_aZJ -> + (GHC.Internal.Data.Type.Equality.$WRefl @Nat @n_aY9) + `cast` (((:~:) + _N + (co1_aYZ + ; (_N + ipv1_s1jl)_N + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] _N _N) + ; Sym co3_aZJ + ; Ifoldl.D:R:+[1] _N _N)) + _N)_R + :: (n_aY9 :~: n_aY9) ~R# ((S k_aYT + ipv_s1jk) :~: n_aY9)) + }) + (\ (@(w_aZP :: Nat)) -> + case (ds4_X5 @w_aZP) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_aYT w_aZP + ~R# ((S k_aYT + S w_aZP) :~: (S (S k_aYT) + w_aZP))) + of + { Refl co3_aXU -> + (GHC.Internal.Data.Type.Equality.$WRefl + @Nat @(S (S (S (k_aYT + w_aZP))))) + `cast` (((:~:) + _N + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N) + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] + _N _N) + ; co3_aXU + ; Ifoldl.D:R:+[1] + _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (S (S (S (k_aYT + w_aZP))) :~: S (S (S (k_aYT + w_aZP)))) + ~R# Wonk (S k_aYT) w_aZP) + }) + (f_azT @k_aYT bk_azY ipv2_s1jm) + ipv3_s1jn + } + } + } + } + }; } in + jump go_azU + @Z + @n_aY9 + ((GHC.Internal.Data.Type.Equality.$WRefl @Nat @Z) + `cast` (((:~:) _N (Sym (Ifoldl.D:R:+[0] _N)) _N)_R + :: (Z :~: Z) ~R# ((Z + Z) :~: Z))) + ((GHC.Internal.Data.Type.Equality.$WRefl @Nat @n_aY9) + `cast` (((:~:) + _N (Sym (Ifoldl.D:R:+[0] _N)) _N)_R + :: (n_aY9 :~: n_aY9) ~R# ((Z + n_aY9) :~: n_aY9))) + ((\ (@(w_a10g :: Nat)) -> + GHC.Internal.Data.Type.Equality.$WRefl @Nat @(S (S w_a10g))) + `cast` (forall (w :: _N). + ((:~:) + _N + ((S (Sym (Ifoldl.D:R:+[0] _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[0] _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (forall (w :: Nat). S (S w) :~: S (S w)) + ~R# (forall (w :: Nat). Wonk Z w))) + eta_B0 + eta1_B1}] +ifoldlRec + = \ (@(b_aY8 :: Nat -> *)) + (@(n_aY9 :: Nat)) + (@a_aYa) + (f_azT :: forall (m :: Nat). b_aY8 m -> a_aYa -> b_aY8 (S m)) + (eta_B0 :: b_aY8 Z) + (eta1_B1 :: Vec n_aY9 a_aYa) -> + joinrec { + $wgo_s1lY [InlPrag=[2], + Occ=LoopBreaker, + Dmd=SC(S,C(1,C(1,C(1,C(1,L)))))] + :: forall (k :: Nat) (m :: Nat). + (k GHC.Internal.Prim.~# (k + Z), + n_aY9 GHC.Internal.Prim.~# (k + m)) => + (forall (w :: Nat). Wonk k w) + -> b_aY8 k -> Vec m a_aYa -> b_aY8 n_aY9 + [LclId[JoinId(7)(Just [~, ~, !, ~, !])], + Arity=5, + Str=<1L>, + Unf=OtherCon []] + $wgo_s1lY (@(k_s1lK :: Nat)) + (@(m_s1lL :: Nat)) + (ww_s1lT :: k_s1lK GHC.Internal.Prim.~# (k_s1lK + Z)) + (ww1_s1lW :: n_aY9 GHC.Internal.Prim.~# (k_s1lK + m_s1lL)) + (ds_s1lO :: forall (w :: Nat). Wonk k_s1lK w) + (bk_s1lP :: b_aY8 k_s1lK) + (ds1_s1lQ :: Vec m_s1lL a_aYa) + = case (ds_s1lO @(GHC.Internal.Types.ZonkAny 0)) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_s1lK (GHC.Internal.Types.ZonkAny 0) + ~R# ((S k_s1lK + S (GHC.Internal.Types.ZonkAny 0)) + :~: (S (S k_s1lK) + GHC.Internal.Types.ZonkAny 0))) + of + { Refl co_aZ3 [Dmd=A] -> + case ds1_s1lQ of { + Nil co1_aZ5 [Dmd=S] -> + bk_s1lP + `cast` (_R (ww_s1lT + ; (_N + Sym co1_aZ5)_N + ; Sym ww1_s1lW) + :: b_aY8 k_s1lK ~R# b_aY8 n_aY9); + ::: @ipv_s1jf ipv1_s1jg [Dmd=S] ipv2_s1jh ipv3_s1ji -> + case ds_s1lO of ds2_X5 { __DEFAULT -> + case (ds2_X5 @ipv_s1jf) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_s1lK ipv_s1jf + ~R# ((S k_s1lK + S ipv_s1jf) :~: (S (S k_s1lK) + ipv_s1jf))) + of + { Refl co1_aZJ -> + jump $wgo_s1lY + @(S k_s1lK) + @ipv_s1jf + @~((S ww_s1lT)_N + ; Sym (Ifoldl.D:R:+[1] _N _N) + :: S k_s1lK GHC.Internal.Prim.~# (S k_s1lK + Z)) + @~(ww1_s1lW + ; (_N + ipv1_s1jg)_N + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] _N _N) + ; Sym co1_aZJ + ; Ifoldl.D:R:+[1] _N _N) + :: n_aY9 GHC.Internal.Prim.~# (S k_s1lK + ipv_s1jf)) + (\ (@(w_aZP :: Nat)) -> + case (ds2_X5 @w_aZP) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_s1lK w_aZP + ~R# ((S k_s1lK + S w_aZP) :~: (S (S k_s1lK) + w_aZP))) + of + { Refl co2_aXU -> + (GHC.Internal.Data.Type.Equality.$WRefl + @Nat @(S (S (S (k_s1lK + w_aZP))))) + `cast` (((:~:) + _N + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N) + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] _N _N) + ; co2_aXU + ; Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (S (S (S (k_s1lK + w_aZP))) :~: S (S (S (k_s1lK + w_aZP)))) + ~R# Wonk (S k_s1lK) w_aZP) + }) + (f_azT @k_s1lK bk_s1lP ipv2_s1jh) + ipv3_s1ji + } + } + } + }; } in + jump $wgo_s1lY + @Z + @n_aY9 + @~(Sym (Ifoldl.D:R:+[0] _N) :: Z GHC.Internal.Prim.~# (Z + Z)) + @~(Sym (Ifoldl.D:R:+[0] _N) + :: n_aY9 GHC.Internal.Prim.~# (Z + n_aY9)) + ((\ (@(w_a10g :: Nat)) -> + GHC.Internal.Data.Type.Equality.$WRefl @Nat @(S (S w_a10g))) + `cast` (forall (w :: _N). + ((:~:) + _N + ((S (Sym (Ifoldl.D:R:+[0] _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[0] _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (forall (w :: Nat). S (S w) :~: S (S w)) + ~R# (forall (w :: Nat). Wonk Z w))) + eta_B0 + eta1_B1 + +Rec { +-- RHS size: {terms: 33, types: 159, coercions: 128, joins: 0/0} +Ifoldl.$wpoly_go [InlPrag=[2], Occ=LoopBreaker] + :: forall a (n :: Nat) (k :: Nat) (m :: Nat). + (k GHC.Internal.Prim.~# (k + Z), n GHC.Internal.Prim.~# (k + m)) => + (forall (w :: Nat). Wonk k w) + -> Flip Vec a k -> Vec m a -> Flip Vec a n +[GblId[StrictWorker([~, ~, !, ~, !])], + Arity=5, + Str=<1L>, + Unf=OtherCon []] +Ifoldl.$wpoly_go + = \ (@a_s1m1) + (@(n_s1m2 :: Nat)) + (@(k_s1m3 :: Nat)) + (@(m_s1m4 :: Nat)) + (ww_s1mc :: k_s1m3 GHC.Internal.Prim.~# (k_s1m3 + Z)) + (ww1_s1mf :: n_s1m2 GHC.Internal.Prim.~# (k_s1m3 + m_s1m4)) + (ds_s1m7 :: forall (w :: Nat). Wonk k_s1m3 w) + (bk_s1m8 :: Flip Vec a_s1m1 k_s1m3) + (ds1_s1m9 :: Vec m_s1m4 a_s1m1) -> + case (ds_s1m7 @(GHC.Internal.Types.ZonkAny 0)) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_s1m3 (GHC.Internal.Types.ZonkAny 0) + ~R# ((S k_s1m3 + S (GHC.Internal.Types.ZonkAny 0)) + :~: (S (S k_s1m3) + GHC.Internal.Types.ZonkAny 0))) + of + { Refl co_aZ3 [Dmd=A] -> + case ds1_s1m9 of { + Nil co1_aZ5 [Dmd=S] -> + bk_s1m8 + `cast` ((Flip + _N + <*>_N + _R + _N + (ww_s1mc + ; (_N + Sym co1_aZ5)_N + ; Sym ww1_s1mf))_R + :: Flip Vec a_s1m1 k_s1m3 ~R# Flip Vec a_s1m1 n_s1m2); + ::: @ipv_s1jk ipv1_s1jl [Dmd=S] ipv2_s1jm ipv3_s1jn -> + case ds_s1m7 of ds2_X5 { __DEFAULT -> + case (ds2_X5 @ipv_s1jk) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_s1m3 ipv_s1jk + ~R# ((S k_s1m3 + S ipv_s1jk) :~: (S (S k_s1m3) + ipv_s1jk))) + of + { Refl co1_aZJ -> + Ifoldl.$wpoly_go + @a_s1m1 + @n_s1m2 + @(S k_s1m3) + @ipv_s1jk + @~((S ww_s1mc)_N + ; Sym (Ifoldl.D:R:+[1] _N _N) + :: S k_s1m3 GHC.Internal.Prim.~# (S k_s1m3 + Z)) + @~(ww1_s1mf + ; (_N + ipv1_s1jl)_N + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] _N _N) + ; Sym co1_aZJ + ; Ifoldl.D:R:+[1] _N _N) + :: n_s1m2 GHC.Internal.Prim.~# (S k_s1m3 + ipv_s1jk)) + (\ (@(w_aZP :: Nat)) -> + case (ds2_X5 @w_aZP) + `cast` (Ifoldl.N:Wonk _N _N + :: Wonk k_s1m3 w_aZP + ~R# ((S k_s1m3 + S w_aZP) :~: (S (S k_s1m3) + w_aZP))) + of + { Refl co2_aXU -> + (GHC.Internal.Data.Type.Equality.$WRefl + @Nat @(S (S (S (k_s1m3 + w_aZP))))) + `cast` (((:~:) + _N + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N) + ; SelCo:Tc(0,N) + (Sym (Ifoldl.D:R:+[1] _N _N) + ; co2_aXU + ; Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (S (S (S (k_s1m3 + w_aZP))) :~: S (S (S (k_s1m3 + w_aZP)))) + ~R# Wonk (S k_s1m3) w_aZP) + }) + ((Ifoldl.::: + @(S k_s1m3) + @a_s1m1 + @k_s1m3 + @~(_N :: S k_s1m3 GHC.Internal.Prim.~# S k_s1m3) + ipv2_s1jm + (bk_s1m8 + `cast` (Ifoldl.N:Flip _N <*>_N _R _N _N + :: Flip Vec a_s1m1 k_s1m3 ~R# Vec k_s1m3 a_s1m1))) + `cast` (Sym (Ifoldl.N:Flip + _N <*>_N _R _N _N) + :: Vec (S k_s1m3) a_s1m1 ~R# Flip Vec a_s1m1 (S k_s1m3))) + ipv3_s1jn + } + } + } + } +end Rec } + +-- RHS size: {terms: 8, types: 15, coercions: 49, joins: 0/0} +Ifoldl.reverseVec_g + :: forall {n :: Nat} {a}. Vec n a -> Flip Vec a n +[GblId, + Arity=1, + Str=<1L>, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [0] 40 60}] +Ifoldl.reverseVec_g + = \ (@(n_a10v :: Nat)) (@a_a10w) (eta_B1 :: Vec n_a10v a_a10w) -> + Ifoldl.$wpoly_go + @a_a10w + @n_a10v + @Z + @n_a10v + @~(Sym (Ifoldl.D:R:+[0] _N) :: Z GHC.Internal.Prim.~# (Z + Z)) + @~(Sym (Ifoldl.D:R:+[0] _N) + :: n_a10v GHC.Internal.Prim.~# (Z + n_a10v)) + ((\ (@(w_a10g :: Nat)) -> + GHC.Internal.Data.Type.Equality.$WRefl @Nat @(S (S w_a10g))) + `cast` (forall (w :: _N). + ((:~:) + _N + ((S (Sym (Ifoldl.D:R:+[0] _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)) + ((S ((S (Sym (Ifoldl.D:R:+[0] _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_N + ; Sym (Ifoldl.D:R:+[1] _N _N)))_R + ; Sym (Ifoldl.N:Wonk _N _N) + :: (forall (w :: Nat). S (S w) :~: S (S w)) + ~R# (forall (w :: Nat). Wonk Z w))) + ((Ifoldl.$WNil @a_a10w) + `cast` (Sym (Ifoldl.N:Flip _N <*>_N _R _N _N) + :: Vec Z a_a10w ~R# Flip Vec a_a10w Z)) + eta_B1 + +-- RHS size: {terms: 1, types: 0, coercions: 15, joins: 0/0} +reverseVec :: forall (n :: Nat) a. Vec n a -> Vec n a +[GblId, + Arity=1, + Str=<1L>, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] +reverseVec + = Ifoldl.reverseVec_g + `cast` (forall (n[infrd]~[spec] :: _N) (a[infrd]~[spec] :: <*>_N). + _R + %_N ->_R Ifoldl.N:Flip _N <*>_N _R _N _N + :: (forall {n :: Nat} {a}. Vec n a -> Flip Vec a n) + ~R# (forall (n :: Nat) a. Vec n a -> Vec n a)) + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$trModule4 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$trModule4 = "main"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$trModule3 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$trModule3 = GHC.Internal.Types.TrNameS Ifoldl.$trModule4 + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$trModule2 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 30 0}] +Ifoldl.$trModule2 = "Ifoldl"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$trModule1 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$trModule1 = GHC.Internal.Types.TrNameS Ifoldl.$trModule2 + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$trModule :: GHC.Internal.Types.Module +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$trModule + = GHC.Internal.Types.Module Ifoldl.$trModule3 Ifoldl.$trModule1 + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +$krep_r1n8 :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep_r1n8 = GHC.Internal.Types.KindRepVar 1# + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep1_r1n9 :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep1_r1n9 + = GHC.Internal.Types.KindRepFun + $krep_r1n8 GHC.Internal.Types.krep$* + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +$krep2_r1na :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep2_r1na = GHC.Internal.Types.KindRepVar 0# + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep3_r1nb :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep3_r1nb = GHC.Internal.Types.KindRepFun $krep2_r1na $krep1_r1n9 + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep4_r1nc :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep4_r1nc + = GHC.Internal.Types.KindRepFun + $krep2_r1na GHC.Internal.Types.krep$* + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep5_r1nd :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep5_r1nd = GHC.Internal.Types.KindRepFun $krep_r1n8 $krep4_r1nc + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcFlip1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tcFlip1 + = GHC.Internal.Types.KindRepFun $krep3_r1nb $krep5_r1nd + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +$krep6_r1ne :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep6_r1ne = GHC.Internal.Types.KindRepVar 2# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +$krep7_r1nf :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep7_r1nf = GHC.Internal.Types.KindRepVar 3# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +$krep8_r1ng :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep8_r1ng = GHC.Internal.Types.KindRepVar 4# + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep9_r1nh :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep9_r1nh = GHC.Internal.Types.KindRepApp $krep6_r1ne $krep8_r1ng + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep10_r1ni :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep10_r1ni + = GHC.Internal.Types.KindRepApp $krep9_r1nh $krep7_r1nf + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcNat2 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tcNat2 = "Nat"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcNat1 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcNat1 = GHC.Internal.Types.TrNameS Ifoldl.$tcNat2 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcNat :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcNat + = GHC.Internal.Types.TyCon + 18236869020729724782#Word64 + 4245855676397049056#Word64 + Ifoldl.$trModule + Ifoldl.$tcNat1 + 0# + GHC.Internal.Types.krep$* + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +Ifoldl.$tc'Z1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tc'Z1 + = GHC.Internal.Types.KindRepTyConApp + Ifoldl.$tcNat (GHC.Internal.Types.[] @GHC.Internal.Types.KindRep) + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Z3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tc'Z3 = "'Z"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Z2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'Z2 = GHC.Internal.Types.TrNameS Ifoldl.$tc'Z3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Z :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'Z + = GHC.Internal.Types.TyCon + 12150613558191457985#Word64 + 17820276006185949984#Word64 + Ifoldl.$trModule + Ifoldl.$tc'Z2 + 0# + Ifoldl.$tc'Z1 + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep11_r1nj :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep11_r1nj + = GHC.Internal.Types.KindRepTyConApp + Ifoldl.$tc'Z (GHC.Internal.Types.[] @GHC.Internal.Types.KindRep) + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcVec1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tcVec1 + = GHC.Internal.Types.KindRepFun + Ifoldl.$tc'Z1 GHC.Internal.Types.krep$*Arr* + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep12_r1nk :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep12_r1nk + = GHC.Internal.Types.KindRepFun + Ifoldl.$tc'Z1 GHC.Internal.Types.krep$* + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcWonk1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tcWonk1 + = GHC.Internal.Types.KindRepFun Ifoldl.$tc'Z1 $krep12_r1nk + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'S1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tc'S1 + = GHC.Internal.Types.KindRepFun Ifoldl.$tc'Z1 Ifoldl.$tc'Z1 + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'S3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tc'S3 = "'S"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'S2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'S2 = GHC.Internal.Types.TrNameS Ifoldl.$tc'S3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'S :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'S + = GHC.Internal.Types.TyCon + 11382371654426533936#Word64 + 12395597000343428369#Word64 + Ifoldl.$trModule + Ifoldl.$tc'S2 + 0# + Ifoldl.$tc'S1 + +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} +$krep13_r1nl :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep13_r1nl + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep + $krep_r1n8 + (GHC.Internal.Types.[] @GHC.Internal.Types.KindRep) + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep14_r1nm :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep14_r1nm + = GHC.Internal.Types.KindRepTyConApp Ifoldl.$tc'S $krep13_r1nl + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcVec3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tcVec3 = "Vec"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcVec2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcVec2 = GHC.Internal.Types.TrNameS Ifoldl.$tcVec3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcVec :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcVec + = GHC.Internal.Types.TyCon + 14854607458058977841#Word64 + 8374922991311866538#Word64 + Ifoldl.$trModule + Ifoldl.$tcVec2 + 0# + Ifoldl.$tcVec1 + +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} +$krep15_r1nn :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep15_r1nn + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep + $krep2_r1na + (GHC.Internal.Types.[] @GHC.Internal.Types.KindRep) + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep16_r1no :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep16_r1no + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep $krep_r1n8 $krep15_r1nn + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep17_r1np :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep17_r1np + = GHC.Internal.Types.KindRepTyConApp Ifoldl.$tcVec $krep16_r1no + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep18_r1nq :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep18_r1nq + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep $krep14_r1nm $krep15_r1nn + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep19_r1nr :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep19_r1nr + = GHC.Internal.Types.KindRepTyConApp Ifoldl.$tcVec $krep18_r1nq + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep20_r1ns :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep20_r1ns + = GHC.Internal.Types.KindRepFun $krep17_r1np $krep19_r1nr + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc':::1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tc':::1 + = GHC.Internal.Types.KindRepFun $krep2_r1na $krep20_r1ns + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc':::3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tc':::3 = "':::"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc':::2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc':::2 = GHC.Internal.Types.TrNameS Ifoldl.$tc':::3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'::: :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'::: + = GHC.Internal.Types.TyCon + 334686219684160234#Word64 + 3014902632845087398#Word64 + Ifoldl.$trModule + Ifoldl.$tc':::2 + 2# + Ifoldl.$tc':::1 + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep21_r1nt :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep21_r1nt + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep $krep11_r1nj $krep15_r1nn + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Nil1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tc'Nil1 + = GHC.Internal.Types.KindRepTyConApp Ifoldl.$tcVec $krep21_r1nt + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Nil3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tc'Nil3 = "'Nil"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Nil2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'Nil2 = GHC.Internal.Types.TrNameS Ifoldl.$tc'Nil3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Nil :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'Nil + = GHC.Internal.Types.TyCon + 6632636372057876164#Word64 + 13532705703229277899#Word64 + Ifoldl.$trModule + Ifoldl.$tc'Nil2 + 1# + Ifoldl.$tc'Nil1 + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcWonk3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tcWonk3 = "Wonk"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcWonk2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcWonk2 = GHC.Internal.Types.TrNameS Ifoldl.$tcWonk3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcWonk :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcWonk + = GHC.Internal.Types.TyCon + 2107340412666559272#Word64 + 605784541161197679#Word64 + Ifoldl.$trModule + Ifoldl.$tcWonk2 + 0# + Ifoldl.$tcWonk1 + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcFlip3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 20 0}] +Ifoldl.$tcFlip3 = "Flip"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcFlip2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcFlip2 = GHC.Internal.Types.TrNameS Ifoldl.$tcFlip3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tcFlip :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tcFlip + = GHC.Internal.Types.TyCon + 562740838472115680#Word64 + 15461924706169976739#Word64 + Ifoldl.$trModule + Ifoldl.$tcFlip2 + 2# + Ifoldl.$tcFlip1 + +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} +$krep22_r1nu :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep22_r1nu + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep + $krep8_r1ng + (GHC.Internal.Types.[] @GHC.Internal.Types.KindRep) + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep23_r1nv :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep23_r1nv + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep $krep7_r1nf $krep22_r1nu + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep24_r1nw :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep24_r1nw + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep $krep6_r1ne $krep23_r1nv + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep25_r1nx :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep25_r1nx + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep $krep_r1n8 $krep24_r1nw + +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} +$krep26_r1ny :: [GHC.Internal.Types.KindRep] +[GblId, Unf=OtherCon []] +$krep26_r1ny + = GHC.Internal.Types.: + @GHC.Internal.Types.KindRep $krep2_r1na $krep25_r1nx + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +$krep27_r1nz :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +$krep27_r1nz + = GHC.Internal.Types.KindRepTyConApp Ifoldl.$tcFlip $krep26_r1ny + +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Flip1 [InlPrag=[~]] :: GHC.Internal.Types.KindRep +[GblId, Unf=OtherCon []] +Ifoldl.$tc'Flip1 + = GHC.Internal.Types.KindRepFun $krep10_r1ni $krep27_r1nz + +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Flip3 :: GHC.Internal.Prim.Addr# +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 30 0}] +Ifoldl.$tc'Flip3 = "'Flip"# + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Flip2 :: GHC.Internal.Types.TrName +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'Flip2 = GHC.Internal.Types.TrNameS Ifoldl.$tc'Flip3 + +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} +Ifoldl.$tc'Flip :: GHC.Internal.Types.TyCon +[GblId, + Unf=Unf{Src=, TopLvl=True, + Value=True, ConLike=True, WorkFree=True, Expandable=True, + Guidance=IF_ARGS [] 10 10}] +Ifoldl.$tc'Flip + = GHC.Internal.Types.TyCon + 7623277265010559423#Word64 + 16926366384040641029#Word64 + Ifoldl.$trModule + Ifoldl.$tc'Flip2 + 5# + Ifoldl.$tc'Flip1 + + + ===================================== testsuite/tests/simplCore/should_compile/all.T ===================================== @@ -532,3 +532,4 @@ test('T24725a', [ grep_errmsg(r'testedRule')], compile, ['-O -ddump-rule-firings test('T25033', normal, compile, ['-O']) test('T25160', normal, compile, ['-O -ddump-rules']) test('T25197', [req_th, extra_files(["T25197_TH.hs"]), only_ways(['optasm'])], multimod_compile, ['T25197', '-O2 -v0']) +test('T25713', [grep_errmsg('W:::')], compile, ['-O -ddump-simpl']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/98b06af7614b10ac8910f6935e5600031dd74dff -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/98b06af7614b10ac8910f6935e5600031dd74dff You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 2 22:26:17 2025 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Sun, 02 Feb 2025 17:26:17 -0500 Subject: [Git][ghc/ghc][wip/aidylns/ttg-remove-hsunboundvar-via-hshole] 49 commits: Enhance kind inference for data family instances Message-ID: <679ff109867f2_10911efb06441927@gitlab.mail> Adriaan Leijnse pushed to branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC Commits: 3d9cacd5 by Patrick at 2025-01-14T02:34:46+08:00 Enhance kind inference for data family instances This commit improves kind inference for data family instances by kind-checking the constructors, for H98 and newtype declarations (ONLY), as well as kind-checking the result kind signature (when using GADT syntax). This fixes #25611. Typechecker changes: In `tcDataFamInstHeader`, we now kind-check the constructors using `kcConDecls`, for H98-style decls and newtype decls ONLY. See Note [Kind inference for data family instances]. Testsuite changes: - The T25611{a,b,c,d} tests test the new kind inference implementation. - a,b: infer result kind from constructors (H98 case) - c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail, which now passes - d: GADT case, checking that we don't infer overly rigid kinds when kind-checking the constructors in data family instances. - DataInstanceKindsDefaults tests defaulting data instance kinds without UnliftedNewtypes or UnliftedDatatypes, as outlined in Note [Defaulting result kind of newtype/data family instance]. Also a few notes are updated to reflect the changes. Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones at gmail.com> - - - - - f6493dbc by amesgen at 2025-01-15T18:47:23-05:00 wasm: prevent bundlers from resolving import("node:timers") This fixes the following esbuild error: ✘ [ERROR] Could not resolve "node:timers" www/ghc_wasm_jsffi.js:66:25: 66 │ return (await import("node:timers")).setImmediate; ╵ ~~~~~~~~~~~~~ The package "node:timers" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "--platform=node" to do that, which will remove this error. Previously (i.e. after !13503), one had to work around this by passing `--external:node:timers`. - - - - - 87e82e2e by sheaf at 2025-01-16T14:51:45+01:00 Use checkTyEqRhs to make types concrete This commit refactors makeTypeConcrete to call checkTyEqRhs with the appropriate parameters. This avoids duplicating subtle logic in two places in the compiler. Changes: 1. Refactor of 'TyEqFlags'. Now 'TyEqFlags' stores a 'TEFTask', which is a description of which of the following checks we want to perform in 'checkTyEqRhs': - occurs check - level check - concreteness check In the process, the 'AreUnifying' datatype has been removed, as it is no longer needed. 2. Refactor of 'checkTyVar': a. Make use of the new 'TEFTask' data type to decide which checks to perform. In particular, this ensures that we perform **both** a concreteness check and a level check when both are required; previously we only did a concreteness check (that was a bug!). b. Recursively call 'checkTyVar' on the kind of unfilled metavariables. This deals with a bug in which we failed to uphold the invariant that the kind of a concrete type must itself be concrete. See test cases T23051, T23176. 3. Re-write of 'makeTypeConcrete', which now simply calls 'checkTyEqRhs' with appropriate 'TyEqFlags'/'TEFTask'. This gets rid of code duplication and risk for the two code paths going out-of-sync. Fixes #25616. See also #23883. - - - - - 5a8f35bd by ARATA Mizuki at 2025-01-17T11:17:49-05:00 x86 NCG: Use correct format for MOVD in the implementation of unpackInt64X2# MOVD takes the input format. Fixes #25658 - - - - - 14f8a7ec by Mateusz Goślinowski at 2025-01-17T22:49:09+00:00 Allow multiline strings in JS FFI (#25633) - - - - - 854c2f75 by Simon Peyton Jones at 2025-01-18T02:54:08-05:00 Fix a buglet in tcSplitForAllTyVarsReqTVBindersN The problem was that an equation in `split` had two guards (one about visiblity and one about `n_req`). So it fell thorugh if /either/ was False. But the next equation then assumed an invisible binder. Simple bug, easily fixed. Fixes #25661. - - - - - 264a1186 by sheaf at 2025-01-18T10:05:56+00:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - bf4f5ad3 by Jade at 2025-01-18T10:05:56+00:00 Add structured errors to GHCi (#23338) This patch creates the 'GhciCommandErrorMessage' data type which implents the 'Diagnostic' class and also provides error code for these error conditions. - - - - - b6f54188 by Ben Gamari at 2025-01-18T12:38:46-05:00 Revert "Division by constants optimization" This appears to be responsible for the regression described in #25653. This reverts commit daff1e30219d136977c71f42e82ccc58c9013cfb. - - - - - 0fd90de8 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Introduce div2 test This is a useful test from !8392 which is worth keeping around. - - - - - 32680979 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Test shift correctness in mul2 test - - - - - 163aa50a by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Add regression test for #25653 - - - - - 44778963 by Matthew Pickering at 2025-01-20T11:23:08+00:00 driver: Store an ExternalModuleGraph in the EPS We now store an ExternalModuleGraph in the EPS. When an new interface is loaded, the module graph is extended with a node for the loaded interface. The result is a partial module graph. If you want to run a transitive closure query on the graph you must first force the transitive closure to be loaded by using `loadExternalGraphBelow`. The primary advantage (for now) is that the transitive dependency calculation does not have to be repeated in getLinkDeps. If your module had many dependencies and many splices, performing this calculation at every splice site took a significant amount of time. We might also want to use this module graph in future for considering questions such as reachability of rules or accessibilty of instance imported by levelled imported. This patch removes another place in the compiler where transitive dependency is calculated in an ad-hoc manner. In general, the transitive dependency calculation should be cached and computed using a ModuleGraph abstraction. The transitive dependency query required by getLinkDeps operates on a graph without hs-boot nodes. If a linkable from a module in a loop is needed, then all modules in the loop are necessary to be available to execute that module. Therefore there is a query in `ModuleGraph` and `ExternalModuleGraph` which allows a transitive closure query to be performed on a graph without loops. Fixes #25634 ------------------------- Metric Decrease: MultiLayerModulesTH_Make MultiLayerModulesTH_OneShot Metric Increase: mhu-perf ------------------------- Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - b3c0acfc by Cheng Shao at 2025-01-20T11:53:10-05:00 hie: fix hie.yaml to use default hie-bios script !13778 accidentally changed hie.yaml to use hie-bios.bat as the default hie-bios script, which completely breaks hie support on non-Windows platforms. This patch reverts that change. - - - - - 595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. - - - - - 09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00 Fix :info pretty-printing of UNPACKed fields This patch: * Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int` as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the `:info` command. * Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one unpacks a newtype) from being printed in `:info` output unless `-dppr-debug` is enabled. Fixes #25651. - - - - - 6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00 driver: Store the HomePackageTable in a mutable reference This commit refactors the HomePackageTable and HomeUnitGraph: (1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511) (2) And it reworks these structures into their own modules to simplify the driver. The refactor is driven by the introduction of IO in the HPT interface, but is a bit more aggressive in simplifying the interfaces to enforce correct usage (ie to avoid performance pitfalls). Specifically: - The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph` - The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable` - The HPT now stores an `IORef` with the table of loaded home package modules. - The interface to the HPT now requires IO - The interface now enforces that the HPT is a datastructure that only grows - This is not enforced in the interface, but, clients of the HPT should never care about there being more or less entries in the HPT when these additional entries are not relevant to their result. - The exception to the invariant that the HPT is monotonically increasing is `restrictHpt`, a function which is called at a "barrier point" (during which there are no other threads inspecting or inserting in the HPT). The invariant can be temporarily broken at this point (currently, after upsweep). This is safe because a single thread holds control over the structure (thus the invariant being broken is never observed). The hug_var and associated structures in the driver, which aimed to improve memory usage in the driver by updating in place a HUG during upsweep, are no longer required as the HPT entries in the HUG are now themselves mutable by construction. This was previously explained in Note [ModuleNameSet, efficiency and space leaks], which is no longer relevant and was deleted. Fixes #25511 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> ------------------------- Metric Decrease: MultiComponentModulesRecomp MultiLayerModulesRecomp ------------------------- - - - - - f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 Fix build with gcc-15 which defaults to C23 standard (-std=gnu23) Fixes #25662 ``` utils/hp2ps/Utilities.c:6:14: error: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c:5:1: error: note: ‘malloc’ is declared in header ‘<stdlib.h>’ 4 | #include "Error.h" +++ |+#include <stdlib.h> 5 | | 5 | | ^ utils/hp2ps/Utilities.c: In function ‘xmalloc’: utils/hp2ps/Utilities.c:80:17: error: error: too many arguments to function ‘malloc’; expected 0, have 1 80 | r = (void*) malloc(n); | ^~~~~~ ~ | 80 | r = (void*) malloc(n); | ^ utils/hp2ps/Utilities.c:6:14: error: note: declared here 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c: In function ‘xrealloc’: utils/hp2ps/Utilities.c:92:18: error: warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:92:18: error: note: ‘realloc’ is declared in header ‘<stdlib.h>’ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:94:9: error: error: too many arguments to function ‘realloc’; expected 0, have 2 94 | r = realloc(p, n); | ^~~~~~~ ~ | 94 | r = realloc(p, n); | ^ utils/hp2ps/Utilities.c:92:18: error: note: declared here 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ ``` - - - - - 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 0ac83d93 by Adriaan Leijnse at 2025-02-02T20:54:10+00:00 Replace HsUnboundVar with HsHole The 'HsHole' constructor represents expression holes ("_") in the surface syntax. Its 'XHole' extension point is used in GHC phases for things with a type but which are not necessarily complete Haskell such as (named) expression holes, parse errors, and unbound variables. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Uniques.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/Config.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Core/Opt/Pipeline.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/06add9dbe979249856f7963c1986eb88c364003a...0ac83d9376fe4463b17b3dab9687d175c812280e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/06add9dbe979249856f7963c1986eb88c364003a...0ac83d9376fe4463b17b3dab9687d175c812280e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 2 22:33:32 2025 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Sun, 02 Feb 2025 17:33:32 -0500 Subject: [Git][ghc/ghc][wip/aidylns/ttg-remove-hsunboundvar-via-hshole] Replace HsUnboundVar with HsHole Message-ID: <679ff2bca6580_1091110f35d84483@gitlab.mail> Adriaan Leijnse pushed to branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC Commits: 8c968cdc by Adriaan Leijnse at 2025-02-02T22:33:02+00:00 Replace HsUnboundVar with HsHole The 'HsHole' constructor represents expression holes ("_") in the surface syntax. Its 'XHole' extension point is used in GHC phases for things with a type but which are not necessarily complete Haskell such as (named) expression holes, parse errors, and unbound variables. - - - - - 26 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/Language/Haskell/Syntax/Extension.hs - testsuite/tests/perf/compiler/hard_hole_fits.hs - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/plugins/T20803-plugin/FixErrorsPlugin.hs - utils/check-exact/ExactPrint.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -15,6 +15,7 @@ -- in module Language.Haskell.Syntax.Extension {-# OPTIONS_GHC -Wno-orphans #-} -- Outputable +{-# LANGUAGE AllowAmbiguousTypes #-} {- (c) The University of Glasgow 2006 @@ -220,11 +221,6 @@ data EpAnnLam = EpAnnLam instance NoAnn EpAnnLam where noAnn = EpAnnLam noAnn noAnn -data EpAnnUnboundVar = EpAnnUnboundVar - { hsUnboundBackquotes :: (EpToken "`", EpToken "`") - , hsUnboundHole :: EpToken "_" - } deriving Data - -- Record selectors at parse time are HsVar; they convert to HsRecSel -- on renaming. type instance XRecSel GhcPs = DataConCantHappen @@ -241,14 +237,6 @@ type instance XOverLabel GhcTc = DataConCantHappen type instance XVar (GhcPass _) = NoExtField -type instance XUnboundVar GhcPs = Maybe EpAnnUnboundVar -type instance XUnboundVar GhcRn = NoExtField -type instance XUnboundVar GhcTc = HoleExprRef - -- We really don't need the whole HoleExprRef; just the IORef EvTerm - -- would be enough. But then deriving a Data instance becomes impossible. - -- Much, much easier just to define HoleExprRef with a Data instance and - -- store the whole structure. - type instance XIPVar GhcPs = NoExtField type instance XIPVar GhcRn = NoExtField type instance XIPVar GhcTc = DataConCantHappen @@ -394,6 +382,37 @@ type instance XEmbTy GhcTc = DataConCantHappen -- A free-standing HsEmbTy is an error. -- Valid usages are immediately desugared into Type. + +-- | Expression Hole. +-- +-- Parser: produced on encountering an anonymous +-- expression hole ("_"), or a parse error. +-- +-- Renamer: produced from 'HsVar' when encountering out-of-scope variables +-- (which can also be named expression holes, i.e. "_hole"). The 'ParseError' +-- case is unhandled in this and the type checking phase. +-- +-- Type checker: the HoleExprRef is where the erroring expression will be written after +-- solving. See Note [Holes in expressions] in GHC.Tc.Types.Constraint. +-- +-- We really don't need the whole HoleExprRef; just the IORef EvTerm would +-- be enough. But then deriving a Data instance becomes impossible. Much, +-- much easier just to define HoleExprRef with a Data instance and store +-- the whole structure. +type instance XHole GhcPs = (HoleKind, NoExtField) +type instance XHole GhcRn = (HoleKind, NoExtField) +type instance XHole GhcTc = (HoleKind, HoleExprRef) + +data HoleKind + = HoleVar (LIdP GhcPs) + | HoleError + deriving Data + +-- | The RdrName for an unnamed hole ("_"). +unnamedHoleRdrName :: RdrName +unnamedHoleRdrName = mkUnqual varName (fsLit "_") + + type instance XForAll GhcPs = NoExtField type instance XForAll GhcRn = NoExtField type instance XForAll GhcTc = DataConCantHappen @@ -698,7 +717,13 @@ ppr_lexpr e = ppr_expr (unLoc e) ppr_expr :: forall p. (OutputableBndrId p) => HsExpr (GhcPass p) -> SDoc ppr_expr (HsVar _ (L _ v)) = pprPrefixOcc v -ppr_expr (HsUnboundVar _ uv) = pprPrefixOcc uv +ppr_expr (HsHole x) = case (ghcPass @p, x) of + (GhcPs, (HoleVar (L _ v), _)) -> pprPrefixOcc v + (GhcRn, (HoleVar (L _ v), _)) -> pprPrefixOcc v + (GhcTc, (HoleVar (L _ v), _)) -> pprPrefixOcc v + (GhcPs, (HoleError, _)) -> pprPrefixOcc unnamedHoleRdrName + (GhcRn, (HoleError, _)) -> pprPrefixOcc unnamedHoleRdrName + (GhcTc, (HoleError, _)) -> pprPrefixOcc unnamedHoleRdrName ppr_expr (HsIPVar _ v) = ppr v ppr_expr (HsOverLabel s l) = case ghcPass @p of GhcPs -> helper s @@ -954,10 +979,13 @@ instance Outputable XXExprGhcTc where ppr exp, text ")"] ppr (HsRecSelTc f) = pprPrefixOcc f - ppr_infix_expr :: forall p. (OutputableBndrId p) => HsExpr (GhcPass p) -> Maybe SDoc ppr_infix_expr (HsVar _ (L _ v)) = Just (pprInfixOcc v) -ppr_infix_expr (HsUnboundVar _ occ) = Just (pprInfixOcc occ) +ppr_infix_expr (HsHole x) = Just $ pprInfixOcc $ case (ghcPass @p, x) of + (GhcPs, (HoleVar (L _ v), _)) -> v + (GhcRn, (HoleVar (L _ v), _)) -> v + (GhcTc, (HoleVar (L _ v), _)) -> v + _ -> unnamedHoleRdrName -- TODO: this is the HoleError case; print the actual source code or something better than "_" ppr_infix_expr (XExpr x) = case ghcPass @p of GhcRn -> ppr_infix_expr_rn x GhcTc -> ppr_infix_expr_tc x @@ -976,7 +1004,6 @@ ppr_infix_expr_tc (HsTick {}) = Nothing ppr_infix_expr_tc (HsBinTick {}) = Nothing ppr_infix_expr_tc (HsRecSelTc f) = Just (pprInfixOcc f) - ppr_infix_hs_expansion :: HsThingRn -> Maybe SDoc ppr_infix_hs_expansion (OrigExpr e) = ppr_infix_expr e ppr_infix_hs_expansion _ = Nothing @@ -1023,7 +1050,6 @@ hsExprNeedsParens prec = go where go :: HsExpr (GhcPass p) -> Bool go (HsVar{}) = False - go (HsUnboundVar{}) = False go (HsIPVar{}) = False go (HsOverLabel{}) = False go (HsLit _ l) = hsLitNeedsParens prec l @@ -1065,6 +1091,7 @@ hsExprNeedsParens prec = go go (HsProjection{}) = True go (HsGetField{}) = False go (HsEmbTy{}) = prec > topPrec + go (HsHole{}) = False go (HsForAll{}) = prec >= funPrec go (HsQual{}) = prec >= funPrec go (HsFunArr{}) = prec >= funPrec @@ -1120,7 +1147,7 @@ isAtomicHsExpr (HsLit {}) = True isAtomicHsExpr (HsOverLit {}) = True isAtomicHsExpr (HsIPVar {}) = True isAtomicHsExpr (HsOverLabel {}) = True -isAtomicHsExpr (HsUnboundVar {}) = True +isAtomicHsExpr (HsHole{}) = True isAtomicHsExpr (XExpr x) | GhcTc <- ghcPass @p = go_x_tc x | GhcRn <- ghcPass @p = go_x_rn x ===================================== compiler/GHC/Hs/Syn/Type.hs ===================================== @@ -103,7 +103,6 @@ lhsExprType (L _ e) = hsExprType e -- | Compute the 'Type' of an @'HsExpr' 'GhcTc'@ in a pure fashion. hsExprType :: HsExpr GhcTc -> Type hsExprType (HsVar _ (L _ id)) = idType id -hsExprType (HsUnboundVar (HER _ ty _) _) = ty hsExprType (HsOverLabel v _) = dataConCantHappen v hsExprType (HsIPVar v _) = dataConCantHappen v hsExprType (HsOverLit _ lit) = overLitType lit @@ -146,6 +145,7 @@ hsExprType (HsProc _ _ lcmd_top) = lhsCmdTopType lcmd_top hsExprType (HsStatic (_, ty) _s) = ty hsExprType (HsPragE _ _ e) = lhsExprType e hsExprType (HsEmbTy x _) = dataConCantHappen x +hsExprType (HsHole (_, (HER _ ty _))) = ty hsExprType (HsQual x _ _) = dataConCantHappen x hsExprType (HsForAll x _ _) = dataConCantHappen x hsExprType (HsFunArr x _ _ _) = dataConCantHappen x ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -273,8 +273,8 @@ dsExpr e@(HsVar {}) = dsApp e dsExpr e@(HsApp {}) = dsApp e dsExpr e@(HsAppType {}) = dsApp e -dsExpr (HsUnboundVar (HER ref _ _) _) = dsEvTerm =<< readMutVar ref - -- See Note [Holes] in GHC.Tc.Types.Constraint +dsExpr (HsHole (_, (HER ref _ _))) = dsEvTerm =<< readMutVar ref + -- See Note [Holes in expressions] in GHC.Tc.Types.Constraint. dsExpr (HsPar _ e) = dsLExpr e dsExpr (ExprWithTySig _ e _) = dsLExpr e @@ -316,6 +316,7 @@ dsExpr e@(XExpr ext_expr_tc) } + -- Strip ticks due to #21701, need to be invariant about warnings we produce whether -- this is enabled or not. dsExpr (NegApp _ (L loc ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1539,6 +1539,10 @@ repE (HsVar _ (L _ x)) = Just (DsBound y) -> repVarOrCon x (coreVar y) Just (DsSplice e) -> do { e' <- lift $ dsExpr e ; return (MkC e') } } +repE (HsHole (HoleVar (L _ uv), NoExtField)) = do + name <- repRdrName uv + repUnboundVar name +repE (HsHole (HoleError, NoExtField)) = panic "repE: HoleError" repE (HsIPVar _ n) = rep_implicit_param_name n >>= repImplicitParamVar repE (HsOverLabel _ s) = repOverLabel s @@ -1677,9 +1681,6 @@ repE (HsTypedSplice n _) = rep_splice n repE (HsUntypedSplice (HsUntypedSpliceNested n) _) = rep_splice n repE e@(HsUntypedSplice (HsUntypedSpliceTop _ _) _) = pprPanic "repE: top level splice" (ppr e) repE (HsStatic _ e) = repLE e >>= rep2 staticEName . (:[]) . unC -repE (HsUnboundVar _ uv) = do - name <- repRdrName uv - repUnboundVar name repE (HsGetField _ e (L _ (DotFieldOcc _ (L _ (FieldLabelString f))))) = do e1 <- repLE e repGetField e1 f @@ -1714,10 +1715,8 @@ repE e@(XExpr (ExpandedThingRn o x)) else repE e } | otherwise = notHandled (ThExpressionForm e) - repE (XExpr (PopErrCtxt (L _ e))) = repE e repE (XExpr (HsRecSelRn (FieldOcc _ (L _ x)))) = repE (HsVar noExtField (noLocA x)) - repE e@(HsPragE _ (HsPragSCC {}) _) = notHandled (ThCostCentres e) repE e@(HsTypedBracket{}) = notHandled (ThExpressionForm e) repE e@(HsUntypedBracket{}) = notHandled (ThExpressionForm e) ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -470,13 +470,12 @@ addBinTickLHsExpr boxLabel e@(L pos e0) addTickHsExpr :: HsExpr GhcTc -> TM (HsExpr GhcTc) addTickHsExpr e@(HsVar _ (L _ id)) = do freeVar id; return e -addTickHsExpr e@(HsUnboundVar {}) = return e - addTickHsExpr e@(HsIPVar {}) = return e addTickHsExpr e@(HsOverLit {}) = return e addTickHsExpr e@(HsOverLabel{}) = return e addTickHsExpr e@(HsLit {}) = return e addTickHsExpr e@(HsEmbTy {}) = return e +addTickHsExpr e@(HsHole {}) = return e addTickHsExpr e@(HsQual {}) = return e addTickHsExpr e@(HsForAll {}) = return e addTickHsExpr e@(HsFunArr {}) = return e ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1199,7 +1199,6 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where [ toHie $ C Use (L mspan var) -- Patch up var location since typechecker removes it ] - HsUnboundVar _ _ -> [] -- there is an unbound name here, but that causes trouble HsOverLabel {} -> [] HsIPVar _ _ -> [] HsOverLit _ o -> @@ -1347,6 +1346,7 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where ] HsGetField {} -> [] HsProjection {} -> [] + HsHole _ -> [] -- there is a hole here, but that causes trouble XExpr x -> case hiePass @p of HieTc -> case x of WrapExpr w a ===================================== compiler/GHC/Parser.y ===================================== @@ -3928,8 +3928,9 @@ qopm :: { forall b. DisambInfixOp b => PV (LocatedN b) } -- used in section | qconop { mkHsConOpPV $1 } | hole_op { mkHsInfixHolePV $1 } -hole_op :: { LocatedN (HsExpr GhcPs) } -- used in sections -hole_op : '`' '_' '`' { sLLa $1 $> (hsHoleExpr (Just $ EpAnnUnboundVar (epTok $1, epTok $3) (epTok $2))) } +hole_op :: { LocatedN RdrName } -- used in sections +hole_op : '`' '_' '`' {% amsr (sLL $1 $> (mkUnqual varName (fsLit "_"))) + (NameAnn (NameBackquotes (epTok $1) (epTok $3)) (glR $2) []) } qvarop :: { LocatedN RdrName } : qvarsym { $1 } ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -108,7 +108,6 @@ module GHC.Parser.PostProcess ( withArrowParsingMode, withArrowParsingMode', setTelescopeBndrsNameSpace, PatBuilder, - hsHoleExpr, -- Type/datacon ambiguity resolution DisambTD(..), @@ -1610,12 +1609,12 @@ type Fbind b = Either (LHsRecField GhcPs (LocatedA b)) (LHsRecProj GhcPs (Locate class DisambInfixOp b where mkHsVarOpPV :: LocatedN RdrName -> PV (LocatedN b) mkHsConOpPV :: LocatedN RdrName -> PV (LocatedN b) - mkHsInfixHolePV :: LocatedN (HsExpr GhcPs) -> PV (LocatedN b) + mkHsInfixHolePV :: LocatedN RdrName -> PV (LocatedN b) instance DisambInfixOp (HsExpr GhcPs) where mkHsVarOpPV v = return $ L (getLoc v) (HsVar noExtField v) mkHsConOpPV v = return $ L (getLoc v) (HsVar noExtField v) - mkHsInfixHolePV h = return h + mkHsInfixHolePV v = return $ L (getLoc v) (HsHole (HoleVar v, noExtField)) instance DisambInfixOp RdrName where mkHsConOpPV (L l v) = return $ L l v @@ -1897,11 +1896,11 @@ instance DisambECP (HsExpr GhcPs) where type Body (HsExpr GhcPs) = HsExpr ecpFromCmd' (L l c) = do addError $ mkPlainErrorMsgEnvelope (locA l) $ PsErrArrowCmdInExpr c - return (L l (hsHoleExpr noAnn)) + return (L l parseError) ecpFromExp' = return ecpFromPat' p@(L l _) = do addError $ mkPlainErrorMsgEnvelope (locA l) $ PsErrOrPatInExpr p - return (L l (hsHoleExpr noAnn)) + return (L l parseError) mkHsProjUpdatePV l fields arg isPun anns = do !cs <- getCommentsFor l return $ mkRdrProjUpdate (EpAnn (spanAsAnchor l) noAnn cs) fields arg isPun anns @@ -1950,7 +1949,7 @@ instance DisambECP (HsExpr GhcPs) where mkHsOverLitPV (L (EpAnn l an csIn) a) = do !cs <- getCommentsFor (locA l) return $ L (EpAnn l an (cs Semi.<> csIn)) (HsOverLit NoExtField a) - mkHsWildCardPV l = return $ L (noAnnSrcSpan l) (hsHoleExpr noAnn) + mkHsWildCardPV l = return $ L (noAnnSrcSpan l) (HsHole (HoleVar (L (noAnnSrcSpan l) (mkUnqual varName (fsLit "_"))), NoExtField)) mkHsTySigPV l@(EpAnn anc an csIn) a sig anns = do !cs <- getCommentsFor (locA l) return $ L (EpAnn anc an (csIn Semi.<> cs)) (ExprWithTySig anns a (hsTypeToHsSigWcType sig)) @@ -1971,11 +1970,11 @@ instance DisambECP (HsExpr GhcPs) where !cs <- getCommentsFor l return $ L (EpAnn (spanAsAnchor l) noAnn cs) (SectionR noExtField op e) mkHsAsPatPV l v _ e = addError (mkPlainErrorMsgEnvelope l $ PsErrTypeAppWithoutSpace (unLoc v) e) - >> return (L (noAnnSrcSpan l) (hsHoleExpr noAnn)) + >> return (L (noAnnSrcSpan l) parseError) mkHsLazyPatPV l e _ = addError (mkPlainErrorMsgEnvelope l $ PsErrLazyPatWithoutSpace e) - >> return (L (noAnnSrcSpan l) (hsHoleExpr noAnn)) + >> return (L (noAnnSrcSpan l) parseError) mkHsBangPatPV l e _ = addError (mkPlainErrorMsgEnvelope l $ PsErrBangPatWithoutSpace e) - >> return (L (noAnnSrcSpan l) (hsHoleExpr noAnn)) + >> return (L (noAnnSrcSpan l) parseError) mkSumOrTuplePV = mkSumOrTupleExpr mkHsEmbTyPV l toktype ty = return $ L (noAnnSrcSpan l) $ @@ -2002,9 +2001,6 @@ instance DisambECP (HsExpr GhcPs) where (PsErrUnallowedPragma prag) rejectPragmaPV _ = return () -hsHoleExpr :: Maybe EpAnnUnboundVar -> HsExpr GhcPs -hsHoleExpr anns = HsUnboundVar anns (mkRdrUnqual (mkVarOccFS (fsLit "_"))) - instance DisambECP (PatBuilder GhcPs) where type Body (PatBuilder GhcPs) = PatBuilder ecpFromCmd' (L l c) = addFatalError $ mkPlainErrorMsgEnvelope (locA l) $ PsErrArrowCmdInPat c @@ -3678,3 +3674,6 @@ mkListSyntaxTy1 brkOpen t brkClose = annsKeyword = (NoEpTok, brkOpen, brkClose) annParen = AnnParensSquare brkOpen brkClose + +parseError :: HsExpr GhcPs +parseError = HsHole (HoleError, NoExtField) ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -312,18 +312,18 @@ finishHsVar (L l name) checkThLocalName name ; return (HsVar noExtField (L (l2l l) name), unitFV name) } -rnUnboundVar :: RdrName -> RnM (HsExpr GhcRn, FreeVars) -rnUnboundVar v = do +rnUnboundVar :: SrcSpanAnnN -> RdrName -> RnM (HsExpr GhcRn, FreeVars) +rnUnboundVar l v = do deferOutofScopeVariables <- goptM Opt_DeferOutOfScopeVariables -- See Note [Reporting unbound names] for difference between qualified and unqualified names. unless (isUnqual v || deferOutofScopeVariables) (reportUnboundName v >> return ()) - return (HsUnboundVar noExtField v, emptyFVs) + return (HsHole (HoleVar (L l v), NoExtField), emptyFVs) rnExpr (HsVar _ (L l v)) = do { dflags <- getDynFlags ; mb_gre <- lookupExprOccRn v ; case mb_gre of { - Nothing -> rnUnboundVar v ; + Nothing -> rnUnboundVar l v ; Just gre -> do { let nm = greName gre info = greInfo gre @@ -352,8 +352,8 @@ rnExpr (HsVar _ (L l v)) rnExpr (HsIPVar x v) = return (HsIPVar x v, emptyFVs) -rnExpr (HsUnboundVar _ v) - = return (HsUnboundVar noExtField v, emptyFVs) +rnExpr (HsHole (h, NoExtField)) + = return ((HsHole (h, NoExtField)), emptyFVs) -- HsOverLabel: see Note [Handling overloaded and rebindable constructs] rnExpr (HsOverLabel src v) @@ -858,8 +858,8 @@ See #18151. Note [Reporting unbound names] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Faced with an out-of-scope `RdrName` there are two courses of action -A. Report an error immediately (and return a HsUnboundVar). This will halt GHC after the renamer is complete -B. Return a HsUnboundVar without reporting an error. That will allow the typechecker to run, which in turn +A. Report an error immediately (and return a `HsHole (HoleVar ...)`). This will halt GHC after the renamer is complete +B. Return a `HsHole (HoleVar ...)` without reporting an error. That will allow the typechecker to run, which in turn can give a better error message, notably giving the type of the variable via the "typed holes" mechanism. When `-fdefer-out-of-scope-variables` is on we follow plan B. ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -1466,10 +1466,10 @@ data NegationHandling = ReassociateNegation | KeepNegationIntact ---------------------------- get_op :: LHsExpr GhcRn -> OpName --- An unbound name could be either HsVar or HsUnboundVar +-- An unbound name could be either HsVar or (HsHole (HoleVar _, _)) -- See GHC.Rename.Expr.rnUnboundVar get_op (L _ (HsVar _ n)) = NormalOp (unLoc n) -get_op (L _ (HsUnboundVar _ uv)) = UnboundOp uv +get_op (L _ (HsHole (HoleVar (L _ uv), NoExtField))) = UnboundOp uv get_op (L _ (XExpr (HsRecSelRn fld))) = RecFldOp fld get_op other = pprPanic "get_op" (ppr other) ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -1298,7 +1298,7 @@ badRuleLhsErr name lhs bad_e = TcRnIllegalRuleLhs errReason name lhs bad_e where errReason = case bad_e of - HsUnboundVar _ uv -> + HsHole (HoleVar (L _ uv), NoExtField) -> UnboundVariable uv $ notInScopeErr WL_Global uv _ -> IllegalExpression ===================================== compiler/GHC/Tc/Errors.hs ===================================== @@ -1525,7 +1525,7 @@ maybeAddDeferredBindings hole report = do when (deferringAnyBindings ctxt) $ do err_tm <- mkErrorTerm (hole_loc hole) ref_ty report -- NB: ref_ty, not hole_ty. hole_ty might be rewritten. - -- See Note [Holes] in GHC.Tc.Types.Constraint + -- See Note [Holes in expressions] in GHC.Tc.Types.Constraint writeMutVar ref err_tm _ -> pure () where ===================================== compiler/GHC/Tc/Errors/Ppr.hs ===================================== @@ -71,7 +71,7 @@ import GHC.CoreToIface import GHC.Driver.Flags import GHC.Driver.Backend -import GHC.Hs +import GHC.Hs hiding (HoleError) import GHC.Tc.Errors.Types import GHC.Tc.Errors.Hole.FitTypes ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -221,7 +221,7 @@ A "head" has three special cases (for which we can infer a polytype using tcInferAppHead_maybe); otherwise is just any old expression (for which we can infer a rho-type (via tcInfer). -There is no special treatment for HsUnboundVar, HsOverLit etc, because +There is no special treatment for HsHole (HsVar ...), HsOverLit, etc, because we can't get a polytype from them. Left and right sections (e.g. (x +) and (+ x)) are not yet supported. @@ -680,7 +680,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args fun_is_out_of_scope -- See Note [VTA for out-of-scope functions] = case tc_fun of - HsUnboundVar {} -> True + HsHole _ -> True _ -> False inst_fun :: [HsExprArg 'TcpRn] -> ForAllTyFlag -> Bool @@ -1056,7 +1056,7 @@ expr_to_type earg = = do { t <- go (L l e) ; let splice_result' = HsUntypedSpliceTop finalizers t ; return (L l (HsSpliceTy splice_result' splice)) } - go (L l (HsUnboundVar _ rdr)) + go (L l (HsHole (HoleVar (L _ rdr), NoExtField))) | isUnderscore occ = return (L l (HsWildCardTy noExtField)) | startsWithUnderscore occ = -- See Note [Wildcards in the T2T translation] @@ -1128,7 +1128,7 @@ This conversion is in the TcM monad because vfun [x | x <- xs] Can't convert list comprehension to a type vfun (\x -> x) Can't convert a lambda to a type * It needs to check for LangExt.NamedWildCards to generate an appropriate - error message for HsUnboundVar. + error message for HsHole (HsVar ...). vfun _a Not in scope: ‘_a’ (NamedWildCards disabled) vfun _a Illegal named wildcard in a required type argument: ‘_a’ @@ -1478,7 +1478,7 @@ Note [VTA for out-of-scope functions] Suppose 'wurble' is not in scope, and we have (wurble @Int @Bool True 'x') -Then the renamer will make (HsUnboundVar "wurble") for 'wurble', +Then the renamer will make (HsHole (HsVar "wurble", NoExtField)) for 'wurble', and the typechecker will typecheck it with tcUnboundId, giving it a type 'alpha', and emitting a deferred Hole constraint, to be reported later. @@ -1493,7 +1493,7 @@ tcUnboundId. It later reports 'wurble' as out of scope, and tries to give its type. Fortunately in tcInstFun we still have access to the function, so we -can check if it is a HsUnboundVar. We use this info to simply skip +can check if it is a HsHole. We use this info to simply skip over any visible type arguments. We'll /already/ have emitted a Hole constraint; failing preserves that constraint. ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -44,7 +44,7 @@ import GHC.Types.Unique.Map import GHC.Types.Unique.Set import GHC.Core.Multiplicity import GHC.Core.UsageEnv -import GHC.Tc.Errors.Types +import GHC.Tc.Errors.Types hiding (HoleError) import GHC.Tc.Utils.Concrete ( hasFixedRuntimeRep_syntactic, hasFixedRuntimeRep ) import GHC.Tc.Utils.Instantiate import GHC.Tc.Gen.App @@ -298,13 +298,16 @@ tcExpr (XExpr e) res_ty = tcXExpr e res_ty -- Typecheck an occurrence of an unbound Id -- -- Some of these started life as a true expression hole "_". --- Others might simply be variables that accidentally have no binding site -tcExpr (HsUnboundVar _ occ) res_ty +-- Others might simply be variables that accidentally have no binding site. +tcExpr (HsHole (HoleVar locc@(L _ occ), NoExtField)) res_ty = do { ty <- expTypeToType res_ty -- Allow Int# etc (#12531) ; her <- emitNewExprHole occ ty ; tcEmitBindingUsage bottomUE -- Holes fit any usage environment -- (#18491) - ; return (HsUnboundVar her occ) } + ; return (HsHole (HoleVar locc, her)) + } +tcExpr (HsHole (HoleError, NoExtField)) _ = + panic "GHC.Tc.Gen.Expr: tcExpr: HoleError: Not implemented" tcExpr e@(HsLit x lit) res_ty = do { let lit_ty = hsLitType lit @@ -765,6 +768,7 @@ tcXExpr xe@(ExpandedThingRn o e') res_ty | OrigStmt ls@(L loc _) <- o = setSrcSpanA loc $ mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + tcXExpr xe res_ty = tcApp (XExpr xe) res_ty {- ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -1271,10 +1271,9 @@ addStmtCtxt stmt = addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of - HsUnboundVar {} -> thing_inside + HsHole _ -> thing_inside _ -> addErrCtxt (ExprCtxt e) thing_inside - -- The HsUnboundVar special case addresses situations like + -- The HsHole special case addresses situations like -- f x = _ -- when we don't want to say "In the expression: _", -- because it is mentioned in the error message itself - ===================================== compiler/GHC/Tc/Types/Constraint.hs ===================================== @@ -359,7 +359,7 @@ data DelayedError = DE_Hole Hole -- ^ A hole (in a type or in a term). -- - -- See Note [Holes]. + -- See Note [Holes in expressions]. | DE_NotConcrete NotConcreteError -- ^ A type could not be ensured to be concrete. -- @@ -378,7 +378,7 @@ instance Outputable DelayedError where -- | A hole stores the information needed to report diagnostics -- about holes in terms (unbound identifiers or underscores) or -- in types (also called wildcards, as used in partial type --- signatures). See Note [Holes]. +-- signatures). See Note [Holes in expressions] for holes in terms. data Hole = Hole { hole_sort :: HoleSort -- ^ What flavour of hole is this? , hole_occ :: RdrName -- ^ The name of this hole @@ -646,43 +646,78 @@ of the rhs. This is necessary because these constraints are used for substitutio during solving. If the kinds differed, then the substitution would take a well-kinded type to an ill-kinded one. -Note [Holes] -~~~~~~~~~~~~ -This Note explains how GHC tracks *holes*. - -A hole represents one of two conditions: - - A missing bit of an expression. Example: foo x = x + _ - - A missing bit of a type. Example: bar :: Int -> _ - -What these have in common is that both cause GHC to emit a diagnostic to the -user describing the bit that is left out. - -When a hole is encountered, a new entry of type Hole is added to the ambient -WantedConstraints. The type (hole_ty) of the hole is then simplified during -solving (with respect to any Givens in surrounding implications). It is -reported with all the other errors in GHC.Tc.Errors. - -For expression holes, the user has the option of deferring errors until runtime -with -fdefer-type-errors. In this case, the hole actually has evidence: this -evidence is an erroring expression that prints an error and crashes at runtime. -The ExprHole variant of holes stores an IORef EvTerm that will contain this evidence; -during constraint generation, this IORef was stored in the HsUnboundVar extension -field by the type checker. The desugarer simply dereferences to get the CoreExpr. - -Prior to fixing #17812, we used to invent an Id to hold the erroring -expression, and then bind it during type-checking. But this does not support -representation-polymorphic out-of-scope identifiers. See -typecheck/should_compile/T17812. We thus use the mutable-CoreExpr approach -described above. - -You might think that the type in the HoleExprRef is the same as the type of the -hole. However, because the hole type (hole_ty) is rewritten with respect to -givens, this might not be the case. That is, the hole_ty is always (~) to the -type of the HoleExprRef, but they might not be `eqType`. We need the type of the generated -evidence to match what is expected in the context of the hole, and so we must -store these types separately. - -Type-level holes have no evidence at all. +Note [Holes in expressions] +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This Note explains how GHC tracks "holes" in expressions. It does not +deal with holes in types, nor with partial type signatures. + +A hole represents a missing bit of an expression. Example: + foo x = x && _ +GHC then emits a diagnostic, describing the bit that is left out: + Foo.hs:5:14: error: [GHC-88464] + • Found hole: _ :: Bool + • In the second argument of ‘(&&)’, namely ‘_’ + In the expression: x && _ + +GHC uses the same mechanism is used to give diagnostics for out-of-scope +variables: + foo x = x && y +gives diagnostic + Foo.hs:5:14: error: [GHC-88464] + Variable not in scope: y :: Bool + +Here is how holes are represented in expressions: + +* If the user wrote "_": + Parser HsHole (HoleVar "_", NoExtField) + Renamer HsHole (HoleVar "_", NoExtField) + Typechecker HsHole (HoleVar "_", ref) + +* If the user wrote "x", where `x` is not in scope + Parser HsVar "x" + Renamer HsHole (HoleVar "x", NoExtField) + Typechecker HsHole (HoleVar "x", ref) + +In both cases (ref::HoleExprRef) contains + - The type of the hole. + - A ref-cell that is filled in (by the typechecker) with an + error thunk. With -fdefer-type errors we use this as the + value of the hole. + - A Unique (see Note [Uniques and tags]). + +Typechecking holes + +* When the typechecker encounters a `HsHole`, it returns one with the + HoleExprRef, but also emits a `DelayedError` into the `WantedConstraints`. + +* This DelayedError later triggers the error reporting, and the filling-in of + the error thunk, in GHC.Tc.Errors. + +* The user has the option of deferring errors until runtime with + `-fdefer-type-errors`. In this case, the hole carries evidence in its + `HoleExprRef`. This evidence is an erroring expression that prints an error + and crashes at runtime. + +Desugaring holes + +* During desugaring, the `(HsHole (HoleVar "x", ref))` is desugared by + reading the ref-cell to find the error thunk evidence term, put there by the + constraint solver. + +Wrinkles: + +* Prior to fixing #17812, we used to invent an Id to hold the erroring + expression, and then bind it during type-checking. But this does not support + representation-polymorphic out-of-scope identifiers. See + typecheck/should_compile/T17812. We thus use the mutable-CoreExpr approach + described above. + +* You might think that the type in the HoleExprRef is the same as the type of the + hole. However, because the hole type (hole_ty) is rewritten with respect to + givens, this might not be the case. That is, the hole_ty is always (~) to the + type of the HoleExprRef, but they might not be `eqType`. We need the type of the generated + evidence to match what is expected in the context of the hole, and so we must + store these types separately. -} mkNonCanonical :: CtEvidence -> Ct ===================================== compiler/GHC/Tc/Types/Evidence.hs ===================================== @@ -585,7 +585,7 @@ data EvCallStack -} -- | Where to store evidence for expression holes --- See Note [Holes] in GHC.Tc.Types.Constraint +-- See Note [Holes in expressions] in GHC.Tc.Types.Constraint data HoleExprRef = HER (IORef EvTerm) -- ^ where to write the erroring expression TcType -- ^ expected type of that expression Unique -- ^ for debug output only ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -717,7 +717,6 @@ lexprCtOrigin (L _ e) = exprCtOrigin e exprCtOrigin :: HsExpr GhcRn -> CtOrigin exprCtOrigin (HsVar _ (L _ name)) = OccurrenceOf name exprCtOrigin (HsGetField _ _ (L _ f)) = GetFieldOrigin (field_label $ unLoc $ dfoLabel f) -exprCtOrigin (HsUnboundVar {}) = Shouldn'tHappenOrigin "unbound variable" exprCtOrigin (HsOverLabel _ l) = OverLabelOrigin l exprCtOrigin (ExplicitList {}) = ListOrigin exprCtOrigin (HsIPVar _ ip) = IPOccOrigin ip @@ -751,6 +750,7 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" +exprCtOrigin (HsHole _) = Shouldn'tHappenOrigin "hole expression" exprCtOrigin (HsForAll {}) = Shouldn'tHappenOrigin "forall telescope" -- See Note [Types in terms] exprCtOrigin (HsQual {}) = Shouldn'tHappenOrigin "constraint context" -- See Note [Types in terms] exprCtOrigin (HsFunArr {}) = Shouldn'tHappenOrigin "function arrow" -- See Note [Types in terms] ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -925,9 +925,9 @@ zonkExpr (HsVar x (L l id)) do { id' <- zonkIdOcc id ; return (HsVar x (L l id')) } -zonkExpr (HsUnboundVar her occ) +zonkExpr (HsHole (h, her)) = do her' <- zonk_her her - return (HsUnboundVar her' occ) + return (HsHole (h, her')) where zonk_her :: HoleExprRef -> ZonkTcM HoleExprRef zonk_her (HER ref ty u) @@ -935,7 +935,6 @@ zonkExpr (HsUnboundVar her occ) ty' <- zonkTcTypeToTypeX ty return (HER ref ty' u) - zonkExpr (HsIPVar x _) = dataConCantHappen x zonkExpr (HsOverLabel x _) = dataConCantHappen x ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -41,7 +41,6 @@ import Data.Bool import Data.Eq import Data.Maybe import Data.List.NonEmpty ( NonEmpty ) -import GHC.Types.Name.Reader {- Note [RecordDotSyntax field updates] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -335,19 +334,6 @@ data HsExpr p (LIdP p) -- ^ Variable -- See Note [Located RdrNames] - | HsUnboundVar (XUnboundVar p) - RdrName -- ^ Unbound variable; also used for "holes" - -- (_ or _x). - -- Turned from HsVar to HsUnboundVar by the - -- renamer, when it finds an out-of-scope - -- variable or hole. - -- The (XUnboundVar p) field becomes an HoleExprRef - -- after typechecking; this is where the - -- erroring expression will be written after - -- solving. See Note [Holes] in GHC.Tc.Types.Constraint. - - - | HsOverLabel (XOverLabel p) FastString -- ^ Overloaded label (Note [Overloaded labels] in GHC.OverloadedLabels) @@ -380,7 +366,7 @@ data HsExpr p -- NB Bracketed ops such as (+) come out as Vars. -- NB Sadly, we need an expr for the operator in an OpApp/Section since - -- the renamer may turn a HsVar into HsRecSel or HsUnboundVar + -- the renamer may turn a HsVar into HsRecSel or HsHole. | OpApp (XOpApp p) (LHsExpr p) -- left operand @@ -529,6 +515,10 @@ data HsExpr p | HsEmbTy (XEmbTy p) (LHsWcType (NoGhcTc p)) + -- | Holes in expressions, i.e. '_'. + -- See Note [Holes in expressions] in GHC.Tc.Types.Constraint. + | HsHole (XHole p) + -- | Forall-types @forall tvs. t@ and @forall tvs -> t at . -- Used with @RequiredTypeArguments@, e.g. @fn (forall a. Proxy a)@. -- See Note [Types in terms] ===================================== compiler/Language/Haskell/Syntax/Extension.hs ===================================== @@ -445,6 +445,7 @@ type family XTick x type family XBinTick x type family XPragE x type family XEmbTy x +type family XHole x type family XForAll x type family XQual x type family XFunArr x ===================================== testsuite/tests/perf/compiler/hard_hole_fits.hs ===================================== @@ -12,7 +12,7 @@ import GHC (GhcPs) testMe :: HsExpr GhcPs -> Int testMe (HsVar a b) = _ -testMe (HsUnboundVar xuv uv) = _ +testMe (HsHole a) = _ testMe (HsOverLabel xol m_ip) = _ testMe (HsIPVar xv hin) = _ testMe (HsOverLit xole hol) = _ ===================================== testsuite/tests/perf/compiler/hard_hole_fits.stderr ===================================== @@ -17,14 +17,12 @@ hard_hole_fits.hs:14:22: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] (imported from ‘Prelude’ at hard_hole_fits.hs:8:8-20 (and originally defined in ‘GHC.Internal.Enum’)) -hard_hole_fits.hs:15:32: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] - • Found hole: _ :: Int - • In an equation for ‘testMe’: testMe (HsUnboundVar xuv uv) = _ - • Relevant bindings include - uv :: GHC.Types.Name.Reader.RdrName - (bound at hard_hole_fits.hs:15:26) - xuv :: Language.Haskell.Syntax.Extension.XUnboundVar GhcPs - (bound at hard_hole_fits.hs:15:22) +hard_hole_fits.hs:15:21: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] + Found hole: _ :: Int + In an equation for ‘testMe’: testMe (HsHole a) = _ + Relevant bindings include + a :: Language.Haskell.Syntax.Extension.XHole GhcPs + (bound at hard_hole_fits.hs:15:16) testMe :: HsExpr GhcPs -> Int (bound at hard_hole_fits.hs:14:1) Valid hole fits include maxBound :: forall a. Bounded a => a ===================================== testsuite/tests/plugins/T20803-plugin/FixErrorsPlugin.hs ===================================== @@ -20,15 +20,15 @@ import Data.Maybe plugin :: Plugin plugin = defaultPlugin {parsedResultAction = parsedAction} --- Replace every hole (and other unbound vars) with the given expression +-- Replace every hole with the given expression replaceHoles :: forall a . Data a => HsExpr GhcPs -> a -> a replaceHoles new = gmapT \case (d :: d) -> replaceHoles new d `fromMaybe` tryHole where tryHole :: Maybe d tryHole = eqT @d @(HsExpr GhcPs) >>= \case - Eq.Refl | HsUnboundVar _ _ <- d -> Just new - _ -> Nothing + Eq.Refl | HsHole _ <- d -> Just new + _ -> Nothing parsedAction :: [CommandLineOption] -> ModSummary -> ParsedResult -> Hsc ParsedResult ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -314,10 +314,6 @@ instance HasTrailing AnnExplicitSum where trailing _ = [] setTrailing a _ = a -instance HasTrailing (Maybe EpAnnUnboundVar) where - trailing _ = [] - setTrailing a _ = a - instance HasTrailing GrhsAnn where trailing _ = [] setTrailing a _ = a @@ -2879,16 +2875,14 @@ instance ExactPrint (HsExpr GhcPs) where then markAnnotated n else return n return (HsVar x n') - exact (HsUnboundVar an n) = do - case an of - Just (EpAnnUnboundVar (ob,cb) l) -> do - ob' <- markEpToken ob - l' <- markEpToken l - cb' <- markEpToken cb - return (HsUnboundVar (Just (EpAnnUnboundVar (ob',cb') l')) n) - _ -> do - printStringAdvanceA "_" >> return () - return (HsUnboundVar an n) + exact (HsHole (HoleVar n, NoExtField)) = do + let pun_RDR = "pun-right-hand-side" + n' <- if (showPprUnsafe n /= pun_RDR) + then markAnnotated n + else return n + return (HsHole (HoleVar n', NoExtField)) + -- TODO: Adapt 'HoleError' to include the 'SourceText': + exact (HsHole (HoleError, NoExtField)) = error "Cannot exact print HoleError" exact x@(HsOverLabel src l) = do printStringAdvanceA "#" >> return () case src of View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8c968cdc7977e64ce5b34d07b0cf1c311d0dd4ed -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8c968cdc7977e64ce5b34d07b0cf1c311d0dd4ed You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 2 22:34:41 2025 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Sun, 02 Feb 2025 17:34:41 -0500 Subject: [Git][ghc/ghc][wip/aidylns/ttg-remove-hsunboundvar-via-hshole] Replace HsUnboundVar with HsHole Message-ID: <679ff301e35f8_10911f9df9445763@gitlab.mail> Adriaan Leijnse pushed to branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC Commits: 3a556901 by Adriaan Leijnse at 2025-02-02T22:34:15+00:00 Replace HsUnboundVar with HsHole The 'HsHole' constructor represents expression holes ("_") in the surface syntax. Its 'XHole' extension point is used in GHC phases for things with a type but which are not necessarily complete Haskell such as (named) expression holes, parse errors, and unbound variables. - - - - - 26 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/Language/Haskell/Syntax/Extension.hs - testsuite/tests/perf/compiler/hard_hole_fits.hs - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/plugins/T20803-plugin/FixErrorsPlugin.hs - utils/check-exact/ExactPrint.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -220,11 +220,6 @@ data EpAnnLam = EpAnnLam instance NoAnn EpAnnLam where noAnn = EpAnnLam noAnn noAnn -data EpAnnUnboundVar = EpAnnUnboundVar - { hsUnboundBackquotes :: (EpToken "`", EpToken "`") - , hsUnboundHole :: EpToken "_" - } deriving Data - -- Record selectors at parse time are HsVar; they convert to HsRecSel -- on renaming. type instance XRecSel GhcPs = DataConCantHappen @@ -241,14 +236,6 @@ type instance XOverLabel GhcTc = DataConCantHappen type instance XVar (GhcPass _) = NoExtField -type instance XUnboundVar GhcPs = Maybe EpAnnUnboundVar -type instance XUnboundVar GhcRn = NoExtField -type instance XUnboundVar GhcTc = HoleExprRef - -- We really don't need the whole HoleExprRef; just the IORef EvTerm - -- would be enough. But then deriving a Data instance becomes impossible. - -- Much, much easier just to define HoleExprRef with a Data instance and - -- store the whole structure. - type instance XIPVar GhcPs = NoExtField type instance XIPVar GhcRn = NoExtField type instance XIPVar GhcTc = DataConCantHappen @@ -394,6 +381,37 @@ type instance XEmbTy GhcTc = DataConCantHappen -- A free-standing HsEmbTy is an error. -- Valid usages are immediately desugared into Type. + +-- | Expression Hole. +-- +-- Parser: produced on encountering an anonymous +-- expression hole ("_"), or a parse error. +-- +-- Renamer: produced from 'HsVar' when encountering out-of-scope variables +-- (which can also be named expression holes, i.e. "_hole"). The 'ParseError' +-- case is unhandled in this and the type checking phase. +-- +-- Type checker: the HoleExprRef is where the erroring expression will be written after +-- solving. See Note [Holes in expressions] in GHC.Tc.Types.Constraint. +-- +-- We really don't need the whole HoleExprRef; just the IORef EvTerm would +-- be enough. But then deriving a Data instance becomes impossible. Much, +-- much easier just to define HoleExprRef with a Data instance and store +-- the whole structure. +type instance XHole GhcPs = (HoleKind, NoExtField) +type instance XHole GhcRn = (HoleKind, NoExtField) +type instance XHole GhcTc = (HoleKind, HoleExprRef) + +data HoleKind + = HoleVar (LIdP GhcPs) + | HoleError + deriving Data + +-- | The RdrName for an unnamed hole ("_"). +unnamedHoleRdrName :: RdrName +unnamedHoleRdrName = mkUnqual varName (fsLit "_") + + type instance XForAll GhcPs = NoExtField type instance XForAll GhcRn = NoExtField type instance XForAll GhcTc = DataConCantHappen @@ -698,7 +716,13 @@ ppr_lexpr e = ppr_expr (unLoc e) ppr_expr :: forall p. (OutputableBndrId p) => HsExpr (GhcPass p) -> SDoc ppr_expr (HsVar _ (L _ v)) = pprPrefixOcc v -ppr_expr (HsUnboundVar _ uv) = pprPrefixOcc uv +ppr_expr (HsHole x) = case (ghcPass @p, x) of + (GhcPs, (HoleVar (L _ v), _)) -> pprPrefixOcc v + (GhcRn, (HoleVar (L _ v), _)) -> pprPrefixOcc v + (GhcTc, (HoleVar (L _ v), _)) -> pprPrefixOcc v + (GhcPs, (HoleError, _)) -> pprPrefixOcc unnamedHoleRdrName + (GhcRn, (HoleError, _)) -> pprPrefixOcc unnamedHoleRdrName + (GhcTc, (HoleError, _)) -> pprPrefixOcc unnamedHoleRdrName ppr_expr (HsIPVar _ v) = ppr v ppr_expr (HsOverLabel s l) = case ghcPass @p of GhcPs -> helper s @@ -954,10 +978,13 @@ instance Outputable XXExprGhcTc where ppr exp, text ")"] ppr (HsRecSelTc f) = pprPrefixOcc f - ppr_infix_expr :: forall p. (OutputableBndrId p) => HsExpr (GhcPass p) -> Maybe SDoc ppr_infix_expr (HsVar _ (L _ v)) = Just (pprInfixOcc v) -ppr_infix_expr (HsUnboundVar _ occ) = Just (pprInfixOcc occ) +ppr_infix_expr (HsHole x) = Just $ pprInfixOcc $ case (ghcPass @p, x) of + (GhcPs, (HoleVar (L _ v), _)) -> v + (GhcRn, (HoleVar (L _ v), _)) -> v + (GhcTc, (HoleVar (L _ v), _)) -> v + _ -> unnamedHoleRdrName -- TODO: this is the HoleError case; print the actual source code or something better than "_" ppr_infix_expr (XExpr x) = case ghcPass @p of GhcRn -> ppr_infix_expr_rn x GhcTc -> ppr_infix_expr_tc x @@ -976,7 +1003,6 @@ ppr_infix_expr_tc (HsTick {}) = Nothing ppr_infix_expr_tc (HsBinTick {}) = Nothing ppr_infix_expr_tc (HsRecSelTc f) = Just (pprInfixOcc f) - ppr_infix_hs_expansion :: HsThingRn -> Maybe SDoc ppr_infix_hs_expansion (OrigExpr e) = ppr_infix_expr e ppr_infix_hs_expansion _ = Nothing @@ -1023,7 +1049,6 @@ hsExprNeedsParens prec = go where go :: HsExpr (GhcPass p) -> Bool go (HsVar{}) = False - go (HsUnboundVar{}) = False go (HsIPVar{}) = False go (HsOverLabel{}) = False go (HsLit _ l) = hsLitNeedsParens prec l @@ -1065,6 +1090,7 @@ hsExprNeedsParens prec = go go (HsProjection{}) = True go (HsGetField{}) = False go (HsEmbTy{}) = prec > topPrec + go (HsHole{}) = False go (HsForAll{}) = prec >= funPrec go (HsQual{}) = prec >= funPrec go (HsFunArr{}) = prec >= funPrec @@ -1120,7 +1146,7 @@ isAtomicHsExpr (HsLit {}) = True isAtomicHsExpr (HsOverLit {}) = True isAtomicHsExpr (HsIPVar {}) = True isAtomicHsExpr (HsOverLabel {}) = True -isAtomicHsExpr (HsUnboundVar {}) = True +isAtomicHsExpr (HsHole{}) = True isAtomicHsExpr (XExpr x) | GhcTc <- ghcPass @p = go_x_tc x | GhcRn <- ghcPass @p = go_x_rn x ===================================== compiler/GHC/Hs/Syn/Type.hs ===================================== @@ -103,7 +103,6 @@ lhsExprType (L _ e) = hsExprType e -- | Compute the 'Type' of an @'HsExpr' 'GhcTc'@ in a pure fashion. hsExprType :: HsExpr GhcTc -> Type hsExprType (HsVar _ (L _ id)) = idType id -hsExprType (HsUnboundVar (HER _ ty _) _) = ty hsExprType (HsOverLabel v _) = dataConCantHappen v hsExprType (HsIPVar v _) = dataConCantHappen v hsExprType (HsOverLit _ lit) = overLitType lit @@ -146,6 +145,7 @@ hsExprType (HsProc _ _ lcmd_top) = lhsCmdTopType lcmd_top hsExprType (HsStatic (_, ty) _s) = ty hsExprType (HsPragE _ _ e) = lhsExprType e hsExprType (HsEmbTy x _) = dataConCantHappen x +hsExprType (HsHole (_, (HER _ ty _))) = ty hsExprType (HsQual x _ _) = dataConCantHappen x hsExprType (HsForAll x _ _) = dataConCantHappen x hsExprType (HsFunArr x _ _ _) = dataConCantHappen x ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -273,8 +273,8 @@ dsExpr e@(HsVar {}) = dsApp e dsExpr e@(HsApp {}) = dsApp e dsExpr e@(HsAppType {}) = dsApp e -dsExpr (HsUnboundVar (HER ref _ _) _) = dsEvTerm =<< readMutVar ref - -- See Note [Holes] in GHC.Tc.Types.Constraint +dsExpr (HsHole (_, (HER ref _ _))) = dsEvTerm =<< readMutVar ref + -- See Note [Holes in expressions] in GHC.Tc.Types.Constraint. dsExpr (HsPar _ e) = dsLExpr e dsExpr (ExprWithTySig _ e _) = dsLExpr e @@ -316,6 +316,7 @@ dsExpr e@(XExpr ext_expr_tc) } + -- Strip ticks due to #21701, need to be invariant about warnings we produce whether -- this is enabled or not. dsExpr (NegApp _ (L loc ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1539,6 +1539,10 @@ repE (HsVar _ (L _ x)) = Just (DsBound y) -> repVarOrCon x (coreVar y) Just (DsSplice e) -> do { e' <- lift $ dsExpr e ; return (MkC e') } } +repE (HsHole (HoleVar (L _ uv), NoExtField)) = do + name <- repRdrName uv + repUnboundVar name +repE (HsHole (HoleError, NoExtField)) = panic "repE: HoleError" repE (HsIPVar _ n) = rep_implicit_param_name n >>= repImplicitParamVar repE (HsOverLabel _ s) = repOverLabel s @@ -1677,9 +1681,6 @@ repE (HsTypedSplice n _) = rep_splice n repE (HsUntypedSplice (HsUntypedSpliceNested n) _) = rep_splice n repE e@(HsUntypedSplice (HsUntypedSpliceTop _ _) _) = pprPanic "repE: top level splice" (ppr e) repE (HsStatic _ e) = repLE e >>= rep2 staticEName . (:[]) . unC -repE (HsUnboundVar _ uv) = do - name <- repRdrName uv - repUnboundVar name repE (HsGetField _ e (L _ (DotFieldOcc _ (L _ (FieldLabelString f))))) = do e1 <- repLE e repGetField e1 f @@ -1714,10 +1715,8 @@ repE e@(XExpr (ExpandedThingRn o x)) else repE e } | otherwise = notHandled (ThExpressionForm e) - repE (XExpr (PopErrCtxt (L _ e))) = repE e repE (XExpr (HsRecSelRn (FieldOcc _ (L _ x)))) = repE (HsVar noExtField (noLocA x)) - repE e@(HsPragE _ (HsPragSCC {}) _) = notHandled (ThCostCentres e) repE e@(HsTypedBracket{}) = notHandled (ThExpressionForm e) repE e@(HsUntypedBracket{}) = notHandled (ThExpressionForm e) ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -470,13 +470,12 @@ addBinTickLHsExpr boxLabel e@(L pos e0) addTickHsExpr :: HsExpr GhcTc -> TM (HsExpr GhcTc) addTickHsExpr e@(HsVar _ (L _ id)) = do freeVar id; return e -addTickHsExpr e@(HsUnboundVar {}) = return e - addTickHsExpr e@(HsIPVar {}) = return e addTickHsExpr e@(HsOverLit {}) = return e addTickHsExpr e@(HsOverLabel{}) = return e addTickHsExpr e@(HsLit {}) = return e addTickHsExpr e@(HsEmbTy {}) = return e +addTickHsExpr e@(HsHole {}) = return e addTickHsExpr e@(HsQual {}) = return e addTickHsExpr e@(HsForAll {}) = return e addTickHsExpr e@(HsFunArr {}) = return e ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1199,7 +1199,6 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where [ toHie $ C Use (L mspan var) -- Patch up var location since typechecker removes it ] - HsUnboundVar _ _ -> [] -- there is an unbound name here, but that causes trouble HsOverLabel {} -> [] HsIPVar _ _ -> [] HsOverLit _ o -> @@ -1347,6 +1346,7 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where ] HsGetField {} -> [] HsProjection {} -> [] + HsHole _ -> [] -- there is a hole here, but that causes trouble XExpr x -> case hiePass @p of HieTc -> case x of WrapExpr w a ===================================== compiler/GHC/Parser.y ===================================== @@ -3928,8 +3928,9 @@ qopm :: { forall b. DisambInfixOp b => PV (LocatedN b) } -- used in section | qconop { mkHsConOpPV $1 } | hole_op { mkHsInfixHolePV $1 } -hole_op :: { LocatedN (HsExpr GhcPs) } -- used in sections -hole_op : '`' '_' '`' { sLLa $1 $> (hsHoleExpr (Just $ EpAnnUnboundVar (epTok $1, epTok $3) (epTok $2))) } +hole_op :: { LocatedN RdrName } -- used in sections +hole_op : '`' '_' '`' {% amsr (sLL $1 $> (mkUnqual varName (fsLit "_"))) + (NameAnn (NameBackquotes (epTok $1) (epTok $3)) (glR $2) []) } qvarop :: { LocatedN RdrName } : qvarsym { $1 } ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -108,7 +108,6 @@ module GHC.Parser.PostProcess ( withArrowParsingMode, withArrowParsingMode', setTelescopeBndrsNameSpace, PatBuilder, - hsHoleExpr, -- Type/datacon ambiguity resolution DisambTD(..), @@ -1610,12 +1609,12 @@ type Fbind b = Either (LHsRecField GhcPs (LocatedA b)) (LHsRecProj GhcPs (Locate class DisambInfixOp b where mkHsVarOpPV :: LocatedN RdrName -> PV (LocatedN b) mkHsConOpPV :: LocatedN RdrName -> PV (LocatedN b) - mkHsInfixHolePV :: LocatedN (HsExpr GhcPs) -> PV (LocatedN b) + mkHsInfixHolePV :: LocatedN RdrName -> PV (LocatedN b) instance DisambInfixOp (HsExpr GhcPs) where mkHsVarOpPV v = return $ L (getLoc v) (HsVar noExtField v) mkHsConOpPV v = return $ L (getLoc v) (HsVar noExtField v) - mkHsInfixHolePV h = return h + mkHsInfixHolePV v = return $ L (getLoc v) (HsHole (HoleVar v, noExtField)) instance DisambInfixOp RdrName where mkHsConOpPV (L l v) = return $ L l v @@ -1897,11 +1896,11 @@ instance DisambECP (HsExpr GhcPs) where type Body (HsExpr GhcPs) = HsExpr ecpFromCmd' (L l c) = do addError $ mkPlainErrorMsgEnvelope (locA l) $ PsErrArrowCmdInExpr c - return (L l (hsHoleExpr noAnn)) + return (L l parseError) ecpFromExp' = return ecpFromPat' p@(L l _) = do addError $ mkPlainErrorMsgEnvelope (locA l) $ PsErrOrPatInExpr p - return (L l (hsHoleExpr noAnn)) + return (L l parseError) mkHsProjUpdatePV l fields arg isPun anns = do !cs <- getCommentsFor l return $ mkRdrProjUpdate (EpAnn (spanAsAnchor l) noAnn cs) fields arg isPun anns @@ -1950,7 +1949,7 @@ instance DisambECP (HsExpr GhcPs) where mkHsOverLitPV (L (EpAnn l an csIn) a) = do !cs <- getCommentsFor (locA l) return $ L (EpAnn l an (cs Semi.<> csIn)) (HsOverLit NoExtField a) - mkHsWildCardPV l = return $ L (noAnnSrcSpan l) (hsHoleExpr noAnn) + mkHsWildCardPV l = return $ L (noAnnSrcSpan l) (HsHole (HoleVar (L (noAnnSrcSpan l) (mkUnqual varName (fsLit "_"))), NoExtField)) mkHsTySigPV l@(EpAnn anc an csIn) a sig anns = do !cs <- getCommentsFor (locA l) return $ L (EpAnn anc an (csIn Semi.<> cs)) (ExprWithTySig anns a (hsTypeToHsSigWcType sig)) @@ -1971,11 +1970,11 @@ instance DisambECP (HsExpr GhcPs) where !cs <- getCommentsFor l return $ L (EpAnn (spanAsAnchor l) noAnn cs) (SectionR noExtField op e) mkHsAsPatPV l v _ e = addError (mkPlainErrorMsgEnvelope l $ PsErrTypeAppWithoutSpace (unLoc v) e) - >> return (L (noAnnSrcSpan l) (hsHoleExpr noAnn)) + >> return (L (noAnnSrcSpan l) parseError) mkHsLazyPatPV l e _ = addError (mkPlainErrorMsgEnvelope l $ PsErrLazyPatWithoutSpace e) - >> return (L (noAnnSrcSpan l) (hsHoleExpr noAnn)) + >> return (L (noAnnSrcSpan l) parseError) mkHsBangPatPV l e _ = addError (mkPlainErrorMsgEnvelope l $ PsErrBangPatWithoutSpace e) - >> return (L (noAnnSrcSpan l) (hsHoleExpr noAnn)) + >> return (L (noAnnSrcSpan l) parseError) mkSumOrTuplePV = mkSumOrTupleExpr mkHsEmbTyPV l toktype ty = return $ L (noAnnSrcSpan l) $ @@ -2002,9 +2001,6 @@ instance DisambECP (HsExpr GhcPs) where (PsErrUnallowedPragma prag) rejectPragmaPV _ = return () -hsHoleExpr :: Maybe EpAnnUnboundVar -> HsExpr GhcPs -hsHoleExpr anns = HsUnboundVar anns (mkRdrUnqual (mkVarOccFS (fsLit "_"))) - instance DisambECP (PatBuilder GhcPs) where type Body (PatBuilder GhcPs) = PatBuilder ecpFromCmd' (L l c) = addFatalError $ mkPlainErrorMsgEnvelope (locA l) $ PsErrArrowCmdInPat c @@ -3678,3 +3674,6 @@ mkListSyntaxTy1 brkOpen t brkClose = annsKeyword = (NoEpTok, brkOpen, brkClose) annParen = AnnParensSquare brkOpen brkClose + +parseError :: HsExpr GhcPs +parseError = HsHole (HoleError, NoExtField) ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -312,18 +312,18 @@ finishHsVar (L l name) checkThLocalName name ; return (HsVar noExtField (L (l2l l) name), unitFV name) } -rnUnboundVar :: RdrName -> RnM (HsExpr GhcRn, FreeVars) -rnUnboundVar v = do +rnUnboundVar :: SrcSpanAnnN -> RdrName -> RnM (HsExpr GhcRn, FreeVars) +rnUnboundVar l v = do deferOutofScopeVariables <- goptM Opt_DeferOutOfScopeVariables -- See Note [Reporting unbound names] for difference between qualified and unqualified names. unless (isUnqual v || deferOutofScopeVariables) (reportUnboundName v >> return ()) - return (HsUnboundVar noExtField v, emptyFVs) + return (HsHole (HoleVar (L l v), NoExtField), emptyFVs) rnExpr (HsVar _ (L l v)) = do { dflags <- getDynFlags ; mb_gre <- lookupExprOccRn v ; case mb_gre of { - Nothing -> rnUnboundVar v ; + Nothing -> rnUnboundVar l v ; Just gre -> do { let nm = greName gre info = greInfo gre @@ -352,8 +352,8 @@ rnExpr (HsVar _ (L l v)) rnExpr (HsIPVar x v) = return (HsIPVar x v, emptyFVs) -rnExpr (HsUnboundVar _ v) - = return (HsUnboundVar noExtField v, emptyFVs) +rnExpr (HsHole (h, NoExtField)) + = return ((HsHole (h, NoExtField)), emptyFVs) -- HsOverLabel: see Note [Handling overloaded and rebindable constructs] rnExpr (HsOverLabel src v) @@ -858,8 +858,8 @@ See #18151. Note [Reporting unbound names] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Faced with an out-of-scope `RdrName` there are two courses of action -A. Report an error immediately (and return a HsUnboundVar). This will halt GHC after the renamer is complete -B. Return a HsUnboundVar without reporting an error. That will allow the typechecker to run, which in turn +A. Report an error immediately (and return a `HsHole (HoleVar ...)`). This will halt GHC after the renamer is complete +B. Return a `HsHole (HoleVar ...)` without reporting an error. That will allow the typechecker to run, which in turn can give a better error message, notably giving the type of the variable via the "typed holes" mechanism. When `-fdefer-out-of-scope-variables` is on we follow plan B. ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -1466,10 +1466,10 @@ data NegationHandling = ReassociateNegation | KeepNegationIntact ---------------------------- get_op :: LHsExpr GhcRn -> OpName --- An unbound name could be either HsVar or HsUnboundVar +-- An unbound name could be either HsVar or (HsHole (HoleVar _, _)) -- See GHC.Rename.Expr.rnUnboundVar get_op (L _ (HsVar _ n)) = NormalOp (unLoc n) -get_op (L _ (HsUnboundVar _ uv)) = UnboundOp uv +get_op (L _ (HsHole (HoleVar (L _ uv), NoExtField))) = UnboundOp uv get_op (L _ (XExpr (HsRecSelRn fld))) = RecFldOp fld get_op other = pprPanic "get_op" (ppr other) ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -1298,7 +1298,7 @@ badRuleLhsErr name lhs bad_e = TcRnIllegalRuleLhs errReason name lhs bad_e where errReason = case bad_e of - HsUnboundVar _ uv -> + HsHole (HoleVar (L _ uv), NoExtField) -> UnboundVariable uv $ notInScopeErr WL_Global uv _ -> IllegalExpression ===================================== compiler/GHC/Tc/Errors.hs ===================================== @@ -1525,7 +1525,7 @@ maybeAddDeferredBindings hole report = do when (deferringAnyBindings ctxt) $ do err_tm <- mkErrorTerm (hole_loc hole) ref_ty report -- NB: ref_ty, not hole_ty. hole_ty might be rewritten. - -- See Note [Holes] in GHC.Tc.Types.Constraint + -- See Note [Holes in expressions] in GHC.Tc.Types.Constraint writeMutVar ref err_tm _ -> pure () where ===================================== compiler/GHC/Tc/Errors/Ppr.hs ===================================== @@ -71,7 +71,7 @@ import GHC.CoreToIface import GHC.Driver.Flags import GHC.Driver.Backend -import GHC.Hs +import GHC.Hs hiding (HoleError) import GHC.Tc.Errors.Types import GHC.Tc.Errors.Hole.FitTypes ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -221,7 +221,7 @@ A "head" has three special cases (for which we can infer a polytype using tcInferAppHead_maybe); otherwise is just any old expression (for which we can infer a rho-type (via tcInfer). -There is no special treatment for HsUnboundVar, HsOverLit etc, because +There is no special treatment for HsHole (HsVar ...), HsOverLit, etc, because we can't get a polytype from them. Left and right sections (e.g. (x +) and (+ x)) are not yet supported. @@ -680,7 +680,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args fun_is_out_of_scope -- See Note [VTA for out-of-scope functions] = case tc_fun of - HsUnboundVar {} -> True + HsHole _ -> True _ -> False inst_fun :: [HsExprArg 'TcpRn] -> ForAllTyFlag -> Bool @@ -1056,7 +1056,7 @@ expr_to_type earg = = do { t <- go (L l e) ; let splice_result' = HsUntypedSpliceTop finalizers t ; return (L l (HsSpliceTy splice_result' splice)) } - go (L l (HsUnboundVar _ rdr)) + go (L l (HsHole (HoleVar (L _ rdr), NoExtField))) | isUnderscore occ = return (L l (HsWildCardTy noExtField)) | startsWithUnderscore occ = -- See Note [Wildcards in the T2T translation] @@ -1128,7 +1128,7 @@ This conversion is in the TcM monad because vfun [x | x <- xs] Can't convert list comprehension to a type vfun (\x -> x) Can't convert a lambda to a type * It needs to check for LangExt.NamedWildCards to generate an appropriate - error message for HsUnboundVar. + error message for HsHole (HsVar ...). vfun _a Not in scope: ‘_a’ (NamedWildCards disabled) vfun _a Illegal named wildcard in a required type argument: ‘_a’ @@ -1478,7 +1478,7 @@ Note [VTA for out-of-scope functions] Suppose 'wurble' is not in scope, and we have (wurble @Int @Bool True 'x') -Then the renamer will make (HsUnboundVar "wurble") for 'wurble', +Then the renamer will make (HsHole (HsVar "wurble", NoExtField)) for 'wurble', and the typechecker will typecheck it with tcUnboundId, giving it a type 'alpha', and emitting a deferred Hole constraint, to be reported later. @@ -1493,7 +1493,7 @@ tcUnboundId. It later reports 'wurble' as out of scope, and tries to give its type. Fortunately in tcInstFun we still have access to the function, so we -can check if it is a HsUnboundVar. We use this info to simply skip +can check if it is a HsHole. We use this info to simply skip over any visible type arguments. We'll /already/ have emitted a Hole constraint; failing preserves that constraint. ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -44,7 +44,7 @@ import GHC.Types.Unique.Map import GHC.Types.Unique.Set import GHC.Core.Multiplicity import GHC.Core.UsageEnv -import GHC.Tc.Errors.Types +import GHC.Tc.Errors.Types hiding (HoleError) import GHC.Tc.Utils.Concrete ( hasFixedRuntimeRep_syntactic, hasFixedRuntimeRep ) import GHC.Tc.Utils.Instantiate import GHC.Tc.Gen.App @@ -298,13 +298,16 @@ tcExpr (XExpr e) res_ty = tcXExpr e res_ty -- Typecheck an occurrence of an unbound Id -- -- Some of these started life as a true expression hole "_". --- Others might simply be variables that accidentally have no binding site -tcExpr (HsUnboundVar _ occ) res_ty +-- Others might simply be variables that accidentally have no binding site. +tcExpr (HsHole (HoleVar locc@(L _ occ), NoExtField)) res_ty = do { ty <- expTypeToType res_ty -- Allow Int# etc (#12531) ; her <- emitNewExprHole occ ty ; tcEmitBindingUsage bottomUE -- Holes fit any usage environment -- (#18491) - ; return (HsUnboundVar her occ) } + ; return (HsHole (HoleVar locc, her)) + } +tcExpr (HsHole (HoleError, NoExtField)) _ = + panic "GHC.Tc.Gen.Expr: tcExpr: HoleError: Not implemented" tcExpr e@(HsLit x lit) res_ty = do { let lit_ty = hsLitType lit @@ -765,6 +768,7 @@ tcXExpr xe@(ExpandedThingRn o e') res_ty | OrigStmt ls@(L loc _) <- o = setSrcSpanA loc $ mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + tcXExpr xe res_ty = tcApp (XExpr xe) res_ty {- ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -1271,10 +1271,9 @@ addStmtCtxt stmt = addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of - HsUnboundVar {} -> thing_inside + HsHole _ -> thing_inside _ -> addErrCtxt (ExprCtxt e) thing_inside - -- The HsUnboundVar special case addresses situations like + -- The HsHole special case addresses situations like -- f x = _ -- when we don't want to say "In the expression: _", -- because it is mentioned in the error message itself - ===================================== compiler/GHC/Tc/Types/Constraint.hs ===================================== @@ -359,7 +359,7 @@ data DelayedError = DE_Hole Hole -- ^ A hole (in a type or in a term). -- - -- See Note [Holes]. + -- See Note [Holes in expressions]. | DE_NotConcrete NotConcreteError -- ^ A type could not be ensured to be concrete. -- @@ -378,7 +378,7 @@ instance Outputable DelayedError where -- | A hole stores the information needed to report diagnostics -- about holes in terms (unbound identifiers or underscores) or -- in types (also called wildcards, as used in partial type --- signatures). See Note [Holes]. +-- signatures). See Note [Holes in expressions] for holes in terms. data Hole = Hole { hole_sort :: HoleSort -- ^ What flavour of hole is this? , hole_occ :: RdrName -- ^ The name of this hole @@ -646,43 +646,78 @@ of the rhs. This is necessary because these constraints are used for substitutio during solving. If the kinds differed, then the substitution would take a well-kinded type to an ill-kinded one. -Note [Holes] -~~~~~~~~~~~~ -This Note explains how GHC tracks *holes*. - -A hole represents one of two conditions: - - A missing bit of an expression. Example: foo x = x + _ - - A missing bit of a type. Example: bar :: Int -> _ - -What these have in common is that both cause GHC to emit a diagnostic to the -user describing the bit that is left out. - -When a hole is encountered, a new entry of type Hole is added to the ambient -WantedConstraints. The type (hole_ty) of the hole is then simplified during -solving (with respect to any Givens in surrounding implications). It is -reported with all the other errors in GHC.Tc.Errors. - -For expression holes, the user has the option of deferring errors until runtime -with -fdefer-type-errors. In this case, the hole actually has evidence: this -evidence is an erroring expression that prints an error and crashes at runtime. -The ExprHole variant of holes stores an IORef EvTerm that will contain this evidence; -during constraint generation, this IORef was stored in the HsUnboundVar extension -field by the type checker. The desugarer simply dereferences to get the CoreExpr. - -Prior to fixing #17812, we used to invent an Id to hold the erroring -expression, and then bind it during type-checking. But this does not support -representation-polymorphic out-of-scope identifiers. See -typecheck/should_compile/T17812. We thus use the mutable-CoreExpr approach -described above. - -You might think that the type in the HoleExprRef is the same as the type of the -hole. However, because the hole type (hole_ty) is rewritten with respect to -givens, this might not be the case. That is, the hole_ty is always (~) to the -type of the HoleExprRef, but they might not be `eqType`. We need the type of the generated -evidence to match what is expected in the context of the hole, and so we must -store these types separately. - -Type-level holes have no evidence at all. +Note [Holes in expressions] +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This Note explains how GHC tracks "holes" in expressions. It does not +deal with holes in types, nor with partial type signatures. + +A hole represents a missing bit of an expression. Example: + foo x = x && _ +GHC then emits a diagnostic, describing the bit that is left out: + Foo.hs:5:14: error: [GHC-88464] + • Found hole: _ :: Bool + • In the second argument of ‘(&&)’, namely ‘_’ + In the expression: x && _ + +GHC uses the same mechanism is used to give diagnostics for out-of-scope +variables: + foo x = x && y +gives diagnostic + Foo.hs:5:14: error: [GHC-88464] + Variable not in scope: y :: Bool + +Here is how holes are represented in expressions: + +* If the user wrote "_": + Parser HsHole (HoleVar "_", NoExtField) + Renamer HsHole (HoleVar "_", NoExtField) + Typechecker HsHole (HoleVar "_", ref) + +* If the user wrote "x", where `x` is not in scope + Parser HsVar "x" + Renamer HsHole (HoleVar "x", NoExtField) + Typechecker HsHole (HoleVar "x", ref) + +In both cases (ref::HoleExprRef) contains + - The type of the hole. + - A ref-cell that is filled in (by the typechecker) with an + error thunk. With -fdefer-type errors we use this as the + value of the hole. + - A Unique (see Note [Uniques and tags]). + +Typechecking holes + +* When the typechecker encounters a `HsHole`, it returns one with the + HoleExprRef, but also emits a `DelayedError` into the `WantedConstraints`. + +* This DelayedError later triggers the error reporting, and the filling-in of + the error thunk, in GHC.Tc.Errors. + +* The user has the option of deferring errors until runtime with + `-fdefer-type-errors`. In this case, the hole carries evidence in its + `HoleExprRef`. This evidence is an erroring expression that prints an error + and crashes at runtime. + +Desugaring holes + +* During desugaring, the `(HsHole (HoleVar "x", ref))` is desugared by + reading the ref-cell to find the error thunk evidence term, put there by the + constraint solver. + +Wrinkles: + +* Prior to fixing #17812, we used to invent an Id to hold the erroring + expression, and then bind it during type-checking. But this does not support + representation-polymorphic out-of-scope identifiers. See + typecheck/should_compile/T17812. We thus use the mutable-CoreExpr approach + described above. + +* You might think that the type in the HoleExprRef is the same as the type of the + hole. However, because the hole type (hole_ty) is rewritten with respect to + givens, this might not be the case. That is, the hole_ty is always (~) to the + type of the HoleExprRef, but they might not be `eqType`. We need the type of the generated + evidence to match what is expected in the context of the hole, and so we must + store these types separately. -} mkNonCanonical :: CtEvidence -> Ct ===================================== compiler/GHC/Tc/Types/Evidence.hs ===================================== @@ -585,7 +585,7 @@ data EvCallStack -} -- | Where to store evidence for expression holes --- See Note [Holes] in GHC.Tc.Types.Constraint +-- See Note [Holes in expressions] in GHC.Tc.Types.Constraint data HoleExprRef = HER (IORef EvTerm) -- ^ where to write the erroring expression TcType -- ^ expected type of that expression Unique -- ^ for debug output only ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -717,7 +717,6 @@ lexprCtOrigin (L _ e) = exprCtOrigin e exprCtOrigin :: HsExpr GhcRn -> CtOrigin exprCtOrigin (HsVar _ (L _ name)) = OccurrenceOf name exprCtOrigin (HsGetField _ _ (L _ f)) = GetFieldOrigin (field_label $ unLoc $ dfoLabel f) -exprCtOrigin (HsUnboundVar {}) = Shouldn'tHappenOrigin "unbound variable" exprCtOrigin (HsOverLabel _ l) = OverLabelOrigin l exprCtOrigin (ExplicitList {}) = ListOrigin exprCtOrigin (HsIPVar _ ip) = IPOccOrigin ip @@ -751,6 +750,7 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" +exprCtOrigin (HsHole _) = Shouldn'tHappenOrigin "hole expression" exprCtOrigin (HsForAll {}) = Shouldn'tHappenOrigin "forall telescope" -- See Note [Types in terms] exprCtOrigin (HsQual {}) = Shouldn'tHappenOrigin "constraint context" -- See Note [Types in terms] exprCtOrigin (HsFunArr {}) = Shouldn'tHappenOrigin "function arrow" -- See Note [Types in terms] ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -925,9 +925,9 @@ zonkExpr (HsVar x (L l id)) do { id' <- zonkIdOcc id ; return (HsVar x (L l id')) } -zonkExpr (HsUnboundVar her occ) +zonkExpr (HsHole (h, her)) = do her' <- zonk_her her - return (HsUnboundVar her' occ) + return (HsHole (h, her')) where zonk_her :: HoleExprRef -> ZonkTcM HoleExprRef zonk_her (HER ref ty u) @@ -935,7 +935,6 @@ zonkExpr (HsUnboundVar her occ) ty' <- zonkTcTypeToTypeX ty return (HER ref ty' u) - zonkExpr (HsIPVar x _) = dataConCantHappen x zonkExpr (HsOverLabel x _) = dataConCantHappen x ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -41,7 +41,6 @@ import Data.Bool import Data.Eq import Data.Maybe import Data.List.NonEmpty ( NonEmpty ) -import GHC.Types.Name.Reader {- Note [RecordDotSyntax field updates] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -335,19 +334,6 @@ data HsExpr p (LIdP p) -- ^ Variable -- See Note [Located RdrNames] - | HsUnboundVar (XUnboundVar p) - RdrName -- ^ Unbound variable; also used for "holes" - -- (_ or _x). - -- Turned from HsVar to HsUnboundVar by the - -- renamer, when it finds an out-of-scope - -- variable or hole. - -- The (XUnboundVar p) field becomes an HoleExprRef - -- after typechecking; this is where the - -- erroring expression will be written after - -- solving. See Note [Holes] in GHC.Tc.Types.Constraint. - - - | HsOverLabel (XOverLabel p) FastString -- ^ Overloaded label (Note [Overloaded labels] in GHC.OverloadedLabels) @@ -380,7 +366,7 @@ data HsExpr p -- NB Bracketed ops such as (+) come out as Vars. -- NB Sadly, we need an expr for the operator in an OpApp/Section since - -- the renamer may turn a HsVar into HsRecSel or HsUnboundVar + -- the renamer may turn a HsVar into HsRecSel or HsHole. | OpApp (XOpApp p) (LHsExpr p) -- left operand @@ -529,6 +515,10 @@ data HsExpr p | HsEmbTy (XEmbTy p) (LHsWcType (NoGhcTc p)) + -- | Holes in expressions, i.e. '_'. + -- See Note [Holes in expressions] in GHC.Tc.Types.Constraint. + | HsHole (XHole p) + -- | Forall-types @forall tvs. t@ and @forall tvs -> t at . -- Used with @RequiredTypeArguments@, e.g. @fn (forall a. Proxy a)@. -- See Note [Types in terms] ===================================== compiler/Language/Haskell/Syntax/Extension.hs ===================================== @@ -445,6 +445,7 @@ type family XTick x type family XBinTick x type family XPragE x type family XEmbTy x +type family XHole x type family XForAll x type family XQual x type family XFunArr x ===================================== testsuite/tests/perf/compiler/hard_hole_fits.hs ===================================== @@ -12,7 +12,7 @@ import GHC (GhcPs) testMe :: HsExpr GhcPs -> Int testMe (HsVar a b) = _ -testMe (HsUnboundVar xuv uv) = _ +testMe (HsHole a) = _ testMe (HsOverLabel xol m_ip) = _ testMe (HsIPVar xv hin) = _ testMe (HsOverLit xole hol) = _ ===================================== testsuite/tests/perf/compiler/hard_hole_fits.stderr ===================================== @@ -17,14 +17,12 @@ hard_hole_fits.hs:14:22: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] (imported from ‘Prelude’ at hard_hole_fits.hs:8:8-20 (and originally defined in ‘GHC.Internal.Enum’)) -hard_hole_fits.hs:15:32: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] - • Found hole: _ :: Int - • In an equation for ‘testMe’: testMe (HsUnboundVar xuv uv) = _ - • Relevant bindings include - uv :: GHC.Types.Name.Reader.RdrName - (bound at hard_hole_fits.hs:15:26) - xuv :: Language.Haskell.Syntax.Extension.XUnboundVar GhcPs - (bound at hard_hole_fits.hs:15:22) +hard_hole_fits.hs:15:21: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] + Found hole: _ :: Int + In an equation for ‘testMe’: testMe (HsHole a) = _ + Relevant bindings include + a :: Language.Haskell.Syntax.Extension.XHole GhcPs + (bound at hard_hole_fits.hs:15:16) testMe :: HsExpr GhcPs -> Int (bound at hard_hole_fits.hs:14:1) Valid hole fits include maxBound :: forall a. Bounded a => a ===================================== testsuite/tests/plugins/T20803-plugin/FixErrorsPlugin.hs ===================================== @@ -20,15 +20,15 @@ import Data.Maybe plugin :: Plugin plugin = defaultPlugin {parsedResultAction = parsedAction} --- Replace every hole (and other unbound vars) with the given expression +-- Replace every hole with the given expression replaceHoles :: forall a . Data a => HsExpr GhcPs -> a -> a replaceHoles new = gmapT \case (d :: d) -> replaceHoles new d `fromMaybe` tryHole where tryHole :: Maybe d tryHole = eqT @d @(HsExpr GhcPs) >>= \case - Eq.Refl | HsUnboundVar _ _ <- d -> Just new - _ -> Nothing + Eq.Refl | HsHole _ <- d -> Just new + _ -> Nothing parsedAction :: [CommandLineOption] -> ModSummary -> ParsedResult -> Hsc ParsedResult ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -314,10 +314,6 @@ instance HasTrailing AnnExplicitSum where trailing _ = [] setTrailing a _ = a -instance HasTrailing (Maybe EpAnnUnboundVar) where - trailing _ = [] - setTrailing a _ = a - instance HasTrailing GrhsAnn where trailing _ = [] setTrailing a _ = a @@ -2879,16 +2875,14 @@ instance ExactPrint (HsExpr GhcPs) where then markAnnotated n else return n return (HsVar x n') - exact (HsUnboundVar an n) = do - case an of - Just (EpAnnUnboundVar (ob,cb) l) -> do - ob' <- markEpToken ob - l' <- markEpToken l - cb' <- markEpToken cb - return (HsUnboundVar (Just (EpAnnUnboundVar (ob',cb') l')) n) - _ -> do - printStringAdvanceA "_" >> return () - return (HsUnboundVar an n) + exact (HsHole (HoleVar n, NoExtField)) = do + let pun_RDR = "pun-right-hand-side" + n' <- if (showPprUnsafe n /= pun_RDR) + then markAnnotated n + else return n + return (HsHole (HoleVar n', NoExtField)) + -- TODO: Adapt 'HoleError' to include the 'SourceText': + exact (HsHole (HoleError, NoExtField)) = error "Cannot exact print HoleError" exact x@(HsOverLabel src l) = do printStringAdvanceA "#" >> return () case src of View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3a55690149c88f98c022929bb7d91a3aa3e5ba25 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3a55690149c88f98c022929bb7d91a3aa3e5ba25 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 2 23:17:11 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Sun, 02 Feb 2025 18:17:11 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] 54 commits: Fix for alex-3.5.2.0 (#25623) Message-ID: <679ffcf72c944_109111bd59885224f@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 269fdfdd by Alan Zimmerman at 2025-02-01T10:49:09+00:00 GHC-CPP: first rough proof of concept Processes #define FOO #ifdef FOO x = 1 #endif Into [ITcppIgnored [L loc ITcppDefine] ,ITcppIgnored [L loc ITcppIfdef] ,ITvarid "x" ,ITequal ,ITinteger (IL {il_text = SourceText "1", il_neg = False, il_value = 1}) ,ITcppIgnored [L loc ITcppEndif] ,ITeof] In time, ITcppIgnored will be pushed into a comment - - - - - 4467d44b by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Tidy up before re-visiting the continuation mechanic - - - - - 95cbc2d7 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Switch preprocessor to continuation passing style Proof of concept, needs tidying up - - - - - 54c278db by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Small cleanup - - - - - 0883493f by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Get rid of some cruft - - - - - 64bd6a0c by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Starting to integrate. Need to get the pragma recognised and set - - - - - 81134858 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Make cppTokens extend to end of line, and process CPP comments - - - - - 10ef3eff by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Remove unused ITcppDefined - - - - - baa2b797 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Allow spaces between # and keyword for preprocessor directive - - - - - 6c8846b5 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Process CPP continuation lines They are emited as separate ITcppContinue tokens. Perhaps the processing should be more like a comment, and keep on going to the end. BUT, the last line needs to be slurped as a whole. - - - - - d8ea6bf7 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Accumulate CPP continuations, process when ready Can be simplified further, we only need one CPP token - - - - - 2508452a by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Simplify Lexer interface. Only ITcpp We transfer directive lines through it, then parse them from scratch in the preprocessor. - - - - - 560ed5ec by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Deal with directive on last line, with no trailing \n - - - - - 2751d2ed by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Start parsing and processing the directives - - - - - 2c75b2cd by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Prepare for processing include files - - - - - 6bbc72e2 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Move PpState into PreProcess And initParserState, initPragState too - - - - - 8710ea96 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Process nested include files Also move PpState out of Lexer.x, so it is easy to evolve it in a ghci session, loading utils/check-cpp/Main.hs - - - - - c4726bea by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Split into separate files - - - - - 4afbdcd3 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Starting on expression parser. But it hangs. Time for Text.Parsec.Expr - - - - - a2786148 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Start integrating the ghc-cpp work >From https://github.com/alanz/ghc-cpp - - - - - f30904bd by Alan Zimmerman at 2025-02-01T10:49:09+00:00 WIP - - - - - ba29a952 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Fixup after rebase - - - - - 5cdac204 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 WIP - - - - - 5e209d54 by Alan Zimmerman at 2025-02-01T10:49:09+00:00 Fixup after rebase, including all tests pass - - - - - 4afec6ec by Alan Zimmerman at 2025-02-01T11:54:53+00:00 Change pragma usage to GHC_CPP from GhcCPP - - - - - baad4fd2 by Alan Zimmerman at 2025-02-02T11:27:49+00:00 Some comments - - - - - 2507ac9e by Alan Zimmerman at 2025-02-02T11:28:21+00:00 Reformat - - - - - c8f167a9 by Alan Zimmerman at 2025-02-02T11:49:33+00:00 Delete unused file - - - - - 53a647e0 by Alan Zimmerman at 2025-02-02T11:52:06+00:00 Rename module Parse to ParsePP - - - - - cb4f357a by Alan Zimmerman at 2025-02-02T12:13:02+00:00 Clarify naming in the parser - - - - - d91c19a3 by Alan Zimmerman at 2025-02-02T23:16:23+00:00 WIP. Switching to alex/happy to be able to work in-tree Since Parsec is not available - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Parser/Monad.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b4134b73432211cb9a8a306cd318765b532bcdac...d91c19a39a9fd5fe4a2f2800d37ca6232f4e0db5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b4134b73432211cb9a8a306cd318765b532bcdac...d91c19a39a9fd5fe4a2f2800d37ca6232f4e0db5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 09:21:18 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Mon, 03 Feb 2025 04:21:18 -0500 Subject: [Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] 15 commits: hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage Message-ID: <67a08a8e3832e_13a961a53020571f8@gitlab.mail> Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC Commits: 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - a68cbb60 by Patrick at 2025-02-03T09:21:12+00:00 update kcConDecl to also consider the result type in newtype GADT instance - - - - - 3ee2f304 by Patrick at 2025-02-03T09:21:12+00:00 peek at the result kind - - - - - c7f4518a by Patrick at 2025-02-03T09:21:12+00:00 test if gadt has UserSuppliedResultKind in lhs, we let tc_res_kind to unify with rhs result kind if not to gain more inference - - - - - a928958e by Patrick at 2025-02-03T09:21:12+00:00 format and remove getTyConResultKind - - - - - bd1ab0d8 by Patrick at 2025-02-03T09:21:12+00:00 format - - - - - 265ed301 by Patrick at 2025-02-03T09:21:12+00:00 add comment - - - - - 7ed2dfc2 by Patrick at 2025-02-03T09:21:12+00:00 cleanup - - - - - 0ab6f659 by Patrick at 2025-02-03T09:21:12+00:00 cleanup - - - - - 0f7588fe by Patrick at 2025-02-03T09:21:12+00:00 update T25611a - - - - - bb0a574c by Patrick at 2025-02-03T09:21:12+00:00 rename and add note - - - - - edbf2cef by Patrick at 2025-02-03T09:21:12+00:00 update note - - - - - 04a684e9 by Patrick at 2025-02-03T09:21:12+00:00 update note - - - - - 1e7a8743 by Patrick at 2025-02-03T09:21:12+00:00 format - - - - - 5 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs - testsuite/tests/indexed-types/should_compile/T25611a.hs Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -93,6 +93,11 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Platform/Constants.hs') build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') +def prep_ghc_boot_th(): + # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', + lambda s: s.replace('../ghc-internal/src', '')) + PACKAGES = { pkg.name: pkg for pkg in [ @@ -105,9 +110,10 @@ PACKAGES = { Package('template-haskell', Path("libraries/template-haskell"), no_prep), Package('ghc-heap', Path("libraries/ghc-heap"), no_prep), Package('ghc-boot', Path("libraries/ghc-boot"), prep_ghc_boot), - Package('ghc-boot-th', Path("libraries/ghc-boot-th"), no_prep), + Package('ghc-boot-th', Path("libraries/ghc-boot-th"), prep_ghc_boot_th), Package('ghc-compact', Path("libraries/ghc-compact"), no_prep), Package('ghc', Path("compiler"), prep_ghc), + Package('ghci', Path("libraries/ghci"), no_prep), ] } # Dict[str, Package] ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -12,8 +12,8 @@ -- | Typecheck type and class declarations module GHC.Tc.TyCl ( + HasHeaderKindSig(..), tcTyAndClassDecls, - -- Functions used by GHC.Tc.TyCl.Instance to check -- data/type family instance declarations kcConDecls, tcConDecls, DataDeclInfo(..), @@ -1763,7 +1763,7 @@ kcTyClDecl :: TyClDecl GhcRn -> MonoTcTyCon -> TcM () -- kind inference (see GHC.Tc.TyCl Note [TcTyCon, MonoTcTyCon, and PolyTcTyCon]) kcTyClDecl (DataDecl { tcdLName = (L _ _name) - , tcdDataDefn = HsDataDefn { dd_ctxt = ctxt, dd_cons = cons } }) + , tcdDataDefn = HsDataDefn { dd_ctxt = ctxt, dd_cons = cons, dd_kindSig = kindSig } }) tycon = tcExtendNameTyVarEnv (tcTyConScopedTyVars tycon) $ -- NB: binding these tyvars isn't necessary for GADTs, but it does no @@ -1772,7 +1772,9 @@ kcTyClDecl (DataDecl { tcdLName = (L _ _name) -- (conceivably) shadowed. do { traceTc "kcTyClDecl" (ppr tycon $$ ppr (tyConTyVars tycon) $$ ppr (tyConResKind tycon)) ; _ <- tcHsContext ctxt - ; kcConDecls (tyConResKind tycon) cons + ; kcConDecls (tyConResKind tycon) (if (isJust kindSig) + then HasHeaderKindSig + else NoHeaderKindSig) cons } kcTyClDecl (SynDecl { tcdLName = L _ _name, tcdRhs = rhs }) tycon @@ -1832,12 +1834,25 @@ kcConGADTArgs exp_kind con_args = case con_args of RecConGADT _ (L _ flds) -> kcConArgTys exp_kind $ map (hsLinear . cd_fld_type . unLoc) flds + +{- Note [Header kind signatures for GADTs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Specifically for GADT style declarations. +User supplied header kind signature as in +`data xxx :: HasHeaderKindSig where ...` +See (KCD4) in Note [kcConDecls: kind-checking data type decls] +for why we need to check this. +-} +-- see Note [Header kind signatures for GADTs] +data HasHeaderKindSig = HasHeaderKindSig | NoHeaderKindSig deriving Eq + kcConDecls :: TcKind -- Result kind of tycon -- Used only in H98 case + -> HasHeaderKindSig -> DataDefnCons (LConDecl GhcRn) -> TcM () -- See Note [kcConDecls: kind-checking data type decls] -kcConDecls tc_res_kind cons - = traverse_ (wrapLocMA_ (kcConDecl new_or_data tc_res_kind)) cons +kcConDecls tc_res_kind usrk cons + = traverse_ (wrapLocMA_ (kcConDecl new_or_data usrk tc_res_kind)) cons where new_or_data = dataDefnConsNewOrData cons @@ -1846,8 +1861,8 @@ kcConDecls tc_res_kind cons -- declared with data or newtype, and we need to know the result kind of -- this type. See Note [Implementation of UnliftedNewtypes] for why -- we need the first two arguments. -kcConDecl :: NewOrData -> TcKind -> ConDecl GhcRn -> TcM () -kcConDecl new_or_data tc_res_kind +kcConDecl :: NewOrData -> HasHeaderKindSig -> TcKind -> ConDecl GhcRn -> TcM () +kcConDecl new_or_data _usrk tc_res_kind (ConDeclH98 { con_name = name, con_ex_tvs = ex_tvs , con_mb_cxt = ex_ctxt, con_args = args }) = addErrCtxt (DataConDefCtxt (NE.singleton name)) $ @@ -1863,8 +1878,11 @@ kcConDecl new_or_data tc_res_kind -- because that's done in tcConDecl } -kcConDecl new_or_data _tc_res_kind - -- NB: _tc_res_kind is unused. See (KCD3) in +kcConDecl new_or_data usrk tc_res_kind + -- tc_res_kind usage is a bit tricky here, + -- only newtype with no user header kind signature + -- uses it. + -- See (KCD3), (KCD4) in -- Note [kcConDecls: kind-checking data type decls] (ConDeclGADT { con_names = names, con_bndrs = L _ outer_bndrs , con_mb_cxt = cxt, con_g_args = args, con_res_ty = res_ty }) @@ -1875,10 +1893,13 @@ kcConDecl new_or_data _tc_res_kind bindOuterSigTKBndrs_Tv outer_bndrs $ -- Why "_Tv"? See Note [Using TyVarTvs for kind-checking GADTs] do { _ <- tcHsContext cxt - ; traceTc "kcConDecl:GADT {" (ppr names $$ ppr res_ty) - ; con_res_kind <- newOpenTypeKind - ; _ <- tcCheckLHsTypeInContext res_ty (TheKind con_res_kind) - + ; traceTc "kcConDecl:GADT {" (ppr names $$ ppr res_ty $$ ppr tc_res_kind) + -- We handle the case of newtypes without user header kind signatures specially + -- see (KCD4) in Note [kcConDecls: kind-checking data type decls] + ; con_res_kind <- if NewType == new_or_data && NoHeaderKindSig == usrk + then return tc_res_kind + else newOpenTypeKind + ; _ <- tcCheckLHsTypeInContext res_ty $ (TheKind con_res_kind) ; let arg_exp_kind = getArgExpKind new_or_data con_res_kind -- getArgExpKind: for newtypes, check that the argument kind -- is the same the kind of `res_ty`, the data con's return type @@ -1891,8 +1912,11 @@ kcConDecl new_or_data _tc_res_kind {- Note [kcConDecls: kind-checking data type decls] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kcConDecls is used when we are inferring the kind of the type -constructor in a data type declaration. The basic plan is described in +constructor. For two cases: +* Data type declarations, The basic plan is described in Note [Inferring kinds for type declarations]; here we are doing Step 2. +* Data family instance declaration, see the DESIGN CHOICE +in Note [Kind inference for data family instances]. We are kind-checking the data constructors /only/ to compute the kind of the type construtor. For example @@ -1950,8 +1974,20 @@ Again there are two cases to consider in `kcConDecl`: `S g a`) and, for newtypes, ensure that the arugment has that same kind. (KCD3) The tycon's result kind `tc_res_kind` is not used at all in the GADT - case; rather it is accessed via looking up S's kind in the type environment - when kind-checking the result type of the data constructor. + case except being newtype without user header kind signature; rather it is + accessed via looking up S's kind in the type environment when kind-checking the + result type of the data constructor. + + data family Fix2 :: (k -> Type) -> k + newtype instance Fix2 f where In2 :: f (Fix2 f) -> Fix2 f + + * When kind checking the newtype instance, Fix2's kind in the type environment is + already generalized. If using -XUnliftedNewtypes, since the instance does not have + a user header kind signature, the result kind is defaulted to (TYPE r), where r is + a unification variable. r could not be constrained through the type environment. + + Solution (KCD4): For newtype instances, we have to use the `tc_res_kind` in + contrast to (KCD3) to constrain r properly. Note [Using TyVarTvs for kind-checking GADTs] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -946,7 +946,11 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- Add constraints from the data constructors -- Fix #25611 -- See DESIGN CHOICE in Note [Kind inference for data family instances] - ; when is_H98_or_newtype $ kcConDecls lhs_applied_kind hs_cons + ; when is_H98_or_newtype $ + kcConDecls lhs_applied_kind (if (isJust m_ksig) + then HasHeaderKindSig + else NoHeaderKindSig) hs_cons + -- Check that the result kind of the TyCon applied to its args -- is compatible with the explicit signature (or Type, if there ===================================== libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs ===================================== @@ -131,10 +131,10 @@ class Category a => Arrow a where -- The default definition may be overridden with a more efficient -- version if desired. -- - -- > b ╭─────╮ b' + -- > b ╭─────╮ c -- > >───┼─ f ─┼───> -- > >───┼─ g ─┼───> - -- > c ╰─────╯ c' + -- > b'╰─────╯ c' (***) :: a b c -> a b' c' -> a (b,b') (c,c') f *** g = first f >>> arr swap >>> first g >>> arr swap where swap ~(x,y) = (y,x) ===================================== testsuite/tests/indexed-types/should_compile/T25611a.hs ===================================== @@ -12,6 +12,6 @@ data family Fix0 :: (k -> Type) -> k newtype instance Fix0 f = In0 { out0 :: f (Fix0 f) } -- This is the GADT newtype instance case --- currently not enabled since !9116 (closed) impose `A newtype must not be a GADT` --- data family Fix2 :: (k -> Type) -> k --- newtype instance Fix2 f where In2 :: f (Fix2 f) -> Fix2 f +-- enabled since !13809 +data family Fix2 :: (k -> Type) -> k +newtype instance Fix2 f where In2 :: f (Fix2 f) -> Fix2 f View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/19560b50b390175bf6f9173f639ee08fcec29ef2...1e7a8743293a2424c9dd63181228132668d6ce16 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/19560b50b390175bf6f9173f639ee08fcec29ef2...1e7a8743293a2424c9dd63181228132668d6ce16 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 12:14:41 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 03 Feb 2025 07:14:41 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage Message-ID: <67a0b3317f0c_17a306d233cc100729@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 27aa3b9b by Matthew Pickering at 2025-02-03T07:14:33-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 54bc5519 by Peter Trommler at 2025-02-03T07:14:33-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - 4 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/Data/FastString.hs - libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs - rts/StgCRunAsm.S Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -93,6 +93,11 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Platform/Constants.hs') build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') +def prep_ghc_boot_th(): + # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', + lambda s: s.replace('../ghc-internal/src', '')) + PACKAGES = { pkg.name: pkg for pkg in [ @@ -105,9 +110,10 @@ PACKAGES = { Package('template-haskell', Path("libraries/template-haskell"), no_prep), Package('ghc-heap', Path("libraries/ghc-heap"), no_prep), Package('ghc-boot', Path("libraries/ghc-boot"), prep_ghc_boot), - Package('ghc-boot-th', Path("libraries/ghc-boot-th"), no_prep), + Package('ghc-boot-th', Path("libraries/ghc-boot-th"), prep_ghc_boot_th), Package('ghc-compact', Path("libraries/ghc-compact"), no_prep), Package('ghc', Path("compiler"), prep_ghc), + Package('ghci', Path("libraries/ghci"), no_prep), ] } # Dict[str, Package] ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -2,10 +2,19 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +{-# OPTIONS_GHC -fno-unoptimized-core-for-interpreter #-} +#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected +-- +-- Also important, if you load this module into GHCi then the data representation of +-- FastString has to match that of the host compiler due to the shared FastString +-- table. Otherwise you will get segfaults when the table is consulted and the fields +-- from the FastString are in an incorrect order. -- | -- There are two principal string types used internally by GHC: ===================================== libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs ===================================== @@ -131,10 +131,10 @@ class Category a => Arrow a where -- The default definition may be overridden with a more efficient -- version if desired. -- - -- > b ╭─────╮ b' + -- > b ╭─────╮ c -- > >───┼─ f ─┼───> -- > >───┼─ g ─┼───> - -- > c ╰─────╯ c' + -- > b'╰─────╯ c' (***) :: a b c -> a b' c' -> a (b,b') (c,c') f *** g = first f >>> arr swap >>> first g >>> arr swap where swap ~(x,y) = (y,x) ===================================== rts/StgCRunAsm.S ===================================== @@ -69,7 +69,7 @@ StgReturn: .section .note.GNU-stack,"", at progbits # else // Not ELF v2 -# error Only ELF v2 supported. + // ELF v1 is in StgCrun.c # endif #elif defined(powerpc_HOST_ARCH) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/682c248b6789830ce97ba0f3f1699fa45db49615...54bc5519d7ffcdf3e10b3ac442ee6eda1b7be6c0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/682c248b6789830ce97ba0f3f1699fa45db49615...54bc5519d7ffcdf3e10b3ac442ee6eda1b7be6c0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 13:13:17 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 03 Feb 2025 08:13:17 -0500 Subject: [Git][ghc/ghc][wip/ghci-force-background] 3 commits: hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage Message-ID: <67a0c0ed129bf_17a306191da741049ac@gitlab.mail> Matthew Pickering pushed to branch wip/ghci-force-background at Glasgow Haskell Compiler / GHC Commits: 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 49afe39e by Matthew Pickering at 2025-02-03T13:12:51+00:00 ghci: Force bytecode to be evaluated after loading Behaviour before: Bytecode is forced when you need it to evaluate an expression in the interpreter. Behaviour after: Bytecode is forced in parallel, in the background, after the initial load is completed. The goal is to increase percieved responsiveness of the interpreter after a reload. If you do a reload and at a later point perform evaluation, now the evaluation will start immediately, rather than waiting first for all the byte code to be compiled. Since the bytecode is evaluated in the background, the prompt can still be used like normal to evaluate expressions or perform other queries. 2 * NUM_CAPABILITIES worker threads are spawned. The work to evaluate the unforced bytecode is queued in a TChan which is then read by the worker threads. - - - - - 8 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/Driver/Main.hs - compiler/GHC/Unit/Home/PackageTable.hs - compiler/GHC/Utils/Trace.hs - ghc/GHCi/UI.hs - ghc/GHCi/UI/Monad.hs - ghc/ghc-bin.cabal.in - libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -93,6 +93,11 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Platform/Constants.hs') build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') +def prep_ghc_boot_th(): + # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', + lambda s: s.replace('../ghc-internal/src', '')) + PACKAGES = { pkg.name: pkg for pkg in [ @@ -105,9 +110,10 @@ PACKAGES = { Package('template-haskell', Path("libraries/template-haskell"), no_prep), Package('ghc-heap', Path("libraries/ghc-heap"), no_prep), Package('ghc-boot', Path("libraries/ghc-boot"), prep_ghc_boot), - Package('ghc-boot-th', Path("libraries/ghc-boot-th"), no_prep), + Package('ghc-boot-th', Path("libraries/ghc-boot-th"), prep_ghc_boot_th), Package('ghc-compact', Path("libraries/ghc-compact"), no_prep), Package('ghc', Path("compiler"), prep_ghc), + Package('ghci', Path("libraries/ghci"), no_prep), ] } # Dict[str, Package] ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -1114,6 +1114,7 @@ compileWholeCoreBindings :: WholeCoreBindings -> IO (CompiledByteCode, [FilePath]) compileWholeCoreBindings hsc_env type_env wcb = do + pprMarkerIO "WholeCoreBindings:" (ppr wcb_module) core_binds <- typecheck (stubs, foreign_files) <- decode_foreign gen_bytecode core_binds stubs foreign_files ===================================== compiler/GHC/Unit/Home/PackageTable.hs ===================================== @@ -47,6 +47,7 @@ module GHC.Unit.Home.PackageTable -- ** More Traversal-based queries , hptCollectDependencies , hptCollectObjects + , hptCollectByteCode , hptCollectModules -- ** Memory dangerous queries @@ -248,6 +249,12 @@ hptCollectObjects HPT{table} = do return $ foldr ((:) . expectJust "collectObjects" . homeModInfoObject) [] hpt +hptCollectByteCode :: HomePackageTable -> IO [Linkable] +hptCollectByteCode HPT{table} = do + hpt <- readIORef table + return $ + catMaybes $ foldr ((:) . homeModInfoByteCode) [] hpt + -- | Collect all module ifaces in the HPT -- -- $O(n)$ in the number of modules in the HPT. ===================================== compiler/GHC/Utils/Trace.hs ===================================== @@ -10,6 +10,7 @@ module GHC.Utils.Trace , warnPprTrace , warnPprTraceM , pprTraceUserWarning + , pprMarkerIO , trace ) where @@ -33,7 +34,7 @@ import GHC.Utils.GlobalVars import GHC.Utils.Constants import GHC.Stack -import Debug.Trace (trace) +import Debug.Trace (trace, traceMarkerIO) import Control.Monad.IO.Class -- | If debug output is on, show some 'SDoc' on the screen @@ -101,3 +102,11 @@ traceCallStackDoc :: HasCallStack => SDoc traceCallStackDoc = hang (text "Call stack:") 4 (vcat $ map text $ lines (prettyCallStack callStack)) + +-- | Emit a marker to the eventlog. +pprMarkerIO :: String -> SDoc -> IO () +pprMarkerIO s msg + | unsafeHasNoDebugOutput = return () + | otherwise = pprDebugAndThen (traceSDocContext {sdocLineLength = 10000}) + traceMarkerIO empty (text s <+> msg) + ===================================== ghc/GHCi/UI.hs ===================================== @@ -94,6 +94,8 @@ import GHC.Unit.Finder as Finder import GHC.Unit.Module.Graph (filterToposortToModules) import GHC.Unit.Module.ModSummary +import GHC.Linker.Types + import GHC.Data.StringBuffer import GHC.Utils.Outputable import GHC.Utils.Logger @@ -176,6 +178,13 @@ import GHC.TopHandler ( topHandler ) import qualified GHC.Unit.Module.Graph as GHC +import GHC.Conc.Sync ( forkIO, getNumCapabilities, killThread, labelThread) +import System.Mem.Weak +import Debug.Trace ( traceMarkerIO ) + +import Control.Concurrent.STM.TChan +import Control.Concurrent.STM + ----------------------------------------------------------------------------- data GhciSettings = GhciSettings { @@ -589,7 +598,8 @@ interactiveUI config srcs maybe_exprs = do mod_infos = M.empty, flushStdHandles = flush, noBuffering = nobuffering, - ifaceCache = empty_cache + ifaceCache = empty_cache, + workerThread = Nothing } return () @@ -2140,6 +2150,8 @@ doLoad load_type howmuch = do -- turn off breakpoints before we load: we can't turn them off later, because -- the ModBreaks will have gone away. discardActiveBreakPoints + -- Stop any work from the previous session being evaluated. + killWorkerThread resetLastErrorLocations -- Enable buffering stdout and stderr as we're compiling. Keeping these @@ -2170,6 +2182,75 @@ afterLoad ok load_type = do modulesLoadedMsg ok loaded_mods load_type graph <- GHC.getModuleGraph setContextAfterLoad (isReload load_type) (Just graph) + forceByteCode + +mkWorkerThread :: Int -> IO WorkerThread +mkWorkerThread n = do + work_queue <- newTChanIO + traceMarkerIO "ghci workers created" + let enqueueWork work_item = atomically (writeTChan work_queue work_item) + + let mkThread = do + tid <- forkIO $ forever $ do + work_item <- atomically $ readTChan work_queue + work_item + labelThread tid "ghci worker" + return tid + + threads <- replicateM n mkThread + + let shutdownWorkers = do + traceMarkerIO "ghci workers killed" + mapM_ killThread threads + -- NB no need to empty the chan because it is only reachable from the workers. + + return $ WorkerThread{..} + + +-- | Force any compiled bytecode in the background +-- +-- During compilation the compiler leaves thunks when producing bytecode, so that +-- the result is not forced before it is needed. (Especially important when doing recompilation +-- checking) +-- +-- However, after the reload is complete, the interpreter will otherwise be idle, so +-- force those thunks in parallel so that when the user comes to write in the prompt +-- the response is faster. +-- +-- If a reload happens, then the thunks which have been sparked will no longer +-- be reachable. Therefore they will be gced so we do not need to explicitly terminate +-- the parallel work if a reload happens before we are finished. +forceByteCode :: GhciMonad m => m () +forceByteCode = do + hsc_env <- GHC.getSession + -- A slightly awkward place to perform initialisation, but right now, this is the only + -- place where work is ever added to the queue. + buckets <- (2 *) <$> liftIO getNumCapabilities + worker <- liftIO $ mkWorkerThread buckets + setWorkerThread worker + + let + queueLinkable :: Linkable -> IO () + queueLinkable (Linkable _ _ ps) = mapM_ queuePart ps + + queuePart (LazyBCOs x _) = do + w <- mkWeakPtr x Nothing + enqueueWork worker (mkWork w) + queuePart _ = return () + + -- The "work", dereferences a weak pointer and forces the value to WHNF. + mkWork x = do + wt <- deRefWeak x + case wt of + Nothing -> return () + Just !_ -> return () + + -- Spawn a new thread, so the thunks are forced completely in the background of the main thread + -- and we can get to the prompt as fast as possible. + void $ liftIO $ forkIO $ do + all_linkables <- (concat <$> traverse (hptCollectByteCode . homeUnitEnv_hpt) (hsc_HUG hsc_env)) + mapM_ queueLinkable all_linkables + setContextAfterLoad :: GhciMonad m => Bool -> Maybe GHC.ModuleGraph -> m () setContextAfterLoad keep_ctxt Nothing = do ===================================== ghc/GHCi/UI/Monad.hs ===================================== @@ -11,7 +11,7 @@ module GHCi.UI.Monad ( GHCi(..), startGHCi, - GHCiState(..), GhciMonad(..), + GHCiState(..), WorkerThread(..), GhciMonad(..), GHCiOption(..), isOptionSet, setOption, unsetOption, Command(..), CommandResult(..), cmdSuccess, CmdExecOutcome(..), @@ -21,6 +21,9 @@ module GHCi.UI.Monad ( TickArray, extractDynFlags, getDynFlags, + setWorkerThread, + killWorkerThread, + runStmt, runDecls, runDecls', resume, recordBreak, revertCAFs, ActionStats(..), runAndPrintStats, runWithStats, printStats, @@ -161,9 +164,14 @@ data GHCiState = GHCiState -- ^ @hFlush stdout; hFlush stderr@ in the interpreter noBuffering :: ForeignHValue, -- ^ @hSetBuffering NoBuffering@ for stdin/stdout/stderr - ifaceCache :: ModIfaceCache + ifaceCache :: ModIfaceCache, + + workerThread :: Maybe WorkerThread + -- ^ The WorkerThread abstraction which will compute things + -- in the background. Currently used for evaluating bytecode. } + type TickArray = Array Int [(GHC.BreakIndex,RealSrcSpan)] -- | A GHCi command @@ -410,6 +418,25 @@ resume canLogSpan step mbIgnoreCnt = do reflectGHCi x $ do GHC.resumeExec canLogSpan step mbIgnoreCnt +{- WorkerThread implementation -} + +data WorkerThread = + WorkerThread { enqueueWork :: IO () -> IO () + , shutdownWorkers :: IO () + } + +setWorkerThread :: GhciMonad m => WorkerThread -> m () +setWorkerThread wt = modifyGHCiState (\st -> st { workerThread = Just wt } ) + +killWorkerThread :: GhciMonad m => m () +killWorkerThread = do + mwt <- workerThread <$> getGHCiState + case mwt of + Nothing -> return () + Just wt -> do + liftIO (shutdownWorkers wt) + modifyGHCiState (\st -> st { workerThread = Nothing }) + -- -------------------------------------------------------------------------- -- timing & statistics ===================================== ghc/ghc-bin.cabal.in ===================================== @@ -40,7 +40,8 @@ Executable ghc containers >= 0.5 && < 0.8, transformers >= 0.5 && < 0.7, ghc-boot == @ProjectVersionMunged@, - ghc == @ProjectVersionMunged@ + ghc == @ProjectVersionMunged@, + stm >= 2.5 && < 2.6 if os(windows) Build-Depends: Win32 >= 2.3 && < 2.15 ===================================== libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs ===================================== @@ -131,10 +131,10 @@ class Category a => Arrow a where -- The default definition may be overridden with a more efficient -- version if desired. -- - -- > b ╭─────╮ b' + -- > b ╭─────╮ c -- > >───┼─ f ─┼───> -- > >───┼─ g ─┼───> - -- > c ╰─────╯ c' + -- > b'╰─────╯ c' (***) :: a b c -> a b' c' -> a (b,b') (c,c') f *** g = first f >>> arr swap >>> first g >>> arr swap where swap ~(x,y) = (y,x) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e787cccf3461f7a6708b0cdd2540d1a36fd64845...49afe39eaefad08f268852b5182ac5dc40c53491 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e787cccf3461f7a6708b0cdd2540d1a36fd64845...49afe39eaefad08f268852b5182ac5dc40c53491 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 14:24:47 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 03 Feb 2025 09:24:47 -0500 Subject: [Git][ghc/ghc][wip/generic-length] perf: Replace uses of genericLength with strictGenericLength Message-ID: <67a0d1afbcbe1_17a306245b65c1133f@gitlab.mail> Matthew Pickering pushed to branch wip/generic-length at Glasgow Haskell Compiler / GHC Commits: d135dfc0 by Matthew Pickering at 2025-02-03T14:23:53+00:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 4 changed files: - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/StgToByteCode.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -53,7 +53,6 @@ import Data.Array.Base ( UArray(..) ) import Foreign hiding (shiftL, shiftR) import Data.Char ( ord ) -import Data.List ( genericLength ) import Data.Map.Strict (Map) import Data.Maybe (fromMaybe) import qualified Data.Map.Strict as Map @@ -343,6 +342,7 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } + inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) inspectAsm platform long_jumps initial_offset = go (InspectState initial_offset 0 0 Map.empty) @@ -350,7 +350,7 @@ inspectAsm platform long_jumps initial_offset go s (NullAsm _) = (instrCount s, lblEnv s) go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + genericLength ls }) (k n) + go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) where n = litCount s go s (AllocLabel lbl k) = go s' k where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } ===================================== compiler/GHC/Prelude/Basic.hs ===================================== @@ -25,6 +25,8 @@ module GHC.Prelude.Basic , shiftL, shiftR , setBit, clearBit , head, tail + + , strictGenericLength ) where @@ -130,3 +132,15 @@ head = Prelude.head tail :: HasCallStack => [a] -> [a] tail = Prelude.tail {-# INLINE tail #-} + +{- | +The 'genericLength' function defined in base can't be specialised due to the +NOINLINE pragma. + +It is also not strict in the accumulator, and strictGenericLength is not exported. + +See #25706 for why it is important to use a strict, specialised version. + +-} +strictGenericLength :: Num a => [x] -> a +strictGenericLength = fromIntegral . length ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry -import Data.List ( genericReplicate, genericLength, intersperse +import Data.List ( genericReplicate, intersperse , partition, scanl', sortBy, zip4, zip6 ) import Foreign hiding (shiftL, shiftR) import Control.Monad @@ -393,7 +393,7 @@ schemeR_wrk fvs nm original_body (args, body) -- make the arg bitmap bits = argBits platform (reverse (map (idArgRep platform) all_args)) - bitmap_size = genericLength bits + bitmap_size = strictGenericLength bits bitmap = mkBitmap platform bits body_code <- schemeER_wrk sum_szsb_args p_init body @@ -607,7 +607,7 @@ schemeE d s p (StgLet _ext binds body) = do platform <- targetPlatform <$> getDynFlags let (xs,rhss) = case binds of StgNonRec x rhs -> ([x],[rhs]) StgRec xs_n_rhss -> unzip xs_n_rhss - n_binds = genericLength xs + n_binds = strictGenericLength xs fvss = map (fvsToEnv p') rhss @@ -616,7 +616,7 @@ schemeE d s p (StgLet _ext binds body) = do sizes = map (\rhs_fvs -> sum (map size_w rhs_fvs)) fvss -- the arity of each rhs - arities = map (genericLength . fst . collect) rhss + arities = map (strictGenericLength . fst . collect) rhss -- This p', d' defn is safe because all the items being pushed -- are ptrs, so all have size 1 word. d' and p' reflect the stack @@ -1857,7 +1857,7 @@ implement_tagToId implement_tagToId d s p arg names = assert (notNull names) $ do (push_arg, arg_bytes) <- pushAtom d p (StgVarArg arg) - labels <- getLabelsBc (genericLength names) + labels <- getLabelsBc (strictGenericLength names) label_fail <- getLabelBc label_exit <- getLabelBc dflags <- getDynFlags ===================================== libraries/ghc-boot/GHC/Data/SizedSeq.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving, DeriveGeneric, CPP #-} module GHC.Data.SizedSeq ( SizedSeq(..) , emptySS @@ -11,9 +11,12 @@ module GHC.Data.SizedSeq import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary -import Data.List (genericLength) import GHC.Generics +#if ! MIN_VERSION_base(4,20,0) +import Data.List (foldl') +#endif + data SizedSeq a = SizedSeq {-# UNPACK #-} !Word [a] deriving (Generic, Show) @@ -37,9 +40,9 @@ emptySS = SizedSeq 0 [] addToSS :: SizedSeq a -> a -> SizedSeq a addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) +-- NB, important this is eta-expand so that foldl' is inlined. addListToSS :: SizedSeq a -> [a] -> SizedSeq a -addListToSS (SizedSeq n r_xs) xs - = SizedSeq (n + genericLength xs) (reverse xs ++ r_xs) +addListToSS s xs = foldl' addToSS s xs ssElts :: SizedSeq a -> [a] ssElts (SizedSeq _ r_xs) = reverse r_xs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d135dfc0d85629e521d022f7a4d253cc8f57d44c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d135dfc0d85629e521d022f7a4d253cc8f57d44c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 14:30:38 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 03 Feb 2025 09:30:38 -0500 Subject: [Git][ghc/ghc][wip/specialise-assembler] 4 commits: hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage Message-ID: <67a0d30eea4b_17a30627d207411396f@gitlab.mail> Matthew Pickering pushed to branch wip/specialise-assembler at Glasgow Haskell Compiler / GHC Commits: 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - b0dfac83 by Matthew Pickering at 2025-02-03T14:30:01+00:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 593cf5ae by Matthew Pickering at 2025-02-03T14:30:01+00:00 perf: Speed up bytecode assembler by specialising assembleI function By specialising the assembleI function for the two intepreters we avoid having to materialise the intermediate free-monad like structure. The resulting generated code is much more direct. - - - - - 6 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/StgToByteCode.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -93,6 +93,11 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Platform/Constants.hs') build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') +def prep_ghc_boot_th(): + # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', + lambda s: s.replace('../ghc-internal/src', '')) + PACKAGES = { pkg.name: pkg for pkg in [ @@ -105,9 +110,10 @@ PACKAGES = { Package('template-haskell', Path("libraries/template-haskell"), no_prep), Package('ghc-heap', Path("libraries/ghc-heap"), no_prep), Package('ghc-boot', Path("libraries/ghc-boot"), prep_ghc_boot), - Package('ghc-boot-th', Path("libraries/ghc-boot-th"), no_prep), + Package('ghc-boot-th', Path("libraries/ghc-boot-th"), prep_ghc_boot_th), Package('ghc-compact', Path("libraries/ghc-compact"), no_prep), Package('ghc', Path("compiler"), prep_ghc), + Package('ghci', Path("libraries/ghci"), no_prep), ] } # Dict[str, Package] ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -1,6 +1,8 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -53,7 +55,6 @@ import Data.Array.Base ( UArray(..) ) import Foreign hiding (shiftL, shiftR) import Data.Char ( ord ) -import Data.List ( genericLength ) import Data.Map.Strict (Map) import Data.Maybe (fromMaybe) import qualified Data.Map.Strict as Map @@ -177,6 +178,17 @@ assembleOneBCO interp profile pbco = do UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) return ubco' + +{-# NOINLINE inspectInstrs #-} +inspectInstrs :: Platform -> Bool -> Word -> [BCInstr] -> (Word, LabelEnvMap) +inspectInstrs platform long_jump e instrs = + inspectAsm long_jump e (mapM_ (assembleI @InspectAsm platform) instrs) + +{-# NOINLINE runInstrs #-} +runInstrs :: AsmState -> Platform -> Bool -> LabelEnv -> [BCInstr] -> IO AsmState +runInstrs initial_state platform long_jumps env instrs = + flip execStateT initial_state $ runAsm long_jumps env (mapM_ (assembleI @RunAsm platform) instrs) + assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm @@ -185,9 +197,7 @@ assembleBCO platform , protoBCOBitmapSize = bsize , protoBCOArity = arity }) = do -- pass 1: collect up the offsets of the local labels. - let asm = mapM_ (assembleI platform) instrs - - initial_offset = 0 + let initial_offset = 0 -- Jump instructions are variable-sized, there are long and short variants -- depending on the magnitude of the offset. However, we can't tell what @@ -197,11 +207,11 @@ assembleBCO platform -- and if the final size is indeed small enough for short jumps, we are -- done. Otherwise, we repeat the calculation, and we force all jumps in -- this BCO to be long. - (n_insns0, lbl_map0) = inspectAsm platform False initial_offset asm + (n_insns0, lbl_map0) = inspectInstrs platform False initial_offset instrs ((n_insns, lbl_map), long_jumps) | isLargeW (fromIntegral $ Map.size lbl_map0) || isLargeW n_insns0 - = (inspectAsm platform True initial_offset asm, True) + = (inspectInstrs platform True initial_offset instrs, True) | otherwise = ((n_insns0, lbl_map0), False) env :: LocalLabel -> Word @@ -210,8 +220,8 @@ assembleBCO platform (Map.lookup lbl lbl_map) -- pass 2: run assembler and generate instructions, literals and pointers - let initial_state = (emptySS, emptySS, emptySS) - (final_insns, final_lits, final_ptrs) <- flip execStateT initial_state $ runAsm platform long_jumps env asm + let initial_state = AsmState emptySS emptySS emptySS + AsmState final_insns final_lits final_ptrs <- runInstrs initial_state platform long_jumps env instrs -- precomputed size should be equal to final size massertPpr (n_insns == sizeSS final_insns) @@ -238,9 +248,9 @@ mkBitmapArray bsize bitmap fromIntegral bsize : map (fromInteger . fromStgWord) bitmap -- instrs nonptrs ptrs -type AsmState = (SizedSeq Word16, - SizedSeq BCONPtr, - SizedSeq BCOPtr) +data AsmState = AsmState {-# UNPACK #-} !(SizedSeq Word16) + {-# UNPACK #-} !(SizedSeq BCONPtr) + {-# UNPACK #-} !(SizedSeq BCOPtr) data Operand = Op Word @@ -260,39 +270,9 @@ truncHalfWord platform w = case platformWordSize platform of PW8 | w <= 4294967295 -> Op (fromIntegral w) _ -> pprPanic "GHC.ByteCode.Asm.truncHalfWord" (ppr w) -data Assembler a - = AllocPtr (IO BCOPtr) (Word -> Assembler a) - | AllocLit [BCONPtr] (Word -> Assembler a) - | AllocLabel LocalLabel (Assembler a) - | Emit Word16 [Operand] (Assembler a) - | NullAsm a - deriving (Functor) - -instance Applicative Assembler where - pure = NullAsm - (<*>) = ap - -instance Monad Assembler where - NullAsm x >>= f = f x - AllocPtr p k >>= f = AllocPtr p (k >=> f) - AllocLit l k >>= f = AllocLit l (k >=> f) - AllocLabel lbl k >>= f = AllocLabel lbl (k >>= f) - Emit w ops k >>= f = Emit w ops (k >>= f) - -ioptr :: IO BCOPtr -> Assembler Word -ioptr p = AllocPtr p return - -ptr :: BCOPtr -> Assembler Word -ptr = ioptr . return - -lit :: [BCONPtr] -> Assembler Word -lit l = AllocLit l return -label :: LocalLabel -> Assembler () -label w = AllocLabel w (return ()) - -emit :: Word16 -> [Operand] -> Assembler () -emit w ops = Emit w ops (return ()) +ptr :: MonadAssembler m => BCOPtr -> m Word +ptr = ioptr . return type LabelEnv = LocalLabel -> Word @@ -303,36 +283,57 @@ largeOp long_jumps op = case op of IOp i -> isLargeI i LabelOp _ -> long_jumps -runAsm :: Platform -> Bool -> LabelEnv -> Assembler a -> StateT AsmState IO a -runAsm platform long_jumps e = go - where - go (NullAsm x) = return x - go (AllocPtr p_io k) = do - p <- lift p_io - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_p1 = addToSS st_p0 p - in (sizeSS st_p0, (st_i0,st_l0,st_p1)) - go $ k w - go (AllocLit lits k) = do - w <- state $ \(st_i0,st_l0,st_p0) -> +newtype RunAsm a = RunAsm { runRunAsm :: Bool -> LabelEnv -> StateT AsmState IO a } + +instance Functor RunAsm where + fmap f (RunAsm x) = RunAsm (\b c -> fmap f (x b c) ) + +instance Applicative RunAsm where + pure x = RunAsm $ \_ _ -> pure x + (RunAsm f) <*> (RunAsm x) = RunAsm $ \b c -> f b c <*> x b c + {-# INLINE (<*>) #-} + +instance Monad RunAsm where + return = pure + (RunAsm m) >>= f = RunAsm $ \b c -> m b c >>= (\d -> runRunAsm (f d) b c) + {-# INLINE (>>=) #-} + +runAsm :: Bool -> LabelEnv -> RunAsm a -> StateT AsmState IO a +runAsm long_jumps e (RunAsm{runRunAsm}) = runRunAsm long_jumps e + +instance MonadAssembler RunAsm where + ioptr p_io = RunAsm $ \_ _ -> do + p <- lift p_io + w <- state $ \(AsmState st_i0 st_l0 st_p0) -> + let st_p1 = addToSS st_p0 p + in (sizeSS st_p0, AsmState st_i0 st_l0 st_p1) + return w + lit lits = RunAsm $ \_ _ -> + state $ \(AsmState st_i0 st_l0 st_p0) -> let st_l1 = addListToSS st_l0 lits - in (sizeSS st_l0, (st_i0,st_l1,st_p0)) - go $ k w - go (AllocLabel _ k) = go k - go (Emit w ops k) = do - let largeArgs = any (largeOp long_jumps) ops - opcode - | largeArgs = largeArgInstr w - | otherwise = w - words = concatMap expand ops - expand (SmallOp w) = [w] - expand (LabelOp w) = expand (Op (e w)) - expand (Op w) = if largeArgs then largeArg platform (fromIntegral w) else [fromIntegral w] - expand (IOp i) = if largeArgs then largeArg platform (fromIntegral i) else [fromIntegral i] - state $ \(st_i0,st_l0,st_p0) -> - let st_i1 = addListToSS st_i0 (opcode : words) - in ((), (st_i1,st_l0,st_p0)) - go k + in (sizeSS st_l0, AsmState st_i0 st_l1 st_p0) + + label _ = return () + + emit platform w ops = RunAsm $ \long_jumps e -> do + let largeArgs = any (largeOp long_jumps) ops + opcode + | largeArgs = largeArgInstr w + | otherwise = w + words = concatMap expand ops + expand (SmallOp w) = [w] + expand (LabelOp w) = expand (Op (e w)) + expand (Op w) = if largeArgs then largeArg platform (fromIntegral w) else [fromIntegral w] + expand (IOp i) = if largeArgs then largeArg platform (fromIntegral i) else [fromIntegral i] + state $ \(AsmState st_i0 st_l0 st_p0) -> + let st_i1 = addListToSS st_i0 (opcode : words) + in ((), AsmState st_i1 st_l0 st_p0) + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + type LabelEnvMap = Map LocalLabel Word @@ -343,26 +344,78 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } -inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) -inspectAsm platform long_jumps initial_offset - = go (InspectState initial_offset 0 0 Map.empty) - where - go s (NullAsm _) = (instrCount s, lblEnv s) - go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) - where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + genericLength ls }) (k n) - where n = litCount s - go s (AllocLabel lbl k) = go s' k - where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } - go s (Emit _ ops k) = go s' k - where - s' = s { instrCount = instrCount s + size } - size = sum (map count ops) + 1 +newtype InspectEnv = InspectEnv { _inspectLongJumps :: Bool + } + +newtype InspectAsm a = InspectAsm { runInspectAsm :: InspectEnv -> InspectState -> (# InspectState, a #) } + +instance Functor InspectAsm where + fmap f (InspectAsm k) = InspectAsm $ \a b -> case k a b of + (# b', c #) -> (# b', f c #) + +instance Applicative InspectAsm where + pure x = InspectAsm $ \_ s -> (# s, x #) + (InspectAsm f) <*> (InspectAsm x) = InspectAsm $ \a b -> case f a b of + (# s', f' #) -> + case x a s' of + (# s'', x' #) -> (# s'', f' x' #) + +instance Monad InspectAsm where + return = pure + (InspectAsm m) >>= f = InspectAsm $ \ a b -> case m a b of + (# s', a' #) -> runInspectAsm (f a') a s' + + + +get_ :: InspectAsm InspectState +get_ = InspectAsm $ \_ b -> (# b, b #) + +put_ :: InspectState -> InspectAsm () +put_ !s = InspectAsm $ \_ _ -> (# s, () #) + +modify_ :: (InspectState -> InspectState) -> InspectAsm () +modify_ f = InspectAsm $ \_ s -> let !s' = f s in (# s', () #) + +ask_ :: InspectAsm InspectEnv +ask_ = InspectAsm $ \a b -> (# b, a #) + +inspectAsm :: Bool -> Word -> InspectAsm () -> (Word, LabelEnvMap) +inspectAsm long_jumps initial_offset (InspectAsm s) = + case s (InspectEnv long_jumps) (InspectState initial_offset 0 0 Map.empty) of + (# res, () #) -> (instrCount res, lblEnv res) +{-# INLINE inspectAsm #-} + +instance MonadAssembler InspectAsm where + ioptr _ = do + s <- get_ + let n = ptrCount s + put_ (s { ptrCount = n + 1 }) + return n + + lit ls = do + s <- get_ + let n = litCount s + put_ (s { litCount = n + strictGenericLength ls }) + return n + + label lbl = modify_ (\s -> s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) }) + + emit platform _ ops = do + InspectEnv long_jumps <- ask_ + let size = sum (map count ops) + 1 largeOps = any (largeOp long_jumps) ops count (SmallOp _) = 1 count (LabelOp _) = count (Op 0) count (Op _) = if largeOps then largeArg16s platform else 1 count (IOp _) = if largeOps then largeArg16s platform else 1 + s <- get_ + put_ (s { instrCount = instrCount s + size }) + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + -- Bring in all the bci_ bytecode constants. #include "Bytecodes.h" @@ -386,31 +439,41 @@ largeArg16s platform = case platformWordSize platform of PW8 -> 4 PW4 -> 2 -assembleI :: Platform +class Monad m => MonadAssembler m where + ioptr :: IO BCOPtr -> m Word + lit :: [BCONPtr] -> m Word + label :: LocalLabel -> m () + emit :: Platform -> Word16 -> [Operand] -> m () + +{-# SPECIALISE assembleI :: Platform -> BCInstr -> InspectAsm () #-} +{-# SPECIALISE assembleI :: Platform -> BCInstr -> RunAsm () #-} + +assembleI :: forall m . MonadAssembler m + => Platform -> BCInstr - -> Assembler () + -> m () assembleI platform i = case i of - STKCHECK n -> emit bci_STKCHECK [Op n] - PUSH_L o1 -> emit bci_PUSH_L [wOp o1] - PUSH_LL o1 o2 -> emit bci_PUSH_LL [wOp o1, wOp o2] - PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] - PUSH8 o1 -> emit bci_PUSH8 [bOp o1] - PUSH16 o1 -> emit bci_PUSH16 [bOp o1] - PUSH32 o1 -> emit bci_PUSH32 [bOp o1] - PUSH8_W o1 -> emit bci_PUSH8_W [bOp o1] - PUSH16_W o1 -> emit bci_PUSH16_W [bOp o1] - PUSH32_W o1 -> emit bci_PUSH32_W [bOp o1] + STKCHECK n -> emit_ bci_STKCHECK [Op n] + PUSH_L o1 -> emit_ bci_PUSH_L [wOp o1] + PUSH_LL o1 o2 -> emit_ bci_PUSH_LL [wOp o1, wOp o2] + PUSH_LLL o1 o2 o3 -> emit_ bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] + PUSH8 o1 -> emit_ bci_PUSH8 [bOp o1] + PUSH16 o1 -> emit_ bci_PUSH16 [bOp o1] + PUSH32 o1 -> emit_ bci_PUSH32 [bOp o1] + PUSH8_W o1 -> emit_ bci_PUSH8_W [bOp o1] + PUSH16_W o1 -> emit_ bci_PUSH16_W [bOp o1] + PUSH32_W o1 -> emit_ bci_PUSH32_W [bOp o1] PUSH_G nm -> do p <- ptr (BCOPtrName nm) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_BCO proto -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_ALTS proto pk -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit (push_alts pk) [Op p] + emit_ (push_alts pk) [Op p] PUSH_ALTS_TUPLE proto call_info tuple_proto -> do let ul_bco = assembleBCO platform proto ul_tuple_bco = assembleBCO platform @@ -419,121 +482,124 @@ assembleI platform i = case i of p_tup <- ioptr (liftM BCOPtrBCO ul_tuple_bco) info <- word (fromIntegral $ mkNativeCallInfoSig platform call_info) - emit bci_PUSH_ALTS_T + emit_ bci_PUSH_ALTS_T [Op p, Op info, Op p_tup] - PUSH_PAD8 -> emit bci_PUSH_PAD8 [] - PUSH_PAD16 -> emit bci_PUSH_PAD16 [] - PUSH_PAD32 -> emit bci_PUSH_PAD32 [] + PUSH_PAD8 -> emit_ bci_PUSH_PAD8 [] + PUSH_PAD16 -> emit_ bci_PUSH_PAD16 [] + PUSH_PAD32 -> emit_ bci_PUSH_PAD32 [] PUSH_UBX8 lit -> do np <- literal lit - emit bci_PUSH_UBX8 [Op np] + emit_ bci_PUSH_UBX8 [Op np] PUSH_UBX16 lit -> do np <- literal lit - emit bci_PUSH_UBX16 [Op np] + emit_ bci_PUSH_UBX16 [Op np] PUSH_UBX32 lit -> do np <- literal lit - emit bci_PUSH_UBX32 [Op np] + emit_ bci_PUSH_UBX32 [Op np] PUSH_UBX lit nws -> do np <- literal lit - emit bci_PUSH_UBX [Op np, wOp nws] + emit_ bci_PUSH_UBX [Op np, wOp nws] -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode PUSH_ADDR nm -> do np <- lit [BCONPtrAddr nm] - emit bci_PUSH_UBX [Op np, SmallOp 1] - - PUSH_APPLY_N -> emit bci_PUSH_APPLY_N [] - PUSH_APPLY_V -> emit bci_PUSH_APPLY_V [] - PUSH_APPLY_F -> emit bci_PUSH_APPLY_F [] - PUSH_APPLY_D -> emit bci_PUSH_APPLY_D [] - PUSH_APPLY_L -> emit bci_PUSH_APPLY_L [] - PUSH_APPLY_P -> emit bci_PUSH_APPLY_P [] - PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP [] - PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP [] - PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP [] - PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP [] - PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP [] - - SLIDE n by -> emit bci_SLIDE [wOp n, wOp by] - ALLOC_AP n -> emit bci_ALLOC_AP [truncHalfWord platform n] - ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [truncHalfWord platform n] - ALLOC_PAP arity n -> emit bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] - MKAP off sz -> emit bci_MKAP [wOp off, truncHalfWord platform sz] - MKPAP off sz -> emit bci_MKPAP [wOp off, truncHalfWord platform sz] - UNPACK n -> emit bci_UNPACK [wOp n] + emit_ bci_PUSH_UBX [Op np, SmallOp 1] + + PUSH_APPLY_N -> emit_ bci_PUSH_APPLY_N [] + PUSH_APPLY_V -> emit_ bci_PUSH_APPLY_V [] + PUSH_APPLY_F -> emit_ bci_PUSH_APPLY_F [] + PUSH_APPLY_D -> emit_ bci_PUSH_APPLY_D [] + PUSH_APPLY_L -> emit_ bci_PUSH_APPLY_L [] + PUSH_APPLY_P -> emit_ bci_PUSH_APPLY_P [] + PUSH_APPLY_PP -> emit_ bci_PUSH_APPLY_PP [] + PUSH_APPLY_PPP -> emit_ bci_PUSH_APPLY_PPP [] + PUSH_APPLY_PPPP -> emit_ bci_PUSH_APPLY_PPPP [] + PUSH_APPLY_PPPPP -> emit_ bci_PUSH_APPLY_PPPPP [] + PUSH_APPLY_PPPPPP -> emit_ bci_PUSH_APPLY_PPPPPP [] + + SLIDE n by -> emit_ bci_SLIDE [wOp n, wOp by] + ALLOC_AP n -> emit_ bci_ALLOC_AP [truncHalfWord platform n] + ALLOC_AP_NOUPD n -> emit_ bci_ALLOC_AP_NOUPD [truncHalfWord platform n] + ALLOC_PAP arity n -> emit_ bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] + MKAP off sz -> emit_ bci_MKAP [wOp off, truncHalfWord platform sz] + MKPAP off sz -> emit_ bci_MKPAP [wOp off, truncHalfWord platform sz] + UNPACK n -> emit_ bci_UNPACK [wOp n] PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)] - emit bci_PACK [Op itbl_no, wOp sz] + emit_ bci_PACK [Op itbl_no, wOp sz] LABEL lbl -> label lbl TESTLT_I i l -> do np <- int i - emit bci_TESTLT_I [Op np, LabelOp l] + emit_ bci_TESTLT_I [Op np, LabelOp l] TESTEQ_I i l -> do np <- int i - emit bci_TESTEQ_I [Op np, LabelOp l] + emit_ bci_TESTEQ_I [Op np, LabelOp l] TESTLT_W w l -> do np <- word w - emit bci_TESTLT_W [Op np, LabelOp l] + emit_ bci_TESTLT_W [Op np, LabelOp l] TESTEQ_W w l -> do np <- word w - emit bci_TESTEQ_W [Op np, LabelOp l] + emit_ bci_TESTEQ_W [Op np, LabelOp l] TESTLT_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTLT_I64 [Op np, LabelOp l] + emit_ bci_TESTLT_I64 [Op np, LabelOp l] TESTEQ_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTEQ_I64 [Op np, LabelOp l] + emit_ bci_TESTEQ_I64 [Op np, LabelOp l] TESTLT_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I32 [Op np, LabelOp l] + emit_ bci_TESTLT_I32 [Op np, LabelOp l] TESTEQ_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I32 [Op np, LabelOp l] + emit_ bci_TESTEQ_I32 [Op np, LabelOp l] TESTLT_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I16 [Op np, LabelOp l] + emit_ bci_TESTLT_I16 [Op np, LabelOp l] TESTEQ_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I16 [Op np, LabelOp l] + emit_ bci_TESTEQ_I16 [Op np, LabelOp l] TESTLT_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I8 [Op np, LabelOp l] + emit_ bci_TESTLT_I8 [Op np, LabelOp l] TESTEQ_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I8 [Op np, LabelOp l] + emit_ bci_TESTEQ_I8 [Op np, LabelOp l] TESTLT_W64 w l -> do np <- word64 w - emit bci_TESTLT_W64 [Op np, LabelOp l] + emit_ bci_TESTLT_W64 [Op np, LabelOp l] TESTEQ_W64 w l -> do np <- word64 w - emit bci_TESTEQ_W64 [Op np, LabelOp l] + emit_ bci_TESTEQ_W64 [Op np, LabelOp l] TESTLT_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W32 [Op np, LabelOp l] + emit_ bci_TESTLT_W32 [Op np, LabelOp l] TESTEQ_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W32 [Op np, LabelOp l] + emit_ bci_TESTEQ_W32 [Op np, LabelOp l] TESTLT_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W16 [Op np, LabelOp l] + emit_ bci_TESTLT_W16 [Op np, LabelOp l] TESTEQ_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W16 [Op np, LabelOp l] + emit_ bci_TESTEQ_W16 [Op np, LabelOp l] TESTLT_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W8 [Op np, LabelOp l] + emit_ bci_TESTLT_W8 [Op np, LabelOp l] TESTEQ_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W8 [Op np, LabelOp l] + emit_ bci_TESTEQ_W8 [Op np, LabelOp l] TESTLT_F f l -> do np <- float f - emit bci_TESTLT_F [Op np, LabelOp l] + emit_ bci_TESTLT_F [Op np, LabelOp l] TESTEQ_F f l -> do np <- float f - emit bci_TESTEQ_F [Op np, LabelOp l] + emit_ bci_TESTEQ_F [Op np, LabelOp l] TESTLT_D d l -> do np <- double d - emit bci_TESTLT_D [Op np, LabelOp l] + emit_ bci_TESTLT_D [Op np, LabelOp l] TESTEQ_D d l -> do np <- double d - emit bci_TESTEQ_D [Op np, LabelOp l] - TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l] - TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l] - CASEFAIL -> emit bci_CASEFAIL [] - SWIZZLE stkoff n -> emit bci_SWIZZLE [wOp stkoff, IOp n] - JMP l -> emit bci_JMP [LabelOp l] - ENTER -> emit bci_ENTER [] - RETURN rep -> emit (return_non_tuple rep) [] - RETURN_TUPLE -> emit bci_RETURN_T [] + emit_ bci_TESTEQ_D [Op np, LabelOp l] + TESTLT_P i l -> emit_ bci_TESTLT_P [SmallOp i, LabelOp l] + TESTEQ_P i l -> emit_ bci_TESTEQ_P [SmallOp i, LabelOp l] + CASEFAIL -> emit_ bci_CASEFAIL [] + SWIZZLE stkoff n -> emit_ bci_SWIZZLE [wOp stkoff, IOp n] + JMP l -> emit_ bci_JMP [LabelOp l] + ENTER -> emit_ bci_ENTER [] + RETURN rep -> emit_ (return_non_tuple rep) [] + RETURN_TUPLE -> emit_ bci_RETURN_T [] CCALL off m_addr i -> do np <- addr m_addr - emit bci_CCALL [wOp off, Op np, SmallOp i] - PRIMCALL -> emit bci_PRIMCALL [] + emit_ bci_CCALL [wOp off, Op np, SmallOp i] + PRIMCALL -> emit_ bci_PRIMCALL [] BRK_FUN arr tick_mod tickx info_mod infox cc -> do p1 <- ptr (BCOPtrBreakArray arr) tick_addr <- addr tick_mod info_addr <- addr info_mod np <- addr cc - emit bci_BRK_FUN [ Op p1 + emit_ bci_BRK_FUN [ Op p1 , Op tick_addr, Op info_addr , SmallOp tickx, SmallOp infox , Op np ] #if MIN_VERSION_rts(1,0,3) BCO_NAME name -> do np <- lit [BCONPtrStr name] - emit bci_BCO_NAME [Op np] + emit_ bci_BCO_NAME [Op np] #endif where + emit_ = emit platform + + literal :: Literal -> m Word literal (LitLabel fs _) = litlabel fs literal LitNullAddr = word 0 literal (LitFloat r) = float (fromRational r) @@ -573,16 +639,16 @@ assembleI platform i = case i of -- Note that we only support host endianness == target endianness for now, -- even with the external interpreter. This would need to be fixed to -- support host endianness /= target endianness - int :: Int -> Assembler Word + int :: Int -> m Word int i = word (fromIntegral i) - float :: Float -> Assembler Word + float :: Float -> m Word float f = word32 (castFloatToWord32 f) - double :: Double -> Assembler Word + double :: Double -> m Word double d = word64 (castDoubleToWord64 d) - word64 :: Word64 -> Assembler Word + word64 :: Word64 -> m Word word64 ww = case word_size of PW4 -> let !wl = fromIntegral ww @@ -592,17 +658,17 @@ assembleI platform i = case i of BigEndian -> words [wh,wl] PW8 -> word (fromIntegral ww) - word8 :: Word8 -> Assembler Word + word8 :: Word8 -> m Word word8 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 8)) - word16 :: Word16 -> Assembler Word + word16 :: Word16 -> m Word word16 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 16)) - word32 :: Word32 -> Assembler Word + word32 :: Word32 -> m Word word32 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> case word_size of ===================================== compiler/GHC/Prelude/Basic.hs ===================================== @@ -25,6 +25,8 @@ module GHC.Prelude.Basic , shiftL, shiftR , setBit, clearBit , head, tail + + , strictGenericLength ) where @@ -130,3 +132,15 @@ head = Prelude.head tail :: HasCallStack => [a] -> [a] tail = Prelude.tail {-# INLINE tail #-} + +{- | +The 'genericLength' function defined in base can't be specialised due to the +NOINLINE pragma. + +It is also not strict in the accumulator, and strictGenericLength is not exported. + +See #25706 for why it is important to use a strict, specialised version. + +-} +strictGenericLength :: Num a => [x] -> a +strictGenericLength = fromIntegral . length ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry -import Data.List ( genericReplicate, genericLength, intersperse +import Data.List ( genericReplicate, intersperse , partition, scanl', sortBy, zip4, zip6 ) import Foreign hiding (shiftL, shiftR) import Control.Monad @@ -393,7 +393,7 @@ schemeR_wrk fvs nm original_body (args, body) -- make the arg bitmap bits = argBits platform (reverse (map (idArgRep platform) all_args)) - bitmap_size = genericLength bits + bitmap_size = strictGenericLength bits bitmap = mkBitmap platform bits body_code <- schemeER_wrk sum_szsb_args p_init body @@ -607,7 +607,7 @@ schemeE d s p (StgLet _ext binds body) = do platform <- targetPlatform <$> getDynFlags let (xs,rhss) = case binds of StgNonRec x rhs -> ([x],[rhs]) StgRec xs_n_rhss -> unzip xs_n_rhss - n_binds = genericLength xs + n_binds = strictGenericLength xs fvss = map (fvsToEnv p') rhss @@ -616,7 +616,7 @@ schemeE d s p (StgLet _ext binds body) = do sizes = map (\rhs_fvs -> sum (map size_w rhs_fvs)) fvss -- the arity of each rhs - arities = map (genericLength . fst . collect) rhss + arities = map (strictGenericLength . fst . collect) rhss -- This p', d' defn is safe because all the items being pushed -- are ptrs, so all have size 1 word. d' and p' reflect the stack @@ -1857,7 +1857,7 @@ implement_tagToId implement_tagToId d s p arg names = assert (notNull names) $ do (push_arg, arg_bytes) <- pushAtom d p (StgVarArg arg) - labels <- getLabelsBc (genericLength names) + labels <- getLabelsBc (strictGenericLength names) label_fail <- getLabelBc label_exit <- getLabelBc dflags <- getDynFlags ===================================== libraries/ghc-boot/GHC/Data/SizedSeq.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving, DeriveGeneric, CPP #-} module GHC.Data.SizedSeq ( SizedSeq(..) , emptySS @@ -11,9 +11,12 @@ module GHC.Data.SizedSeq import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary -import Data.List (genericLength) import GHC.Generics +#if ! MIN_VERSION_base(4,20,0) +import Data.List (foldl') +#endif + data SizedSeq a = SizedSeq {-# UNPACK #-} !Word [a] deriving (Generic, Show) @@ -37,9 +40,9 @@ emptySS = SizedSeq 0 [] addToSS :: SizedSeq a -> a -> SizedSeq a addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) +-- NB, important this is eta-expand so that foldl' is inlined. addListToSS :: SizedSeq a -> [a] -> SizedSeq a -addListToSS (SizedSeq n r_xs) xs - = SizedSeq (n + genericLength xs) (reverse xs ++ r_xs) +addListToSS s xs = foldl' addToSS s xs ssElts :: SizedSeq a -> [a] ssElts (SizedSeq _ r_xs) = reverse r_xs ===================================== libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs ===================================== @@ -131,10 +131,10 @@ class Category a => Arrow a where -- The default definition may be overridden with a more efficient -- version if desired. -- - -- > b ╭─────╮ b' + -- > b ╭─────╮ c -- > >───┼─ f ─┼───> -- > >───┼─ g ─┼───> - -- > c ╰─────╯ c' + -- > b'╰─────╯ c' (***) :: a b c -> a b' c' -> a (b,b') (c,c') f *** g = first f >>> arr swap >>> first g >>> arr swap where swap ~(x,y) = (y,x) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0fe43016b9f26b0df7b2b3d3a14bb6a46b8db6de...593cf5ae5fe12e1faf4a470fbc275dfd7f6fa891 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0fe43016b9f26b0df7b2b3d3a14bb6a46b8db6de...593cf5ae5fe12e1faf4a470fbc275dfd7f6fa891 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 15:17:21 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 03 Feb 2025 10:17:21 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/name-to-clabel Message-ID: <67a0de0126b22_17a3062fa74ac1176c4@gitlab.mail> Matthew Pickering pushed new branch wip/name-to-clabel at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/name-to-clabel You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 15:21:46 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 03 Feb 2025 10:21:46 -0500 Subject: [Git][ghc/ghc][wip/name-to-clabel] perf: nameToCLabel: Directly manipulate ByteString rather than going via strings Message-ID: <67a0df0a5671c_17a306308f9c8121530@gitlab.mail> Matthew Pickering pushed to branch wip/name-to-clabel at Glasgow Haskell Compiler / GHC Commits: ec87ae43 by Matthew Pickering at 2025-02-03T15:21:27+00:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 - - - - - 1 changed file: - compiler/GHC/ByteCode/Linker.hs Changes: ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -210,9 +211,9 @@ linkFail who what nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastString label +nameToCLabel n suffix = mkFastStringByteString label where - encodeZ = zString . zEncodeFS + encodeZ = fastZStringToByteString . zEncodeFS (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. @@ -222,11 +223,14 @@ nameToCLabel n suffix = mkFastString label modulePart = encodeZ (moduleNameFS modName) occPart = encodeZ $ occNameMangledFS (nameOccName n) - label = concat - [ if pkgKey == mainUnit then "" else packagePart ++ "_" - , modulePart - , '_':occPart - , '_':suffix + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix ] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ec87ae432201d3067de11819165ed358164ec66d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ec87ae432201d3067de11819165ed358164ec66d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 16:19:08 2025 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Mon, 03 Feb 2025 11:19:08 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/fromasclist Message-ID: <67a0ec7c2d066_1ef2472089c435766@gitlab.mail> Cheng Shao pushed new branch wip/fromasclist at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/fromasclist You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 16:45:00 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 03 Feb 2025 11:45:00 -0500 Subject: [Git][ghc/ghc][master] compiler: Always load GHC.Data.FastString optimised into GHCi Message-ID: <67a0f28cca3b6_1ef2478e141c48966@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 1 changed file: - compiler/GHC/Data/FastString.hs Changes: ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -2,10 +2,19 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +{-# OPTIONS_GHC -fno-unoptimized-core-for-interpreter #-} +#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected +-- +-- Also important, if you load this module into GHCi then the data representation of +-- FastString has to match that of the host compiler due to the shared FastString +-- table. Otherwise you will get segfaults when the table is consulted and the fields +-- from the FastString are in an incorrect order. -- | -- There are two principal string types used internally by GHC: View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/662645f0aafd94208ac849211d2b78c639864c9b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/662645f0aafd94208ac849211d2b78c639864c9b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 16:46:05 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 03 Feb 2025 11:46:05 -0500 Subject: [Git][ghc/ghc][master] RTS: Fix compile on powerpc64 ELF v1 Message-ID: <67a0f2cd14ebe_1ef2478e161054286@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - 1 changed file: - rts/StgCRunAsm.S Changes: ===================================== rts/StgCRunAsm.S ===================================== @@ -69,7 +69,7 @@ StgReturn: .section .note.GNU-stack,"", at progbits # else // Not ELF v2 -# error Only ELF v2 supported. + // ELF v1 is in StgCrun.c # endif #elif defined(powerpc_HOST_ARCH) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/05e5785a3157c71e327a8e9bdc80fa7082918739 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/05e5785a3157c71e327a8e9bdc80fa7082918739 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 17:33:45 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Mon, 03 Feb 2025 12:33:45 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] 2 commits: Bump hackage state. Message-ID: <67a0fdf9e5dc8_214bb1c0e68992e8@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: 597d463c by Andreas Klebinger at 2025-02-03T17:28:45+01:00 Bump hackage state. This avoids some bound issues when using ghc-9.10.1 as boot compiler. - - - - - 0372966c by Andreas Klebinger at 2025-02-03T18:33:17+01:00 Accept windows export changes. - - - - - 2 changed files: - hadrian/cabal.project - testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 Changes: ===================================== hadrian/cabal.project ===================================== @@ -4,7 +4,7 @@ packages: ./ -- This essentially freezes the build plan for hadrian -- It would be wise to keep this up to date with the state set in ci.sh -index-state: 2024-05-13T15:04:38Z +index-state: 2025-02-03T15:14:19Z -- unordered-containers-0.2.20-r1 requires template-haskell < 2.22 -- ghc-9.10 has template-haskell-2.22.0.0 ===================================== testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 ===================================== @@ -2633,7 +2633,7 @@ module Data.Tuple.Experimental where type Solo :: * -> * data Solo a = MkSolo a type Solo# :: forall (k :: GHC.Types.RuntimeRep). TYPE k -> TYPE (GHC.Types.TupleRep '[k]) - data Solo# a = MkSolo# a + data Solo# a = ... type Tuple0 :: * type Tuple0 = () type Tuple0# :: GHC.Types.ZeroBitType @@ -4806,37 +4806,13 @@ module GHC.PrimOps where float2Double# :: Float# -> Double# float2Int# :: Float# -> Int# fmaddDouble# :: Double# -> Double# -> Double# -> Double# - fmaddDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fmaddDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fmaddDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fmaddFloat# :: Float# -> Float# -> Float# -> Float# - fmaddFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fmaddFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fmaddFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fmsubDouble# :: Double# -> Double# -> Double# -> Double# - fmsubDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fmsubDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fmsubDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fmsubFloat# :: Float# -> Float# -> Float# -> Float# - fmsubFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fmsubFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fmsubFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fnmaddDouble# :: Double# -> Double# -> Double# -> Double# - fnmaddDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fnmaddDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fnmaddDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fnmaddFloat# :: Float# -> Float# -> Float# -> Float# - fnmaddFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fnmaddFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fnmaddFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fnmsubDouble# :: Double# -> Double# -> Double# -> Double# - fnmsubDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fnmsubDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fnmsubDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fnmsubFloat# :: Float# -> Float# -> Float# -> Float# - fnmsubFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fnmsubFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fnmsubFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fork# :: forall {q :: RuntimeRep} (a :: TYPE q). (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, ThreadId# #) forkOn# :: forall {q :: RuntimeRep} (a :: TYPE q). Int# -> (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, ThreadId# #) freezeArray# :: forall {l :: Levity} d (a :: TYPE (BoxedRep l)). MutableArray# d a -> Int# -> Int# -> State# d -> (# State# d, Array# a #) @@ -5109,11 +5085,9 @@ module GHC.PrimOps where intToInt64# :: Int# -> Int64# intToInt8# :: Int# -> Int8# isByteArrayPinned# :: ByteArray# -> Int# - isByteArrayWeaklyPinned# :: ByteArray# -> Int# isCurrentThreadBound# :: State# RealWorld -> (# State# RealWorld, Int# #) isEmptyMVar# :: forall {l :: Levity} d (a :: TYPE (BoxedRep l)). MVar# d a -> State# d -> (# State# d, Int# #) isMutableByteArrayPinned# :: forall d. MutableByteArray# d -> Int# - isMutableByteArrayWeaklyPinned# :: forall d. MutableByteArray# d -> Int# isTrue# :: Int# -> Bool keepAlive# :: forall {l :: Levity} {r :: RuntimeRep} (a :: TYPE (BoxedRep l)) d (b :: TYPE r). a -> State# d -> (State# d -> b) -> b killThread# :: forall a. ThreadId# -> a -> State# RealWorld -> State# RealWorld @@ -5153,71 +5127,7 @@ module GHC.PrimOps where makeStablePtr# :: forall {l :: Levity} (a :: TYPE (BoxedRep l)). a -> State# RealWorld -> (# State# RealWorld, StablePtr# a #) maskAsyncExceptions# :: forall {q :: RuntimeRep} (a :: TYPE q). (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, a #) maskUninterruptible# :: forall {q :: RuntimeRep} (a :: TYPE q). (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, a #) - maxDouble# :: Double# -> Double# -> Double# - maxDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# - maxDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# - maxDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# - maxFloat# :: Float# -> Float# -> Float# - maxFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# - maxFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# - maxFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# - maxInt16X16# :: Int16X16# -> Int16X16# -> Int16X16# - maxInt16X32# :: Int16X32# -> Int16X32# -> Int16X32# - maxInt16X8# :: Int16X8# -> Int16X8# -> Int16X8# - maxInt32X16# :: Int32X16# -> Int32X16# -> Int32X16# - maxInt32X4# :: Int32X4# -> Int32X4# -> Int32X4# - maxInt32X8# :: Int32X8# -> Int32X8# -> Int32X8# - maxInt64X2# :: Int64X2# -> Int64X2# -> Int64X2# - maxInt64X4# :: Int64X4# -> Int64X4# -> Int64X4# - maxInt64X8# :: Int64X8# -> Int64X8# -> Int64X8# - maxInt8X16# :: Int8X16# -> Int8X16# -> Int8X16# - maxInt8X32# :: Int8X32# -> Int8X32# -> Int8X32# - maxInt8X64# :: Int8X64# -> Int8X64# -> Int8X64# maxTupleSize :: Int - maxWord16X16# :: Word16X16# -> Word16X16# -> Word16X16# - maxWord16X32# :: Word16X32# -> Word16X32# -> Word16X32# - maxWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# - maxWord32X16# :: Word32X16# -> Word32X16# -> Word32X16# - maxWord32X4# :: Word32X4# -> Word32X4# -> Word32X4# - maxWord32X8# :: Word32X8# -> Word32X8# -> Word32X8# - maxWord64X2# :: Word64X2# -> Word64X2# -> Word64X2# - maxWord64X4# :: Word64X4# -> Word64X4# -> Word64X4# - maxWord64X8# :: Word64X8# -> Word64X8# -> Word64X8# - maxWord8X16# :: Word8X16# -> Word8X16# -> Word8X16# - maxWord8X32# :: Word8X32# -> Word8X32# -> Word8X32# - maxWord8X64# :: Word8X64# -> Word8X64# -> Word8X64# - minDouble# :: Double# -> Double# -> Double# - minDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# - minDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# - minDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# - minFloat# :: Float# -> Float# -> Float# - minFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# - minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# - minFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# - minInt16X16# :: Int16X16# -> Int16X16# -> Int16X16# - minInt16X32# :: Int16X32# -> Int16X32# -> Int16X32# - minInt16X8# :: Int16X8# -> Int16X8# -> Int16X8# - minInt32X16# :: Int32X16# -> Int32X16# -> Int32X16# - minInt32X4# :: Int32X4# -> Int32X4# -> Int32X4# - minInt32X8# :: Int32X8# -> Int32X8# -> Int32X8# - minInt64X2# :: Int64X2# -> Int64X2# -> Int64X2# - minInt64X4# :: Int64X4# -> Int64X4# -> Int64X4# - minInt64X8# :: Int64X8# -> Int64X8# -> Int64X8# - minInt8X16# :: Int8X16# -> Int8X16# -> Int8X16# - minInt8X32# :: Int8X32# -> Int8X32# -> Int8X32# - minInt8X64# :: Int8X64# -> Int8X64# -> Int8X64# - minWord16X16# :: Word16X16# -> Word16X16# -> Word16X16# - minWord16X32# :: Word16X32# -> Word16X32# -> Word16X32# - minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# - minWord32X16# :: Word32X16# -> Word32X16# -> Word32X16# - minWord32X4# :: Word32X4# -> Word32X4# -> Word32X4# - minWord32X8# :: Word32X8# -> Word32X8# -> Word32X8# - minWord64X2# :: Word64X2# -> Word64X2# -> Word64X2# - minWord64X4# :: Word64X4# -> Word64X4# -> Word64X4# - minWord64X8# :: Word64X8# -> Word64X8# -> Word64X8# - minWord8X16# :: Word8X16# -> Word8X16# -> Word8X16# - minWord8X32# :: Word8X32# -> Word8X32# -> Word8X32# - minWord8X64# :: Word8X64# -> Word8X64# -> Word8X64# minusAddr# :: Addr# -> Addr# -> Int# minusDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# minusDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# @@ -5734,7 +5644,7 @@ module GHC.PrimOps where sameSmallMutableArray# :: forall {l :: Levity} s (a :: TYPE (BoxedRep l)). SmallMutableArray# s a -> SmallMutableArray# s a -> Int# sameTVar# :: forall {l :: Levity} s (a :: TYPE (BoxedRep l)). TVar# s a -> TVar# s a -> Int# seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b - seq# :: forall a s. a -> State# s -> (# State# s, a #) + seq# :: forall a d. a -> State# d -> (# State# d, a #) setAddrRange# :: Addr# -> Int# -> Int# -> State# RealWorld -> State# RealWorld setByteArray# :: forall d. MutableByteArray# d -> Int# -> Int# -> Int# -> State# d -> State# d setThreadAllocationCounter# :: Int64# -> State# RealWorld -> State# RealWorld @@ -5742,36 +5652,6 @@ module GHC.PrimOps where shiftRL# :: Word# -> Int# -> Word# shrinkMutableByteArray# :: forall d. MutableByteArray# d -> Int# -> State# d -> State# d shrinkSmallMutableArray# :: forall {l :: Levity} d (a :: TYPE (BoxedRep l)). SmallMutableArray# d a -> Int# -> State# d -> State# d - shuffleDoubleX2# :: DoubleX2# -> DoubleX2# -> (# Int#, Int# #) -> DoubleX2# - shuffleDoubleX4# :: DoubleX4# -> DoubleX4# -> (# Int#, Int#, Int#, Int# #) -> DoubleX4# - shuffleDoubleX8# :: DoubleX8# -> DoubleX8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> DoubleX8# - shuffleFloatX16# :: FloatX16# -> FloatX16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> FloatX16# - shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# - shuffleFloatX8# :: FloatX8# -> FloatX8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> FloatX8# - shuffleInt16X16# :: Int16X16# -> Int16X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int16X16# - shuffleInt16X32# :: Int16X32# -> Int16X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int16X32# - shuffleInt16X8# :: Int16X8# -> Int16X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int16X8# - shuffleInt32X16# :: Int32X16# -> Int32X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int32X16# - shuffleInt32X4# :: Int32X4# -> Int32X4# -> (# Int#, Int#, Int#, Int# #) -> Int32X4# - shuffleInt32X8# :: Int32X8# -> Int32X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int32X8# - shuffleInt64X2# :: Int64X2# -> Int64X2# -> (# Int#, Int# #) -> Int64X2# - shuffleInt64X4# :: Int64X4# -> Int64X4# -> (# Int#, Int#, Int#, Int# #) -> Int64X4# - shuffleInt64X8# :: Int64X8# -> Int64X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int64X8# - shuffleInt8X16# :: Int8X16# -> Int8X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int8X16# - shuffleInt8X32# :: Int8X32# -> Int8X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int8X32# - shuffleInt8X64# :: Int8X64# -> Int8X64# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int8X64# - shuffleWord16X16# :: Word16X16# -> Word16X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word16X16# - shuffleWord16X32# :: Word16X32# -> Word16X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word16X32# - shuffleWord16X8# :: Word16X8# -> Word16X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word16X8# - shuffleWord32X16# :: Word32X16# -> Word32X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word32X16# - shuffleWord32X4# :: Word32X4# -> Word32X4# -> (# Int#, Int#, Int#, Int# #) -> Word32X4# - shuffleWord32X8# :: Word32X8# -> Word32X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word32X8# - shuffleWord64X2# :: Word64X2# -> Word64X2# -> (# Int#, Int# #) -> Word64X2# - shuffleWord64X4# :: Word64X4# -> Word64X4# -> (# Int#, Int#, Int#, Int# #) -> Word64X4# - shuffleWord64X8# :: Word64X8# -> Word64X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word64X8# - shuffleWord8X16# :: Word8X16# -> Word8X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word8X16# - shuffleWord8X32# :: Word8X32# -> Word8X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word8X32# - shuffleWord8X64# :: Word8X64# -> Word8X64# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word8X64# sinDouble# :: Double# -> Double# sinFloat# :: Float# -> Float# sinhDouble# :: Double# -> Double# @@ -6158,23 +6038,6 @@ module GHC.Profiling.Eras where incrementUserEra :: GHC.Types.Word -> GHC.Types.IO GHC.Types.Word setUserEra :: GHC.Types.Word -> GHC.Types.IO () -module GHC.TypeLits.Experimental where - -- Safety: Safe-Inferred - appendSSymbol :: forall (a :: GHC.Types.Symbol) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SSymbol a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.AppendSymbol a b) - consSSymbol :: forall (a :: GHC.Types.Char) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.ConsSymbol a b) - sCharToSNat :: forall (a :: GHC.Types.Char). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeLits.CharToNat a) - sNatToSChar :: forall (n :: GHC.Num.Natural.Natural). (n GHC.Internal.Data.Type.Ord.<= 1114111) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeLits.SChar (GHC.Internal.TypeLits.NatToChar n) - -module GHC.TypeNats.Experimental where - -- Safety: None - divSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Div n m) - log2SNat :: forall (n :: GHC.Num.Natural.Natural). (1 GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Log2 n) - minusSNat :: forall (m :: GHC.Internal.TypeNats.Nat) (n :: GHC.Internal.TypeNats.Nat). (m GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.- m) - modSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Mod n m) - plusSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.+ m) - powerSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.^ m) - timesSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.* m) - module Prelude.Experimental where -- Safety: Trustworthy type CSolo :: Constraint -> Constraint @@ -10578,7 +10441,6 @@ instance forall a. GHC.Internal.Real.RealFrac a => GHC.Internal.Real.RealFrac (G instance forall a. GHC.Internal.Show.Show a => GHC.Internal.Show.Show (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’ instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.FunPtr a) -- Defined in ‘GHC.Internal.Ptr’ instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’ -instance GHC.Internal.Show.Show GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’ instance GHC.Classes.Eq GHC.Types.Bool -- Defined in ‘GHC.Classes’ instance GHC.Classes.Eq GHC.Types.Char -- Defined in ‘GHC.Classes’ instance GHC.Classes.Eq GHC.Types.Double -- Defined in ‘GHC.Classes’ @@ -10612,7 +10474,6 @@ instance forall a. GHC.Classes.Eq (GHC.Internal.Ptr.FunPtr a) -- Defined in ‘G instance forall a. GHC.Classes.Eq (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’ instance forall a. GHC.Classes.Eq a => GHC.Classes.Eq (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ instance GHC.Classes.Eq GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’ -instance GHC.Classes.Eq GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’ instance GHC.Classes.Ord GHC.Types.Bool -- Defined in ‘GHC.Classes’ instance GHC.Classes.Ord GHC.Types.Char -- Defined in ‘GHC.Classes’ instance GHC.Classes.Ord GHC.Types.Double -- Defined in ‘GHC.Classes’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/07f72b53c15d773c11e3be76cadde4188e402e76...0372966c5b844ad063401cf041d6382604e4ee05 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/07f72b53c15d773c11e3be76cadde4188e402e76...0372966c5b844ad063401cf041d6382604e4ee05 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 19:21:56 2025 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Mon, 03 Feb 2025 14:21:56 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/rm-assembleOneBCO Message-ID: <67a117548477e_214bb11664940111629@gitlab.mail> Cheng Shao pushed new branch wip/rm-assembleOneBCO at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/rm-assembleOneBCO You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 19:40:37 2025 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Mon, 03 Feb 2025 14:40:37 -0500 Subject: [Git][ghc/ghc][wip/rm-assembleOneBCO] compiler: remove unused assembleOneBCO function Message-ID: <67a11bb51e5f8_214bb11bd0fa0117982@gitlab.mail> Cheng Shao pushed to branch wip/rm-assembleOneBCO at Glasgow Haskell Compiler / GHC Commits: b0f12e08 by Cheng Shao at 2025-02-03T19:40:25+00:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - 1 changed file: - compiler/GHC/ByteCode/Asm.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -168,15 +167,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b0f12e08c399615ef16450bf4385a1356f2596c2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b0f12e08c399615ef16450bf4385a1356f2596c2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 20:09:27 2025 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Mon, 03 Feb 2025 15:09:27 -0500 Subject: [Git][ghc/ghc][wip/fromasclist] 3 commits: compiler: Always load GHC.Data.FastString optimised into GHCi Message-ID: <67a12277918d5_214bb11ef24e0121076@gitlab.mail> Cheng Shao pushed to branch wip/fromasclist at Glasgow Haskell Compiler / GHC Commits: 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - 9a1ee181 by Cheng Shao at 2025-02-03T20:09:16+00:00 compiler: use fromAscList when applicable This patch uses fromAscList (with O(n) complexity) instead of fromList (with O(nlogn) complexity) in certain Binary instances. It's safe to do so since the corresponding serialization logic is based on toList (same as toAscList). - - - - - 3 changed files: - compiler/GHC/Data/FastString.hs - compiler/GHC/Utils/Binary.hs - rts/StgCRunAsm.S Changes: ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -2,10 +2,19 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +{-# OPTIONS_GHC -fno-unoptimized-core-for-interpreter #-} +#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected +-- +-- Also important, if you load this module into GHCi then the data representation of +-- FastString has to match that of the host compiler due to the shared FastString +-- table. Otherwise you will get segfaults when the table is consulted and the fields +-- from the FastString are in an incorrect order. -- | -- There are two principal string types used internally by GHC: ===================================== compiler/GHC/Utils/Binary.hs ===================================== @@ -940,8 +940,8 @@ instance Binary a => Binary [a] where -- | This instance doesn't rely on the determinism of the keys' 'Ord' instance, -- so it works e.g. for 'Name's too. instance (Binary a, Ord a) => Binary (Set a) where - put_ bh s = put_ bh (Set.toList s) - get bh = Set.fromList <$> get bh + put_ bh s = put_ bh (Set.toAscList s) + get bh = Set.fromAscList <$> get bh instance Binary a => Binary (NonEmpty a) where put_ bh = put_ bh . NonEmpty.toList @@ -2086,5 +2086,5 @@ source location as part of a larger structure. -------------------------------------------------------------------------------- instance (Binary v) => Binary (IntMap v) where - put_ bh m = put_ bh (IntMap.toList m) - get bh = IntMap.fromList <$> get bh + put_ bh m = put_ bh (IntMap.toAscList m) + get bh = IntMap.fromAscList <$> get bh ===================================== rts/StgCRunAsm.S ===================================== @@ -69,7 +69,7 @@ StgReturn: .section .note.GNU-stack,"", at progbits # else // Not ELF v2 -# error Only ELF v2 supported. + // ELF v1 is in StgCrun.c # endif #elif defined(powerpc_HOST_ARCH) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/72151119bac6b3dd1621be5eac83ba6a3fa88c14...9a1ee1817c7bd4de15140ee0baac6007c7a4d1d0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/72151119bac6b3dd1621be5eac83ba6a3fa88c14...9a1ee1817c7bd4de15140ee0baac6007c7a4d1d0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 20:46:58 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Mon, 03 Feb 2025 15:46:58 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] Layering is now correct Message-ID: <67a12b426d547_214bb127c0b1c1241cf@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: ecec1b0f by Alan Zimmerman at 2025-02-03T20:46:34+00:00 Layering is now correct - GHC lexer, emits CPP tokens - accumulated in Preprocessor state - Lexed by CPP lexer, CPP command extracted, tokens concated with spaces (to get rid of token pasting via comments) - if directive lexed and parsed by CPP lexer/parser, and evaluated - - - - - 10 changed files: - compiler/GHC/Parser/PreProcess.hs - utils/check-cpp/Lexer.x - utils/check-cpp/Macro.hs - utils/check-cpp/Main.hs - utils/check-cpp/ParsePP.hs - utils/check-cpp/Parser.hs - utils/check-cpp/Parser.y - utils/check-cpp/ParserM.hs - utils/check-cpp/PreProcess.hs - utils/check-cpp/Types.hs Changes: ===================================== compiler/GHC/Parser/PreProcess.hs ===================================== @@ -76,7 +76,7 @@ data CppDirective type MacroArgs = [String] data MacroName = MacroName String (Maybe MacroArgs) deriving (Show, Eq, Ord) -type MacroDef = [String] +type MacroDef = String -- --------------------------------------------------------------------- @@ -321,7 +321,7 @@ parseDefine :: FastString -> Maybe (String, [String]) parseDefine fs = r where -- r = Just (cleanTokenString s, "") - r = case regularParse cppDefinition (unpackFS fs) of + r = case parseCppParser cppDefinition (unpackFS fs) of Left _ -> Nothing Right v -> Just v @@ -333,7 +333,6 @@ See Note [GhcCPP Initial Processing] cppInitial :: [FastString] -> String cppInitial fs = r where - -- go fs' = reverse $ drop 2 $ reverse $ unpackFS fs' r = concatMap unpackFS fs {- ===================================== utils/check-cpp/Lexer.x ===================================== @@ -16,105 +16,85 @@ import Control.Monad words :- - <0,def,expr> $white+ ; ----------------------------------------- - <0> "#" { mkTv THash } - <0> "define" { \i -> do {setStartCode def; mkTv TDefine i} } - <0> "include" { mkTv TInclude } - <0> "ifdef" { mkTv TIfdef } - <0> "ifndef" { mkTv TIfndef } - <0> "if" { \i -> do {setStartCode other; mkTv TIf i} } - <0> "else" { mkTv TElse } - <0> "endif" { mkTv TEndif } - <0> () { begin expr } - + <0> $white+ ; --------------------------------------- --- In a define. Params only, then other - "(" { mkTv TOpenParen } - "," { mkTv TComma } - ")" { mkTv TCloseParen } - [a-z][a-zA-Z0-9\#_]* { mkTv TLowerName } - [A-Z][a-zA-Z0-9\#_]* { mkTv TUpperName } - () { begin other } ---------------------------------------- - - "{" { mkTv TOpenBrace } - "}" { mkTv TCloseBrace } - "[" { mkTv TOpenBracket } - "]" { mkTv TCloseBracket } - "#" { mkTv THash } - "##" { mkTv THashHash } - "(" { mkTv TOpenParen } - ")" { mkTv TCloseParen } - "<:" { mkTv TLtColon } - ":>" { mkTv TColonGt} - "<%" { mkTv TLtPercent } - "%>" { mkTv TPercentGt } - "%:" { mkTv TPercentColon } - "%:%:" { mkTv TPercentColonTwice } - ";" { mkTv TSemi } - ":" { mkTv TColon } - "..." { mkTv TDotDotDot } - "new" { mkTv TNew } - "delete" { mkTv TDelete } - "?" { mkTv TQuestion } - "::" { mkTv TColonColon} - "." { mkTv TDot } - ".*" { mkTv TDotStar } - "+" { mkTv TPlus } - "-" { mkTv TMinus } - "*" { mkTv TStar } - "/" { mkTv TSlash } - "%" { mkTv TPercent } - "^" { mkTv TUpArrow } - "&" { mkTv TAmpersand } - "|" { mkTv TPipe } - "~" { mkTv TTilde } - "!" { mkTv TExclamation } - "=" { mkTv TEqual } - "<" { mkTv TOpenAngle } - ">" { mkTv TCloseAngle } - "+=" { mkTv TPlusEqual } - "-=" { mkTv TMinusEqual } - "*=" { mkTv TStarEqual } - "/=" { mkTv TSlashEqual } - "%=" { mkTv TPercentEqual } - "^=" { mkTv TUpEqual } - "&=" { mkTv TAmpersandEqual } - "|=" { mkTv TPipeEqual } - "<<" { mkTv TLtLt } - ">>" { mkTv TGtGt } - ">>=" { mkTv TGtGtEqual } - "<<=" { mkTv TLtLtEqual } - "==" { mkTv TEqualEqual } - "!=" { mkTv TExclaimEqual } - "<=" { mkTv TLtEqual } - ">=" { mkTv TGtEqual } - "&&" { mkTv TAmpersandTwice } - "||" { mkTv TPipePipe } - "++" { mkTv TPlusPlus } - "--" { mkTv TMinusMinus } - "," { mkTv TComma } - "->*" { mkTv TMinusGtStar } - "->" { mkTv TMinusGt } - "and" { mkTv TAnd } - "and_eq" { mkTv TAndEq } - "bitand" { mkTv TBitand } - "bitor" { mkTv TBitor } - "compl" { mkTv TCompl } - "not" { mkTv TNot } - "not_eq" { mkTv TNotEq } - "or" { mkTv TOr } - "or_eq" { mkTv TOrEq } - "xor" { mkTv TXor } - "xor_eq" { mkTv TXorEq } + <0> "{" { mkTv TOpenBrace } + <0> "}" { mkTv TCloseBrace } + <0> "[" { mkTv TOpenBracket } + <0> "]" { mkTv TCloseBracket } + <0> "#" { mkTv THash } + <0> "##" { mkTv THashHash } + <0> "(" { mkTv TOpenParen } + <0> ")" { mkTv TCloseParen } + <0> "<:" { mkTv TLtColon } + <0> ":>" { mkTv TColonGt} + <0> "<%" { mkTv TLtPercent } + <0> "%>" { mkTv TPercentGt } + <0> "%:" { mkTv TPercentColon } + <0> "%:%:" { mkTv TPercentColonTwice } + <0> ";" { mkTv TSemi } + <0> ":" { mkTv TColon } + <0> "..." { mkTv TDotDotDot } + <0> "new" { mkTv TNew } + <0> "delete" { mkTv TDelete } + <0> "?" { mkTv TQuestion } + <0> "::" { mkTv TColonColon} + <0> "." { mkTv TDot } + <0> ".*" { mkTv TDotStar } + <0> "+" { mkTv TPlus } + <0> "-" { mkTv TMinus } + <0> "*" { mkTv TStar } + <0> "/" { mkTv TSlash } + <0> "%" { mkTv TPercent } + <0> "^" { mkTv TUpArrow } + <0> "&" { mkTv TAmpersand } + <0> "|" { mkTv TPipe } + <0> "~" { mkTv TTilde } + <0> "!" { mkTv TExclamation } + <0> "=" { mkTv TEqual } + <0> "<" { mkTv TOpenAngle } + <0> ">" { mkTv TCloseAngle } + <0> "+=" { mkTv TPlusEqual } + <0> "-=" { mkTv TMinusEqual } + <0> "*=" { mkTv TStarEqual } + <0> "/=" { mkTv TSlashEqual } + <0> "%=" { mkTv TPercentEqual } + <0> "^=" { mkTv TUpEqual } + <0> "&=" { mkTv TAmpersandEqual } + <0> "|=" { mkTv TPipeEqual } + <0> "<<" { mkTv TLtLt } + <0> ">>" { mkTv TGtGt } + <0> ">>=" { mkTv TGtGtEqual } + <0> "<<=" { mkTv TLtLtEqual } + <0> "==" { mkTv TEqualEqual } + <0> "!=" { mkTv TExclaimEqual } + <0> "<=" { mkTv TLtEqual } + <0> ">=" { mkTv TGtEqual } + <0> "&&" { mkTv TAmpersandTwice } + <0> "||" { mkTv TPipePipe } + <0> "++" { mkTv TPlusPlus } + <0> "--" { mkTv TMinusMinus } + <0> "," { mkTv TComma } + <0> "->*" { mkTv TMinusGtStar } + <0> "->" { mkTv TMinusGt } + <0> "and" { mkTv TAnd } + <0> "and_eq" { mkTv TAndEq } + <0> "bitand" { mkTv TBitand } + <0> "bitor" { mkTv TBitor } + <0> "compl" { mkTv TCompl } + <0> "not" { mkTv TNot } + <0> "not_eq" { mkTv TNotEq } + <0> "or" { mkTv TOr } + <0> "or_eq" { mkTv TOrEq } + <0> "xor" { mkTv TXor } + <0> "xor_eq" { mkTv TXorEq } ---------------------------------------- - [a-z][a-zA-Z0-9\#_]* { mkTv TLowerName } - [A-Z][a-zA-Z0-9\#_]* { mkTv TUpperName } - \-? [0-9][0-9]* { mkTv TInteger } - \" [^\"]* \" { mkTv (TString . tail . init) } - () { begin other } + <0> [a-z][a-zA-Z0-9\#_]* { mkTv TLowerName } + <0> [A-Z][a-zA-Z0-9\#_]* { mkTv TUpperName } + <0> \-? [0-9][0-9]* { mkTv TInteger } + <0> \" [^\"]* \" { mkTv (TString . tail . init) } + <0> () { begin other } .+ { \i -> do {setStartCode 0; mkTv TOther i} } ===================================== utils/check-cpp/Macro.hs ===================================== @@ -26,7 +26,6 @@ import qualified Data.Map as Map import Data.Maybe import Eval -import Lexer import ParsePP import ParserM import Parser @@ -41,10 +40,10 @@ process s str = (s0, o) Left _ -> undefined Right r -> r s0 = case o of - CppDefine name toks -> define s name toks + CppDefine name rhs -> define s name rhs CppInclude _ -> undefined CppIfdef name -> ifdef s name - CppIf str -> cppIf s str + CppIf ifstr -> cppIf s ifstr CppIfndef name -> ifndef s name CppElse -> undefined CppEndif -> undefined @@ -72,7 +71,7 @@ cppIf s str = r expanded = expand s str -- toks0 = cppLex expanded -- r = error (show toks0) - v = case parseCppParser plusTimesExpr expanded of + v = case Parser.parseExpr expanded of Left err -> error $ show err Right tree -> eval tree -- We evaluate to an Int, which we convert to a bool @@ -80,13 +79,6 @@ cppIf s str = r -- --------------------------------------------------------------------- -cppLex :: String -> Either String [Token] -cppLex s = case lexCppTokenStream s init_state of - Left err -> Left err - Right (_inp, _st, toks) -> Right toks - --- --------------------------------------------------------------------- - expand :: PpState -> String -> String expand s str = expanded where @@ -94,15 +86,15 @@ expand s str = expanded toks = case cppLex str of Left err -> error err Right tks -> tks - expanded = unwords $ concatMap (expandOne s) toks + expanded = concatMap (expandOne s) toks -expandOne :: PpState -> Token -> [String] +expandOne :: PpState -> Token -> String expandOne s tok = r where -- TODO: protect against looking up `define` r = fromMaybe - [t_str tok] + (t_str tok) (Map.lookup (MacroName (t_str tok) Nothing) (pp_defines s)) -- --------------------------------------------------------------------- ===================================== utils/check-cpp/Main.hs ===================================== @@ -25,8 +25,8 @@ import GHC.Types.SrcLoc import GHC.Utils.Error import GHC.Utils.Outputable +import ParsePP import ParseSimulate -import Parser import PreProcess import Types @@ -34,8 +34,8 @@ import Types showAst :: (Data a) => a -> String showAst ast = - showSDocUnsafe - $ showAstData BlankSrcSpanFile NoBlankEpAnnotations ast + showSDocUnsafe $ + showAstData BlankSrcSpanFile NoBlankEpAnnotations ast -- ===================================================================== @@ -59,8 +59,9 @@ parseString libdir includes str = ghcWrapper libdir $ do strGetToks :: Includes -> Lexer.ParserOpts -> FilePath -> String -> [Located Token] strGetToks includes popts filename str = reverse $ lexAll pstate --- strGetToks includes popts filename str = reverse $ lexAll (trace ("pstate=" ++ show initState) pstate) where + -- strGetToks includes popts filename str = reverse $ lexAll (trace ("pstate=" ++ show initState) pstate) + includeMap = Map.fromList $ map (\(k, v) -> (k, stringToStringBuffer (intercalate "\n" v))) includes initState = initPpState{pp_includes = includeMap} pstate = Lexer.initParserState initState popts buf loc @@ -79,12 +80,11 @@ strGetToks includes popts filename str = reverse $ lexAll pstate showErrorMessages :: Messages GhcMessage -> String showErrorMessages msgs = - renderWithContext defaultSDocContext - $ vcat - $ pprMsgEnvelopeBagWithLocDefault - $ getMessages - $ msgs - + renderWithContext defaultSDocContext $ + vcat $ + pprMsgEnvelopeBagWithLocDefault $ + getMessages $ + msgs strParserWrapper :: -- | Haskell module source text (full Unicode is supported) @@ -95,9 +95,9 @@ strParserWrapper :: FilePath -> [Located Token] strParserWrapper str dflags filename = - case strParser str dflags filename of - (_, Left _err) -> error "oops" - (_, Right toks) -> toks + case strParser str dflags filename of + (_, Left _err) -> error "oops" + (_, Right toks) -> toks {- | Parse a file, using the emulated haskell parser, returning the resulting tokens only @@ -143,8 +143,8 @@ initDynFlags = do -- | Internal function. Default runner of GHC.Ghc action in IO. ghcWrapper :: LibDir -> GHC.Ghc a -> IO a ghcWrapper libdir a = - GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut - $ GHC.runGhc (Just libdir) a + GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut $ + GHC.runGhc (Just libdir) a -- --------------------------------------------------------------------- @@ -180,6 +180,7 @@ t0 = do , "#endif" , "" ] + -- x = 1 t1 :: IO () t1 = do @@ -187,6 +188,7 @@ t1 = do [ "data X = X" , "" ] + -- data X = X t2 :: IO () t2 = do @@ -198,6 +200,7 @@ t2 = do , "x = 5" , "#endif" ] + -- x = 5 t3 :: IO () t3 = do @@ -218,6 +221,9 @@ t3 = do , "" , "foo = putStrLn x" ] + -- y = 1 + -- x = "hello" + -- foo = putStrLn x t3a :: IO () t3a = do @@ -236,6 +242,8 @@ t3a = do , "" , "foo = putStrLn x" ] + -- x = "hello" + -- foo = putStrLn x t4 :: IO () t4 = do @@ -257,6 +265,7 @@ t4 = do , "x = \"no version\"" , "#endif" ] + -- x = "got version" t5 :: IO () t5 = do @@ -267,6 +276,7 @@ t5 = do , " (major1) == 1 && (major2) == 7 && (minor) <= 0)" , "x = x" ] + -- x = x t6 :: IO () t6 = do @@ -280,12 +290,13 @@ t6 = do , "#endif" , "" ] + -- x = "got version" -t7 :: Maybe (String, [String]) -t7 = parseDefine (mkFastString "#define VERSION_ghc_exactprint \"1.7.0.1\"") +-- t7 :: Maybe (String, [String]) +t7 = parseDirective "#define VERSION_ghc_exactprint \"1.7.0.1\"" -t8 :: Maybe (String, [String]) -t8 = parseDefine (mkFastString "#define MIN_VERSION_ghc_exactprint(major1,major2,minor) ( (major1) < 1 || (major1) == 1 && (major2) < 7 || (major1) == 1 && (major2) == 7 && (minor) <= 0)") +-- t8 :: Maybe (String, [String]) +t8 = parseDirective "#define MIN_VERSION_ghc_exactprint(major1,major2,minor) ( (major1) < 1 || (major1) == 1 && (major2) < 7 || (major1) == 1 && (major2) == 7 && (minor) <= 0)" t9 :: Either String CppDirective t9 = parseDirective "#define VERSION_ghc_exactprint \"1.7.0.1\"" @@ -302,6 +313,7 @@ t10 = do , "x = 2" , "#endif" ] + -- x = 1 testIncludes :: Includes testIncludes = @@ -325,6 +337,4 @@ t11 = do , "x = 5" , "#endif" ] - -t12 :: Either String CppDirective -t12 = parseDirective "#define VERSION_ghc_exactprint \"1.7.0.1\"" + -- x = 1 ===================================== utils/check-cpp/ParsePP.hs ===================================== @@ -1,8 +1,10 @@ module ParsePP ( - parseCppParser, - plusTimesExpr, + -- parseCppParser, + -- plusTimesExpr, + cppLex, + parseDirective, -- testing, delete - cppDefinition, + -- cppDefinition, ) where import Data.Char @@ -19,9 +21,12 @@ import qualified Text.Parsec.Expr as E import Text.Parsec.Language (emptyDef) import Text.Parsec.Prim as PS hiding (token) import qualified Text.Parsec.Token as P +import Data.List import qualified Parser import Types +import ParserM (Token(..),init_state) +import Lexer -- ===================================================================== -- First parse to CPP tokens, using a C++-like language spec @@ -52,94 +57,128 @@ exprDef = type CppParser = Parsec String () --- parseDirective :: String -> Either String CppDirective --- parseDirective = Parser.parseDirective - -parseDirectiveOld :: String -> Either Parsec.ParseError CppDirective -parseDirectiveOld = parseCppParser cppDirective - -parseCppParser :: CppParser a -> String -> Either Parsec.ParseError a -parseCppParser p = PS.parse p "" - --- TODO: delete this -cppDefinition :: CppParser (String, [String]) -cppDefinition = do - _ <- PS.char '#' - _ <- whiteSpace - eToken "define" - name <- cppToken - definition <- cppTokens - return (name, definition) - -cppDirective :: CppParser CppDirective -cppDirective = do - _ <- PS.char '#' - _ <- whiteSpace - choice - [ cppKw "define" >> cmdDefinition - , try $ cppKw "include" >> cmdInclude - , try $ cppKw "ifdef" >> cmdIfdef - , try $ cppKw "ifndef" >> cmdIfndef - -- , try $ cppKw "if" >> cmdIf - , try $ cppKw "else" >> return CppElse - , cppKw "endif" >> return CppEndif - -- , cppKw "elif" CppElifKw - -- , cppKw "undef" CppUndefKw - -- , cppKw "error" CppErrorKw - ] - -cmdInclude :: CppParser CppDirective -cmdInclude = do - _ <- string "\"" - filename <- many1 (satisfy (\c -> not (isSpace c || c == '"'))) - _ <- string "\"" - return $ CppInclude filename - -cmdDefinition :: CppParser CppDirective -cmdDefinition = do - name <- cppToken - CppDefine name <$> cppTokens - -cmdIfdef :: CppParser CppDirective -cmdIfdef = CppIfdef <$> cppToken - -cmdIfndef :: CppParser CppDirective -cmdIfndef = CppIfndef <$> cppToken +-- Parse a CPP directive, using tokens from the CPP lexer +parseDirective :: String -> Either String CppDirective +parseDirective s = + case cppLex s of + Left e -> Left e + Right toks -> + case map t_str toks of + ("#":"define":ts) -> cppDefine ts + ("#":"include":ts) -> Right $ cppInclude ts + ("#":"if":ts) -> Right $ cppIf ts + ("#":"ifndef":ts) -> Right $ cppIfndef ts + ("#":"ifdef":ts) -> Right $ cppIfdef ts + ("#":"else":ts) -> Right $ cppElse ts + ("#":"endif":ts) -> Right $ cppEndif ts + other -> Left ("unexpected directive: " ++ (intercalate " " other)) + + +cppDefine [] = Left "error:empty #define directive" +cppDefine (n:ts) = Right $ CppDefine n (intercalate " " ts) + +cppInclude ts = CppInclude (intercalate " " ts) +cppIf ts = CppIf (intercalate " " ts) +cppIfdef ts = CppIfdef (intercalate " " ts) +cppIfndef ts = CppIfndef (intercalate " " ts) +cppElse _ts = CppElse +cppEndif _ts = CppEndif + + +-- --------------------------------------------------------------------- + +cppLex :: String -> Either String [Token] +cppLex s = case lexCppTokenStream s init_state of + Left err -> Left err + Right (_inp, _st, toks) -> Right toks + +-- --------------------------------------------------------------------- + +-- parseDirectiveOld :: String -> Either Parsec.ParseError CppDirective +-- parseDirectiveOld = parseCppParser cppDirective + +-- parseCppParser :: CppParser a -> String -> Either Parsec.ParseError a +-- parseCppParser p = PS.parse p "" + +-- -- TODO: delete this +-- cppDefinition :: CppParser (String, [String]) +-- cppDefinition = do +-- _ <- PS.char '#' +-- _ <- whiteSpace +-- eToken "define" +-- name <- cppToken +-- definition <- cppTokens +-- return (name, definition) + +-- cppDirective :: CppParser CppDirective +-- cppDirective = do +-- _ <- PS.char '#' +-- _ <- whiteSpace +-- choice +-- [ cppKw "define" >> cmdDefinition +-- , try $ cppKw "include" >> cmdInclude +-- , try $ cppKw "ifdef" >> cmdIfdef +-- , try $ cppKw "ifndef" >> cmdIfndef +-- -- , try $ cppKw "if" >> cmdIf +-- , try $ cppKw "else" >> return CppElse +-- , cppKw "endif" >> return CppEndif +-- -- , cppKw "elif" CppElifKw +-- -- , cppKw "undef" CppUndefKw +-- -- , cppKw "error" CppErrorKw +-- ] + +-- cmdInclude :: CppParser CppDirective +-- cmdInclude = do +-- _ <- string "\"" +-- filename <- many1 (satisfy (\c -> not (isSpace c || c == '"'))) +-- _ <- string "\"" +-- return $ CppInclude filename + +-- cmdDefinition :: CppParser CppDirective +-- cmdDefinition = do +-- name <- cppToken +-- CppDefine name <$> cppTokens + +-- cmdIfdef :: CppParser CppDirective +-- cmdIfdef = CppIfdef <$> cppToken + +-- cmdIfndef :: CppParser CppDirective +-- cmdIfndef = CppIfndef <$> cppToken -- cmdIf :: CppParser CppDirective -- cmdIf = CppIf <$> cppTokens -cppKw :: String -> CppParser () -cppKw kw = void $ lexeme (PS.string kw) +-- cppKw :: String -> CppParser () +-- cppKw kw = void $ lexeme (PS.string kw) -cppComment :: CppParser () -cppComment = do - _ <- PS.string "/*" - _ <- PS.manyTill PS.anyChar (PS.try (PS.string "*/")) - return () +-- cppComment :: CppParser () +-- cppComment = do +-- _ <- PS.string "/*" +-- _ <- PS.manyTill PS.anyChar (PS.try (PS.string "*/")) +-- return () -whiteSpace :: CppParser () -whiteSpace = do - _ <- PS.many (PS.choice [cppComment, void PS.space]) - return () +-- whiteSpace :: CppParser () +-- whiteSpace = do +-- _ <- PS.many (PS.choice [cppComment, void PS.space]) +-- return () -lexeme :: CppParser a -> CppParser a -lexeme p = p <* whiteSpace +-- lexeme :: CppParser a -> CppParser a +-- lexeme p = p <* whiteSpace -cppToken :: CppParser String -cppToken = lexeme (PS.many1 (PS.satisfy (not . isSpace))) +-- cppToken :: CppParser String +-- cppToken = lexeme (PS.many1 (PS.satisfy (not . isSpace))) -cppTokens :: CppParser [String] -cppTokens = PS.many cppToken +-- cppTokens :: CppParser [String] +-- cppTokens = PS.many cppToken --- ------------------------------------- +-- -- ------------------------------------- -plusTimesExpr :: CppParser Expr -plusTimesExpr = E.buildExpressionParser eTable eTerm +-- plusTimesExpr :: CppParser Expr +-- plusTimesExpr = E.buildExpressionParser eTable eTerm -eTable :: [[E.Operator String () Data.Functor.Identity.Identity Expr]] -eTable = - [] +-- eTable :: [[E.Operator String () Data.Functor.Identity.Identity Expr]] +-- eTable = +-- [] -- -- Via https://learn.microsoft.com/en-us/cpp/cpp/cpp-built-in-operators-precedence-and-associativity?view=msvc-170 -- [ [E.Infix (Times <$ symbol "*") E.AssocLeft] -- , [E.Infix (Plus <$ symbol "+") E.AssocLeft] @@ -154,17 +193,17 @@ eTable = -- , [E.Infix (BinOp LogicalOr <$ symbol "||") E.AssocLeft] -- ] -eTerm :: CppParser Expr -eTerm = - eVariable -- <|> pteNum - <|> pteParens - <|> eInteger +-- eTerm :: CppParser Expr +-- eTerm = +-- eVariable -- <|> pteNum +-- <|> pteParens +-- <|> eInteger -pteParens :: CppParser Expr -pteParens = Parens <$> between (symbol "(") (symbol ")") plusTimesExpr +-- pteParens :: CppParser Expr +-- pteParens = Parens <$> between (symbol "(") (symbol ")") plusTimesExpr -symbol :: String -> CppParser String -symbol s = lexeme $ string s +-- symbol :: String -> CppParser String +-- symbol s = lexeme $ string s -- -- ------------------------------------- @@ -189,26 +228,26 @@ symbol s = lexeme $ string s -- op <- P.operator (trace "foo" lexer) -- return $ trace ("op=" ++ show op) LogicalOr --- TODO: Do we need this? the expression should be fully expanded by --- the time we get it -eVariable :: CppParser Expr -eVariable = do - v <- P.identifier lexer - return $ Var v +-- -- TODO: Do we need this? the expression should be fully expanded by +-- -- the time we get it +-- eVariable :: CppParser Expr +-- eVariable = do +-- v <- P.identifier lexer +-- return $ Var v -eToken :: String -> CppParser () -eToken = P.reserved lexer +-- eToken :: String -> CppParser () +-- eToken = P.reserved lexer -eInteger :: CppParser Expr -eInteger = IntVal <$> integer +-- eInteger :: CppParser Expr +-- eInteger = IntVal <$> integer -integer :: CppParser Int -integer = read <$> lexeme (many1 digit) +-- integer :: CppParser Int +-- integer = read <$> lexeme (many1 digit) -- --------------------------------------------------------------------- doATest :: String -> Either String CppDirective -doATest str = Parser.parseDirective str +doATest str = parseDirective str -- doATest str = parseDirectiveOld str t0 :: Either String CppDirective @@ -236,4 +275,4 @@ t2 = doATest "# if ((m1) < 1 || (m1) == 1 && (m2) < 7 || (m1) == 1 && (m2) == -- (Comp CmpLtE (Var "m") (IntVal 0))))) t3 :: Either String CppDirective -t3 = Parser.parseDirective "# if FOO == 4" +t3 = parseDirective "# if FOO == 4" ===================================== utils/check-cpp/Parser.hs ===================================== @@ -11,7 +11,7 @@ #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE PartialTypeSignatures #-} #endif -module Parser (parseDirective, parseExpr) where +module Parser (parseExpr) where import Lexer (lex_tok) import ParserM (Token(..), ParserM, run_parser, get_pos, show_pos, @@ -44,30 +44,29 @@ import Control.Monad (ap) data HappyAbsSyn t7 = HappyTerminal (Token) | HappyErrorToken Happy_Prelude.Int - | HappyAbsSyn6 (CppDirective) + | HappyAbsSyn5 (Expr) | HappyAbsSyn7 t7 - | HappyAbsSyn9 ([String]) - | HappyAbsSyn14 (Expr) {-# NOINLINE happyTokenStrings #-} -happyTokenStrings = ["'{'","'}'","'['","']'","'#'","'##'","'('","')'","'<:'","':>'","'<%'","'%>'","'%:'","'%:%:'","';'","':'","'...'","'new'","'delete'","'?'","'::'","'.'","'.*'","'+'","'-'","'*'","'/'","'%'","'^'","'&'","'|'","'~'","'!'","'='","'<'","'>'","'+='","'-='","'*='","'/='","'%='","'^='","'&='","'|='","'<<'","'>>'","'>>='","'<<='","'=='","'!='","'<='","'>='","'&&'","'||'","'++'","'--'","','","'->*'","'->'","'and'","'and_eq'","'bitand'","'bitor'","'compl'","'not'","'not_eq'","'or'","'or_eq'","'xor'","'xor_eq'","lower_name","upper_name","integer","string","other","'define'","'include'","'if'","'ifdef'","'ifndef'","'else'","'endif'","%eof"] +happyTokenStrings = ["'{'","'}'","'['","']'","'#'","'##'","'('","')'","'<:'","':>'","'<%'","'%>'","'%:'","'%:%:'","';'","':'","'...'","'new'","'delete'","'?'","'::'","'.'","'.*'","'+'","'-'","'*'","'/'","'%'","'^'","'&'","'|'","'~'","'!'","'='","'<'","'>'","'+='","'-='","'*='","'/='","'%='","'^='","'&='","'|='","'<<'","'>>'","'>>='","'<<='","'=='","'!='","'<='","'>='","'&&'","'||'","'++'","'--'","','","'->*'","'->'","'and'","'and_eq'","'bitand'","'bitor'","'compl'","'not'","'not_eq'","'or'","'or_eq'","'xor'","'xor_eq'","lower_name","upper_name","integer","string","other","%eof"] happyActOffsets :: HappyAddr -happyActOffsets = HappyA# "\x09\x00\x00\x00\x09\x00\x00\x00\x0d\x00\x00\x00\xcc\xff\xff\xff\xc6\xff\xff\xff\xb7\xff\xff\xff\xc6\xff\xff\xff\xcd\xff\xff\xff\xd0\xff\xff\xff\xd1\xff\xff\xff\xcd\xff\xff\xff\xcd\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfb\xff\xff\xff\x00\x00\x00\x00\xcd\xff\xff\xff\x00\x00\x00\x00\xe2\xff\xff\xff\x15\x00\x00\x00\xf9\xff\xff\xff\xcd\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# +happyActOffsets = HappyA# "\xf9\xff\xff\xff\xe2\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xff\xff\xff\xf9\xff\xff\xff\x00\x00\x00\x00\xfa\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xe6\xff\xff\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# happyGotoOffsets :: HappyAddr -happyGotoOffsets = HappyA# "\x1f\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x1d\x00\x00\x00\x1b\x00\x00\x00\x0c\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x1c\x00\x00\x00\x1e\x00\x00\x00\x21\x00\x00\x00\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# +happyGotoOffsets = HappyA# "\x06\x00\x00\x00\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\x27\x00\x00\x00\x37\x00\x00\x00\x3a\x00\x00\x00\x3d\x00\x00\x00\x44\x00\x00\x00\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# happyDefActions :: HappyAddr -happyDefActions = HappyA# "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\xff\xff\xff\xf7\xff\xff\xff\xed\xff\xff\xff\xfa\xff\xff\xff\xf6\xff\xff\xff\xf5\xff\xff\xff\xee\xff\xff\xff\xfb\xff\xff\xff\xf9\xff\xff\xff\xec\xff\xff\xff\xfc\xff\xff\xff\xef\xff\xff\xff\xf2\xff\xff\xff\xfd\xff\xff\xff\x00\x00\x00\x00\xf4\xff\xff\xff\xf1\xff\xff\xff\x00\x00\x00\x00\xdb\xff\xff\xff\x00\x00\x00\x00\xf0\xff\xff\xff\xf3\xff\xff\xff\xdb\xff\xff\xff\xdb\xff\xff\xff\xdb\xff\xff\xff\xdb\xff\xff\xff\xdb\xff\xff\xff\xdc\xff\xff\xff\xdd\xff\xff\xff\xde\xff\xff\xff\xdf\xff\xff\xff\xe0\xff\xff\xff"# +happyDefActions = HappyA# "\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff\xf4\xff\xff\xff\xf3\xff\xff\xff\xf2\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfd\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfb\xff\xff\xff\xfa\xff\xff\xff\xf7\xff\xff\xff\xf5\xff\xff\xff\xf9\xff\xff\xff\xf8\xff\xff\xff\xf6\xff\xff\xff\xfc\xff\xff\xff"# happyCheck :: HappyAddr -happyCheck = HappyA# "\xff\xff\xff\xff\x08\x00\x00\x00\x09\x00\x00\x00\x08\x00\x00\x00\x4d\x00\x00\x00\x4e\x00\x00\x00\x4f\x00\x00\x00\x50\x00\x00\x00\x51\x00\x00\x00\x52\x00\x00\x00\x53\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x05\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\x03\x00\x00\x00\x48\x00\x00\x00\x49\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x4d\x00\x00\x00\x54\x00\x00\x00\x4b\x00\x00\x00\x3a\x00\x00\x00\x4c\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x07\x00\x00\x00\x0a\x00\x00\x00\x0a\x00\x00\x00\xff\xff\xff\xff\x0a\x00\x00\x00\xff\xff\xff\xff\x0a\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x00\x00\x00\x0a\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x48\x00\x00\x00\x49\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x4c\x00\x00\x00\xff\xff\xff\xff\x4c\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# +happyCheck = HappyA# "\xff\xff\xff\xff\x08\x00\x00\x00\xff\xff\xff\xff\x09\x00\x00\x00\x24\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\x24\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\x24\x00\x00\x00\x25\x00\x00\x00\x32\x00\x00\x00\xff\xff\xff\xff\x34\x00\x00\x00\x35\x00\x00\x00\x36\x00\x00\x00\x37\x00\x00\x00\x32\x00\x00\x00\xff\xff\xff\xff\x34\x00\x00\x00\x35\x00\x00\x00\x36\x00\x00\x00\xff\xff\xff\xff\x24\x00\x00\x00\x25\x00\x00\x00\x34\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x24\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x48\x00\x00\x00\x49\x00\x00\x00\x32\x00\x00\x00\x4d\x00\x00\x00\x34\x00\x00\x00\x35\x00\x00\x00\x36\x00\x00\x00\x37\x00\x00\x00\xff\xff\xff\xff\x32\x00\x00\x00\xff\xff\xff\xff\x34\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\x48\x00\x00\x00\x49\x00\x00\x00\x4a\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# happyTable :: HappyAddr -happyTable = HappyA# "\x00\x00\x00\x00\x23\x00\x00\x00\x24\x00\x00\x00\x1b\x00\x00\x00\x08\x00\x00\x00\x09\x00\x00\x00\x0a\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x0d\x00\x00\x00\x0e\x00\x00\x00\x0e\x00\x00\x00\x1c\x00\x00\x00\x12\x00\x00\x00\x1d\x00\x00\x00\x06\x00\x00\x00\x0f\x00\x00\x00\x13\x00\x00\x00\x1c\x00\x00\x00\x04\x00\x00\x00\x20\x00\x00\x00\x11\x00\x00\x00\x12\x00\x00\x00\x18\x00\x00\x00\x19\x00\x00\x00\x08\x00\x00\x00\xff\xff\xff\xff\x18\x00\x00\x00\x20\x00\x00\x00\x16\x00\x00\x00\x1f\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x16\x00\x00\x00\x14\x00\x00\x00\x21\x00\x00\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x25\x00\x00\x00\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# +happyTable = HappyA# "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x09\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x10\x00\x00\x00\x11\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x17\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x16\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x0d\x00\x00\x00\xff\xff\xff\xff\x0e\x00\x00\x00\x0f\x00\x00\x00\x10\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x15\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x14\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x13\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x09\x00\x00\x00\x12\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# -happyReduceArr = Happy_Data_Array.array (2, 36) [ +happyReduceArr = Happy_Data_Array.array (1, 13) [ + (1 , happyReduce_1), (2 , happyReduce_2), (3 , happyReduce_3), (4 , happyReduce_4), @@ -79,64 +78,49 @@ happyReduceArr = Happy_Data_Array.array (2, 36) [ (10 , happyReduce_10), (11 , happyReduce_11), (12 , happyReduce_12), - (13 , happyReduce_13), - (14 , happyReduce_14), - (15 , happyReduce_15), - (16 , happyReduce_16), - (17 , happyReduce_17), - (18 , happyReduce_18), - (19 , happyReduce_19), - (20 , happyReduce_20), - (21 , happyReduce_21), - (22 , happyReduce_22), - (23 , happyReduce_23), - (24 , happyReduce_24), - (25 , happyReduce_25), - (26 , happyReduce_26), - (27 , happyReduce_27), - (28 , happyReduce_28), - (29 , happyReduce_29), - (30 , happyReduce_30), - (31 , happyReduce_31), - (32 , happyReduce_32), - (33 , happyReduce_33), - (34 , happyReduce_34), - (35 , happyReduce_35), - (36 , happyReduce_36) + (13 , happyReduce_13) ] happyRuleArr :: HappyAddr -happyRuleArr = HappyA# "\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x08\x00\x00\x00\x01\x00\x00\x00\x08\x00\x00\x00\x01\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x08\x00\x00\x00\x03\x00\x00\x00\x09\x00\x00\x00\x01\x00\x00\x00\x0a\x00\x00\x00\x02\x00\x00\x00\x0a\x00\x00\x00\x02\x00\x00\x00\x0a\x00\x00\x00\x02\x00\x00\x00\x0a\x00\x00\x00\x02\x00\x00\x00\x0a\x00\x00\x00\x02\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00"# +happyRuleArr = HappyA# "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00"# happyCatchStates :: [Happy_Prelude.Int] happyCatchStates = [] -happy_n_terms = 85 :: Happy_Prelude.Int -happy_n_nonterms = 11 :: Happy_Prelude.Int +happy_n_terms = 78 :: Happy_Prelude.Int +happy_n_nonterms = 3 :: Happy_Prelude.Int -happy_n_starts = 2 :: Happy_Prelude.Int +happy_n_starts = 1 :: Happy_Prelude.Int + +#if __GLASGOW_HASKELL__ >= 710 +happyReduce_1 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) +#endif +happyReduce_1 = happySpecReduce_1 0# happyReduction_1 +happyReduction_1 (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 + (happy_var_1 + ) +happyReduction_1 _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 happyReduce_2 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_2 = happySpecReduce_3 0# happyReduction_2 -happyReduction_2 (HappyAbsSyn6 happy_var_3) - _ - _ - = HappyAbsSyn6 - (happy_var_3 +happyReduce_2 = happySpecReduce_1 0# happyReduction_2 +happyReduction_2 (HappyTerminal happy_var_1) + = HappyAbsSyn5 + (IntVal (read $ t_str happy_var_1) ) -happyReduction_2 _ _ _ = notHappyAtAll +happyReduction_2 _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 happyReduce_3 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif happyReduce_3 = happySpecReduce_3 0# happyReduction_3 -happyReduction_3 (HappyAbsSyn6 happy_var_3) +happyReduction_3 _ + (HappyAbsSyn5 happy_var_2) _ - _ - = HappyAbsSyn6 - (happy_var_3 + = HappyAbsSyn5 + (happy_var_2 ) happyReduction_3 _ _ _ = notHappyAtAll @@ -144,11 +128,11 @@ happyReduction_3 _ _ _ = notHappyAtAll happyReduce_4 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif happyReduce_4 = happySpecReduce_3 0# happyReduction_4 -happyReduction_4 (HappyAbsSyn6 happy_var_3) +happyReduction_4 (HappyAbsSyn5 happy_var_3) _ - _ - = HappyAbsSyn6 - (happy_var_3 + (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 + (Logic LogicalOr happy_var_1 happy_var_3 ) happyReduction_4 _ _ _ = notHappyAtAll @@ -156,11 +140,11 @@ happyReduction_4 _ _ _ = notHappyAtAll happyReduce_5 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif happyReduce_5 = happySpecReduce_3 0# happyReduction_5 -happyReduction_5 (HappyAbsSyn6 happy_var_3) - _ +happyReduction_5 (HappyAbsSyn5 happy_var_3) _ - = HappyAbsSyn6 - (happy_var_3 + (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 + (Logic LogicalAnd happy_var_1 happy_var_3 ) happyReduction_5 _ _ _ = notHappyAtAll @@ -168,342 +152,94 @@ happyReduction_5 _ _ _ = notHappyAtAll happyReduce_6 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif happyReduce_6 = happySpecReduce_3 0# happyReduction_6 -happyReduction_6 (HappyAbsSyn6 happy_var_3) - _ +happyReduction_6 (HappyAbsSyn5 happy_var_3) _ - = HappyAbsSyn6 - (happy_var_3 + (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 + (Comp CmpEqual happy_var_1 happy_var_3 ) happyReduction_6 _ _ _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 happyReduce_7 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_7 = happySpecReduce_2 0# happyReduction_7 -happyReduction_7 _ - _ - = HappyAbsSyn6 - (CppElse - ) - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_8 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_8 = happySpecReduce_2 0# happyReduction_8 -happyReduction_8 _ - _ - = HappyAbsSyn6 - (CppEndif - ) - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_9 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_9 = happySpecReduce_1 1# happyReduction_9 -happyReduction_9 (HappyTerminal happy_var_1) - = HappyAbsSyn7 - (t_str happy_var_1 - ) -happyReduction_9 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_10 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_10 = happySpecReduce_1 1# happyReduction_10 -happyReduction_10 (HappyTerminal happy_var_1) - = HappyAbsSyn7 - (t_str happy_var_1 - ) -happyReduction_10 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_11 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_11 = happySpecReduce_2 2# happyReduction_11 -happyReduction_11 (HappyTerminal happy_var_2) - (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn6 - (CppDefine happy_var_1 [t_str happy_var_2] - ) -happyReduction_11 _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_12 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_12 = happyReduce 5# 2# happyReduction_12 -happyReduction_12 ((HappyAbsSyn9 happy_var_5) `HappyStk` - (HappyTerminal happy_var_4) `HappyStk` - (HappyAbsSyn9 happy_var_3) `HappyStk` - (HappyTerminal happy_var_2) `HappyStk` - (HappyAbsSyn7 happy_var_1) `HappyStk` - happyRest) - = HappyAbsSyn6 - (CppDefine happy_var_1 (((t_str happy_var_2):happy_var_3) ++ (t_str happy_var_4:(reverse happy_var_5))) - ) `HappyStk` happyRest - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_13 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_13 = happySpecReduce_1 2# happyReduction_13 -happyReduction_13 (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn6 - (CppDefine happy_var_1 [] - ) -happyReduction_13 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_14 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_14 = happySpecReduce_1 3# happyReduction_14 -happyReduction_14 (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn9 - ([happy_var_1] - ) -happyReduction_14 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_15 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_15 = happySpecReduce_3 3# happyReduction_15 -happyReduction_15 (HappyAbsSyn9 happy_var_3) - _ - (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn9 - ((happy_var_1 : "," : happy_var_3) - ) -happyReduction_15 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_16 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_16 = happySpecReduce_1 4# happyReduction_16 -happyReduction_16 (HappyTerminal happy_var_1) - = HappyAbsSyn6 - (CppInclude (t_str happy_var_1) - ) -happyReduction_16 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_17 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_17 = happySpecReduce_1 5# happyReduction_17 -happyReduction_17 (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn6 - (CppIfdef happy_var_1 - ) -happyReduction_17 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_18 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_18 = happySpecReduce_1 6# happyReduction_18 -happyReduction_18 (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn6 - (CppIfndef happy_var_1 - ) -happyReduction_18 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_19 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_19 = happySpecReduce_1 7# happyReduction_19 -happyReduction_19 (HappyTerminal happy_var_1) - = HappyAbsSyn6 - (CppIf (t_str happy_var_1) - ) -happyReduction_19 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_20 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_20 = happySpecReduce_1 8# happyReduction_20 -happyReduction_20 (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 - (happy_var_1 - ) -happyReduction_20 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_21 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_21 = happySpecReduce_1 8# happyReduction_21 -happyReduction_21 (HappyTerminal happy_var_1) - = HappyAbsSyn14 - (IntVal (read $ t_str happy_var_1) - ) -happyReduction_21 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_22 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_22 = happySpecReduce_3 8# happyReduction_22 -happyReduction_22 _ - (HappyAbsSyn14 happy_var_2) - _ - = HappyAbsSyn14 - (happy_var_2 - ) -happyReduction_22 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_23 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_23 = happySpecReduce_3 8# happyReduction_23 -happyReduction_23 (HappyAbsSyn14 happy_var_3) - _ - (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 - (Logic LogicalOr happy_var_1 happy_var_3 - ) -happyReduction_23 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_24 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_24 = happySpecReduce_3 8# happyReduction_24 -happyReduction_24 (HappyAbsSyn14 happy_var_3) - _ - (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 - (Logic LogicalAnd happy_var_1 happy_var_3 - ) -happyReduction_24 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_25 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_25 = happySpecReduce_3 8# happyReduction_25 -happyReduction_25 (HappyAbsSyn14 happy_var_3) +happyReduce_7 = happySpecReduce_3 0# happyReduction_7 +happyReduction_7 (HappyAbsSyn5 happy_var_3) _ - (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 - (Comp CmpEqual happy_var_1 happy_var_3 - ) -happyReduction_25 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_26 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_26 = happySpecReduce_3 8# happyReduction_26 -happyReduction_26 (HappyAbsSyn14 happy_var_3) - _ - (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 + (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 (Comp CmpGt happy_var_1 happy_var_3 ) -happyReduction_26 _ _ _ = notHappyAtAll +happyReduction_7 _ _ _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 -happyReduce_27 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) +happyReduce_8 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_27 = happySpecReduce_3 8# happyReduction_27 -happyReduction_27 (HappyAbsSyn14 happy_var_3) +happyReduce_8 = happySpecReduce_3 0# happyReduction_8 +happyReduction_8 (HappyAbsSyn5 happy_var_3) _ - (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 + (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 (Comp CmpGtE happy_var_1 happy_var_3 ) -happyReduction_27 _ _ _ = notHappyAtAll +happyReduction_8 _ _ _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 -happyReduce_28 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) +happyReduce_9 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_28 = happySpecReduce_3 8# happyReduction_28 -happyReduction_28 (HappyAbsSyn14 happy_var_3) +happyReduce_9 = happySpecReduce_3 0# happyReduction_9 +happyReduction_9 (HappyAbsSyn5 happy_var_3) _ - (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 + (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 (Comp CmpLt happy_var_1 happy_var_3 ) -happyReduction_28 _ _ _ = notHappyAtAll +happyReduction_9 _ _ _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 -happyReduce_29 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) +happyReduce_10 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_29 = happySpecReduce_3 8# happyReduction_29 -happyReduction_29 (HappyAbsSyn14 happy_var_3) +happyReduce_10 = happySpecReduce_3 0# happyReduction_10 +happyReduction_10 (HappyAbsSyn5 happy_var_3) _ - (HappyAbsSyn14 happy_var_1) - = HappyAbsSyn14 + (HappyAbsSyn5 happy_var_1) + = HappyAbsSyn5 (Comp CmpLtE happy_var_1 happy_var_3 ) -happyReduction_29 _ _ _ = notHappyAtAll +happyReduction_10 _ _ _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 -happyReduce_30 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) +happyReduce_11 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_30 = happySpecReduce_1 9# happyReduction_30 -happyReduction_30 (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn14 +happyReduce_11 = happySpecReduce_1 1# happyReduction_11 +happyReduction_11 (HappyAbsSyn7 happy_var_1) + = HappyAbsSyn5 (Var happy_var_1 ) -happyReduction_30 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_31 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_31 = happySpecReduce_2 10# happyReduction_31 -happyReduction_31 (HappyAbsSyn9 happy_var_2) - (HappyTerminal happy_var_1) - = HappyAbsSyn9 - (t_str happy_var_1 : happy_var_2 - ) -happyReduction_31 _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_32 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_32 = happySpecReduce_2 10# happyReduction_32 -happyReduction_32 (HappyAbsSyn9 happy_var_2) - (HappyTerminal happy_var_1) - = HappyAbsSyn9 - (t_str happy_var_1 : happy_var_2 - ) -happyReduction_32 _ _ = notHappyAtAll +happyReduction_11 _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 -happyReduce_33 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_33 = happySpecReduce_2 10# happyReduction_33 -happyReduction_33 (HappyAbsSyn9 happy_var_2) - (HappyTerminal happy_var_1) - = HappyAbsSyn9 - (t_str happy_var_1 : happy_var_2 - ) -happyReduction_33 _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_34 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_34 = happySpecReduce_2 10# happyReduction_34 -happyReduction_34 (HappyAbsSyn9 happy_var_2) - (HappyTerminal happy_var_1) - = HappyAbsSyn9 - (t_str happy_var_1 : happy_var_2 - ) -happyReduction_34 _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_35 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) +happyReduce_12 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_35 = happySpecReduce_2 10# happyReduction_35 -happyReduction_35 (HappyAbsSyn9 happy_var_2) - (HappyTerminal happy_var_1) - = HappyAbsSyn9 - (t_str happy_var_1 : happy_var_2 +happyReduce_12 = happySpecReduce_1 2# happyReduction_12 +happyReduction_12 (HappyTerminal happy_var_1) + = HappyAbsSyn7 + (t_str happy_var_1 ) -happyReduction_35 _ _ = notHappyAtAll +happyReduction_12 _ = notHappyAtAll #if __GLASGOW_HASKELL__ >= 710 -happyReduce_36 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) +happyReduce_13 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) #endif -happyReduce_36 = happySpecReduce_0 10# happyReduction_36 -happyReduction_36 = HappyAbsSyn9 - ([] +happyReduce_13 = happySpecReduce_1 2# happyReduction_13 +happyReduction_13 (HappyTerminal happy_var_1) + = HappyAbsSyn7 + (t_str happy_var_1 ) +happyReduction_13 _ = notHappyAtAll happyTerminalToTok term = case term of { - TEOF "" -> 84#; + TEOF "" -> 77#; TOpenBrace {} -> 2#; TCloseBrace {} -> 3#; TOpenBracket {} -> 4#; @@ -579,13 +315,6 @@ happyTerminalToTok term = case term of { TInteger {} -> 74#; TString {} -> 75#; TOther {} -> 76#; - TDefine {} -> 77#; - TInclude {} -> 78#; - TIf {} -> 79#; - TIfdef {} -> 80#; - TIfndef {} -> 81#; - TElse {} -> 82#; - TEndif {} -> 83#; _ -> -1#; } {-# NOINLINE happyTerminalToTok #-} @@ -595,9 +324,9 @@ happyLex kend kmore = lex_tok (\tk -> case tk of { _ -> kmore (happyTerminalToTok tk) tk }) {-# INLINE happyLex #-} -happyNewToken action sts stk = happyLex (\tk -> happyDoAction 84# tk action sts stk) (\i tk -> happyDoAction i tk action sts stk) +happyNewToken action sts stk = happyLex (\tk -> happyDoAction 77# tk action sts stk) (\i tk -> happyDoAction i tk action sts stk) -happyReport 84# = happyReport' +happyReport 77# = happyReport' happyReport _ = happyReport' @@ -626,20 +355,14 @@ happyReport' = (\tokens expected resume -> happyError) happyAbort :: () => (ParserM a) happyAbort = Happy_Prelude.error "Called abort handler in non-resumptive parser" -directive = happySomeParser where - happySomeParser = happyThen (happyParse 0#) (\x -> case x of {HappyAbsSyn6 z -> happyReturn z; _other -> notHappyAtAll }) - expr = happySomeParser where - happySomeParser = happyThen (happyParse 1#) (\x -> case x of {HappyAbsSyn6 z -> happyReturn z; _other -> notHappyAtAll }) + happySomeParser = happyThen (happyParse 0#) (\x -> case x of {HappyAbsSyn5 z -> happyReturn z; _other -> notHappyAtAll }) happySeq = happyDontSeq -- parseExpr :: String -> Either String Expr parseExpr = run_parser expr - -parseDirective :: String -> Either String CppDirective -parseDirective = run_parser directive #define HAPPY_DEBUG 1 -- $Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp $ ===================================== utils/check-cpp/Parser.y ===================================== @@ -1,5 +1,5 @@ { -module Parser (parseDirective, parseExpr) where +module Parser (parseExpr) where import Lexer (lex_tok) import ParserM (Token(..), ParserM, run_parser, get_pos, show_pos, @@ -9,7 +9,6 @@ import Types import qualified GHC.Internal.Data.Tuple as Happy_Prelude } -%name directive %name expr %expect 0 %tokentype { Token } @@ -95,16 +94,9 @@ import qualified GHC.Internal.Data.Tuple as Happy_Prelude string { TString {} } other { TOther {} } - 'define' { TDefine {} } - 'include' { TInclude {} } - 'if' { TIf {} } - 'ifdef' { TIfdef {} } - 'ifndef' { TIfndef {} } - 'else' { TElse {} } - 'endif' { TEndif {} } - - -- Operator precedence. Earlier in the table is lower +-- Note: this seems to require all the operators to appear in the same +-- rule. %left '||' %left '&&' %left '==' @@ -114,39 +106,6 @@ import qualified GHC.Internal.Data.Tuple as Happy_Prelude %% -directive :: { CppDirective } -directive : '#' 'define' define { $3 } - | '#' 'include' include { $3 } - | '#' 'ifdef' ifdef { $3 } - | '#' 'ifndef' ifndef { $3 } - | '#' 'if' if { $3 } - | '#' 'else' { CppElse } - | '#' 'endif' { CppEndif } - -name : lower_name { t_str $1 } - | upper_name { t_str $1 } - -define :: { CppDirective } -define : name other { CppDefine $1 [t_str $2] } - | name '(' args ')' rest { CppDefine $1 (((t_str $2):$3) ++ (t_str $4:(reverse $5))) } - | name { CppDefine $1 [] } - -args :: { [String] } -args : name { [$1] } - | name ',' args { ($1 : "," : $3) } - -include :: { CppDirective } -include : string { CppInclude (t_str $1) } - -ifdef :: { CppDirective } -ifdef : name { CppIfdef $1 } - -ifndef :: { CppDirective } -ifndef : name { CppIfndef $1 } - -if :: { CppDirective } -if : other { CppIf (t_str $1) } - expr :: { Expr } expr : variable { $1 } | integer { IntVal (read $ t_str $1) } @@ -162,27 +121,10 @@ expr : variable { $1 } variable :: {Expr} variable : name { Var $1 } - --- The lexer has a specific context for processing a #define --- directive, to allow parameters to be parsed, before swallowing the --- balance into an 'other' token with the rest of the string. It stays --- in this context until it sees something that is not one of the --- prefix tokens. --- --- So when getting the rest, accumulate the possible prefix tokens --- explicitly. -rest :: { [String] } -rest : '(' rest { t_str $1 : $2 } - | ')' rest { t_str $1 : $2 } - | lower_name rest { t_str $1 : $2 } - | upper_name rest { t_str $1 : $2 } - | other rest { t_str $1 : $2 } - | {- -} { [] } +name : lower_name { t_str $1 } + | upper_name { t_str $1 } { -- parseExpr :: String -> Either String Expr parseExpr = run_parser expr - -parseDirective :: String -> Either String CppDirective -parseDirective = run_parser directive } ===================================== utils/check-cpp/ParserM.hs ===================================== @@ -165,14 +165,6 @@ data Token | TString {t_str :: String} | TInteger {t_str :: String} | TOther {t_str :: String} - -- Command names - | TDefine {t_str :: String} - | TInclude {t_str :: String} - | TIfdef {t_str :: String} - | TIfndef {t_str :: String} - | TIf {t_str :: String} - | TElse {t_str :: String} - | TEndif {t_str :: String} deriving (Show) -- Actions ===================================== utils/check-cpp/PreProcess.hs ===================================== @@ -17,7 +17,6 @@ import Debug.Trace import Macro import ParsePP -import Parser import Types -- --------------------------------------------------------------------- @@ -241,7 +240,7 @@ ppInclude filename = do -- return $ trace ("ppInclude:filename=[" ++ filename ++ "]") () -ppDefine :: String -> [String] -> PP () +ppDefine :: String -> String -> PP () ppDefine name val = P $ \s -> -- POk s{pp = (pp s){pp_defines = Set.insert (cleanTokenString def) (pp_defines (pp s))}} () POk s{pp = (pp s){pp_defines = Map.insert (trace ("ppDefine:def=[" ++ name ++ "]") (MacroName name Nothing)) val (pp_defines (pp s))}} () @@ -267,13 +266,13 @@ cleanTokenString fs = r ss = dropWhile (\c -> not $ isSpace c) (unpackFS fs) r = init ss -parseDefine :: FastString -> Maybe (String, [String]) -parseDefine fs = r - where - -- r = Just (cleanTokenString s, "") - r = case parseCppParser cppDefinition (unpackFS fs) of - Left _ -> Nothing - Right v -> Just v +-- parseDefine :: FastString -> Maybe (String, [String]) +-- parseDefine fs = r +-- where +-- -- r = Just (cleanTokenString s, "") +-- r = case parseCppParser cppDefinition (unpackFS fs) of +-- Left _ -> Nothing +-- Right v -> Just v -- ===================================================================== ===================================== utils/check-cpp/Types.hs ===================================== @@ -36,7 +36,7 @@ data PpState = PpState data CppDirective = CppInclude String - | CppDefine String [String] + | CppDefine String String | CppIfdef String | CppIfndef String | CppIf String @@ -49,7 +49,7 @@ data CppDirective type MacroArgs = [String] data MacroName = MacroName String (Maybe MacroArgs) deriving (Show, Eq, Ord) -type MacroDef = [String] +type MacroDef = String -- data PpState = PpState -- { pp_defines :: !(Map MacroName MacroDef) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ecec1b0fe0fd71216876cbd1ae8dd86eedc21480 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ecec1b0fe0fd71216876cbd1ae8dd86eedc21480 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 21:10:03 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Mon, 03 Feb 2025 16:10:03 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] CI fixes for 9.10 backports: export tests and perf window. Message-ID: <67a130abc3bd_214bb12c1f5781245de@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: 70bcec29 by Andreas Klebinger at 2025-02-03T22:08:36+01:00 CI fixes for 9.10 backports: export tests and perf window. * Accept windows export changes. (No simd on 9.10) * Accept some slightly metric decreases. ------------------------- Metric Decrease: T15703 T9872d ------------------------- - - - - - 1 changed file: - testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 Changes: ===================================== testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 ===================================== @@ -2633,7 +2633,7 @@ module Data.Tuple.Experimental where type Solo :: * -> * data Solo a = MkSolo a type Solo# :: forall (k :: GHC.Types.RuntimeRep). TYPE k -> TYPE (GHC.Types.TupleRep '[k]) - data Solo# a = MkSolo# a + data Solo# a = ... type Tuple0 :: * type Tuple0 = () type Tuple0# :: GHC.Types.ZeroBitType @@ -4806,37 +4806,13 @@ module GHC.PrimOps where float2Double# :: Float# -> Double# float2Int# :: Float# -> Int# fmaddDouble# :: Double# -> Double# -> Double# -> Double# - fmaddDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fmaddDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fmaddDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fmaddFloat# :: Float# -> Float# -> Float# -> Float# - fmaddFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fmaddFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fmaddFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fmsubDouble# :: Double# -> Double# -> Double# -> Double# - fmsubDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fmsubDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fmsubDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fmsubFloat# :: Float# -> Float# -> Float# -> Float# - fmsubFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fmsubFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fmsubFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fnmaddDouble# :: Double# -> Double# -> Double# -> Double# - fnmaddDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fnmaddDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fnmaddDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fnmaddFloat# :: Float# -> Float# -> Float# -> Float# - fnmaddFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fnmaddFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fnmaddFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fnmsubDouble# :: Double# -> Double# -> Double# -> Double# - fnmsubDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2# - fnmsubDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# -> DoubleX4# - fnmsubDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# -> DoubleX8# fnmsubFloat# :: Float# -> Float# -> Float# -> Float# - fnmsubFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# -> FloatX16# - fnmsubFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4# - fnmsubFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# -> FloatX8# fork# :: forall {q :: RuntimeRep} (a :: TYPE q). (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, ThreadId# #) forkOn# :: forall {q :: RuntimeRep} (a :: TYPE q). Int# -> (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, ThreadId# #) freezeArray# :: forall {l :: Levity} d (a :: TYPE (BoxedRep l)). MutableArray# d a -> Int# -> Int# -> State# d -> (# State# d, Array# a #) @@ -5109,11 +5085,9 @@ module GHC.PrimOps where intToInt64# :: Int# -> Int64# intToInt8# :: Int# -> Int8# isByteArrayPinned# :: ByteArray# -> Int# - isByteArrayWeaklyPinned# :: ByteArray# -> Int# isCurrentThreadBound# :: State# RealWorld -> (# State# RealWorld, Int# #) isEmptyMVar# :: forall {l :: Levity} d (a :: TYPE (BoxedRep l)). MVar# d a -> State# d -> (# State# d, Int# #) isMutableByteArrayPinned# :: forall d. MutableByteArray# d -> Int# - isMutableByteArrayWeaklyPinned# :: forall d. MutableByteArray# d -> Int# isTrue# :: Int# -> Bool keepAlive# :: forall {l :: Levity} {r :: RuntimeRep} (a :: TYPE (BoxedRep l)) d (b :: TYPE r). a -> State# d -> (State# d -> b) -> b killThread# :: forall a. ThreadId# -> a -> State# RealWorld -> State# RealWorld @@ -5153,71 +5127,7 @@ module GHC.PrimOps where makeStablePtr# :: forall {l :: Levity} (a :: TYPE (BoxedRep l)). a -> State# RealWorld -> (# State# RealWorld, StablePtr# a #) maskAsyncExceptions# :: forall {q :: RuntimeRep} (a :: TYPE q). (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, a #) maskUninterruptible# :: forall {q :: RuntimeRep} (a :: TYPE q). (State# RealWorld -> (# State# RealWorld, a #)) -> State# RealWorld -> (# State# RealWorld, a #) - maxDouble# :: Double# -> Double# -> Double# - maxDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# - maxDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# - maxDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# - maxFloat# :: Float# -> Float# -> Float# - maxFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# - maxFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# - maxFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# - maxInt16X16# :: Int16X16# -> Int16X16# -> Int16X16# - maxInt16X32# :: Int16X32# -> Int16X32# -> Int16X32# - maxInt16X8# :: Int16X8# -> Int16X8# -> Int16X8# - maxInt32X16# :: Int32X16# -> Int32X16# -> Int32X16# - maxInt32X4# :: Int32X4# -> Int32X4# -> Int32X4# - maxInt32X8# :: Int32X8# -> Int32X8# -> Int32X8# - maxInt64X2# :: Int64X2# -> Int64X2# -> Int64X2# - maxInt64X4# :: Int64X4# -> Int64X4# -> Int64X4# - maxInt64X8# :: Int64X8# -> Int64X8# -> Int64X8# - maxInt8X16# :: Int8X16# -> Int8X16# -> Int8X16# - maxInt8X32# :: Int8X32# -> Int8X32# -> Int8X32# - maxInt8X64# :: Int8X64# -> Int8X64# -> Int8X64# maxTupleSize :: Int - maxWord16X16# :: Word16X16# -> Word16X16# -> Word16X16# - maxWord16X32# :: Word16X32# -> Word16X32# -> Word16X32# - maxWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# - maxWord32X16# :: Word32X16# -> Word32X16# -> Word32X16# - maxWord32X4# :: Word32X4# -> Word32X4# -> Word32X4# - maxWord32X8# :: Word32X8# -> Word32X8# -> Word32X8# - maxWord64X2# :: Word64X2# -> Word64X2# -> Word64X2# - maxWord64X4# :: Word64X4# -> Word64X4# -> Word64X4# - maxWord64X8# :: Word64X8# -> Word64X8# -> Word64X8# - maxWord8X16# :: Word8X16# -> Word8X16# -> Word8X16# - maxWord8X32# :: Word8X32# -> Word8X32# -> Word8X32# - maxWord8X64# :: Word8X64# -> Word8X64# -> Word8X64# - minDouble# :: Double# -> Double# -> Double# - minDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# - minDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# - minDoubleX8# :: DoubleX8# -> DoubleX8# -> DoubleX8# - minFloat# :: Float# -> Float# -> Float# - minFloatX16# :: FloatX16# -> FloatX16# -> FloatX16# - minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# - minFloatX8# :: FloatX8# -> FloatX8# -> FloatX8# - minInt16X16# :: Int16X16# -> Int16X16# -> Int16X16# - minInt16X32# :: Int16X32# -> Int16X32# -> Int16X32# - minInt16X8# :: Int16X8# -> Int16X8# -> Int16X8# - minInt32X16# :: Int32X16# -> Int32X16# -> Int32X16# - minInt32X4# :: Int32X4# -> Int32X4# -> Int32X4# - minInt32X8# :: Int32X8# -> Int32X8# -> Int32X8# - minInt64X2# :: Int64X2# -> Int64X2# -> Int64X2# - minInt64X4# :: Int64X4# -> Int64X4# -> Int64X4# - minInt64X8# :: Int64X8# -> Int64X8# -> Int64X8# - minInt8X16# :: Int8X16# -> Int8X16# -> Int8X16# - minInt8X32# :: Int8X32# -> Int8X32# -> Int8X32# - minInt8X64# :: Int8X64# -> Int8X64# -> Int8X64# - minWord16X16# :: Word16X16# -> Word16X16# -> Word16X16# - minWord16X32# :: Word16X32# -> Word16X32# -> Word16X32# - minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# - minWord32X16# :: Word32X16# -> Word32X16# -> Word32X16# - minWord32X4# :: Word32X4# -> Word32X4# -> Word32X4# - minWord32X8# :: Word32X8# -> Word32X8# -> Word32X8# - minWord64X2# :: Word64X2# -> Word64X2# -> Word64X2# - minWord64X4# :: Word64X4# -> Word64X4# -> Word64X4# - minWord64X8# :: Word64X8# -> Word64X8# -> Word64X8# - minWord8X16# :: Word8X16# -> Word8X16# -> Word8X16# - minWord8X32# :: Word8X32# -> Word8X32# -> Word8X32# - minWord8X64# :: Word8X64# -> Word8X64# -> Word8X64# minusAddr# :: Addr# -> Addr# -> Int# minusDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# minusDoubleX4# :: DoubleX4# -> DoubleX4# -> DoubleX4# @@ -5734,7 +5644,7 @@ module GHC.PrimOps where sameSmallMutableArray# :: forall {l :: Levity} s (a :: TYPE (BoxedRep l)). SmallMutableArray# s a -> SmallMutableArray# s a -> Int# sameTVar# :: forall {l :: Levity} s (a :: TYPE (BoxedRep l)). TVar# s a -> TVar# s a -> Int# seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b - seq# :: forall a s. a -> State# s -> (# State# s, a #) + seq# :: forall a d. a -> State# d -> (# State# d, a #) setAddrRange# :: Addr# -> Int# -> Int# -> State# RealWorld -> State# RealWorld setByteArray# :: forall d. MutableByteArray# d -> Int# -> Int# -> Int# -> State# d -> State# d setThreadAllocationCounter# :: Int64# -> State# RealWorld -> State# RealWorld @@ -5742,36 +5652,6 @@ module GHC.PrimOps where shiftRL# :: Word# -> Int# -> Word# shrinkMutableByteArray# :: forall d. MutableByteArray# d -> Int# -> State# d -> State# d shrinkSmallMutableArray# :: forall {l :: Levity} d (a :: TYPE (BoxedRep l)). SmallMutableArray# d a -> Int# -> State# d -> State# d - shuffleDoubleX2# :: DoubleX2# -> DoubleX2# -> (# Int#, Int# #) -> DoubleX2# - shuffleDoubleX4# :: DoubleX4# -> DoubleX4# -> (# Int#, Int#, Int#, Int# #) -> DoubleX4# - shuffleDoubleX8# :: DoubleX8# -> DoubleX8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> DoubleX8# - shuffleFloatX16# :: FloatX16# -> FloatX16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> FloatX16# - shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# - shuffleFloatX8# :: FloatX8# -> FloatX8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> FloatX8# - shuffleInt16X16# :: Int16X16# -> Int16X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int16X16# - shuffleInt16X32# :: Int16X32# -> Int16X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int16X32# - shuffleInt16X8# :: Int16X8# -> Int16X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int16X8# - shuffleInt32X16# :: Int32X16# -> Int32X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int32X16# - shuffleInt32X4# :: Int32X4# -> Int32X4# -> (# Int#, Int#, Int#, Int# #) -> Int32X4# - shuffleInt32X8# :: Int32X8# -> Int32X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int32X8# - shuffleInt64X2# :: Int64X2# -> Int64X2# -> (# Int#, Int# #) -> Int64X2# - shuffleInt64X4# :: Int64X4# -> Int64X4# -> (# Int#, Int#, Int#, Int# #) -> Int64X4# - shuffleInt64X8# :: Int64X8# -> Int64X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int64X8# - shuffleInt8X16# :: Int8X16# -> Int8X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int8X16# - shuffleInt8X32# :: Int8X32# -> Int8X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int8X32# - shuffleInt8X64# :: Int8X64# -> Int8X64# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Int8X64# - shuffleWord16X16# :: Word16X16# -> Word16X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word16X16# - shuffleWord16X32# :: Word16X32# -> Word16X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word16X32# - shuffleWord16X8# :: Word16X8# -> Word16X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word16X8# - shuffleWord32X16# :: Word32X16# -> Word32X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word32X16# - shuffleWord32X4# :: Word32X4# -> Word32X4# -> (# Int#, Int#, Int#, Int# #) -> Word32X4# - shuffleWord32X8# :: Word32X8# -> Word32X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word32X8# - shuffleWord64X2# :: Word64X2# -> Word64X2# -> (# Int#, Int# #) -> Word64X2# - shuffleWord64X4# :: Word64X4# -> Word64X4# -> (# Int#, Int#, Int#, Int# #) -> Word64X4# - shuffleWord64X8# :: Word64X8# -> Word64X8# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word64X8# - shuffleWord8X16# :: Word8X16# -> Word8X16# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word8X16# - shuffleWord8X32# :: Word8X32# -> Word8X32# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word8X32# - shuffleWord8X64# :: Word8X64# -> Word8X64# -> (# Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int#, Int# #) -> Word8X64# sinDouble# :: Double# -> Double# sinFloat# :: Float# -> Float# sinhDouble# :: Double# -> Double# @@ -6158,23 +6038,6 @@ module GHC.Profiling.Eras where incrementUserEra :: GHC.Types.Word -> GHC.Types.IO GHC.Types.Word setUserEra :: GHC.Types.Word -> GHC.Types.IO () -module GHC.TypeLits.Experimental where - -- Safety: Safe-Inferred - appendSSymbol :: forall (a :: GHC.Types.Symbol) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SSymbol a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.AppendSymbol a b) - consSSymbol :: forall (a :: GHC.Types.Char) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.ConsSymbol a b) - sCharToSNat :: forall (a :: GHC.Types.Char). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeLits.CharToNat a) - sNatToSChar :: forall (n :: GHC.Num.Natural.Natural). (n GHC.Internal.Data.Type.Ord.<= 1114111) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeLits.SChar (GHC.Internal.TypeLits.NatToChar n) - -module GHC.TypeNats.Experimental where - -- Safety: None - divSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Div n m) - log2SNat :: forall (n :: GHC.Num.Natural.Natural). (1 GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Log2 n) - minusSNat :: forall (m :: GHC.Internal.TypeNats.Nat) (n :: GHC.Internal.TypeNats.Nat). (m GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.- m) - modSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Mod n m) - plusSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.+ m) - powerSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.^ m) - timesSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.* m) - module Prelude.Experimental where -- Safety: Trustworthy type CSolo :: Constraint -> Constraint @@ -10578,7 +10441,6 @@ instance forall a. GHC.Internal.Real.RealFrac a => GHC.Internal.Real.RealFrac (G instance forall a. GHC.Internal.Show.Show a => GHC.Internal.Show.Show (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’ instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.FunPtr a) -- Defined in ‘GHC.Internal.Ptr’ instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’ -instance GHC.Internal.Show.Show GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’ instance GHC.Classes.Eq GHC.Types.Bool -- Defined in ‘GHC.Classes’ instance GHC.Classes.Eq GHC.Types.Char -- Defined in ‘GHC.Classes’ instance GHC.Classes.Eq GHC.Types.Double -- Defined in ‘GHC.Classes’ @@ -10612,7 +10474,6 @@ instance forall a. GHC.Classes.Eq (GHC.Internal.Ptr.FunPtr a) -- Defined in ‘G instance forall a. GHC.Classes.Eq (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’ instance forall a. GHC.Classes.Eq a => GHC.Classes.Eq (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ instance GHC.Classes.Eq GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’ -instance GHC.Classes.Eq GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’ instance GHC.Classes.Ord GHC.Types.Bool -- Defined in ‘GHC.Classes’ instance GHC.Classes.Ord GHC.Types.Char -- Defined in ‘GHC.Classes’ instance GHC.Classes.Ord GHC.Types.Double -- Defined in ‘GHC.Classes’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/70bcec29d2020d64ee36382c750ae1ebdb17847c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/70bcec29d2020d64ee36382c750ae1ebdb17847c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 22:55:34 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Mon, 03 Feb 2025 17:55:34 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] First example working Message-ID: <67a1496690c0c_214bb13cf508c13324a@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: 23754809 by Alan Zimmerman at 2025-02-03T22:54:04+00:00 First example working Loading Example1.hs into ghci, getting the right results ``` {-# LANGUAGE GHC_CPP #-} module Example1 where y = 3 x = "hello" "bye now" foo = putStrLn x ``` - - - - - 19 changed files: - compiler/GHC/Driver/Session.hs - compiler/GHC/Parser.hs-boot - compiler/GHC/Parser.y - compiler/GHC/Parser/HaddockLex.x - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PreProcess.hs - + compiler/GHC/Parser/PreProcess/Eval.hs - + compiler/GHC/Parser/PreProcess/Lexer.x - + compiler/GHC/Parser/PreProcess/Macro.hs - + compiler/GHC/Parser/PreProcess/ParsePP.hs - + compiler/GHC/Parser/PreProcess/Parser.y - + compiler/GHC/Parser/PreProcess/ParserM.hs - + compiler/GHC/Parser/PreProcess/Types.hs - compiler/ghc.cabal.in - hadrian/src/Rules/SourceDist.hs - utils/check-cpp/ParsePP.hs - utils/check-cpp/PreProcess.hs - utils/check-cpp/Types.hs - utils/haddock/haddock-api/src/Haddock/Parser.hs Changes: ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -295,6 +295,7 @@ import Text.ParserCombinators.ReadP as R import qualified GHC.Data.EnumSet as EnumSet import qualified GHC.LanguageExtensions as LangExt +import GHC.Parser.PreProcess (initPpState) -- Note [Updating flag description in the User's Guide] @@ -3168,7 +3169,7 @@ setMainIs arg = parse parse_main_f arg POk _ (L _ re) -> callback re -- dummy parser state. - p_state str = initParserState () + p_state str = initParserState initPpState (mkParserOpts mempty emptyDiagOpts False False False True) (stringToStringBuffer str) (mkRealSrcLoc (mkFastString []) 1 1) ===================================== compiler/GHC/Parser.hs-boot ===================================== @@ -3,5 +3,6 @@ module GHC.Parser where import GHC.Types.Name.Reader (RdrName) import GHC.Parser.Lexer (P) import GHC.Parser.Annotation (LocatedN) +import GHC.Parser.PreProcess (PpState) -parseIdentifier :: P p (LocatedN RdrName) +parseIdentifier :: P PpState (LocatedN RdrName) ===================================== compiler/GHC/Parser.y ===================================== @@ -83,9 +83,10 @@ import GHC.Core.DataCon ( DataCon, dataConName ) import GHC.Parser.PostProcess import GHC.Parser.PostProcess.Haddock --- import GHC.Parser.Lexer hiding (lexer, lexerDbg) -import GHC.Parser.Lexer -import GHC.Parser.PreProcess hiding (lexer, lexerDbg) +import GHC.Parser.Lexer hiding (lexer, lexerDbg) +-- import GHC.Parser.Lexer +-- import GHC.Parser.PreProcess hiding (lexer, lexerDbg) +import GHC.Parser.PreProcess import GHC.Parser.HaddockLex import GHC.Parser.Annotation import GHC.Parser.Errors.Types @@ -775,7 +776,8 @@ TH_QQUASIQUOTE { L _ (ITqQuasiQuote _) } -- '#else' { L _ ITcppElse } -- '#endif' { L _ ITcppEndif } -%monad { P p } { >>= } { return } +-- %monad { P p } { >>= } { return } +%monad { P PpState } { >>= } { return } %lexer { (lexer True) } { L _ ITeof } -- %lexer { (lexerDbg True) } { L _ ITeof } -- Replace 'lexer' above with 'lexerDbg' @@ -4185,7 +4187,7 @@ bars :: { ([EpToken "|"],Int) } -- One or more bars | '|' { ([epTok $1],1) } { -happyError :: P p a +happyError :: P PpState a happyError = srcParseFail getVARID (L _ (ITvarid x)) = x @@ -4290,7 +4292,7 @@ hasE (L _ (ITopenExpQuote HasE _)) = True hasE (L _ (ITopenTExpQuote HasE)) = True hasE _ = False -getSCC :: Located Token -> P p FastString +getSCC :: Located Token -> P PpState FastString getSCC lt = do let s = getSTRING lt -- We probably actually want to be more restrictive than this if ' ' `elem` unpackFS s @@ -4410,7 +4412,7 @@ incorrect. -- Make a source location for the file. We're a bit lazy here and just -- make a point SrcSpan at line 1, column 0. Strictly speaking we should -- try to find the span of the whole file (ToDo). -fileSrcSpan :: P p SrcSpan +fileSrcSpan :: P PpState SrcSpan fileSrcSpan = do l <- getRealSrcLoc; let loc = mkSrcLoc (srcLocFile l) 1 1; @@ -4443,13 +4445,13 @@ hintOrPats pat = do return pat -- Hint about the MultiWayIf extension -hintMultiWayIf :: SrcSpan -> P p () +hintMultiWayIf :: SrcSpan -> P PpState () hintMultiWayIf span = do mwiEnabled <- getBit MultiWayIfBit unless mwiEnabled $ addError $ mkPlainErrorMsgEnvelope span PsErrMultiWayIf -- Hint about explicit-forall -hintExplicitForall :: Located Token -> P p () +hintExplicitForall :: Located Token -> P PpState () hintExplicitForall tok = do explicit_forall_enabled <- getBit ExplicitForallBit in_rule_prag <- getBit InRulePragBit @@ -4458,7 +4460,7 @@ hintExplicitForall tok = do PsErrExplicitForall (isUnicode tok) -- Hint about qualified-do -hintQualifiedDo :: Located Token -> P p () +hintQualifiedDo :: Located Token -> P PpState () hintQualifiedDo tok = do qualifiedDo <- getBit QualifiedDoBit case maybeQDoDoc of @@ -4475,7 +4477,7 @@ hintQualifiedDo tok = do -- When two single quotes don't followed by tyvar or gtycon, we report the -- error as empty character literal, or TH quote that missing proper type -- variable or constructor. See #13450. -reportEmptyDoubleQuotes :: SrcSpan -> P p a +reportEmptyDoubleQuotes :: SrcSpan -> P PpState a reportEmptyDoubleQuotes span = do thQuotes <- getBit ThQuotesBit addFatalError $ mkPlainErrorMsgEnvelope span $ PsErrEmptyDoubleQuotes thQuotes @@ -4530,7 +4532,7 @@ n2l :: LocatedN a -> LocatedA a n2l (L !la !a) = L (l2l la) a -- Called at the very end to pick up the EOF position, as well as any comments not allocated yet. -acsFinal :: (EpAnnComments -> Maybe (RealSrcSpan, RealSrcSpan) -> Located a) -> P p (Located a) +acsFinal :: (EpAnnComments -> Maybe (RealSrcSpan, RealSrcSpan) -> Located a) -> P PpState (Located a) acsFinal a = do let (L l _) = a emptyComments Nothing !cs <- getCommentsFor l @@ -4561,7 +4563,7 @@ amsA' (L l a) = do !cs <- getCommentsFor l return (L (EpAnn (spanAsAnchor l) noAnn cs) a) --- acsExpr :: (EpAnnComments -> LHsExpr GhcPs) -> P p ECP +-- acsExpr :: (EpAnnComments -> LHsExpr GhcPs) -> P PpState ECP -- acsExpr a = do { expr :: (LHsExpr GhcPs) <- runPV $ acsa a -- ; return (ecpFromExp $ expr) } @@ -4588,7 +4590,7 @@ amsr (L l a) an = do -- This and the signature module parser are the only parser entry points that -- deal with Haddock comments. The other entry points ('parseDeclaration', -- 'parseExpression', etc) do not insert them into the AST. -parseModule :: P p (Located (HsModule GhcPs)) +parseModule :: P PpState (Located (HsModule GhcPs)) parseModule = parseModuleNoHaddock >>= addHaddockToModule -- | Parse a Haskell signature module with Haddock comments. This is done in two @@ -4600,7 +4602,7 @@ parseModule = parseModuleNoHaddock >>= addHaddockToModule -- This and the module parser are the only parser entry points that deal with -- Haddock comments. The other entry points ('parseDeclaration', -- 'parseExpression', etc) do not insert them into the AST. -parseSignature :: P p (Located (HsModule GhcPs)) +parseSignature :: P PpState (Located (HsModule GhcPs)) parseSignature = parseSignatureNoHaddock >>= addHaddockToModule commentsA :: (NoAnn ann) => SrcSpan -> EpAnnComments -> EpAnn ann @@ -4614,7 +4616,7 @@ spanWithComments l = do -- | Instead of getting the *enclosed* comments, this includes the -- *preceding* ones. It is used at the top level to get comments -- between top level declarations. -commentsPA :: (NoAnn ann) => LocatedAn ann a -> P p (LocatedAn ann a) +commentsPA :: (NoAnn ann) => LocatedAn ann a -> P PpState (LocatedAn ann a) commentsPA la@(L l a) = do !cs <- getPriorCommentsFor (getLocA la) return (L (addCommentsToEpAnn l cs) a) ===================================== compiler/GHC/Parser/HaddockLex.x ===================================== @@ -10,6 +10,7 @@ import GHC.Hs.Doc import GHC.Parser.Lexer hiding (AlexInput) import GHC.Parser.Lexer.Interface (adjustChar) import GHC.Parser.Annotation +import GHC.Parser.PreProcess.Types (PpState(..), initPpState) import GHC.Types.SrcLoc import GHC.Types.SourceText import GHC.Data.StringBuffer @@ -131,7 +132,7 @@ advanceSrcLocBS !loc bs = case utf8UnconsByteString bs of Just (c, bs') -> advanceSrcLocBS (advanceSrcLoc loc c) bs' -- | Lex 'StringLiteral' for warning messages -lexStringLiteral :: P () (LocatedN RdrName) -- ^ A precise identifier parser +lexStringLiteral :: P PpState (LocatedN RdrName) -- ^ A precise identifier parser -> Located StringLiteral -> Located (WithHsDocIdentifiers StringLiteral GhcPs) lexStringLiteral identParser (L l sl@(StringLiteral _ fs _)) @@ -149,7 +150,7 @@ lexStringLiteral identParser (L l sl@(StringLiteral _ fs _)) fakeLoc = mkRealSrcLoc nilFS 0 0 -- | Lex identifiers from a docstring. -lexHsDoc :: P () (LocatedN RdrName) -- ^ A precise identifier parser +lexHsDoc :: P PpState (LocatedN RdrName) -- ^ A precise identifier parser -> HsDocString -> HsDoc GhcPs lexHsDoc identParser doc = @@ -169,7 +170,7 @@ lexHsDoc identParser doc = fakeLoc = mkRealSrcLoc nilFS 0 0 -validateIdentWith :: P () (LocatedN RdrName) -> SrcSpan -> ByteString -> Maybe (Located RdrName) +validateIdentWith :: P PpState (LocatedN RdrName) -> SrcSpan -> ByteString -> Maybe (Located RdrName) validateIdentWith identParser mloc str0 = let -- These ParserFlags should be as "inclusive" as possible, allowing -- identifiers defined with any language extension. @@ -182,7 +183,7 @@ validateIdentWith identParser mloc str0 = realSrcLc = case mloc of RealSrcSpan loc _ -> realSrcSpanStart loc UnhelpfulSpan _ -> mkRealSrcLoc nilFS 0 0 - pstate = initParserState () pflags buffer realSrcLc + pstate = initParserState initPpState pflags buffer realSrcLc in case unP identParser pstate of POk _ name -> Just $ case mloc of RealSrcSpan _ _ -> reLoc name ===================================== compiler/GHC/Parser/Lexer.x ===================================== @@ -1259,8 +1259,8 @@ cppToken code span buf len _buf2 = -- check if the string ends with backslash and newline -- NOTE: performance likely sucks, make it work for now (len0, continue) <- case (reverse $ unpackFS tokStr) of - -- ('\n':'\\':_) -> pushLexState code >> return (len -2, True) - ('\n':'\\':_) -> pushLexState (trace ("cppToken: push state") code) >> return (len - 2, True) + ('\n':'\\':_) -> pushLexState code >> return (len -2, True) + -- ('\n':'\\':_) -> pushLexState (trace ("cppToken: push state") code) >> return (len - 2, True) ('\n':_) -> return (len - 1, False) _ -> return (len, False) return (L span (ITcpp continue $! lexemeToFastString buf len0)) @@ -1281,8 +1281,8 @@ cppTokenCont code span buf len _buf2 = cppTokenPop :: (FastString -> Token)-> Action p cppTokenPop t span buf len _buf2 = do _ <- popLexState - -- return (L span (t $! lexemeToFastString buf (len - 1))) - return (L span (t $! lexemeToFastString buf (trace "cppTokenPop" len))) + -- return (L span (t $! lexemeToFastString buf (trace "cppTokenPop" len))) + return (L span (t $! lexemeToFastString buf len)) popCpp :: Action p popCpp _span _buf _len _buf2 = ===================================== compiler/GHC/Parser/PreProcess.hs ===================================== @@ -25,6 +25,9 @@ import GHC.Data.StringBuffer import GHC.Parser.Errors.Ppr () import GHC.Parser.Lexer (P (..), PState (..), ParseResult (..), Token (..)) import GHC.Parser.Lexer qualified as Lexer +import GHC.Parser.PreProcess.Macro +import GHC.Parser.PreProcess.ParsePP +import GHC.Parser.PreProcess.Types import GHC.Prelude import GHC.Types.SrcLoc @@ -38,46 +41,6 @@ initPragState = Lexer.initPragState initPpState initParserState :: Lexer.ParserOpts -> StringBuffer -> RealSrcLoc -> PState PpState initParserState = Lexer.initParserState initPpState -initPpState :: PpState -initPpState = - PpState - { pp_defines = Map.empty - , pp_includes = Map.empty - , pp_include_stack = [] - , pp_continuation = [] - , pp_context = [] - , pp_accepting = True - } - -data PpState = PpState - { pp_defines :: !(Map MacroName MacroDef) - , pp_includes :: !(Map String StringBuffer) - , pp_include_stack :: ![Lexer.AlexInput] - , pp_continuation :: ![Located Token] - , pp_context :: ![Token] -- ^ What preprocessor directive we are currently processing - , pp_accepting :: !Bool - } - deriving (Show) - --- --------------------------------------------------------------------- - -data CppDirective - = CppInclude String - | CppDefine String [String] - | CppIfdef String - | CppIfndef String - | CppIf [String] - | CppElse - | CppEndif - deriving (Show, Eq) - --- --------------------------------------------------------------------- - -type MacroArgs = [String] -data MacroName = MacroName String (Maybe MacroArgs) - deriving (Show, Eq, Ord) -type MacroDef = String - -- --------------------------------------------------------------------- data CppState @@ -87,21 +50,8 @@ data CppState -- --------------------------------------------------------------------- -{- -lexer, lexerDbg :: Bool -> (Located Token -> P PpState a) -> P PpState a --- bypass for now, work in ghci -lexer = Lexer.lexer -lexerDbg = Lexer.lexerDbg - -setAccepting :: Bool -> P PpState () -setAccepting on = - P $ \s -> POk s{pp = (pp s){pp_accepting = on}} () - -getAccepting :: P PpState Bool -getAccepting = P $ \s -> POk s (pp_accepting (pp s)) --} - --- --------------------------------------------------------------------- +lexer = ppLexer +lexerDbg = ppLexerDbg ppLexer, ppLexerDbg :: Bool -> (Located Token -> PP a) -> PP a -- Use this instead of 'lexer' in GHC.Parser to dump the tokens for debugging. @@ -113,16 +63,16 @@ ppLexer queueComments cont = queueComments ( \tk -> let - contInner t = (trace ("ppLexer: tk=" ++ show (unLoc tk, unLoc t)) cont) t - -- contPush = pushContext (unLoc tk) >> contIgnoreTok tk + -- contInner t = (trace ("ppLexer: tk=" ++ show (unLoc tk, unLoc t)) cont) t + contInner t = cont t contIgnoreTok (L l tok) = do case l of RealSrcSpan r (Strict.Just b) -> Lexer.queueIgnoredToken (L (PsSpan r b) tok) _ -> return () ppLexer queueComments cont in - -- case tk of - case (trace ("M.ppLexer:tk=" ++ show (unLoc tk)) tk) of + case tk of + -- case (trace ("M.ppLexer:tk=" ++ show (unLoc tk)) tk) of L _ ITeof -> do mInp <- popIncludeLoc case mInp of @@ -173,7 +123,7 @@ processCpp fs = do -- let s = cppInitial fs let s = cppInitial fs case parseDirective s of - Left err -> error $ show err + Left err -> error $ show (err, s) Right (CppInclude filename) -> do ppInclude filename Right (CppDefine name def) -> do @@ -287,26 +237,26 @@ ppInclude filename = do pushIncludeLoc origInput let loc = PsLoc (mkRealSrcLoc (mkFastString filename) 1 1) (BufPos 0) Lexer.setInput (Lexer.AI loc src) - return $ trace ("ppInclude:mSrc=[" ++ show mSrc ++ "]") () + -- return $ trace ("ppInclude:mSrc=[" ++ show mSrc ++ "]") () -- return $ trace ("ppInclude:filename=[" ++ filename ++ "]") () -ppDefine :: String -> [String] -> PP () +ppDefine :: String -> String -> PP () ppDefine name val = P $ \s -> - -- POk s{pp = (pp s){pp_defines = Set.insert (cleanTokenString def) (pp_defines (pp s))}} () - POk s{pp = (pp s){pp_defines = Map.insert (trace ("ppDefine:def=[" ++ name ++ "]") (MacroName name Nothing)) val (pp_defines (pp s))}} () + -- POk s{pp = (pp s){pp_defines = Map.insert (trace ("ppDefine:def=[" ++ name ++ "]") (MacroName name Nothing)) val (pp_defines (pp s))}} () + POk s{pp = (pp s){pp_defines = Map.insert (MacroName name Nothing) val (pp_defines (pp s))}} () ppIsDefined :: String -> PP Bool ppIsDefined def = P $ \s -> - -- POk s (Map.member def (pp_defines (pp s))) - POk s (Map.member (trace ("ppIsDefined:def=[" ++ def ++ "]") (MacroName def Nothing)) (pp_defines (pp s))) + POk s (Map.member (MacroName def Nothing) (pp_defines (pp s))) + -- POk s (Map.member (trace ("ppIsDefined:def=[" ++ def ++ "]") (MacroName def Nothing)) (pp_defines (pp s))) -ppIf :: [String] -> PP Bool -ppIf toks = P $ \s -> +ppIf :: String -> PP Bool +ppIf str = P $ \s -> -- -- POk s (Map.member def (pp_defines (pp s))) -- POk s (Map.member (trace ("ppIsDefined:def=[" ++ def ++ "]") def) (pp_defines (pp s))) let - s' = cppIf (pp s) toks + s' = cppIf (pp s) str in POk s{pp = s'} (pp_accepting s') @@ -317,13 +267,13 @@ cleanTokenString fs = r ss = dropWhile (\c -> not $ isSpace c) (unpackFS fs) r = init ss -parseDefine :: FastString -> Maybe (String, [String]) -parseDefine fs = r - where - -- r = Just (cleanTokenString s, "") - r = case parseCppParser cppDefinition (unpackFS fs) of - Left _ -> Nothing - Right v -> Just v +-- parseDefine :: FastString -> Maybe (String, [String]) +-- parseDefine fs = r +-- where +-- -- r = Just (cleanTokenString s, "") +-- r = case parseCppParser cppDefinition (unpackFS fs) of +-- Left _ -> Nothing +-- Right v -> Just v -- ===================================================================== @@ -331,9 +281,7 @@ parseDefine fs = r See Note [GhcCPP Initial Processing] -} cppInitial :: [FastString] -> String -cppInitial fs = r - where - r = concatMap unpackFS fs +cppInitial fs = concatMap unpackFS fs {- Note [GhcCPP Initial Processing] ===================================== compiler/GHC/Parser/PreProcess/Eval.hs ===================================== @@ -0,0 +1,43 @@ +module GHC.Parser.PreProcess.Eval where + +import GHC.Parser.PreProcess.Types +import GHC.Prelude + +-- --------------------------------------------------------------------- + +eval :: Expr -> Int +eval (Parens e) = eval e +eval (Var v) = error $ "need to look up :" ++ v +eval (IntVal i) = i +eval (Plus e1 e2) = (eval e1) + (eval e2) +eval (Times e1 e2) = (eval e1) * (eval e2) +eval (Logic op e1 e2) = evalLogicOp op (eval e1) (eval e2) +eval (Comp op e1 e2) = evalCompOp op (eval e1) (eval e2) + +evalLogicOp :: LogicOp -> Int -> Int -> Int +evalLogicOp LogicalOr e1 e2 = fromBool $ (toBool e1) || (toBool e2) +evalLogicOp LogicalAnd e1 e2 = fromBool $ (toBool e1) || (toBool e2) + + +evalCompOp :: CompOp -> Int -> Int -> Int +evalCompOp CmpEqual e1 e2 = fromBool $ e1 == e2 +evalCompOp CmpGt e1 e2 = fromBool $ e1 > e2 +evalCompOp CmpGtE e1 e2 = fromBool $ e1 >= e2 +evalCompOp CmpLt e1 e2 = fromBool $ e1 < e2 +evalCompOp CmpLtE e1 e2 = fromBool $ e1 <= e2 + +toBool :: Int -> Bool +toBool 0 = False +toBool _ = True + +fromBool :: Bool -> Int +fromBool False = 0 +fromBool True = 1 + +-- --------------------------------------------------------------------- + +v0 :: Int +v0 = eval (Plus (IntVal 1) (IntVal 3)) + +v1 :: Int +v1 = eval (Comp CmpGt (IntVal 4) (IntVal 3)) ===================================== compiler/GHC/Parser/PreProcess/Lexer.x ===================================== @@ -0,0 +1,132 @@ +{ +module GHC.Parser.PreProcess.Lexer (lex_tok, lexCppTokenStream ) where + +import GHC.Parser.PreProcess.ParserM ( + St, init_pos, + ParserM (..), Action, mkTv, Token(..), start_code, + setStartCode, + show_pos, position, + AlexInput(..), alexGetByte) +import qualified GHC.Parser.PreProcess.ParserM as ParserM (input) +import Control.Monad +import GHC.Prelude + + +-- The lexer is based on +-- https://timsong-cpp.github.io/cppwp/n4140/lex.pptoken +} + +words :- + + <0> $white+ ; +--------------------------------------- + + <0> "{" { mkTv TOpenBrace } + <0> "}" { mkTv TCloseBrace } + <0> "[" { mkTv TOpenBracket } + <0> "]" { mkTv TCloseBracket } + <0> "#" { mkTv THash } + <0> "##" { mkTv THashHash } + <0> "(" { mkTv TOpenParen } + <0> ")" { mkTv TCloseParen } + <0> "<:" { mkTv TLtColon } + <0> ":>" { mkTv TColonGt} + <0> "<%" { mkTv TLtPercent } + <0> "%>" { mkTv TPercentGt } + <0> "%:" { mkTv TPercentColon } + <0> "%:%:" { mkTv TPercentColonTwice } + <0> ";" { mkTv TSemi } + <0> ":" { mkTv TColon } + <0> "..." { mkTv TDotDotDot } + <0> "new" { mkTv TNew } + <0> "delete" { mkTv TDelete } + <0> "?" { mkTv TQuestion } + <0> "::" { mkTv TColonColon} + <0> "." { mkTv TDot } + <0> ".*" { mkTv TDotStar } + <0> "+" { mkTv TPlus } + <0> "-" { mkTv TMinus } + <0> "*" { mkTv TStar } + <0> "/" { mkTv TSlash } + <0> "%" { mkTv TPercent } + <0> "^" { mkTv TUpArrow } + <0> "&" { mkTv TAmpersand } + <0> "|" { mkTv TPipe } + <0> "~" { mkTv TTilde } + <0> "!" { mkTv TExclamation } + <0> "=" { mkTv TEqual } + <0> "<" { mkTv TOpenAngle } + <0> ">" { mkTv TCloseAngle } + <0> "+=" { mkTv TPlusEqual } + <0> "-=" { mkTv TMinusEqual } + <0> "*=" { mkTv TStarEqual } + <0> "/=" { mkTv TSlashEqual } + <0> "%=" { mkTv TPercentEqual } + <0> "^=" { mkTv TUpEqual } + <0> "&=" { mkTv TAmpersandEqual } + <0> "|=" { mkTv TPipeEqual } + <0> "<<" { mkTv TLtLt } + <0> ">>" { mkTv TGtGt } + <0> ">>=" { mkTv TGtGtEqual } + <0> "<<=" { mkTv TLtLtEqual } + <0> "==" { mkTv TEqualEqual } + <0> "!=" { mkTv TExclaimEqual } + <0> "<=" { mkTv TLtEqual } + <0> ">=" { mkTv TGtEqual } + <0> "&&" { mkTv TAmpersandTwice } + <0> "||" { mkTv TPipePipe } + <0> "++" { mkTv TPlusPlus } + <0> "--" { mkTv TMinusMinus } + <0> "," { mkTv TComma } + <0> "->*" { mkTv TMinusGtStar } + <0> "->" { mkTv TMinusGt } + <0> "and" { mkTv TAnd } + <0> "and_eq" { mkTv TAndEq } + <0> "bitand" { mkTv TBitand } + <0> "bitor" { mkTv TBitor } + <0> "compl" { mkTv TCompl } + <0> "not" { mkTv TNot } + <0> "not_eq" { mkTv TNotEq } + <0> "or" { mkTv TOr } + <0> "or_eq" { mkTv TOrEq } + <0> "xor" { mkTv TXor } + <0> "xor_eq" { mkTv TXorEq } +---------------------------------------- + <0> [a-z][a-zA-Z0-9\#_]* { mkTv TLowerName } + <0> [A-Z][a-zA-Z0-9\#_]* { mkTv TUpperName } + <0> \-? [0-9][0-9]* { mkTv TInteger } + <0> \" [^\"]* \" { mkTv (TString . tail . init) } + <0> () { begin other } + + .+ { \i -> do {setStartCode 0; + mkTv TOther i} } + +{ + +begin :: Int -> Action +begin sc _str = + do setStartCode sc + get_tok + +get_tok :: ParserM Token +get_tok = ParserM $ \i st -> + case alexScan i (start_code st) of + AlexEOF -> Right (i, st, TEOF "") + AlexError _ -> Left ("Lexical error at " ++ show_pos (position i)) + AlexSkip i' _ -> case get_tok of + ParserM f -> f i' st + AlexToken i' l a -> case a $ take l $ ParserM.input i of + ParserM f -> f i' st + +lex_tok :: (Token -> ParserM a) -> ParserM a +lex_tok cont = get_tok >>= cont + +lexCppTokenStream :: String -> St -> Either String (AlexInput, St, [Token]) +lexCppTokenStream s = unParserM go (AlexInput init_pos [] s) + where + go = do + ltok <- lex_tok return + case ltok of + TEOF _ -> return [] + _ -> liftM (ltok:) go +} ===================================== compiler/GHC/Parser/PreProcess/Macro.hs ===================================== @@ -0,0 +1,134 @@ +module GHC.Parser.PreProcess.Macro where + +-- From https://gcc.gnu.org/onlinedocs/cpp/Macros.html + +{- + +A macro is a fragment of code which has been given a name. Whenever +the name is used, it is replaced by the contents of the macro. There +are two kinds of macros. They differ mostly in what they look like +when they are used. Object-like macros resemble data objects when +used, function-like macros resemble function calls. + +... the preprocessor operator `defined` can never be defined as a macro + +If the expansion of a macro contains its own name, either directly or +via intermediate macros, it is not expanded again when the expansion +is examined for more macros. See +https://gcc.gnu.org/onlinedocs/cpp/Self-Referential-Macros.html for +details + +-} + +-- TODO: Parse tokens with original locations in them. + +import Data.Map qualified as Map +import Data.Maybe + +import GHC.Parser.PreProcess.Eval +import GHC.Parser.PreProcess.ParsePP +import GHC.Parser.PreProcess.Parser qualified as Parser +import GHC.Parser.PreProcess.ParserM +import GHC.Parser.PreProcess.Types +import GHC.Prelude + +-- --------------------------------------------------------------------- + +process :: PpState -> Input -> (PpState, Output) +process s str = (s0, o) + where + o = case parseDirective str of + Left _ -> undefined + Right r -> r + s0 = case o of + CppDefine name rhs -> define s name rhs + CppInclude _ -> undefined + CppIfdef name -> ifdef s name + CppIf ifstr -> cppIf s ifstr + CppIfndef name -> ifndef s name + CppElse -> undefined + CppEndif -> undefined + +-- --------------------------------------------------------------------- + +define :: PpState -> String -> MacroDef -> PpState +define s name toks = s{pp_defines = Map.insert (MacroName name Nothing) toks (pp_defines s)} + +ifdef :: PpState -> String -> PpState +ifdef s name = + case Map.lookup (MacroName name Nothing) (pp_defines s) of + Just _ -> s{pp_accepting = True} + _ -> s{pp_accepting = False} + +ifndef :: PpState -> String -> PpState +ifndef s name = + case Map.lookup (MacroName name Nothing) (pp_defines s) of + Just _ -> s{pp_accepting = False} + _ -> s{pp_accepting = True} + +cppIf :: PpState -> String -> PpState +cppIf s str = r + where + expanded = expand s str + -- toks0 = cppLex expanded + -- r = error (show toks0) + v = case Parser.parseExpr expanded of + Left err -> error $ show err + Right tree -> eval tree + -- We evaluate to an Int, which we convert to a bool + r = s{pp_accepting = toBool v} + +-- --------------------------------------------------------------------- + +expand :: PpState -> String -> String +expand s str = expanded + where + -- TODO: repeat until re-expand or fixpoint + toks = case cppLex str of + Left err -> error err + Right tks -> tks + expanded = concatMap (expandOne s) toks + +expandOne :: PpState -> Token -> String +expandOne s tok = r + where + -- TODO: protect against looking up `define` + r = + fromMaybe + (t_str tok) + (Map.lookup (MacroName (t_str tok) Nothing) (pp_defines s)) + +-- --------------------------------------------------------------------- + +m0 :: (PpState, Output) +m0 = do + let (s0, _) = process initPpState "#define FOO 3" + let (s1, _) = process s0 "#ifdef FOO" + process s1 "# if FOO == 4" + +-- --------------------------------------------------------------------- + +m1 :: Either String [Token] +m1 = cppLex "`" + +m2 :: Either String [Token] +m2 = cppLex "hello(5)" + +m3 :: Either String [Token] +m3 = cppLex "#define FOO(m1,m2,m) ((m1) < 1 || (m1) == 1 && (m2) < 7 || (m1) == 1 && (m2) == 7 && (m) <= 0)" + +-- Right [THash {t_str = "#"} +-- ,TDefine {t_str = "define"} +-- ,TUpperName {t_str = "FOO"} +-- ,TOpenParen {t_str = "("} +-- ,TLowerName {t_str = "m1"} +-- ,TComma {t_str = ","} +-- ,TLowerName {t_str = "m2"} +-- ,TComma {t_str = ","} +-- ,TLowerName {t_str = "m"} +-- ,TCloseParen {t_str = ")"} +-- ,TOther {t_str = " ((m1) < 1 || (m1) == 1 && (m2) < 7 || (m1) == 1 && (m2) == 7 && (m) <= 0)"} +-- ] + +m4 :: Either String [Token] +m4 = cppLex "#if (m < 1)" ===================================== compiler/GHC/Parser/PreProcess/ParsePP.hs ===================================== @@ -0,0 +1,95 @@ +module GHC.Parser.PreProcess.ParsePP ( + cppLex, + parseDirective, +) where + +import Data.List +import GHC.Parser.Errors.Ppr () + +import GHC.Parser.PreProcess.Lexer +import GHC.Parser.PreProcess.ParserM (Token (..), init_state) +import GHC.Parser.PreProcess.Types +import GHC.Prelude + +-- ===================================================================== +-- First parse to CPP tokens, using a C++-like language spec +-- https://gcc.gnu.org/onlinedocs/cpp/Tokenization.html + +-- Parse a CPP directive, using tokens from the CPP lexer +parseDirective :: String -> Either String CppDirective +parseDirective s = + case cppLex s of + Left e -> Left e + Right toks -> + case map t_str toks of + ("#" : "define" : ts) -> cppDefine ts + ("#" : "include" : ts) -> Right $ cppInclude ts + ("#" : "if" : ts) -> Right $ cppIf ts + ("#" : "ifndef" : ts) -> Right $ cppIfndef ts + ("#" : "ifdef" : ts) -> Right $ cppIfdef ts + ("#" : "else" : ts) -> Right $ cppElse ts + ("#" : "endif" : ts) -> Right $ cppEndif ts + other -> Left ("unexpected directive: " ++ (intercalate " " other)) + +cppDefine :: [String] -> Either String CppDirective +cppDefine [] = Left "error:empty #define directive" +cppDefine (n : ts) = Right $ CppDefine n (intercalate " " ts) + +cppInclude :: [String] -> CppDirective +cppInclude ts = CppInclude (intercalate " " ts) + +cppIf :: [String] -> CppDirective +cppIf ts = CppIf (intercalate " " ts) + +cppIfdef :: [String] -> CppDirective +cppIfdef ts = CppIfdef (intercalate " " ts) + +cppIfndef :: [String] -> CppDirective +cppIfndef ts = CppIfndef (intercalate " " ts) + +cppElse :: [String] -> CppDirective +cppElse _ts = CppElse + +cppEndif :: [String] -> CppDirective +cppEndif _ts = CppEndif + +-- --------------------------------------------------------------------- + +cppLex :: String -> Either String [Token] +cppLex s = case lexCppTokenStream s init_state of + Left err -> Left err + Right (_inp, _st, toks) -> Right toks + +-- --------------------------------------------------------------------- + +doATest :: String -> Either String CppDirective +doATest str = parseDirective str + +-- doATest str = parseDirectiveOld str + +t0 :: Either String CppDirective +t0 = doATest "#define FOO(m1,m2,m) ((m1) < 1 || (m1) == 1 && (m2) < 7 || (m1) == 1 && (m2) == 7 && (m) <= 0)" + +-- Right (CppDefine "FOO(m1,m2,m)" ["((m1)","<","1","||","(m1)","==","1","&&","(m2)","<","7","||","(m1)","==","1","&&","(m2)","==","7","&&","(m)","<=","0)"]) + +t1 :: Either String CppDirective +t1 = doATest "#if (m < 1)" + +t2 :: Either String CppDirective +t2 = doATest "# if ((m1) < 1 || (m1) == 1 && (m2) < 7 || (m1) == 1 && (m2) == 7 && (m) <= 0)" + +-- Right (CppIf +-- (Logic LogicalOr +-- (Logic LogicalOr +-- (Comp CmpLt (Var "m1") (IntVal 1)) +-- (Logic LogicalAnd +-- (Comp CmpEqual (Var "m1") (IntVal 1)) +-- (Comp CmpLt (Var "m2") (IntVal 7)))) +-- (Logic LogicalAnd +-- (Logic LogicalAnd +-- (Comp CmpEqual (Var "m1") (IntVal 1)) +-- (Comp CmpEqual (Var "m2") (IntVal 7))) +-- (Comp CmpLtE (Var "m") (IntVal 0))))) + +t3 :: Either String CppDirective +t3 = parseDirective "# if FOO == 4" ===================================== compiler/GHC/Parser/PreProcess/Parser.y ===================================== @@ -0,0 +1,131 @@ +{ +module GHC.Parser.PreProcess.Parser (parseExpr) where + +import GHC.Parser.PreProcess.Lexer (lex_tok) +import GHC.Parser.PreProcess.ParserM (Token(..), ParserM, run_parser, get_pos, show_pos, + happyError) +import GHC.Parser.PreProcess.Types +import GHC.Prelude +-- Needed when invoking happy -ad +-- import qualified GHC.Internal.Data.Tuple as Happy_Prelude +} + +%name expr +%expect 0 +%tokentype { Token } +%monad { ParserM } +%lexer { lex_tok } { TEOF "" } + +%token + + '{' { TOpenBrace {} } + '}' { TCloseBrace {} } + '[' { TOpenBracket {} } + ']' { TCloseBracket {} } + '#' { THash {} } + '##' { THashHash {} } + '(' { TOpenParen {} } + ')' { TCloseParen {} } + '<:' { TLtColon {} } + ':>' { TColonGt{} } + '<%' { TLtPercent {} } + '%>' { TPercentGt {} } + '%:' { TPercentColon {} } + '%:%:' { TPercentColonTwice {} } + ';' { TSemi {} } + ':' { TColon {} } + '...' { TDotDotDot {} } + 'new' { TNew {} } + 'delete' { TDelete {} } + '?' { TQuestion {} } + '::' { TColonColon{} } + '.' { TDot {} } + '.*' { TDotStar {} } + '+' { TPlus {} } + '-' { TMinus {} } + '*' { TStar {} } + '/' { TSlash {} } + '%' { TPercent {} } + '^' { TUpArrow {} } + '&' { TAmpersand {} } + '|' { TPipe {} } + '~' { TTilde {} } + '!' { TExclamation {} } + '=' { TEqual {} } + '<' { TOpenAngle {} } + '>' { TCloseAngle {} } + '+=' { TPlusEqual {} } + '-=' { TMinusEqual {} } + '*=' { TStarEqual {} } + '/=' { TSlashEqual {} } + '%=' { TPercentEqual {} } + '^=' { TUpEqual {} } + '&=' { TAmpersandEqual {} } + '|=' { TPipeEqual {} } + '<<' { TLtLt {} } + '>>' { TGtGt {} } + '>>=' { TGtGtEqual {} } + '<<=' { TLtLtEqual {} } + '==' { TEqualEqual {} } + '!=' { TExclaimEqual {} } + '<=' { TLtEqual {} } + '>=' { TGtEqual {} } + '&&' { TAmpersandTwice {} } + '||' { TPipePipe {} } + '++' { TPlusPlus {} } + '--' { TMinusMinus {} } + ',' { TComma {} } + '->*' { TMinusGtStar {} } + '->' { TMinusGt {} } + 'and' { TAnd {} } + 'and_eq' { TAndEq {} } + 'bitand' { TBitand {} } + 'bitor' { TBitor {} } + 'compl' { TCompl {} } + 'not' { TNot {} } + 'not_eq' { TNotEq {} } + 'or' { TOr {} } + 'or_eq' { TOrEq {} } + 'xor' { TXor {} } + 'xor_eq' { TXorEq {} } + + lower_name { TLowerName {} } + upper_name { TUpperName {} } + integer { TInteger {} } + string { TString {} } + other { TOther {} } + +-- Operator precedence. Earlier in the table is lower +-- Note: this seems to require all the operators to appear in the same +-- rule. +%left '||' +%left '&&' +%left '==' +%left '>' '>=' '<' '<=' +%left '+' '-' +%left '*' '/' + +%% + +expr :: { Expr } +expr : variable { $1 } + | integer { IntVal (read $ t_str $1) } + | '(' expr ')' { $2 } + | expr '||' expr { Logic LogicalOr $1 $3 } + | expr '&&' expr { Logic LogicalAnd $1 $3 } + | expr '==' expr { Comp CmpEqual $1 $3 } + | expr '>' expr { Comp CmpGt $1 $3 } + | expr '>=' expr { Comp CmpGtE $1 $3 } + | expr '<' expr { Comp CmpLt $1 $3 } + | expr '<=' expr { Comp CmpLtE $1 $3 } + +variable :: {Expr} +variable : name { Var $1 } + +name : lower_name { t_str $1 } + | upper_name { t_str $1 } + +{ +-- parseExpr :: String -> Either String Expr +parseExpr = run_parser expr +} ===================================== compiler/GHC/Parser/PreProcess/ParserM.hs ===================================== @@ -0,0 +1,256 @@ +{-# LANGUAGE BinaryLiterals #-} + +-- Support functions for the CPP Lexer.x + +module GHC.Parser.PreProcess.ParserM ( + -- Parser Monad + ParserM (..), + AlexInput (..), + run_parser, + -- Parser state + St, + init_state, + StartCode, + start_code, + setStartCode, + -- Tokens + Token (..), + -- Actions + Action, + andBegin, + mkT, + mkTv, + -- Positions + init_pos, + get_pos, + show_pos, + -- Input + alexGetByte, + alexInputPrevChar, + -- Other + happyError, +) where + +import Control.Applicative + +import Control.Monad.Fail (MonadFail (..)) +import Prelude hiding (fail) + +import Control.Monad (ap, liftM) +import Data.Bits (shiftR, (.&.), (.|.)) +import Data.Char (ord) +import Data.Word (Word8) + +-- Parser Monad +newtype ParserM a = ParserM {unParserM :: AlexInput -> St -> Either String (AlexInput, St, a)} + +-- newtype P a = P { unP :: PState -> ParseResult a } + +instance Functor ParserM where + fmap = liftM + +instance Applicative ParserM where + pure a = ParserM $ \i s -> Right (i, s, a) + (<*>) = ap + +instance Monad ParserM where + ParserM m >>= k = ParserM $ \i s -> case m i s of + Right (i', s', x) -> + case k x of + ParserM y -> y i' s' + Left err -> + Left err + +instance MonadFail ParserM where + fail err = ParserM $ \_ _ -> Left err + +run_parser :: ParserM a -> (String -> Either String a) +run_parser (ParserM f) = + \s -> case f (AlexInput init_pos [] s) init_state of + Left es -> Left es + Right (_, _, x) -> Right x + +-- Parser state + +data St = St + { start_code :: !StartCode + , brace_depth :: !Int + } + deriving (Show) +type StartCode = Int + +init_state :: St +init_state = + St + { start_code = 0 + , brace_depth = 0 + } + +-- Tokens + +data Token + = TEOF {t_str :: String} + | TOpenBrace {t_str :: String} + | TCloseBrace {t_str :: String} + | TOpenBracket {t_str :: String} + | TCloseBracket {t_str :: String} + | THash {t_str :: String} + | THashHash {t_str :: String} + | TOpenParen {t_str :: String} + | TCloseParen {t_str :: String} + | TLtColon {t_str :: String} + | TColonGt {t_str :: String} + | TLtPercent {t_str :: String} + | TPercentGt {t_str :: String} + | TPercentColon {t_str :: String} + | TPercentColonTwice {t_str :: String} + | TSemi {t_str :: String} + | TColon {t_str :: String} + | TDotDotDot {t_str :: String} + | TNew {t_str :: String} + | TDelete {t_str :: String} + | TQuestion {t_str :: String} + | TColonColon {t_str :: String} + | TDot {t_str :: String} + | TDotStar {t_str :: String} + | TPlus {t_str :: String} + | TMinus {t_str :: String} + | TStar {t_str :: String} + | TSlash {t_str :: String} + | TPercent {t_str :: String} + | TUpArrow {t_str :: String} + | TAmpersand {t_str :: String} + | TPipe {t_str :: String} + | TTilde {t_str :: String} + | TExclamation {t_str :: String} + | TEqual {t_str :: String} + | TOpenAngle {t_str :: String} + | TCloseAngle {t_str :: String} + | TPlusEqual {t_str :: String} + | TMinusEqual {t_str :: String} + | TStarEqual {t_str :: String} + | TSlashEqual {t_str :: String} + | TPercentEqual {t_str :: String} + | TUpEqual {t_str :: String} + | TAmpersandEqual {t_str :: String} + | TPipeEqual {t_str :: String} + | TLtLt {t_str :: String} + | TGtGt {t_str :: String} + | TGtGtEqual {t_str :: String} + | TLtLtEqual {t_str :: String} + | TEqualEqual {t_str :: String} + | TExclaimEqual {t_str :: String} + | TLtEqual {t_str :: String} + | TGtEqual {t_str :: String} + | TAmpersandTwice {t_str :: String} + | TPipePipe {t_str :: String} + | TPlusPlus {t_str :: String} + | TMinusMinus {t_str :: String} + | TComma {t_str :: String} + | TMinusGtStar {t_str :: String} + | TMinusGt {t_str :: String} + | TAnd {t_str :: String} + | TAndEq {t_str :: String} + | TBitand {t_str :: String} + | TBitor {t_str :: String} + | TCompl {t_str :: String} + | TNot {t_str :: String} + | TNotEq {t_str :: String} + | TOr {t_str :: String} + | TOrEq {t_str :: String} + | TXor {t_str :: String} + | TXorEq {t_str :: String} + | TLowerName {t_str :: String} + | TUpperName {t_str :: String} + | TString {t_str :: String} + | TInteger {t_str :: String} + | TOther {t_str :: String} + deriving (Show) + +-- Actions + +type Action = String -> ParserM Token + +setStartCode :: StartCode -> ParserM () +setStartCode sc = ParserM $ \i st -> Right (i, st{start_code = sc}, ()) + +andBegin :: Action -> StartCode -> Action +(act `andBegin` sc) x = do + setStartCode sc + act x + +mkT :: Token -> Action +mkT t = mkTv (const t) + +mkTv :: (String -> Token) -> Action +mkTv f str = ParserM (\i st -> Right (i, st, f str)) + +-- begin :: Int -> Action +-- begin sc _span _buf _len _buf2 = +-- do setStartCode sc +-- lex_tok + +-- Positions + +data Pos = Pos !Int {- Line -} !Int {- Column -} + deriving (Show) + +get_pos :: ParserM Pos +get_pos = ParserM $ \i@(AlexInput p _ _) st -> Right (i, st, p) + +alexMove :: Pos -> Char -> Pos +alexMove (Pos l _) '\n' = Pos (l + 1) 1 +alexMove (Pos l c) '\t' = Pos l ((c + 8) `div` 8 * 8) +alexMove (Pos l c) _ = Pos l (c + 1) + +init_pos :: Pos +init_pos = Pos 1 0 + +show_pos :: Pos -> String +show_pos (Pos l c) = "line " ++ show l ++ ", column " ++ show c + +-- Input + +data AlexInput = AlexInput + { position :: !Pos + , char_bytes :: [Word8] + , input :: String + } + deriving (Show) + +alexGetByte :: AlexInput -> Maybe (Word8, AlexInput) +alexGetByte (AlexInput p (w : ws) cs) = + Just (w, AlexInput p ws cs) +alexGetByte (AlexInput p [] (c : cs)) = + alexGetByte (AlexInput (alexMove p c) (utf8_encode c) cs) +alexGetByte (AlexInput _ [] []) = + Nothing + +-- annoyingly, this doesn't seem to exist anywhere else as a standalone function +utf8_encode :: Char -> [Word8] +utf8_encode c = case ord c of + n + | n < 0x80 -> [fromIntegral n] + | n < 0x800 -> + [ fromIntegral $ 0b11000000 .|. (n `shiftR` 6) + , fromIntegral $ 0b10000000 .|. (n .&. 0b111111) + ] + | n < 0x10000 -> + [ fromIntegral $ 0b11100000 .|. (n `shiftR` 12) + , fromIntegral $ 0b10000000 .|. ((n `shiftR` 6) .&. 0b111111) + , fromIntegral $ 0b10000000 .|. (n .&. 0b111111) + ] + | otherwise -> + [ fromIntegral $ 0b11110000 .|. (n `shiftR` 18) + , fromIntegral $ 0b10000000 .|. ((n `shiftR` 12) .&. 0b111111) + , fromIntegral $ 0b10000000 .|. ((n `shiftR` 6) .&. 0b111111) + , fromIntegral $ 0b10000000 .|. (n .&. 0b111111) + ] + +alexInputPrevChar :: AlexInput -> Char +alexInputPrevChar _ = error "Lexer doesn't implement alexInputPrevChar" + +happyError :: ParserM a +happyError = do + p <- get_pos + fail $ "Parse error at " ++ show_pos p ===================================== compiler/GHC/Parser/PreProcess/Types.hs ===================================== @@ -0,0 +1,85 @@ +module GHC.Parser.PreProcess.Types where + +import GHC.Data.StringBuffer +import GHC.Parser.Lexer (Token (..)) +import qualified GHC.Parser.Lexer as Lexer +import GHC.Types.SrcLoc + +import Data.Map (Map) +import qualified Data.Map as Map +import GHC.Prelude + +-- --------------------------------------------------------------------- + +initPpState :: PpState +initPpState = + PpState + { pp_defines = Map.empty + , pp_includes = Map.empty + , pp_include_stack = [] + , pp_continuation = [] + , pp_context = [] + , pp_accepting = True + } + +data PpState = PpState + { pp_defines :: !(Map MacroName MacroDef) + , pp_includes :: !(Map String StringBuffer) + , pp_include_stack :: ![Lexer.AlexInput] + , pp_continuation :: ![Located Token] + , pp_context :: ![Token] + -- ^ What preprocessor directive we are currently processing + , pp_accepting :: !Bool + } + deriving (Show) + +-- --------------------------------------------------------------------- + +data CppDirective + = CppInclude String + | CppDefine String String + | CppIfdef String + | CppIfndef String + | CppIf String + | CppElse + | CppEndif + deriving (Show, Eq) + +-- --------------------------------------------------------------------- + +type MacroArgs = [String] +data MacroName = MacroName String (Maybe MacroArgs) + deriving (Show, Eq, Ord) +type MacroDef = String + +type Input = String +type Output = CppDirective + +-- --------------------------------------------------------------------- +-- Expression language +-- NOTE: need to take care of macro expansion while parsing. Or perhaps before? + +data Expr + = Parens Expr + | Var String + | IntVal Int + | Plus Expr Expr + | Times Expr Expr + | Logic LogicOp Expr Expr + | Comp CompOp Expr Expr + deriving (Show, Eq) + +data LogicOp + = LogicalOr + | LogicalAnd + deriving (Show, Eq) + +data CompOp + = CmpEqual + | CmpGt + | CmpGtE + | CmpLt + | CmpLtE + deriving (Show, Eq) + +-- --------------------------------------------------------------------- ===================================== compiler/ghc.cabal.in ===================================== @@ -649,9 +649,16 @@ Library GHC.Parser.Lexer.Interface GHC.Parser.Lexer.String GHC.Parser.HaddockLex - GHC.Parser.PreProcess GHC.Parser.PostProcess GHC.Parser.PostProcess.Haddock + GHC.Parser.PreProcess + GHC.Parser.PreProcess.Eval + GHC.Parser.PreProcess.Lexer + GHC.Parser.PreProcess.Macro + GHC.Parser.PreProcess.ParsePP + GHC.Parser.PreProcess.ParserM + GHC.Parser.PreProcess.Parser + GHC.Parser.PreProcess.Types GHC.Parser.String GHC.Parser.Types GHC.Parser.Utils ===================================== hadrian/src/Rules/SourceDist.hs ===================================== @@ -187,6 +187,8 @@ prepareTree dest = do , (stage0InTree , compiler, "GHC/Parser/Lexer.x", "GHC/Parser/Lexer.hs") , (stage0InTree , compiler, "GHC/Parser/Lexer/String.x", "GHC/Parser/Lexer/String.hs") , (stage0InTree , compiler, "GHC/Parser/HaddockLex.x", "GHC/Parser/HaddockLex.hs") + , (stage0InTree , compiler, "GHC/Parser/PreProcess/Parser.y", "GHC/Parser/PreProcess/Parser.hs") + , (stage0InTree , compiler, "GHC/Parser/PreProcess/Lexer.x", "GHC/Parser/PreProcess/Lexer.hs") , (stage0InTree , hpcBin, "src/Trace/Hpc/Parser.y", "src/Trace/Hpc/Parser.hs") , (stage0InTree , genprimopcode, "Parser.y", "Parser.hs") , (stage0InTree , genprimopcode, "Lexer.x", "Lexer.hs") ===================================== utils/check-cpp/ParsePP.hs ===================================== @@ -1,10 +1,6 @@ module ParsePP ( - -- parseCppParser, - -- plusTimesExpr, cppLex, parseDirective, - -- testing, delete - -- cppDefinition, ) where import Data.Char @@ -13,14 +9,6 @@ import Control.Monad (void) import Data.Functor.Identity import Debug.Trace import GHC.Parser.Errors.Ppr () -import Text.Parsec -import qualified Text.Parsec as Parsec -import Text.Parsec.Char as PS -import Text.Parsec.Combinator as PS -import qualified Text.Parsec.Expr as E -import Text.Parsec.Language (emptyDef) -import Text.Parsec.Prim as PS hiding (token) -import qualified Text.Parsec.Token as P import Data.List import qualified Parser @@ -32,31 +20,6 @@ import Lexer -- First parse to CPP tokens, using a C++-like language spec -- https://gcc.gnu.org/onlinedocs/cpp/Tokenization.html -lexer :: P.TokenParser () -lexer = P.makeTokenParser exprDef - -exprDef :: P.LanguageDef st -exprDef = - emptyDef - { P.commentStart = "/*" - , P.commentEnd = "*/" - , P.commentLine = "//" - , P.nestedComments = False - , P.identStart = letter <|> char '_' - , P.identLetter = alphaNum <|> oneOf "_'" - , P.opStart = P.opLetter exprDef - , P.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~" - , P.reservedOpNames = [] - , P.reservedNames = [] - , P.caseSensitive = True - } - --- ===================================================================== --- --------------------------------------------------------------------- - -type CppParser = Parsec String () - - -- Parse a CPP directive, using tokens from the CPP lexer parseDirective :: String -> Either String CppDirective parseDirective s = @@ -94,158 +57,6 @@ cppLex s = case lexCppTokenStream s init_state of -- --------------------------------------------------------------------- --- parseDirectiveOld :: String -> Either Parsec.ParseError CppDirective --- parseDirectiveOld = parseCppParser cppDirective - --- parseCppParser :: CppParser a -> String -> Either Parsec.ParseError a --- parseCppParser p = PS.parse p "" - --- -- TODO: delete this --- cppDefinition :: CppParser (String, [String]) --- cppDefinition = do --- _ <- PS.char '#' --- _ <- whiteSpace --- eToken "define" --- name <- cppToken --- definition <- cppTokens --- return (name, definition) - --- cppDirective :: CppParser CppDirective --- cppDirective = do --- _ <- PS.char '#' --- _ <- whiteSpace --- choice --- [ cppKw "define" >> cmdDefinition --- , try $ cppKw "include" >> cmdInclude --- , try $ cppKw "ifdef" >> cmdIfdef --- , try $ cppKw "ifndef" >> cmdIfndef --- -- , try $ cppKw "if" >> cmdIf --- , try $ cppKw "else" >> return CppElse --- , cppKw "endif" >> return CppEndif --- -- , cppKw "elif" CppElifKw --- -- , cppKw "undef" CppUndefKw --- -- , cppKw "error" CppErrorKw --- ] - --- cmdInclude :: CppParser CppDirective --- cmdInclude = do --- _ <- string "\"" --- filename <- many1 (satisfy (\c -> not (isSpace c || c == '"'))) --- _ <- string "\"" --- return $ CppInclude filename - --- cmdDefinition :: CppParser CppDirective --- cmdDefinition = do --- name <- cppToken --- CppDefine name <$> cppTokens - --- cmdIfdef :: CppParser CppDirective --- cmdIfdef = CppIfdef <$> cppToken - --- cmdIfndef :: CppParser CppDirective --- cmdIfndef = CppIfndef <$> cppToken - --- cmdIf :: CppParser CppDirective --- cmdIf = CppIf <$> cppTokens - --- cppKw :: String -> CppParser () --- cppKw kw = void $ lexeme (PS.string kw) - --- cppComment :: CppParser () --- cppComment = do --- _ <- PS.string "/*" --- _ <- PS.manyTill PS.anyChar (PS.try (PS.string "*/")) --- return () - --- whiteSpace :: CppParser () --- whiteSpace = do --- _ <- PS.many (PS.choice [cppComment, void PS.space]) --- return () - --- lexeme :: CppParser a -> CppParser a --- lexeme p = p <* whiteSpace - --- cppToken :: CppParser String --- cppToken = lexeme (PS.many1 (PS.satisfy (not . isSpace))) - --- cppTokens :: CppParser [String] --- cppTokens = PS.many cppToken - --- -- ------------------------------------- - --- plusTimesExpr :: CppParser Expr --- plusTimesExpr = E.buildExpressionParser eTable eTerm - --- eTable :: [[E.Operator String () Data.Functor.Identity.Identity Expr]] --- eTable = --- [] - -- -- Via https://learn.microsoft.com/en-us/cpp/cpp/cpp-built-in-operators-precedence-and-associativity?view=msvc-170 - -- [ [E.Infix (Times <$ symbol "*") E.AssocLeft] - -- , [E.Infix (Plus <$ symbol "+") E.AssocLeft] - -- , - -- [ E.Infix (try $ BinOp CmpLtE <$ symbol "<=") E.AssocLeft - -- , E.Infix (try $ BinOp CmpGtE <$ symbol ">=") E.AssocLeft - -- , E.Infix (BinOp CmpLt <$ symbol "<") E.AssocLeft - -- , E.Infix (BinOp CmpGt <$ symbol ">") E.AssocLeft - -- ] - -- , [E.Infix (BinOp CmpEqual <$ symbol "==") E.AssocLeft] - -- , [E.Infix (BinOp LogicalAnd <$ symbol "&&") E.AssocLeft] - -- , [E.Infix (BinOp LogicalOr <$ symbol "||") E.AssocLeft] - -- ] - --- eTerm :: CppParser Expr --- eTerm = --- eVariable -- <|> pteNum --- <|> pteParens --- <|> eInteger - --- pteParens :: CppParser Expr --- pteParens = Parens <$> between (symbol "(") (symbol ")") plusTimesExpr - --- symbol :: String -> CppParser String --- symbol s = lexeme $ string s - --- -- ------------------------------------- - --- eExpr :: CppParser Expr --- eExpr = choice [eParens, eBinOp, eVariable] - --- eParens :: CppParser Expr --- eParens = P.parens lexer $ do --- Parens <$> eExpr - --- eBinOp :: CppParser Expr --- eBinOp = do --- e1 <- eExpr --- op <- eOp --- -- _ <- cppToken --- -- let op = Or --- BinOp op e1 <$> eExpr - --- eOp :: CppParser Op --- eOp = do --- -- op <- P.operator lexer --- op <- P.operator (trace "foo" lexer) --- return $ trace ("op=" ++ show op) LogicalOr - --- -- TODO: Do we need this? the expression should be fully expanded by --- -- the time we get it --- eVariable :: CppParser Expr --- eVariable = do --- v <- P.identifier lexer --- return $ Var v - --- eToken :: String -> CppParser () --- eToken = P.reserved lexer - --- eInteger :: CppParser Expr --- eInteger = IntVal <$> integer - --- integer :: CppParser Int --- integer = read <$> lexeme (many1 digit) - --- --------------------------------------------------------------------- - doATest :: String -> Either String CppDirective doATest str = parseDirective str -- doATest str = parseDirectiveOld str ===================================== utils/check-cpp/PreProcess.hs ===================================== @@ -21,7 +21,6 @@ import Types -- --------------------------------------------------------------------- -type PP = P PpState -- initPpState :: PpState -- initPpState = @@ -96,6 +95,8 @@ ppLexer queueComments cont = -- --------------------------------------------------------------------- +type PP = P PpState + preprocessElse :: PP () preprocessElse = do accepting <- getAccepting @@ -280,10 +281,7 @@ cleanTokenString fs = r See Note [GhcCPP Initial Processing] -} cppInitial :: [FastString] -> String -cppInitial fs = r - where - -- go fs' = reverse $ drop 2 $ reverse $ unpackFS fs' - r = concatMap unpackFS fs +cppInitial fs = concatMap unpackFS fs {- Note [GhcCPP Initial Processing] ===================================== utils/check-cpp/Types.hs ===================================== @@ -51,15 +51,6 @@ data MacroName = MacroName String (Maybe MacroArgs) deriving (Show, Eq, Ord) type MacroDef = String --- data PpState = PpState --- { pp_defines :: !(Map MacroName MacroDef) --- , pp_accepting :: !Bool --- } --- deriving (Show, Eq) - --- initPpState :: PpState --- initPpState = PpState{pp_defines = Map.empty, pp_accepting = True} - type Input = String type Output = CppDirective ===================================== utils/haddock/haddock-api/src/Haddock/Parser.hs ===================================== @@ -17,6 +17,7 @@ import GHC.Data.FastString (fsLit) import GHC.Data.StringBuffer (stringToStringBuffer) import GHC.Parser (parseIdentifier) import GHC.Parser.Lexer (ParseResult (PFailed, POk), ParserOpts, initParserState, unP) +import GHC.Parser.PreProcess (initPpState) import GHC.Types.Name.Occurrence (occNameString) import GHC.Types.Name.Reader (RdrName (..)) import GHC.Types.SrcLoc (GenLocated (..), mkRealSrcLoc) @@ -45,7 +46,7 @@ parseIdent parserOpts ns str0 = PFailed{} -> Nothing where realSrcLc = mkRealSrcLoc (fsLit "") 0 0 - pstate str = initParserState () parserOpts (stringToStringBuffer str) realSrcLc + pstate str = initParserState initPpState parserOpts (stringToStringBuffer str) realSrcLc (wrap, str1) = case str0 of '(' : s@(c : _) | c /= ',' View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/237548092a8cedcc244412f1bf10a6a08f982de1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/237548092a8cedcc244412f1bf10a6a08f982de1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 23:29:58 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 03 Feb 2025 18:29:58 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/T25647 Message-ID: <67a1517686012_214bb1425c17413645e@gitlab.mail> Simon Peyton Jones pushed new branch wip/T25647 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25647 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 23:45:30 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Mon, 03 Feb 2025 18:45:30 -0500 Subject: [Git][ghc/ghc][ghc-9.12] 2 commits: hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage Message-ID: <67a1551ae6a26_214bb144579c4136640@gitlab.mail> Ben Gamari pushed to branch ghc-9.12 at Glasgow Haskell Compiler / GHC Commits: 49f934d3 by Zubin Duggal at 2025-01-29T08:59:12-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 (cherry picked from commit fd297671f81fc262b700471cfc6cd05d34254b6e) - - - - - c3657b33 by Ben Gamari at 2025-01-30T14:07:53-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th Fixes #25687 - - - - - 1 changed file: - .gitlab/rel_eng/upload_ghc_libs.py Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -93,6 +93,25 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Platform/Constants.hs') build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') +def prep_ghc_boot_th(): + # Drop references to `ghc-internal` from `hs-source-dirs` as Hackage rejects + # out-of-sdist references and this packages is only uploaded for documentation + # purposes. + modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', + lambda s: s.replace('../ghc-internal/src', '') + .replace('GHC.Internal.TH.Lib.Map', '') + .replace('GHC.Internal.TH.PprLib', '') + .replace('GHC.Internal.TH.Ppr', '') + .replace('GHC.Internal.TH.Lib,', '') + .replace('GHC.Internal.TH.Lib', '') + .replace('GHC.Internal.TH.Lift,', '') + .replace('GHC.Internal.TH.Quote,', '') + .replace('GHC.Internal.TH.Syntax', '') + .replace('GHC.Internal.ForeignSrcLang', '') + .replace('GHC.Internal.LanguageExtensions', '') + .replace('GHC.Internal.Lexeme', '') + ) + PACKAGES = { pkg.name: pkg for pkg in [ @@ -105,9 +124,10 @@ PACKAGES = { Package('template-haskell', Path("libraries/template-haskell"), no_prep), Package('ghc-heap', Path("libraries/ghc-heap"), no_prep), Package('ghc-boot', Path("libraries/ghc-boot"), prep_ghc_boot), - Package('ghc-boot-th', Path("libraries/ghc-boot-th"), no_prep), + Package('ghc-boot-th', Path("libraries/ghc-boot-th"), prep_ghc_boot_th), Package('ghc-compact', Path("libraries/ghc-compact"), no_prep), Package('ghc', Path("compiler"), prep_ghc), + Package('ghci', Path("libraries/ghci"), no_prep), ] } # Dict[str, Package] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d3633636f652bdafc71538c28d27e580ca2ef89f...c3657b3347133b52cff99f250ac8cdfb45732c6e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d3633636f652bdafc71538c28d27e580ca2ef89f...c3657b3347133b52cff99f250ac8cdfb45732c6e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 23:50:41 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 03 Feb 2025 18:50:41 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: compiler: Always load GHC.Data.FastString optimised into GHCi Message-ID: <67a15651bda8d_214bb14520ba8141148@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - 24f6f98a by Matthew Pickering at 2025-02-03T18:50:25-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - efec7a70 by Ben Gamari at 2025-02-03T18:50:25-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 4 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/Data/FastString.hs - compiler/GHC/StgToByteCode.hs - rts/StgCRunAsm.S Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -94,9 +94,23 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') def prep_ghc_boot_th(): - # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + # Drop references to `ghc-internal` from `hs-source-dirs` as Hackage rejects + # out-of-sdist references and this packages is only uploaded for documentation + # purposes. modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', - lambda s: s.replace('../ghc-internal/src', '')) + lambda s: s.replace('../ghc-internal/src', '') + .replace('GHC.Internal.TH.Lib.Map', '') + .replace('GHC.Internal.TH.PprLib', '') + .replace('GHC.Internal.TH.Ppr', '') + .replace('GHC.Internal.TH.Lib,', '') + .replace('GHC.Internal.TH.Lib', '') + .replace('GHC.Internal.TH.Lift,', '') + .replace('GHC.Internal.TH.Quote,', '') + .replace('GHC.Internal.TH.Syntax', '') + .replace('GHC.Internal.ForeignSrcLang', '') + .replace('GHC.Internal.LanguageExtensions', '') + .replace('GHC.Internal.Lexeme', '') + ) PACKAGES = { pkg.name: pkg ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -2,10 +2,19 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +{-# OPTIONS_GHC -fno-unoptimized-core-for-interpreter #-} +#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected +-- +-- Also important, if you load this module into GHCi then the data representation of +-- FastString has to match that of the host compiler due to the shared FastString +-- table. Otherwise you will get segfaults when the table is consulted and the fields +-- from the FastString are in an incorrect order. -- | -- There are two principal string types used internally by GHC: ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -240,11 +240,12 @@ ppBCEnv p -- Create a BCO and do a spot of peephole optimisation on the insns -- at the same time. mkProtoBCO - :: (Outputable name) - => Platform - -> Bool -- ^ True <=> label with @BCO_NAME@ instruction - -- see Note [BCO_NAME] - -> name + :: + Platform + -> Maybe Module + -- ^ Just cur_mod <=> label with @BCO_NAME@ instruction + -- see Note [BCO_NAME] + -> Name -> BCInstrList -> Either [CgStgAlt] (CgStgRhs) -- ^ original expression; for debugging only @@ -253,7 +254,7 @@ mkProtoBCO -> [StgWord] -- ^ bitmap -> Bool -- ^ True <=> is a return point, rather than a function -> [FFIInfo] - -> ProtoBCO name + -> ProtoBCO Name mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bitmap is_ret ffis = ProtoBCO { protoBCOName = nm, @@ -267,9 +268,9 @@ mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bit where #if MIN_VERSION_rts(1,0,3) maybe_add_bco_name instrs - | _add_bco_name = BCO_NAME str : instrs - where - str = BS.pack $ showSDocOneLine defaultSDocContext (ppr nm) + | Just cur_mod <- _add_bco_name = + let str = BS.pack $ showSDocOneLine defaultSDocContext (pprFullName cur_mod nm) + in BCO_NAME str : instrs #endif maybe_add_bco_name instrs = instrs @@ -1398,7 +1399,7 @@ Note [unboxed tuple bytecodes and tuple_BCO] tupleBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name tupleBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1419,7 +1420,7 @@ tupleBCO platform args_info args = primCallBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name primCallBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -2359,8 +2360,12 @@ getHscEnv = BcM $ \st -> return (st, bcm_hsc_env st) getProfile :: BcM Profile getProfile = targetProfile <$> getDynFlags -shouldAddBcoName :: BcM Bool -shouldAddBcoName = gopt Opt_AddBcoName <$> getDynFlags +shouldAddBcoName :: BcM (Maybe Module) +shouldAddBcoName = do + add <- gopt Opt_AddBcoName <$> getDynFlags + if add + then Just <$> getCurrentModule + else return Nothing emitBc :: ([FFIInfo] -> ProtoBCO Name) -> BcM (ProtoBCO Name) emitBc bco ===================================== rts/StgCRunAsm.S ===================================== @@ -69,7 +69,7 @@ StgReturn: .section .note.GNU-stack,"", at progbits # else // Not ELF v2 -# error Only ELF v2 supported. + // ELF v1 is in StgCrun.c # endif #elif defined(powerpc_HOST_ARCH) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/54bc5519d7ffcdf3e10b3ac442ee6eda1b7be6c0...efec7a7055433151e4672bf3cf3d56a492f811dd -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/54bc5519d7ffcdf3e10b3ac442ee6eda1b7be6c0...efec7a7055433151e4672bf3cf3d56a492f811dd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 23:52:18 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Mon, 03 Feb 2025 18:52:18 -0500 Subject: [Git][ghc/ghc][wip/strict-level] 36 commits: compiler: Fix CPP guards around ghc_unique_counter64 Message-ID: <67a156b211482_214bb148a984c14343b@gitlab.mail> Ben Gamari pushed to branch wip/strict-level at Glasgow Haskell Compiler / GHC Commits: 595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. - - - - - 09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00 Fix :info pretty-printing of UNPACKed fields This patch: * Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int` as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the `:info` command. * Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one unpacks a newtype) from being printed in `:info` output unless `-dppr-debug` is enabled. Fixes #25651. - - - - - 6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00 driver: Store the HomePackageTable in a mutable reference This commit refactors the HomePackageTable and HomeUnitGraph: (1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511) (2) And it reworks these structures into their own modules to simplify the driver. The refactor is driven by the introduction of IO in the HPT interface, but is a bit more aggressive in simplifying the interfaces to enforce correct usage (ie to avoid performance pitfalls). Specifically: - The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph` - The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable` - The HPT now stores an `IORef` with the table of loaded home package modules. - The interface to the HPT now requires IO - The interface now enforces that the HPT is a datastructure that only grows - This is not enforced in the interface, but, clients of the HPT should never care about there being more or less entries in the HPT when these additional entries are not relevant to their result. - The exception to the invariant that the HPT is monotonically increasing is `restrictHpt`, a function which is called at a "barrier point" (during which there are no other threads inspecting or inserting in the HPT). The invariant can be temporarily broken at this point (currently, after upsweep). This is safe because a single thread holds control over the structure (thus the invariant being broken is never observed). The hug_var and associated structures in the driver, which aimed to improve memory usage in the driver by updating in place a HUG during upsweep, are no longer required as the HPT entries in the HUG are now themselves mutable by construction. This was previously explained in Note [ModuleNameSet, efficiency and space leaks], which is no longer relevant and was deleted. Fixes #25511 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> ------------------------- Metric Decrease: MultiComponentModulesRecomp MultiLayerModulesRecomp ------------------------- - - - - - f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 Fix build with gcc-15 which defaults to C23 standard (-std=gnu23) Fixes #25662 ``` utils/hp2ps/Utilities.c:6:14: error: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c:5:1: error: note: ‘malloc’ is declared in header ‘<stdlib.h>’ 4 | #include "Error.h" +++ |+#include <stdlib.h> 5 | | 5 | | ^ utils/hp2ps/Utilities.c: In function ‘xmalloc’: utils/hp2ps/Utilities.c:80:17: error: error: too many arguments to function ‘malloc’; expected 0, have 1 80 | r = (void*) malloc(n); | ^~~~~~ ~ | 80 | r = (void*) malloc(n); | ^ utils/hp2ps/Utilities.c:6:14: error: note: declared here 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c: In function ‘xrealloc’: utils/hp2ps/Utilities.c:92:18: error: warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:92:18: error: note: ‘realloc’ is declared in header ‘<stdlib.h>’ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:94:9: error: error: too many arguments to function ‘realloc’; expected 0, have 2 94 | r = realloc(p, n); | ^~~~~~~ ~ | 94 | r = realloc(p, n); | ^ utils/hp2ps/Utilities.c:92:18: error: note: declared here 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ ``` - - - - - 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 79d46e74 by Ben Gamari at 2025-02-03T18:46:43-05:00 SetLevels: Make Level strict - - - - - 0231790a by Ben Gamari at 2025-02-03T18:52:05-05:00 SetLevels: Track binding context - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Uniques.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Core/Opt/Pipeline.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f38353db3b9fdef5b7a15ab5392395dea4a60b86...0231790ae1f734571ab5dd38ebc1b598f97b5b52 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f38353db3b9fdef5b7a15ab5392395dea4a60b86...0231790ae1f734571ab5dd38ebc1b598f97b5b52 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 3 23:56:08 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Mon, 03 Feb 2025 18:56:08 -0500 Subject: [Git][ghc/ghc][wip/coreprep-sat-name] 31 commits: Rework built-in and punned names (#25174, #25179, #25180, #25182) Message-ID: <67a15798234bc_214bb1450720c14908f@gitlab.mail> Ben Gamari pushed to branch wip/coreprep-sat-name at Glasgow Haskell Compiler / GHC Commits: 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 88264075 by Ben Gamari at 2025-02-03T18:55:58-05:00 CorePrep: Name `sat` binders more descriptively - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Uniques.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2a9b869a65d988cacfc00c6fe9755ff307e891b6...88264075139ddd739dbd169d3843bf1b6971330b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2a9b869a65d988cacfc00c6fe9755ff307e891b6...88264075139ddd739dbd169d3843bf1b6971330b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 01:54:40 2025 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Mon, 03 Feb 2025 20:54:40 -0500 Subject: [Git][ghc/ghc][wip/bytecode-serialize] 6 commits: hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage Message-ID: <67a173606cceb_2b35bd11b5e6c101542@gitlab.mail> Cheng Shao pushed to branch wip/bytecode-serialize at Glasgow Haskell Compiler / GHC Commits: 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - 5c3cb265 by Cheng Shao at 2025-02-04T01:54:26+00:00 WIP - - - - - 94e3652f by Cheng Shao at 2025-02-04T01:54:26+00:00 WIP - - - - - 13 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/ByteCode/Asm.hs - + compiler/GHC/ByteCode/Serialize.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Data/FastString.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Iface/Binary.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/Types/Name.hs - compiler/ghc.cabal.in - libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs - rts/StgCRunAsm.S Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -93,6 +93,11 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Platform/Constants.hs') build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') +def prep_ghc_boot_th(): + # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', + lambda s: s.replace('../ghc-internal/src', '')) + PACKAGES = { pkg.name: pkg for pkg in [ @@ -105,9 +110,10 @@ PACKAGES = { Package('template-haskell', Path("libraries/template-haskell"), no_prep), Package('ghc-heap', Path("libraries/ghc-heap"), no_prep), Package('ghc-boot', Path("libraries/ghc-boot"), prep_ghc_boot), - Package('ghc-boot-th', Path("libraries/ghc-boot-th"), no_prep), + Package('ghc-boot-th', Path("libraries/ghc-boot-th"), prep_ghc_boot_th), Package('ghc-compact', Path("libraries/ghc-compact"), no_prep), Package('ghc', Path("compiler"), prep_ghc), + Package('ghci', Path("libraries/ghci"), no_prep), ] } # Dict[str, Package] ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -52,6 +52,7 @@ import qualified Data.Array.Unboxed as Array import Data.Array.Base ( UArray(..) ) import Foreign hiding (shiftL, shiftR) +import Data.ByteString ( ByteString ) import Data.Char ( ord ) import Data.List ( genericLength ) import Data.Map.Strict (Map) @@ -94,7 +95,7 @@ assembleBCOs -> Profile -> FlatBag (ProtoBCO Name) -> [TyCon] - -> AddrEnv + -> [(Name, ByteString)] -> Maybe ModBreaks -> [SptEntry] -> IO CompiledByteCode ===================================== compiler/GHC/ByteCode/Serialize.hs ===================================== @@ -0,0 +1,108 @@ +{-# LANGUAGE RecordWildCards #-} +{-# OPTIONS_GHC -Wno-orphans -fdefer-typed-holes -Wno-typed-holes #-} + +module GHC.ByteCode.Serialize where + +import GHC.Prelude +import GHC.ByteCode.Types +import GHC.Utils.Binary +import GHC.Data.FlatBag as FlatBag +import GHC.Builtin.PrimOps +import Data.Word +import GHC.Utils.Panic +import qualified Data.Binary as Binary +import GHCi.ResolvedBCO () +import qualified Data.ByteString.Lazy as LBS +import Data.Foldable +import GHC.Types.Name.Env +import Control.Monad +import GHC.Types.Name +import GHC.Types.SrcLoc +import GHC.Types.Unique.Supply +import Data.Proxy + +instance Binary CompiledByteCode where + get bh = do + bc_bcos <- get bh + bc_strs_len <- get bh + bc_strs <- replicateM bc_strs_len $ (,) <$> getViaSerializableName bh <*> get bh + pure CompiledByteCode {bc_bcos, bc_itbls = emptyNameEnv, bc_ffis = [], bc_strs, bc_breaks = Nothing, bc_spt_entries = []} + + put_ bh CompiledByteCode {..} = do + put_ bh bc_bcos + put_ bh $ length bc_strs + for_ bc_strs $ \(nm, str) -> putViaSerializableName bh nm *> put_ bh str + +instance Binary UnlinkedBCO where + get bh = UnlinkedBCO <$> getViaSerializableName bh <*> get bh <*> (Binary.decode . LBS.fromStrict <$> get bh) <*> (Binary.decode . LBS.fromStrict <$> get bh) <*> get bh <*> get bh + + put_ bh UnlinkedBCO {..} = do + putViaSerializableName bh unlinkedBCOName + put_ bh unlinkedBCOArity + put_ bh $ LBS.toStrict $ Binary.encode unlinkedBCOInstrs + put_ bh $ LBS.toStrict $ Binary.encode unlinkedBCOBitmap + put_ bh unlinkedBCOLits + put_ bh unlinkedBCOPtrs + +instance Binary BCOPtr where + get bh = do + t <- getByte bh + case t of + 0 -> BCOPtrName <$> getViaSerializableName bh + 1 -> BCOPtrPrimOp <$> get bh + 2 -> BCOPtrBCO <$> get bh + _ -> panic "GHC.ByteCode.Serialize.BCOPtr.get" + put_ bh ptr = case ptr of + BCOPtrName nm -> putByte bh 0 *> putViaSerializableName bh nm + BCOPtrPrimOp op -> putByte bh 1 *> put_ bh op + BCOPtrBCO bco -> putByte bh 2 *> put_ bh bco + BCOPtrBreakArray {} -> panic "GHC.ByteCode.Serialize.BCOPtr.put" + +instance Binary BCONPtr where + get bh = do + t <- getByte bh + case t of + 0 -> BCONPtrWord . fromIntegral <$> (get bh :: IO Word64) + 1 -> BCONPtrLbl <$> get bh + 2 -> BCONPtrItbl <$> getViaSerializableName bh + 3 -> BCONPtrAddr <$> getViaSerializableName bh + 4 -> BCONPtrStr <$> get bh + _ -> panic "GHC.ByteCode.Serialize.BCONPtr.get" + + put_ bh ptr = case ptr of + BCONPtrWord lit -> putByte bh 0 *> put_ bh (fromIntegral lit :: Word64) + BCONPtrLbl sym -> putByte bh 1 *> put_ bh sym + BCONPtrItbl nm -> putByte bh 2 *> putViaSerializableName bh nm + BCONPtrAddr nm -> putByte bh 3 *> putViaSerializableName bh nm + BCONPtrStr str -> putByte bh 4 *> put_ bh str + +newtype SerializableName = SerializableName { unSerializableName :: Name } + +instance Binary SerializableName where + get bh = + case findUserDataReader Proxy bh of + BinaryReader f -> f bh + + put_ bh nm = + case findUserDataWriter Proxy bh of + BinaryWriter f -> f bh nm + +getViaSerializableName :: ReadBinHandle -> IO Name +getViaSerializableName bh = unSerializableName <$> get bh + +putViaSerializableName :: WriteBinHandle -> Name -> IO () +putViaSerializableName bh nm = put_ bh $ SerializableName nm + +addSerializableNameWriter :: WriteBinHandle -> IO WriteBinHandle +addSerializableNameWriter = undefined + +instance Binary PrimOp where + get bh = (allThePrimOps !!) <$> get bh + put_ bh = put_ bh . primOpTag + +instance Binary a => Binary (FlatBag a) where + get bh = do + xs <- get bh + pure $ FlatBag.fromList (fromIntegral $ length xs) xs + + put_ bh = put_ bh . FlatBag.elemsFlatBag ===================================== compiler/GHC/ByteCode/Types.hs ===================================== @@ -64,7 +64,7 @@ data CompiledByteCode = CompiledByteCode , bc_ffis :: [FFIInfo] -- ^ ffi blocks we allocated - , bc_strs :: AddrEnv + , bc_strs :: [(Name, ByteString)] -- ^ top-level strings (heap allocated) , bc_breaks :: Maybe ModBreaks @@ -89,7 +89,7 @@ seqCompiledByteCode CompiledByteCode{..} = rnf bc_bcos `seq` seqEltsNameEnv rnf bc_itbls `seq` rnf bc_ffis `seq` - seqEltsNameEnv rnf bc_strs `seq` + rnf bc_strs `seq` rnf (fmap seqModBreaks bc_breaks) newtype ByteOff = ByteOff Int ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -2,10 +2,19 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +{-# OPTIONS_GHC -fno-unoptimized-core-for-interpreter #-} +#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected +-- +-- Also important, if you load this module into GHCi then the data representation of +-- FastString has to match that of the host compiler due to the shared FastString +-- table. Otherwise you will get segfaults when the table is consulted and the fields +-- from the FastString are in an incorrect order. -- | -- There are two principal string types used internally by GHC: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2747,7 +2747,8 @@ hscCompileCoreExpr' hsc_env srcspan ds_expr = do -- The id has to be exported for the JS backend. This isn't required for the -- byte-code interpreter but it does no harm to always do it. u <- uniqFromTag 'I' - let binding_name = mkSystemVarName u (fsLit ("BCO_toplevel")) + let this_mod = mkInteractiveModule (show u) + let binding_name = mkExternalName u this_mod (mkVarOcc ("BCO_toplevel")) noSrcSpan let binding_id = mkExportedVanillaId binding_name (exprType simpl_expr) {- Tidy it (temporary, until coreSat does cloning) -} @@ -2781,7 +2782,6 @@ hscCompileCoreExpr' hsc_env srcspan ds_expr = do -- guaranteed. -- -- We reuse the unique we obtained for the binding, but any unique would do. - let this_mod = mkInteractiveModule (show u) let for_bytecode = True (stg_binds_with_deps, _prov_map, _collected_ccs, _stg_cg_infos) <- ===================================== compiler/GHC/Iface/Binary.hs ===================================== @@ -43,7 +43,6 @@ import GHC.Types.Unique.FM import GHC.Utils.Panic import GHC.Utils.Binary as Binary import GHC.Data.FastMutInt -import GHC.Data.FastString (FastString) import GHC.Types.Unique import GHC.Utils.Outputable import GHC.Types.Name.Cache @@ -321,18 +320,7 @@ putWithTables compressionLevel bh' put_payload = do (ifaceType_wt, ifaceTypeWriter) <- initWriteIfaceType compressionLevel -- Initialise the 'WriterUserData'. - let writerUserData = mkWriterUserData - [ mkSomeBinaryWriter @FastString fsWriter - , mkSomeBinaryWriter @Name nameWriter - -- We sometimes serialise binding and non-binding names differently, but - -- not during 'ModIface' serialisation. Here, we serialise both to the same - -- deduplication table. - -- - -- See Note [Binary UserData] - , mkSomeBinaryWriter @BindingName $ mkWriter (\bh name -> putEntry nameWriter bh (getBindingName name)) - , mkSomeBinaryWriter @IfaceType ifaceTypeWriter - ] - let bh = setWriterUserData bh' writerUserData + let bh = foldl' (&) bh' [addWriterToUserData fsWriter, addWriterToUserData nameWriter, addWriterToUserData $ mkWriter (\bh name -> putEntry nameWriter bh (getBindingName name)), addWriterToUserData ifaceTypeWriter] ([fs_count, name_count, ifacetype_count] , r) <- -- The order of these entries matters! ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -97,6 +97,7 @@ import GHC.Linker.Types -- Standard libraries import Control.Monad +import Data.ByteString (ByteString) import qualified Data.Set as Set import Data.Char (isSpace) import qualified Data.Foldable as Foldable @@ -723,8 +724,9 @@ loadDecls interp hsc_env span linkable = do else do -- Link the expression itself let le = linker_env pls - le2 = le { itbl_env = foldl' (\acc cbc -> plusNameEnv acc (bc_itbls cbc)) (itbl_env le) cbcs - , addr_env = foldl' (\acc cbc -> plusNameEnv acc (bc_strs cbc)) (addr_env le) cbcs } + le2_addr_env <- foldlM (\env cbc -> allocateTopStrings interp (bc_strs cbc) env) (addr_env le) cbcs + let le2 = le { itbl_env = foldl' (\acc cbc -> plusNameEnv acc (bc_itbls cbc)) (itbl_env le) cbcs + , addr_env = le2_addr_env } -- Link the necessary packages and linkables new_bindings <- linkSomeBCOs interp (pkgs_loaded pls) le2 cbcs @@ -947,8 +949,8 @@ dynLinkBCOs interp pls bcos = do le1 = linker_env pls ie2 = foldr plusNameEnv (itbl_env le1) (map bc_itbls cbcs) - ae2 = foldr plusNameEnv (addr_env le1) (map bc_strs cbcs) - le2 = le1 { itbl_env = ie2, addr_env = ae2 } + ae2 <- foldlM (\env cbc -> allocateTopStrings interp (bc_strs cbc) env) (addr_env le1) cbcs + let le2 = le1 { itbl_env = ie2, addr_env = ae2 } names_and_refs <- linkSomeBCOs interp (pkgs_loaded pls) le2 cbcs @@ -1649,3 +1651,17 @@ maybePutStr logger s = maybePutSDoc logger (text s) maybePutStrLn :: Logger -> String -> IO () maybePutStrLn logger s = maybePutSDoc logger (text s <> text "\n") + +-- | see Note [Generating code for top-level string literal bindings] +allocateTopStrings + :: Interp + -> [(Name, ByteString)] + -> AddrEnv + -> IO AddrEnv +allocateTopStrings interp topStrings prev_env = + do + let !(bndrs, strings) = unzip topStrings + ptrs <- interpCmd interp $ MallocStrings strings + return $ extendNameEnvList prev_env (zipWith mk_entry bndrs ptrs) + where + mk_entry nm ptr = (nm, (nm, AddrPtr ptr)) ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -66,7 +66,6 @@ import GHC.Data.Bitmap import GHC.Data.FlatBag as FlatBag import GHC.Data.OrdList import GHC.Data.Maybe -import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry @@ -81,7 +80,6 @@ import GHC.Unit.Home.PackageTable (lookupHpt) import Data.Array import Data.Coerce (coerce) -import Data.ByteString (ByteString) #if MIN_VERSION_rts(1,0,3) import qualified Data.ByteString.Char8 as BS #endif @@ -96,6 +94,12 @@ import Data.Either ( partitionEithers ) import GHC.Stg.Syntax import qualified Data.IntSet as IntSet import GHC.CoreToIface +import GHC.Types.Name.Env +import GHC.Utils.Binary +import GHC.Iface.Binary +import GHC.ByteCode.Serialize () +import GHC.Utils.TmpFs +import System.FilePath -- ----------------------------------------------------------------------------- -- Generating byte code for a complete module @@ -117,10 +121,9 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks spt_entries bnd <- binds case bnd of StgTopLifted bnd -> [Right bnd] - StgTopStringLit b str -> [Left (b, str)] + StgTopStringLit b str -> [Left (idName b, str)] flattenBind (StgNonRec b e) = [(b,e)] flattenBind (StgRec bs) = bs - stringPtrs <- allocateTopStrings interp strings (BcM_State{..}, proto_bcos) <- runBc hsc_env this_mod mb_modBreaks $ do @@ -137,7 +140,7 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks spt_entries let mod_breaks = case modBreaks of Nothing -> Nothing Just mb -> Just mb{ modBreaks_breakInfo = breakInfo } - cbc <- assembleBCOs interp profile proto_bcos tycs stringPtrs mod_breaks spt_entries + cbc <- assembleBCOs interp profile proto_bcos tycs strings mod_breaks spt_entries -- Squash space leaks in the CompiledByteCode. This is really -- important, because when loading a set of modules into GHCi @@ -147,26 +150,26 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks spt_entries -- modules. evaluate (seqCompiledByteCode cbc) - return cbc + cbc' <- case cbc of + CompiledByteCode{bc_itbls, bc_ffis = [], bc_breaks = Nothing, bc_spt_entries = []} | isEmptyNameEnv bc_itbls -> + withSystemTempDirectory "foo" $ \tmpdir -> + do + let fn = tmpdir "bar" + appendFile "/tmp/test.log" "1" + bh0 <- openBinMem (1024*1024) + putWithUserData QuietBinIFace NormalCompression bh0 cbc + writeBinMem bh0 fn + bh1 <- readBinMem fn + getWithUserData (hsc_NC hsc_env) bh1 + _ -> pure cbc + + return cbc' where dflags = hsc_dflags hsc_env logger = hsc_logger hsc_env interp = hscInterp hsc_env profile = targetProfile dflags --- | see Note [Generating code for top-level string literal bindings] -allocateTopStrings - :: Interp - -> [(Id, ByteString)] - -> IO AddrEnv -allocateTopStrings interp topStrings = do - let !(bndrs, strings) = unzip topStrings - ptrs <- interpCmd interp $ MallocStrings strings - return $ mkNameEnv (zipWith mk_entry bndrs ptrs) - where - mk_entry bndr ptr = let nm = getName bndr - in (nm, (nm, AddrPtr ptr)) - {- Note [Generating code for top-level string literal bindings] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As described in Note [Compilation plan for top-level string literals] ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -51,7 +51,7 @@ module GHC.Types.Name ( mkExternalName, mkWiredInName, -- ** Manipulating and deconstructing 'Name's - nameUnique, setNameUnique, + nameUnique, setNameExternalModule, setNameUnique, nameOccName, nameNameSpace, nameModule, nameModule_maybe, setNameLoc, tidyNameOcc, @@ -563,6 +563,9 @@ mkFCallName :: Unique -> FastString -> Name mkFCallName uniq str = mkInternalName uniq (mkVarOccFS str) noSrcSpan -- The encoded string completely describes the ccall +setNameExternalModule :: Name -> Module -> Name +setNameExternalModule name mod = name {n_sort = External mod} + -- When we renumber/rename things, we need to be -- able to change a Name's Unique to match the cached -- one in the thing it's the name of. If you know what I mean. ===================================== compiler/ghc.cabal.in ===================================== @@ -226,6 +226,7 @@ Library GHC.ByteCode.InfoTable GHC.ByteCode.Instr GHC.ByteCode.Linker + GHC.ByteCode.Serialize GHC.ByteCode.Types GHC.Cmm GHC.Cmm.BlockId ===================================== libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs ===================================== @@ -131,10 +131,10 @@ class Category a => Arrow a where -- The default definition may be overridden with a more efficient -- version if desired. -- - -- > b ╭─────╮ b' + -- > b ╭─────╮ c -- > >───┼─ f ─┼───> -- > >───┼─ g ─┼───> - -- > c ╰─────╯ c' + -- > b'╰─────╯ c' (***) :: a b c -> a b' c' -> a (b,b') (c,c') f *** g = first f >>> arr swap >>> first g >>> arr swap where swap ~(x,y) = (y,x) ===================================== rts/StgCRunAsm.S ===================================== @@ -69,7 +69,7 @@ StgReturn: .section .note.GNU-stack,"", at progbits # else // Not ELF v2 -# error Only ELF v2 supported. + // ELF v1 is in StgCrun.c # endif #elif defined(powerpc_HOST_ARCH) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d5a7ece3fb0c2734f9829a1f567adc49c871b905...94e3652f700fcdfd2356b6954f46318e9159d601 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d5a7ece3fb0c2734f9829a1f567adc49c871b905...94e3652f700fcdfd2356b6954f46318e9159d601 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 04:03:49 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Mon, 03 Feb 2025 23:03:49 -0500 Subject: [Git][ghc/ghc] Deleted branch wip/ghc-9.6.7-backports Message-ID: <67a191a534fbe_2ee976fe560063ad@gitlab.mail> Ben Gamari deleted branch wip/ghc-9.6.7-backports at Glasgow Haskell Compiler / GHC -- You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 04:03:53 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Mon, 03 Feb 2025 23:03:53 -0500 Subject: [Git][ghc/ghc][ghc-9.6] rts: don't export atomic_inc64 Message-ID: <67a191a99b0ae_2ee976fbd77c6539@gitlab.mail> Ben Gamari pushed to branch ghc-9.6 at Glasgow Haskell Compiler / GHC Commits: 6205e04a by Luite Stegeman at 2025-01-31T14:51:48+01:00 rts: don't export atomic_inc64 This makes it easier for packges to use GHC 9.6.7 because the symbols exported by the rts are the same as in 9.6.6. This means that we define the symbol in the ghc library instead, where we have to pessimistically assume a threaded rts. - - - - - 3 changed files: - compiler/cbits/genSym.c - rts/RtsSymbols.c - rts/include/stg/SMP.h Changes: ===================================== compiler/cbits/genSym.c ===================================== @@ -30,8 +30,8 @@ HsInt ghc_unique_inc = 1; // This function has been added to the RTS. Here we pessimistically assume // that a threaded RTS is used. This function is only used for bootstrapping. -#if !MIN_VERSION_GLASGOW_HASKELL(9,6,7,0) -EXTERN_INLINE StgWord64 +#if !MIN_VERSION_GLASGOW_HASKELL(9,7,0,0) +STATIC_INLINE StgWord64 atomic_inc64(StgWord64 volatile* p, StgWord64 incr) { #if defined(HAVE_C11_ATOMICS) ===================================== rts/RtsSymbols.c ===================================== @@ -923,7 +923,6 @@ extern char **environ; SymI_HasProto(stopHeapProfTimer) \ SymI_HasProto(requestHeapCensus) \ SymI_HasProto(atomic_inc) \ - SymI_HasProto(atomic_inc64) \ SymI_HasProto(atomic_dec) \ SymI_HasProto(hs_spt_lookup) \ SymI_HasProto(hs_spt_insert) \ ===================================== rts/include/stg/SMP.h ===================================== @@ -87,15 +87,6 @@ EXTERN_INLINE StgWord cas_seq_cst_relaxed(StgVolatilePtr p, StgWord o, StgWord n EXTERN_INLINE StgWord atomic_inc(StgVolatilePtr p, StgWord n); -/* - * Atomic 64-bit addition of by the provided quantity - * - * atomic_inc64(p, n) { - * return ((*p) += n); - * } - */ -EXTERN_INLINE StgWord64 atomic_inc64(StgWord64 volatile* p, StgWord64 n); - /* * Atomic decrement * @@ -440,16 +431,6 @@ atomic_inc(StgVolatilePtr p, StgWord incr) #endif } -EXTERN_INLINE StgWord64 -atomic_inc64(StgWord64 volatile* p, StgWord64 incr) -{ -#if defined(HAVE_C11_ATOMICS) - return __atomic_add_fetch(p, incr, __ATOMIC_SEQ_CST); -#else - return __sync_add_and_fetch(p, incr); -#endif -} - EXTERN_INLINE StgWord atomic_dec(StgVolatilePtr p) { @@ -678,15 +659,6 @@ atomic_inc(StgVolatilePtr p, StgWord incr) return ((*p) += incr); } - -EXTERN_INLINE StgWord64 atomic_inc64(StgWord64 volatile* p, StgWord64 incr); -EXTERN_INLINE StgWord64 -atomic_inc64(StgWord64 volatile* p, StgWord64 incr) -{ - return ((*p) += incr); -} - - INLINE_HEADER StgWord atomic_dec(StgVolatilePtr p) { View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6205e04ae920776f282df9a428829d9e90a9c776 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6205e04ae920776f282df9a428829d9e90a9c776 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 04:40:55 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 03 Feb 2025 23:40:55 -0500 Subject: [Git][ghc/ghc][master] interpreter: Always print unit and module name in BCO_NAME instruction Message-ID: <67a19a57b2015_2ee97616346141091b@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 1 changed file: - compiler/GHC/StgToByteCode.hs Changes: ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -240,11 +240,12 @@ ppBCEnv p -- Create a BCO and do a spot of peephole optimisation on the insns -- at the same time. mkProtoBCO - :: (Outputable name) - => Platform - -> Bool -- ^ True <=> label with @BCO_NAME@ instruction - -- see Note [BCO_NAME] - -> name + :: + Platform + -> Maybe Module + -- ^ Just cur_mod <=> label with @BCO_NAME@ instruction + -- see Note [BCO_NAME] + -> Name -> BCInstrList -> Either [CgStgAlt] (CgStgRhs) -- ^ original expression; for debugging only @@ -253,7 +254,7 @@ mkProtoBCO -> [StgWord] -- ^ bitmap -> Bool -- ^ True <=> is a return point, rather than a function -> [FFIInfo] - -> ProtoBCO name + -> ProtoBCO Name mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bitmap is_ret ffis = ProtoBCO { protoBCOName = nm, @@ -267,9 +268,9 @@ mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bit where #if MIN_VERSION_rts(1,0,3) maybe_add_bco_name instrs - | _add_bco_name = BCO_NAME str : instrs - where - str = BS.pack $ showSDocOneLine defaultSDocContext (ppr nm) + | Just cur_mod <- _add_bco_name = + let str = BS.pack $ showSDocOneLine defaultSDocContext (pprFullName cur_mod nm) + in BCO_NAME str : instrs #endif maybe_add_bco_name instrs = instrs @@ -1398,7 +1399,7 @@ Note [unboxed tuple bytecodes and tuple_BCO] tupleBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name tupleBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1419,7 +1420,7 @@ tupleBCO platform args_info args = primCallBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name primCallBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -2359,8 +2360,12 @@ getHscEnv = BcM $ \st -> return (st, bcm_hsc_env st) getProfile :: BcM Profile getProfile = targetProfile <$> getDynFlags -shouldAddBcoName :: BcM Bool -shouldAddBcoName = gopt Opt_AddBcoName <$> getDynFlags +shouldAddBcoName :: BcM (Maybe Module) +shouldAddBcoName = do + add <- gopt Opt_AddBcoName <$> getDynFlags + if add + then Just <$> getCurrentModule + else return Nothing emitBc :: ([FFIInfo] -> ProtoBCO Name) -> BcM (ProtoBCO Name) emitBc bco View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cbbb64fbee2de679131efa4abd9b056e1d64870d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cbbb64fbee2de679131efa4abd9b056e1d64870d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 04:41:29 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 03 Feb 2025 23:41:29 -0500 Subject: [Git][ghc/ghc][master] upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th Message-ID: <67a19a79ad09d_2ee976164c07013531@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 1 changed file: - .gitlab/rel_eng/upload_ghc_libs.py Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -94,9 +94,23 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') def prep_ghc_boot_th(): - # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + # Drop references to `ghc-internal` from `hs-source-dirs` as Hackage rejects + # out-of-sdist references and this packages is only uploaded for documentation + # purposes. modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', - lambda s: s.replace('../ghc-internal/src', '')) + lambda s: s.replace('../ghc-internal/src', '') + .replace('GHC.Internal.TH.Lib.Map', '') + .replace('GHC.Internal.TH.PprLib', '') + .replace('GHC.Internal.TH.Ppr', '') + .replace('GHC.Internal.TH.Lib,', '') + .replace('GHC.Internal.TH.Lib', '') + .replace('GHC.Internal.TH.Lift,', '') + .replace('GHC.Internal.TH.Quote,', '') + .replace('GHC.Internal.TH.Syntax', '') + .replace('GHC.Internal.ForeignSrcLang', '') + .replace('GHC.Internal.LanguageExtensions', '') + .replace('GHC.Internal.Lexeme', '') + ) PACKAGES = { pkg.name: pkg View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/764a43ac6321b433bcd283f7b8dc318af0da1bc9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/764a43ac6321b433bcd283f7b8dc318af0da1bc9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 05:12:59 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 04 Feb 2025 00:12:59 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: interpreter: Always print unit and module name in BCO_NAME instruction Message-ID: <67a1a1dbdd5e4_2ee976205f2c4229be@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - eaf8e17b by Ben Gamari at 2025-02-04T00:12:44-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 7d020938 by Cheng Shao at 2025-02-04T00:12:45-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - 4 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/StgToByteCode.hs - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -94,9 +94,23 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') def prep_ghc_boot_th(): - # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + # Drop references to `ghc-internal` from `hs-source-dirs` as Hackage rejects + # out-of-sdist references and this packages is only uploaded for documentation + # purposes. modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', - lambda s: s.replace('../ghc-internal/src', '')) + lambda s: s.replace('../ghc-internal/src', '') + .replace('GHC.Internal.TH.Lib.Map', '') + .replace('GHC.Internal.TH.PprLib', '') + .replace('GHC.Internal.TH.Ppr', '') + .replace('GHC.Internal.TH.Lib,', '') + .replace('GHC.Internal.TH.Lib', '') + .replace('GHC.Internal.TH.Lift,', '') + .replace('GHC.Internal.TH.Quote,', '') + .replace('GHC.Internal.TH.Syntax', '') + .replace('GHC.Internal.ForeignSrcLang', '') + .replace('GHC.Internal.LanguageExtensions', '') + .replace('GHC.Internal.Lexeme', '') + ) PACKAGES = { pkg.name: pkg ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -168,15 +167,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -240,11 +240,12 @@ ppBCEnv p -- Create a BCO and do a spot of peephole optimisation on the insns -- at the same time. mkProtoBCO - :: (Outputable name) - => Platform - -> Bool -- ^ True <=> label with @BCO_NAME@ instruction - -- see Note [BCO_NAME] - -> name + :: + Platform + -> Maybe Module + -- ^ Just cur_mod <=> label with @BCO_NAME@ instruction + -- see Note [BCO_NAME] + -> Name -> BCInstrList -> Either [CgStgAlt] (CgStgRhs) -- ^ original expression; for debugging only @@ -253,7 +254,7 @@ mkProtoBCO -> [StgWord] -- ^ bitmap -> Bool -- ^ True <=> is a return point, rather than a function -> [FFIInfo] - -> ProtoBCO name + -> ProtoBCO Name mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bitmap is_ret ffis = ProtoBCO { protoBCOName = nm, @@ -267,9 +268,9 @@ mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bit where #if MIN_VERSION_rts(1,0,3) maybe_add_bco_name instrs - | _add_bco_name = BCO_NAME str : instrs - where - str = BS.pack $ showSDocOneLine defaultSDocContext (ppr nm) + | Just cur_mod <- _add_bco_name = + let str = BS.pack $ showSDocOneLine defaultSDocContext (pprFullName cur_mod nm) + in BCO_NAME str : instrs #endif maybe_add_bco_name instrs = instrs @@ -1398,7 +1399,7 @@ Note [unboxed tuple bytecodes and tuple_BCO] tupleBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name tupleBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1419,7 +1420,7 @@ tupleBCO platform args_info args = primCallBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name primCallBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -2359,8 +2360,12 @@ getHscEnv = BcM $ \st -> return (st, bcm_hsc_env st) getProfile :: BcM Profile getProfile = targetProfile <$> getDynFlags -shouldAddBcoName :: BcM Bool -shouldAddBcoName = gopt Opt_AddBcoName <$> getDynFlags +shouldAddBcoName :: BcM (Maybe Module) +shouldAddBcoName = do + add <- gopt Opt_AddBcoName <$> getDynFlags + if add + then Just <$> getCurrentModule + else return Nothing emitBc :: ([FFIInfo] -> ProtoBCO Name) -> BcM (ProtoBCO Name) emitBc bco ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/efec7a7055433151e4672bf3cf3d56a492f811dd...7d02093878a7cdf7a4e5ad7c8187e7d4f37f3f68 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/efec7a7055433151e4672bf3cf3d56a492f811dd...7d02093878a7cdf7a4e5ad7c8187e7d4f37f3f68 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 08:36:00 2025 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Tue, 04 Feb 2025 03:36:00 -0500 Subject: [Git][ghc/ghc][wip/T24603] 5 commits: compiler: Always load GHC.Data.FastString optimised into GHCi Message-ID: <67a1d1706b1fd_33886c1fc60ec5803e@gitlab.mail> Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC Commits: 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 1d3de001 by Serge S. Gulin at 2025-02-04T11:33:33+03:00 Support for ARM64 Windows (LLVM-enabled) (fixes #24603) submodule Co-authored-by: Cheng Shao <terrorjack at type.dance> Co-authored-by: Dmitrii Egorov <egorov.d.i at icloud.com> Co-authored-by: Andrei Borzenkov <root at sandwitch.dev> - - - - - 22 changed files: - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs - compiler/GHC/Data/FastString.hs - compiler/GHC/Driver/Backend.hs - compiler/GHC/StgToByteCode.hs - libraries/Cabal - libraries/Win32 - libraries/base/src/System/CPUTime/Windows.hsc - libraries/base/tests/perf/encodingAllocations.hs - libraries/directory - libraries/haskeline - libraries/process - libraries/unix - llvm-targets - m4/ghc_tables_next_to_code.m4 - rts/StgCRun.c - rts/StgCRunAsm.S - rts/win32/veh_excn.c - utils/hsc2hs - utils/llvm-targets/gen-data-layout.sh Changes: ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -94,9 +94,23 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') def prep_ghc_boot_th(): - # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + # Drop references to `ghc-internal` from `hs-source-dirs` as Hackage rejects + # out-of-sdist references and this packages is only uploaded for documentation + # purposes. modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', - lambda s: s.replace('../ghc-internal/src', '')) + lambda s: s.replace('../ghc-internal/src', '') + .replace('GHC.Internal.TH.Lib.Map', '') + .replace('GHC.Internal.TH.PprLib', '') + .replace('GHC.Internal.TH.Ppr', '') + .replace('GHC.Internal.TH.Lib,', '') + .replace('GHC.Internal.TH.Lib', '') + .replace('GHC.Internal.TH.Lift,', '') + .replace('GHC.Internal.TH.Quote,', '') + .replace('GHC.Internal.TH.Syntax', '') + .replace('GHC.Internal.ForeignSrcLang', '') + .replace('GHC.Internal.LanguageExtensions', '') + .replace('GHC.Internal.Lexeme', '') + ) PACKAGES = { pkg.name: pkg ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE CPP #-} module GHC.CmmToAsm.AArch64.Instr @@ -217,7 +218,11 @@ regUsageOfInstr platform instr = case instr of -- TODO: The zero register is currently mapped to -1 but should get it's own separate number. callerSavedRegisters :: [Reg] callerSavedRegisters +#if defined(mingw32_HOST_OS) + = map regSingle [0..17] +#else = map regSingle [0..18] +#endif ++ map regSingle [32..39] ++ map regSingle [48..63] ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -43,7 +43,9 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) = pprSectionAlign config (Section Text lbl) $$ -- do not -- pprProcAlignment config $$ - pprLabel platform lbl $$ -- blocks guaranteed not null, so label needed + (if lbl /= blockLbl (blockId (head blocks)) -- blocks can have clashed names + then pprLabel platform lbl -- blocks guaranteed not null, so label needed + else empty) $$ vcat (map (pprBasicBlock platform with_dwarf top_info) blocks) $$ (if ncgDwarfEnabled config then line (pprAsmLabel platform (mkAsmTempEndLabel lbl) <> char ':') else empty) $$ ===================================== compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + module GHC.CmmToAsm.Reg.Linear.AArch64 where import GHC.Prelude @@ -118,7 +120,11 @@ getFreeRegs :: RegClass -> FreeRegs -> [RealReg] getFreeRegs cls (FreeRegs g f) = case cls of RcFloatOrVector -> go 32 f 31 +#if defined(mingw32_HOST_OS) + RcInteger -> go 0 g 17 +#else RcInteger -> go 0 g 18 +#endif where go _ _ i | i < 0 = [] go off x i | testBit x i = RealRegSingle (off + i) : (go off x $! i - 1) ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -2,10 +2,19 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +{-# OPTIONS_GHC -fno-unoptimized-core-for-interpreter #-} +#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected +-- +-- Also important, if you load this module into GHCi then the data representation of +-- FastString has to match that of the host compiler due to the shared FastString +-- table. Otherwise you will get segfaults when the table is consulted and the fields +-- from the FastString are in an incorrect order. -- | -- There are two principal string types used internally by GHC: ===================================== compiler/GHC/Driver/Backend.hs ===================================== @@ -211,7 +211,7 @@ platformNcgSupported platform = if ArchX86_64 -> True ArchPPC -> True ArchPPC_64 {} -> True - ArchAArch64 -> True + ArchAArch64 -> platformOS platform /= OSMinGW32 ArchWasm32 -> True ArchRISCV64 -> True _ -> False ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -240,11 +240,12 @@ ppBCEnv p -- Create a BCO and do a spot of peephole optimisation on the insns -- at the same time. mkProtoBCO - :: (Outputable name) - => Platform - -> Bool -- ^ True <=> label with @BCO_NAME@ instruction - -- see Note [BCO_NAME] - -> name + :: + Platform + -> Maybe Module + -- ^ Just cur_mod <=> label with @BCO_NAME@ instruction + -- see Note [BCO_NAME] + -> Name -> BCInstrList -> Either [CgStgAlt] (CgStgRhs) -- ^ original expression; for debugging only @@ -253,7 +254,7 @@ mkProtoBCO -> [StgWord] -- ^ bitmap -> Bool -- ^ True <=> is a return point, rather than a function -> [FFIInfo] - -> ProtoBCO name + -> ProtoBCO Name mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bitmap is_ret ffis = ProtoBCO { protoBCOName = nm, @@ -267,9 +268,9 @@ mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bit where #if MIN_VERSION_rts(1,0,3) maybe_add_bco_name instrs - | _add_bco_name = BCO_NAME str : instrs - where - str = BS.pack $ showSDocOneLine defaultSDocContext (ppr nm) + | Just cur_mod <- _add_bco_name = + let str = BS.pack $ showSDocOneLine defaultSDocContext (pprFullName cur_mod nm) + in BCO_NAME str : instrs #endif maybe_add_bco_name instrs = instrs @@ -1398,7 +1399,7 @@ Note [unboxed tuple bytecodes and tuple_BCO] tupleBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name tupleBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1419,7 +1420,7 @@ tupleBCO platform args_info args = primCallBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name primCallBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -2359,8 +2360,12 @@ getHscEnv = BcM $ \st -> return (st, bcm_hsc_env st) getProfile :: BcM Profile getProfile = targetProfile <$> getDynFlags -shouldAddBcoName :: BcM Bool -shouldAddBcoName = gopt Opt_AddBcoName <$> getDynFlags +shouldAddBcoName :: BcM (Maybe Module) +shouldAddBcoName = do + add <- gopt Opt_AddBcoName <$> getDynFlags + if add + then Just <$> getCurrentModule + else return Nothing emitBc :: ([FFIInfo] -> ProtoBCO Name) -> BcM (ProtoBCO Name) emitBc bco ===================================== libraries/Cabal ===================================== @@ -1 +1 @@ -Subproject commit 269fd808e5d80223a229b6b19edfe6f5b109007a +Subproject commit 682c54a9e8127c79e714545dbf493bb5de470945 ===================================== libraries/Win32 ===================================== @@ -1 +1 @@ -Subproject commit 027cbcf0de25d681823ea92fb545a2604c3a6a8b +Subproject commit f340d2c3d846fce73117dd2548ad1bf0c56ceb9d ===================================== libraries/base/src/System/CPUTime/Windows.hsc ===================================== @@ -60,7 +60,7 @@ type HANDLE = () #if defined(i386_HOST_ARCH) foreign import stdcall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE) foreign import stdcall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt -#elif defined(x86_64_HOST_ARCH) +#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) foreign import ccall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE) foreign import ccall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt #else ===================================== libraries/base/tests/perf/encodingAllocations.hs ===================================== @@ -13,13 +13,13 @@ import Distribution.Simple.Utils main :: IO () -main = withTempFile "." "encodingAllocations.tmp" (const $ loop 1000000) +main = withTempFile "encodingAllocations.tmp" (loop 1000000) -loop :: Int -> Handle -> IO () -loop 0 !_ = pure () -loop !n !h = do +loop :: Int -> FilePath -> Handle -> IO () +loop 0 !_ !_ = pure () +loop !n !fp !h = do hPutChar h $! dummy_char n - loop (n-1) h + loop (n-1) fp h -- unsafe efficient version of `chr` my_chr :: Int -> Char ===================================== libraries/directory ===================================== @@ -1 +1 @@ -Subproject commit 005fa061171a55d35ce8dfe936cf3703525a8616 +Subproject commit eb40bbebcaf86153bbc60772fb2e0466d35c95c4 ===================================== libraries/haskeline ===================================== @@ -1 +1 @@ -Subproject commit 5f4bf62bf1f4846ad0b8d1fa9d45f902e3934511 +Subproject commit 5f1a790a5db1cb3708d105d4f532c32fcbeb4296 ===================================== libraries/process ===================================== @@ -1 +1 @@ -Subproject commit 9c3bfc214c72bbd0c8a30a1c41465deed0feaf47 +Subproject commit fbbe60718736999db701c12528c85cbc605ab4fb ===================================== libraries/unix ===================================== @@ -1 +1 @@ -Subproject commit 74ae1c0d9dd1518434f7d6cd3e63d7769599e0f9 +Subproject commit 9208d3a5809476e64b9a387a6000821083d1ebfd ===================================== llvm-targets ===================================== @@ -1,4 +1,5 @@ [("x86_64-unknown-windows-gnu", ("e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", "x86-64", "")) +,("aarch64-unknown-windows-gnu", ("e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32", "generic", "+v8a +fp-armv8 +neon")) ,("arm-unknown-linux-gnueabi", ("e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "arm7tdmi", "+strict-align")) ,("arm-unknown-linux-gnueabihf", ("e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align")) ,("arm-unknown-linux-musleabihf", ("e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align")) ===================================== m4/ghc_tables_next_to_code.m4 ===================================== @@ -22,8 +22,13 @@ AC_DEFUN([GHC_TABLES_NEXT_TO_CODE], AC_MSG_RESULT([no]) ;; *) - TablesNextToCodeDefault=YES - AC_MSG_RESULT([yes]) + if test "$TargetOS" = "mingw32" && test "$TargetArch" = "aarch64"; then + TablesNextToCodeDefault=NO + AC_MSG_RESULT([no]) + else + TablesNextToCodeDefault=YES + AC_MSG_RESULT([yes]) + fi ;; esac ;; ===================================== rts/StgCRun.c ===================================== @@ -863,8 +863,12 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { */ "br %1\n\t" +#if defined(mingw32_HOST_OS) + ".globl " STG_RETURN "\n" +#else ".globl " STG_RETURN "\n\t" -#if !defined(ios_HOST_OS) && !defined(darwin_HOST_OS) +#endif +#if !defined(ios_HOST_OS) && !defined(darwin_HOST_OS) && !defined(mingw32_HOST_OS) ".type " STG_RETURN ", %%function\n" #endif STG_RETURN ":\n\t" ===================================== rts/StgCRunAsm.S ===================================== @@ -69,7 +69,7 @@ StgReturn: .section .note.GNU-stack,"", at progbits # else // Not ELF v2 -# error Only ELF v2 supported. + // ELF v1 is in StgCrun.c # endif #elif defined(powerpc_HOST_ARCH) ===================================== rts/win32/veh_excn.c ===================================== @@ -287,6 +287,16 @@ void generateStack (EXCEPTION_POINTERS* pExceptionPointers) stackFrame.AddrStack.Offset = context->Rsp; stackFrame.AddrStack.Mode = AddrModeFlat; +#elif defined(aarch64_HOST_ARCH) + machineType = IMAGE_FILE_MACHINE_ARM64; + stackFrame.AddrPC.Offset = context->Pc; + stackFrame.AddrPC.Mode = AddrModeFlat; + + stackFrame.AddrFrame.Offset = context->Fp; + stackFrame.AddrFrame.Mode = AddrModeFlat; + + stackFrame.AddrStack.Offset = context->Sp; + stackFrame.AddrStack.Mode = AddrModeFlat; #endif fprintf (stderr, "\n Attempting to reconstruct a stack trace...\n\n"); if (!SymInitialize (GetCurrentProcess (), NULL, true)) ===================================== utils/hsc2hs ===================================== @@ -1 +1 @@ -Subproject commit c3b21800a67366c9591dc85a471d1dfdb1efcf29 +Subproject commit 2fab2f4cdffef12afe561ef03f5ebdace7dbae67 ===================================== utils/llvm-targets/gen-data-layout.sh ===================================== @@ -27,6 +27,7 @@ TARGETS=( # Windows "x86_64-unknown-windows-gnu" + "aarch64-unknown-windows-gnu" ######################### # Linux View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9f8176f11878a0fbf637b1f4c9a640d6771c17b1...1d3de001ca88368a1fd0a604bc32f0f351ae8c9b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9f8176f11878a0fbf637b1f4c9a640d6771c17b1...1d3de001ca88368a1fd0a604bc32f0f351ae8c9b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 09:31:47 2025 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 04 Feb 2025 04:31:47 -0500 Subject: [Git][ghc/ghc][wip/T24359] 2 commits: new approach from Jan 31 Message-ID: <67a1de834c658_33886c29a4f0062675@gitlab.mail> sheaf pushed to branch wip/T24359 at Glasgow Haskell Compiler / GHC Commits: ea8fe09b by sheaf at 2025-02-03T19:29:45+01:00 new approach from Jan 31 - - - - - 2d65f88f by sheaf at 2025-02-04T10:31:36+01:00 polish up new approach - - - - - 9 changed files: - compiler/GHC/HsToCore/Binds.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/Solver/Solve.hs - testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs - testsuite/tests/typecheck/should_compile/SpecPragmas.hs → testsuite/tests/typecheck/should_compile/TcSpecPragmas.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/HsToCore/Binds.hs ===================================== @@ -960,12 +960,16 @@ dsSpec poly_rhs ( ; tracePm "dsSpec" (vcat [ text "poly_id" <+> ppr poly_id , text "bndrs" <+> ppr bndrs + , text "lhs_args" <+> ppr lhs_args + , text "bndr_set" <+> ppr bndr_set , text "all_bndrs" <+> ppr all_bndrs + , text "rule_bndrs" <+> ppr rule_bndrs , text "const_bndrs" <+> ppr const_bndrs - , text "ds_call" <+> ppr ds_call - , text "core_call" <+> ppr core_call + , text "spec_bndrs" <+> ppr spec_bndrs , text "core_call fvs" <+> ppr (exprFreeVars core_call) - , text "spec_const_binds" <+> ppr spec_const_binds ]) + , text "spec_const_binds" <+> ppr spec_const_binds + , text "ds_call" <+> ppr ds_call + , text "core_call" <+> ppr core_call ]) ; finishSpecPrag poly_nm poly_rhs rule_bndrs poly_id lhs_args @@ -1004,7 +1008,7 @@ prepareSpecLHS poly_id evs the_call = Nothing transfer_to_spec_rhs qevs rhs - = isEmptyVarSet (exprSomeFreeVars is_quant_id rhs) + = isEmptyVarSet $ exprSomeFreeVars is_quant_id rhs where is_quant_id v = isId v && v `elemVarSet` qevs -- See Note [Desugaring SPECIALISE pragmas] wrinkle (SP4) ===================================== compiler/GHC/Tc/Gen/Sig.hs ===================================== @@ -772,8 +772,9 @@ This is done in three parts. (1) Typecheck the expression, capturing its constraints - (2) Simplify these constraints, in special TcSSpecPrag mode - SLD TODO add more details. + (2) Solve the Wanted constraints that arose from (1). + This is a bit subtle, as we don't want to allow arbitrary constraint + simplification. See Note [Fully solving constraints for specialisation]. (3) Decide which constraints to quantify over, and quantify. @@ -807,6 +808,69 @@ This is done in three parts. of the form: forall @a @b d1 d2 d3. f d1 d2 d3 = $sf d1 d2 d3 +Note [Fully solving constraints for specialisation] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +As far as specialisation is concerned, it is actively harmful to simplify +constraints without fully solving them. Two key examples: + +f :: ∀ a t. (Eq a, ∀x. Eq x => Eq (t x)). t a -> Char +{-# SPECIALISE f @Int #-} + + Typechecking 'f' will result in [W] Eq Int, [W] ∀x. Eq x => Eq (t x). + We absolutely MUST leave the quantified constraint alone, because we want to + quantify over it. If we were to try to simplify it, we would emit an + implication and would thereafter never be able to quantify over the original + quantified constraint. + + However, we still need to simplify quantified constraints that can be fully + solved from instances, otherwise we would never be able to specialise them + away. Example: {-# SPECIALISE f @a @[] #-}. + +g :: ∀ a. Eq a => a -> Bool +{-# SPECIALISE g @[e] #-} + + Typechecking 'g' will result in [W] Eq [e]. Were we to simplify this to + [W] Eq e, we would have difficulty generating a RULE for the specialisation: + + $sg :: Eq e => [e] -> Bool + + RULE ∀ e (d :: Eq [e]). g @[e] d = $sg @e (??? :: Eq e) + -- Can't fill in ??? because we can't run instances in reverse. + + RULE ∀ e (d :: Eq e). g @[e] ($fEqList @e d) = $sg @e d + -- Bad RULE matching template: matches on the structure of a dictionary + + Moreover, there is no real benefit to any of this, because the specialiser + can't do anything useful from the knowledge that a dictionary for 'Eq [e]' is + constructed from a dictionary for 'Eq e' using the 'Eq' instance for lists. + + Note however that it is less important to tackle this problem in the typechecker, + as the desugarer would still be able to generate the correct RULE if we did + simplify 'Eq [e]' to 'Eq e'. See the second bullet point in (SP2) in + Note [Desugaring SPECIALISE pragmas] in GHC.HsToCore.Binds. + +The conclusion is this: + + when solving the constraints that arise from a specialise pragma, following + the recipe described in Note [Handling new-form SPECIALISE pragmas], all + Wanteds should either be: + - fully solved (no free evidence variables), or + - left untouched. + +To achieve this, we proceed as follows: + + 1. Clone the Wanteds that arose from typechecking the specialise expression. + 2. Solve these cloned Wanteds. + 3. Look through the evidence produced by the solver to determine which + of these Wanteds were fully solved using instances (no free evidence variables). + 4. Zonk the original Wanteds, to benefit from any unifications that happened in (2). + 5. Use the information obtained in (3) to partition the original Wanteds into + two sets: those that can be fully solved, and the rest. + 6. Fully solve the "fully soluble" Wanteds, and leave the rest alone (left + as candidates for quantification). + (NB: it is wasteful to do another round of solving here, but doing so is + more convenient than somehow transferring over the evidence terms from the + cloned Wanteds). Note [Handling old-form SPECIALISE pragmas] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -978,7 +1042,7 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) -- For running commentary, see Note [Handling new-form SPECIALISE pragmas] = do { -- (1) Typecheck the expression, spec_e, capturing its constraints let skol_info_anon = SpecESkol nm - ; traceTc "tcSpecPrag SpecSigE 1" (ppr nm $$ ppr spec_e) + ; traceTc "tcSpecPrag SpecSigE {" (ppr nm $$ ppr spec_e) ; skol_info <- mkSkolemInfo skol_info_anon ; (rhs_tclvl, spec_e_wanted, (rule_bndrs', (tc_spec_e, _rho))) <- tcRuleBndrs skol_info rule_bndrs $ @@ -988,80 +1052,71 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) -- in a special way: every original Wanted should be either fully solved -- or left untouched. -- - -- We achieve this by: - -- - -- 2.1. Clone the wanteds that arose from typechecking spec_e. - -- - -- 2.2 Try to solve them, and look through the evidence to see which - -- ones we could fully solve. - -- - -- 2.3 Separate the original Wanteds into two groups, those that - -- we could fully solve and those that we couldn't - -- - -- The fully soluble ones get solved again (a bit wasteful). - -- The other ones either get quantified or emitted as residuals, - -- depending on whether they can be quantified (see 'getRuleQuantCts'.) + -- See Note [Fully solving constraints for specialisation]. + + -- (2.1) Clone the Wanteds. ; ev_binds_var_clone <- newTcEvBinds ; spec_e_wanted_clone <- cloneWC spec_e_wanted + + -- (2.2) Solve the cloned Wanteds. ; simpl_spec_e_wanted_clone <- setTcLevel rhs_tclvl $ runTcSWithEvBinds ev_binds_var_clone $ solveWanteds spec_e_wanted_clone - ; not_fully_solved <- + + -- (2.3) Determine which cloned Wanteds were fully solved. + ; not_fully_solved_ev_ids <- notFullySolvedWanteds ev_binds_var_clone simpl_spec_e_wanted_clone + -- (2.4) Zonk the original Wanteds to benefit from any unifications in (2.2) ; spec_e_wanted <- liftZonkM $ zonkWC spec_e_wanted - ; let (fully_soluble1, other1) = - partitionWC - (\ ev_id -> not (ev_id `elemVarSet` not_fully_solved)) - spec_e_wanted + -- (2.5) Partition the original Wanteds into fully soluble Wanteds and the rest. + ; let (other_wanteds, fully_soluble_wanteds) = + partitionWC (`elemVarSet` not_fully_solved_ev_ids) spec_e_wanted + -- (2.6) Fully solve the fully-soluble Wanteds. ; ev_binds_var <- newTcEvBinds - ; simpl_fully_soluble1 <- setTcLevel rhs_tclvl $ + ; simpl_fully_soluble <- setTcLevel rhs_tclvl $ runTcSWithEvBinds ev_binds_var $ - solveWanteds fully_soluble1 - ; massertPpr (isSolvedWC simpl_fully_soluble1) $ - vcat [ text "tcSpecPrag: fully soluble Wanteds couldn't be fully solved?" - , text "spec_e_wanted:" <+> ppr spec_e_wanted - , text "spec_e_wanted_clone:" <+> ppr spec_e_wanted_clone - , text "simpl_spec_e_wanted_clone:" <+> ppr simpl_spec_e_wanted_clone - , text "not_fully_solved:" <+> ppr not_fully_solved - , text "fully_soluble1:" <+> ppr fully_soluble1 - , text "other1:" <+> ppr other1 - , text "simpl_fully_soluble1:" <+> ppr simpl_fully_soluble1 - ] - - -- (3) Quantify over the constraints - ; (quant_cts, residual) <- getRuleQuantCts other1 + solveWanteds fully_soluble_wanteds + ; massertPpr (isSolvedWC simpl_fully_soluble) $ + vcat [ text "tcSpecPrag (SpecSigE): unexpected unsolved constraints for" <+> quotes (ppr nm) <> colon + , ppr simpl_fully_soluble + , text "original Wanteds:" <+> ppr spec_e_wanted + , text "supposedly soluble Wanteds:" <+> ppr fully_soluble_wanteds + , text "not_fully_solved_ev_ids:" <+> ppr not_fully_solved_ev_ids + , text "spec_e:" <+> ppr spec_e + ] + + -- (3) Quantify other constraints. The quantification candidates + -- are the non-fully-soluble constraints computed in (2.5). + ; (quant_cts, residual_wc) <- getRuleQuantCts other_wanteds ; let qevs = map ctEvId $ bagToList quant_cts - -- (4) Emit the residual (non-quantified) constraints, - -- and wrap the expression in the evidence let bindings + -- (4) Emit the residual constraints, and wrap the expression + -- in the evidence let bindings ; let tv_bndrs = filter isTyVar rule_bndrs' ; emitResidualConstraints rhs_tclvl skol_info_anon ev_binds_var emptyVarSet tv_bndrs qevs - residual + residual_wc ; let lhs_call = mkLHsWrap (WpLet (TcEvBinds ev_binds_var)) tc_spec_e - ; traceTc "tcSpecPrag:SpecSigE" $ + ; traceTc "tcSpecPrag SpecSigE }" $ vcat [ text "nm:" <+> ppr nm , text "rule_bndrs':" <+> ppr rule_bndrs' , text "qevs:" <+> ppr qevs , text "spec_e:" <+> ppr tc_spec_e , text "inl:" <+> ppr inl - , text (replicate 40 '=') - , text "spec_e_wanted:" <+> ppr spec_e_wanted - , text "spec_e_wanted_clone:" <+> ppr spec_e_wanted_clone - , text "simpl_spec_e_wanted_clone:" <+> ppr simpl_spec_e_wanted_clone - , text "not_fully_solved:" <+> ppr not_fully_solved - , text "fully_soluble1:" <+> ppr fully_soluble1 - , text "other1:" <+> ppr other1 - , text "simpl_fully_soluble1:" <+> ppr simpl_fully_soluble1 - , text (replicate 40 '-') + , text "not_fully_solved_ev_ids:" <+> ppr not_fully_solved_ev_ids + , text "fully_soluble_wanteds:" <+> ppr fully_soluble_wanteds + , text "other_wanteds:" <+> ppr other_wanteds , text "quant_cts:" <+> ppr quant_cts - , text "residual:" <+> ppr residual + , text "residual_wc:" <+> ppr residual_wc ] + -- (5) Store the results in a SpecPragE record, which will be + -- zonked and then consumed by the desugarer. + ; return [SpecPragE { spe_fn_nm = nm , spe_fn_id = poly_id , spe_bndrs = qevs ++ rule_bndrs' -- Dependency order @@ -1076,14 +1131,14 @@ tcSpecPrag _ prag = pprPanic "tcSpecPrag" (ppr prag) notFullySolvedWanteds :: EvBindsVar -> WantedConstraints -> TcM VarSet notFullySolvedWanteds ev_binds_var wc = do { (unsolved_ids, ev_deps_edges) <- ev_binds_edges ev_binds_var wc - ; let (ev_graph, node_from_vertex, vertex_from_key) = Graph.graphFromEdges ev_deps_edges - evid_from_vertex v = case node_from_vertex v of ( ev_id, _, _ ) -> ev_id - reachable = mkVarSet - $ concatMap (map evid_from_vertex . toList) - $ Graph.dfs - (Graph.transposeG ev_graph) - (map (expectJust "tcSpecPrag (computing fully solved)" . vertex_from_key) unsolved_ids) - ; return reachable + ; let + (ev_graph, node_from_vertex, vertex_from_key) = Graph.graphFromEdges ev_deps_edges + evid_from_vertex v = case node_from_vertex v of (ev_id, _, _) -> ev_id + reachable = concatMap (map evid_from_vertex . toList) + $ Graph.dfs + (Graph.transposeG ev_graph) + (map (expectJust "tcSpecPrag (computing fully solved)" . vertex_from_key) unsolved_ids) + ; return (mkVarSet reachable) } ev_binds_edges :: EvBindsVar -> WantedConstraints -> TcM ([EvId], [(EvId, EvId, [EvId])]) @@ -1131,12 +1186,17 @@ partitionWC :: (EvId -> Bool) -> WantedConstraints -> (WantedConstraints, Wanted partitionWC f wc@(WC { wc_simple = cts, wc_impl = implics }) = let (yes_cts, no_cts) = partitionBag (f . ctEvId) cts (yes_impls, no_impls) = unzipBag $ mapBag f_impl implics - in ( wc { wc_simple = yes_cts, wc_impl = yes_impls } - , wc { wc_simple = no_cts, wc_impl = no_impls } ) + in ( wc { wc_simple = yes_cts, wc_impl = mapMaybeBag prune yes_impls } + , wc { wc_simple = no_cts, wc_impl = mapMaybeBag prune no_impls } ) where f_impl i@(Implic { ic_wanted = wc' }) = let (yes, no) = partitionWC f wc' in (i { ic_wanted = yes }, i { ic_wanted = no }) + prune :: Implication -> Maybe Implication + prune i = + if isEmptyWC ( ic_wanted i ) + then Nothing + else Just i -------------- tcSpecWrapper :: UserTypeCtxt -> TcType -> TcType -> TcM HsWrapper ===================================== compiler/GHC/Tc/Solver/Dict.hs ===================================== @@ -172,8 +172,10 @@ canDictCt ev cls tys | otherwise = Stage $ do { dflags <- getDynFlags - ; let fuel | classHasSCs cls = wantedsFuel dflags - | otherwise = doNotExpand + ; let fuel | classHasSCs cls + = wantedsFuel dflags + | otherwise + = doNotExpand -- See Invariants in `CCDictCan.cc_pend_sc` ; continueWith (DictCt { di_ev = ev, di_cls = cls , di_tys = tys, di_pend_sc = fuel }) } @@ -842,7 +844,6 @@ shortCutSolver dflags ev_w ; loc' <- lift $ checkInstanceOK (ctEvLoc ev) what pred ; lift $ checkReductionDepth loc' pred - ; evc_vs <- mapM (new_wanted_cached ev loc' solved_dicts') preds -- Emit work for subgoals but use our local cache -- so we can solve recursive dictionaries. @@ -856,10 +857,6 @@ shortCutSolver dflags ev_w _other_inst_res -> mzero } - ForAllPred _tvs _theta _body -> - -- TODO: implement short-cut solving for quantified constraints - mzero - _other_pred -> mzero where pred = ctEvPred ev @@ -887,12 +884,11 @@ tryInstances :: DictCt -> SolverStage () tryInstances dict_ct = Stage $ do { dflags <- getDynFlags ; inerts <- getInertSet - ; mode <- getModeTcS - ; try_instances inerts dflags mode dict_ct } + ; try_instances inerts dflags dict_ct } -try_instances :: InertSet -> DynFlags -> TcSMode -> DictCt -> TcS (StopOrContinue ()) +try_instances :: InertSet -> DynFlags -> DictCt -> TcS (StopOrContinue ()) -- Try to use type-class instance declarations to simplify the constraint -try_instances inerts dflags mode +try_instances inerts dflags work_item@(DictCt { di_ev = ev, di_cls = cls , di_tys = xis }) | isGiven ev -- Never use instances for Given constraints @@ -903,16 +899,6 @@ try_instances inerts dflags mode = do { setEvBindIfWanted ev EvCanonical (ctEvTerm solved_ev) ; stopWith ev "Dict/Top (cached)" } - | TcSSpecPrag <- mode - -- In TcSSpecPrag mode, we only want to "fully solve" constraints - -- from instances. Making partial progress using instances is - -- actively harmful; see Note [Handling new-form SPECIALISE pragmas]. - = do { shortcut_worked <- shortCutSolver dflags ev - ; if shortcut_worked - then stopWith ev "TcSSpecPrag DictCt: short-cut fully solved Wanted from instances" - else continueWith () - } - | otherwise -- Wanted, but not cached = do { lkup_res <- matchClassInst dflags inerts cls xis dict_loc ; case lkup_res of ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -2018,7 +2018,7 @@ finishCanWithIrred :: CtIrredReason -> CtEvidence -> TcS (StopOrContinue (Either IrredCt a)) finishCanWithIrred reason ev = do { -- Abort fast if we have any insoluble Wanted constraints, - -- and the TcSMode is TcsHoleFits + -- and the TcSMode is TcSHoleFits mode <- getModeTcS ; when (mode == TcSHoleFits && isInsolubleReason reason) failTcS ===================================== compiler/GHC/Tc/Solver/Monad.hs ===================================== @@ -16,7 +16,7 @@ module GHC.Tc.Solver.Monad ( -- The TcS monad TcS, TcSMode(..), runTcS, runTcSEarlyAbort, runTcSWithEvBinds, runTcSInerts, - runTcSEqualities, runTcSSpecPragWithEvBinds, + runTcSEqualities, failTcS, failWithTcS, warnTcS, addErrTcS, wrapTcS, ctLocWarnTcS, nestTcS, nestImplicTcS, setEvBindsTcS, emitImplicationTcS, emitTvImplicationTcS, @@ -856,14 +856,11 @@ data TcSMode -- -- See Note [Speeding up valid hole-fits]. - | TcSSpecPrag -- ^ Don't use instance declarations or unpack forall constraints; - -- used when simplifying a SPECIALISE pragma. deriving( Eq ) instance Outputable TcSMode where ppr TcSVanilla = text "TcSVanilla" ppr TcSHoleFits = text "TcSHoleFits" - ppr TcSSpecPrag = text "TcSSpecPrag" --------------- newtype TcS a = TcS { unTcS :: TcSEnv -> TcM a } @@ -994,10 +991,6 @@ csTraceTcM mk_doc runTcSWithEvBinds :: EvBindsVar -> TcS a -> TcM a runTcSWithEvBinds = runTcSWorker True TcSVanilla --- | This version of 'runTcSWithEvBinds' uses the 'TcSSpecPrag' mode. -runTcSSpecPragWithEvBinds :: EvBindsVar -> TcS a -> TcM a -runTcSSpecPragWithEvBinds = runTcSWorker True TcSSpecPrag - runTcS :: TcS a -> TcM (a, EvBindMap) runTcS tcs = do { ev_binds_var <- TcM.newTcEvBinds ===================================== compiler/GHC/Tc/Solver/Solve.hs ===================================== @@ -1212,28 +1212,11 @@ solveForAll :: CtEvidence -> [TcTyVar] -> TcThetaType -> PredType -> ExpansionFu -> TcS (StopOrContinue Void) -- Precondition: already rewritten by inert set solveForAll ev tvs theta pred fuel - = do { mode <- getModeTcS - ; solve_forAll ev tvs theta pred fuel mode - } - -solve_forAll :: CtEvidence -> [TcTyVar] -> TcThetaType -> PredType - -> ExpansionFuel -> TcSMode - -> TcS (StopOrContinue Void) -solve_forAll ev@(CtWanted { ctev_dest = dest, ctev_rewriters = rewriters, ctev_loc = loc }) - tvs theta pred _fuel _mode -{- SLD TODO - | TcSSpecPrag <- mode - = do { dflags <- getDynFlags - ; shortcut_worked <- shortCutSolver dflags ev - ; if shortcut_worked - then stopWith ev "TcSSpecPrag QC: short-cut fully solved Wanted from instances" - else do { let qci = QCI { qci_ev = ev, qci_tvs = tvs - , qci_pred = pred, qci_pend_sc = fuel } - ; addInertForAll qci - ; stopWith ev "TcSSpecPrag QC: Wanted kept as inert" } - } - | otherwise --} + | CtGiven {} <- ev + -- See Note [Solving a Given forall-constraint] + = do { addInertForAll qci + ; stopWith ev "Given forall-constraint" } + | CtWanted { ctev_dest = dest, ctev_rewriters = rewriters, ctev_loc = loc } <- ev = -- See Note [Solving a Wanted forall-constraint] TcS.setSrcSpan (getCtLocEnvLoc $ ctLocEnv loc) $ -- This setSrcSpan is important: the emitImplicationTcS uses that @@ -1279,11 +1262,6 @@ solve_forAll ev@(CtWanted { ctev_dest = dest, ctev_rewriters = rewriters, ctev_l ClassPred cls tys -> pSizeClassPred cls tys _ -> pSizeType pred - -- See Note [Solving a Given forall-constraint] -solve_forAll ev@(CtGiven {}) tvs _theta pred fuel _mode - = do { addInertForAll qci - ; stopWith ev "Given forall-constraint" } - where qci = QCI { qci_ev = ev, qci_tvs = tvs , qci_pred = pred, qci_pend_sc = fuel } ===================================== testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs ===================================== @@ -6,7 +6,10 @@ module DsSpecPragmas where -import Control.Monad.ST ( ST ) +import Control.Monad.ST + ( ST ) +import Data.Proxy + ( Proxy(..) ) -- Some specialise pragmas that are difficult to generate the correct RULE for. @@ -17,22 +20,28 @@ f1 _ _ = 111 -- Make sure we don't generate a rule with an LHS of the form -- --- forall @e (d :: Eq e). f @[e] ($fEqList d) = ... +-- forall @e (d :: Eq e). f1 @[e] ($fEqList d) = ... -- -- but rather -- --- forall @e (d :: Eq [e]). f @[e] d = ... +-- forall @e (d :: Eq [e]). f1 @[e] d = ... {-# SPECIALISE f1 :: Eq [e] => Word -> [e] -> Int #-} +f1_qc :: ( forall x. Eq x => Eq ( f x ), Eq a, Num b ) => Proxy f -> a -> b -> Char +f1_qc _ _ _ = 'q' + +-- Like 'f1', but with a local instance (quantified constraint). +{-# SPECIALISE f1_qc :: ( forall y. Eq y => Eq ( g y ), Eq ( g e ) ) => Proxy g -> g e -> Word -> Char #-} + -------------------------------------------------------------------------------- -f2 :: ( Eq a, Eq b ) => a -> b -> Int -f2 a b = if ( a == a ) == ( b == b ) then 1 else 2 +f2 :: ( Eq a, Eq b, Num c ) => a -> b -> c -> Int +f2 _ _ _ = 2 -- Make sure the rule LHS is of the form -- -- f2 @c @c d1 d2 and not f2 @c @c d d -{-# SPECIALISE f2 :: Eq c => c -> c -> Int #-} +{-# SPECIALISE f2 :: Eq c => c -> c -> Word -> Int #-} -------------------------------------------------------------------------------- @@ -69,15 +78,30 @@ f5 x = x == x {-# SPECIALISE f5 :: D Int -> Bool #-} -f6 :: ( Eq a, Eq ( T a ), forall x. ( Eq x, Eq ( T x ) ) => Eq ( f x ) ) => f a -> Bool -f6 z = z == z +f5_qc :: ( Eq a, Eq ( T a ), forall x. ( Eq x, Eq ( T x ) ) => Eq ( f x ) ) => f a -> Bool +f5_qc z = z == z -- Discharge a quantified constraint using a top-level instance -- whose context includes a type family application. -{-# SPECIALISE f6 :: D Int -> Bool #-} +{-# SPECIALISE f5_qc :: D Int -> Bool #-} -- Quantify over this same quantified constraint, but discharge the -- other dictionary constraints. -{-# SPECIALISE f6 :: ( forall y. ( Eq y, Eq ( T y ) ) => Eq ( g y ) ) => g Int -> Bool #-} +{-# SPECIALISE f5_qc :: ( forall y. ( Eq y, Eq ( T y ) ) => Eq ( g y ) ) => g Int -> Bool #-} + +-------------------------------------------------------------------------------- + +f6 :: ( Eq a, Ord b, Num c ) => a -> b -> c -> Char +f6 _ _ _ = 'c' + +-- Check that we do perform simplification among Wanteds that we quantify over. +{-# SPECIALISE f6 :: Ord c => c -> c -> Word -> Char #-} + + +f6_qc :: ( forall x. Eq x => Eq ( f x ), forall y. Eq y => Ord ( g y ), Num c ) => Proxy f -> Proxy g -> c -> Char +f6_qc _ _ _ = 'd' + +-- Like 'f6', but with quantified constraints. +{-# SPECIALISE f6_qc :: ( forall z. Eq z => Ord ( h z ) ) => Proxy h -> Proxy h -> Word -> Char #-} -------------------------------------------------------------------------------- ===================================== testsuite/tests/typecheck/should_compile/SpecPragmas.hs → testsuite/tests/typecheck/should_compile/TcSpecPragmas.hs ===================================== @@ -1,8 +1,17 @@ -{-# LANGUAGE NamedWildCards, PartialTypeSignatures #-} +{-# LANGUAGE GADTs, NamedWildCards, PartialTypeSignatures #-} module SpecPragmas where +import Data.Proxy + ( Proxy(..) ) +import Data.Type.Equality + ( (:~~:)(HRefl) ) +import Data.Typeable + ( Typeable, heqT ) + +-------------------------------------------------------------------------------- + foo :: Num a => a -> a foo x = x + 1 @@ -32,3 +41,16 @@ baz a b = realToFrac a + fromIntegral b {-# SPECIALISE [~1] forall a. forall. baz @a @_ @a #-} +-------------------------------------------------------------------------------- + +tyEq :: ( Typeable a, Typeable b ) => Proxy a -> Proxy b -> Float +tyEq ( _ :: Proxy a ) ( _ :: Proxy b ) = + case heqT @a @b of + Nothing -> 17.9 + Just HRefl -> 1.1 + +-- Check that we don't emit a "useless specialisation" warning, as the +-- specialisation allows us to drop dead code in the body of 'f7'. +{-# SPECIALISE tyEq :: Typeable c => Proxy c -> Proxy c -> Float #-} + +-------------------------------------------------------------------------------- ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -738,7 +738,7 @@ test('ExplicitSpecificityA1', normal, compile, ['']) test('ExplicitSpecificityA2', normal, compile, ['']) test('ExplicitSpecificity4', normal, compile, ['']) test('RuleEqs', normal, compile, ['']) -test('SpecPragmas', normal, compile, ['']) +test('TcSpecPragmas', normal, compile, ['']) test('T17775-viewpats-a', normal, compile, ['']) test('T17775-viewpats-b', normal, compile_fail, ['']) test('T17775-viewpats-c', normal, compile_fail, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4c9dc29cd3b4c8612ea03f36ea35ba7d9579fba3...2d65f88fb38d577e9001053501ad5881f407134c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4c9dc29cd3b4c8612ea03f36ea35ba7d9579fba3...2d65f88fb38d577e9001053501ad5881f407134c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 10:33:24 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 04 Feb 2025 05:33:24 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: ghc-toolchain: Parse i686 triples Message-ID: <67a1ecf4392a0_33886c34c64247390@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 70d30fea by Ben Gamari at 2025-02-04T05:33:12-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - eabffd14 by Cheng Shao at 2025-02-04T05:33:12-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - 2 changed files: - compiler/GHC/ByteCode/Asm.hs - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -168,15 +167,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7d02093878a7cdf7a4e5ad7c8187e7d4f37f3f68...eabffd144dea36db311b12b275f6e3cafe9543b5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7d02093878a7cdf7a4e5ad7c8187e7d4f37f3f68...eabffd144dea36db311b12b275f6e3cafe9543b5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 11:38:19 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 04 Feb 2025 06:38:19 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/no-simple-joinpoints Message-ID: <67a1fc2b62a4b_3c769eaebdac991e7@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/no-simple-joinpoints You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 13:48:04 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Tue, 04 Feb 2025 08:48:04 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] 9.10 record more changes in changelog Message-ID: <67a21a94afe6b_5e753b9b743793c@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: 2e62bd15 by Andreas Klebinger at 2025-02-04T14:25:19+01:00 9.10 record more changes in changelog - - - - - 1 changed file: - docs/users_guide/9.10.2-notes.rst Changes: ===================================== docs/users_guide/9.10.2-notes.rst ===================================== @@ -142,7 +142,7 @@ Build system and packaging - Bindists: Fixed a bug in the Makefile which caused windows installs to duplicate files. (#24800) - +- The packages ghc-internal and ghc-experimental are now versioned based on the GHC version they are shipped with. ``base`` library ~~~~~~~~~~~~~~~~ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e62bd152cc20492059b3229d01132dc5acebaee -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e62bd152cc20492059b3229d01132dc5acebaee You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 13:59:05 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Tue, 04 Feb 2025 08:59:05 -0500 Subject: [Git][ghc/ghc][wip/coreprep-sat-name] CorePrep: Name `sat` binders more descriptively Message-ID: <67a21d2916103_5e758ede7445429@gitlab.mail> Ben Gamari pushed to branch wip/coreprep-sat-name at Glasgow Haskell Compiler / GHC Commits: a204de6a by Ben Gamari at 2025-02-04T08:58:47-05:00 CorePrep: Name `sat` binders more descriptively - - - - - 8 changed files: - compiler/GHC/CoreToStg/Prep.hs - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr Changes: ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -59,7 +59,8 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Id.Make ( realWorldPrimId ) import GHC.Types.Basic -import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName ) +import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName, OccName ) +import GHC.Types.Name.Occurrence (occNameString) import GHC.Types.SrcLoc ( SrcSpan(..), realSrcLocSpan, mkRealSrcLoc ) import GHC.Types.Literal import GHC.Types.Tickish @@ -70,6 +71,7 @@ import qualified Data.ByteString.Builder as BB import Data.ByteString.Builder.Prim import Control.Monad +import Data.List (intercalate) {- Note [CorePrep Overview] @@ -247,11 +249,11 @@ corePrepPgm logger cp_cfg pgm_cfg withTiming logger (text "CorePrep"<+>brackets (ppr this_mod)) (\a -> a `seqList` ()) $ do - us <- mkSplitUniqSupply 's' let initialCorePrepEnv = mkInitialCorePrepEnv cp_cfg - let - implicit_binds = mkDataConWorkers + us <- mkSplitUniqSupply 's' + + let implicit_binds = mkDataConWorkers (cpPgm_generateDebugInfo pgm_cfg) mod_loc data_tycons -- NB: we must feed mkImplicitBinds through corePrep too @@ -711,13 +713,13 @@ cpePair :: TopLevelFlag -> RecFlag -> Demand -> Levity -> UniqSM (Floats, CpeRhs) -- Used for all bindings -- The binder is already cloned, hence an OutId -cpePair top_lvl is_rec dmd lev env bndr rhs +cpePair top_lvl is_rec dmd lev env0 bndr rhs = assert (not (isJoinId bndr)) $ -- those should use cpeJoinPair do { (floats1, rhs1) <- cpeRhsE env rhs -- See if we are allowed to float this stuff out of the RHS ; let dec = want_float_from_rhs floats1 rhs1 - ; (floats2, rhs2) <- executeFloatDecision dec floats1 rhs1 + ; (floats2, rhs2) <- executeFloatDecision env dec floats1 rhs1 -- Make the arity match up ; (floats3, rhs3) @@ -725,7 +727,7 @@ cpePair top_lvl is_rec dmd lev env bndr rhs then return (floats2, cpeEtaExpand arity rhs2) else warnPprTrace True "CorePrep: silly extra arguments:" (ppr bndr) $ -- Note [Silly extra arguments] - (do { v <- newVar (idType bndr) + (do { v <- newVar env (idType bndr) ; let (float, v') = mkNonRecFloat env Lifted v rhs2 ; return ( snocFloat floats2 float , cpeEtaExpand arity (Var v')) }) @@ -735,6 +737,8 @@ cpePair top_lvl is_rec dmd lev env bndr rhs ; return (floats4, rhs4) } where + env = pushBinderContext bndr env0 + arity = idArity bndr -- We must match this arity want_float_from_rhs floats rhs @@ -967,36 +971,36 @@ cpeBodyNF env expr cpeBody :: CorePrepEnv -> CoreExpr -> UniqSM (Floats, CpeBody) cpeBody env expr = do { (floats1, rhs) <- cpeRhsE env expr - ; (floats2, body) <- rhsToBody rhs + ; (floats2, body) <- rhsToBody env rhs ; return (floats1 `appFloats` floats2, body) } -------- -rhsToBody :: CpeRhs -> UniqSM (Floats, CpeBody) +rhsToBody :: CorePrepEnv -> CpeRhs -> UniqSM (Floats, CpeBody) -- Remove top level lambdas by let-binding -rhsToBody (Tick t expr) +rhsToBody env (Tick t expr) | tickishScoped t == NoScope -- only float out of non-scoped annotations - = do { (floats, expr') <- rhsToBody expr + = do { (floats, expr') <- rhsToBody env expr ; return (floats, mkTick t expr') } -rhsToBody (Cast e co) +rhsToBody env (Cast e co) -- You can get things like -- case e of { p -> coerce t (\s -> ...) } - = do { (floats, e') <- rhsToBody e + = do { (floats, e') <- rhsToBody env e ; return (floats, Cast e' co) } -rhsToBody expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] +rhsToBody env expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] | all isTyVar bndrs -- Type lambdas are ok = return (emptyFloats, expr) | otherwise -- Some value lambdas = do { let rhs = cpeEtaExpand (exprArity expr) expr - ; fn <- newVar (exprType rhs) + ; fn <- newVar env (exprType rhs) ; let float = Float (NonRec fn rhs) LetBound TopLvlFloatable ; return (unitFloat float, Var fn) } where (bndrs,_) = collectBinders expr -rhsToBody expr = return (emptyFloats, expr) +rhsToBody _env expr = return (emptyFloats, expr) {- Note [No eta reduction needed in rhsToBody] @@ -1168,7 +1172,7 @@ cpeApp top_env expr -- allocating CaseBound Floats for token and thing as needed = do { (floats1, token) <- cpeArg env topDmd token ; (floats2, thing) <- cpeBody env thing - ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar ty + ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar env ty ; let tup = mkCoreUnboxedTuple [token, Var case_bndr] ; let float = mkCaseFloat case_bndr thing ; return (floats1 `appFloats` floats2 `snocFloat` float, tup) } @@ -1577,7 +1581,7 @@ cpeArg env dmd arg ; let arg_ty = exprType arg1 lev = typeLevity arg_ty dec = wantFloatLocal NonRecursive dmd lev floats1 arg1 - ; (floats2, arg2) <- executeFloatDecision dec floats1 arg1 + ; (floats2, arg2) <- executeFloatDecision env dec floats1 arg1 -- Else case: arg1 might have lambdas, and we can't -- put them inside a wrapBinds @@ -1586,7 +1590,7 @@ cpeArg env dmd arg -- see Note [ANF-ising literal string arguments] ; if exprIsTrivial arg2 then return (floats2, arg2) - else do { v <- (`setIdDemandInfo` dmd) <$> newVar arg_ty + else do { v <- (`setIdDemandInfo` dmd) <$> newVar env arg_ty -- See Note [Pin demand info on floats] ; let arity = cpeArgArity env dec floats1 arg2 arg3 = cpeEtaExpand arity arg2 @@ -2424,13 +2428,13 @@ instance Outputable FloatDecision where ppr FloatNone = text "none" ppr FloatAll = text "all" -executeFloatDecision :: FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) -executeFloatDecision dec floats rhs +executeFloatDecision :: CorePrepEnv -> FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) +executeFloatDecision env dec floats rhs = case dec of FloatAll -> return (floats, rhs) FloatNone | isEmptyFloats floats -> return (emptyFloats, rhs) - | otherwise -> do { (floats', body) <- rhsToBody rhs + | otherwise -> do { (floats', body) <- rhsToBody env rhs ; return (emptyFloats, wrapBinds floats $ wrapBinds floats' body) } -- FloatNone case: `rhs` might have lambdas, and we can't @@ -2569,6 +2573,8 @@ data CorePrepEnv , cpe_subst :: Subst -- ^ See Note [CorePrepEnv: cpe_subst] , cpe_rec_ids :: UnVarSet -- Faster OutIdSet; See Note [Speculative evaluation] + + , cpe_context :: [OccName] -- ^ See Note [Binder context] } mkInitialCorePrepEnv :: CorePrepConfig -> CorePrepEnv @@ -2576,6 +2582,7 @@ mkInitialCorePrepEnv cfg = CPE { cpe_config = cfg , cpe_subst = emptySubst , cpe_rec_ids = emptyUnVarSet + , cpe_context = [] } extendCorePrepEnv :: CorePrepEnv -> Id -> Id -> CorePrepEnv @@ -2616,6 +2623,14 @@ cpSubstCo :: CorePrepEnv -> Coercion -> Coercion cpSubstCo (CPE { cpe_subst = subst }) co = substCo subst co -- substCo has a short-cut if the TCvSubst is empty +-- | See Note [Binder context] +pushBinderContext :: Id -> CorePrepEnv -> CorePrepEnv +pushBinderContext ident env + | lengthAtLeast (cpe_context env) 2 + = env + | otherwise + = env { cpe_context = getOccName ident : cpe_context env} + ------------------------------------------------------------------------------ -- Cloning binders -- --------------------------------------------------------------------------- @@ -2704,10 +2719,20 @@ fiddleCCall id -- Generating new binders -- --------------------------------------------------------------------------- -newVar :: Type -> UniqSM Id -newVar ty - = seqType ty `seq` mkSysLocalOrCoVarM (fsLit "sat") ManyTy ty - +newVar :: CorePrepEnv -> Type -> UniqSM Id +newVar env ty + -- See Note [Binder context] + = seqType ty `seq` mkSysLocalOrCoVarM (fsLit occ) ManyTy ty + where occ = intercalate "_" (map occNameString $ cpe_context env) ++ "_sat" + +{- Note [Binder context] + ~~~~~~~~~~~~~~~~~~~~~ + To ensure that the compiled program (specifically symbol names) + remains understandable to the user we maintain a context + of binders that we are currently under. This allows us to give + identifiers conjured during CorePrep more contextually-meaningful + names. This is done in `newVar`. + -} ------------------------------------------------------------------------------ -- Floating ticks ===================================== testsuite/tests/core-to-stg/T14895.stderr ===================================== @@ -11,10 +11,10 @@ T14895.go GHC.Internal.Data.Either.Left e [Occ=Once1] -> wild; GHC.Internal.Data.Either.Right a1 [Occ=Once1] -> let { - sat [Occ=Once1] :: b + go_sat [Occ=Once1] :: b [LclId] = {a1, f} \u [] f a1; - } in GHC.Internal.Data.Either.Right [sat]; + } in GHC.Internal.Data.Either.Right [go_sat]; }; ===================================== testsuite/tests/core-to-stg/T24124.stderr ===================================== @@ -9,16 +9,16 @@ T24124.testFun1 T24124.StrictPair a b #) [GblId, Arity=3, Str=, Cpr=1, Unf=OtherCon []] = {} \r [x y void] - case x of sat { + case x of testFun1_sat { __DEFAULT -> case case y of y [OS=OneShot] { - __DEFAULT -> T24124.MkStrictPair [sat y]; + __DEFAULT -> T24124.MkStrictPair [testFun1_sat y]; } of - sat + testFun1_sat { - __DEFAULT -> GHC.Internal.Types.MkSolo# [sat]; + __DEFAULT -> GHC.Internal.Types.MkSolo# [testFun1_sat]; }; }; ===================================== testsuite/tests/ghci/should_run/T21052.stdout ===================================== @@ -4,9 +4,9 @@ BCO_toplevel :: GHC.Internal.Types.IO [GHC.Internal.Types.Any] [LclIdX] = {} \u [] let { - sat :: [GHC.Internal.Types.Any] + _sat :: [GHC.Internal.Types.Any] [LclId, Unf=OtherCon []] = :! [GHC.Internal.Tuple.() GHC.Internal.Types.[]]; - } in GHC.Internal.Base.returnIO sat; + } in GHC.Internal.Base.returnIO _sat; ===================================== testsuite/tests/simplCore/should_compile/T20040.stderr ===================================== @@ -16,7 +16,9 @@ ifoldl' = Cons ipv2 ipv3 -> case z of z1 { __DEFAULT -> - case f z1 ipv2 of sat { __DEFAULT -> ifoldl' f sat ipv3; }; + case f z1 ipv2 of ifoldl'_sat { + __DEFAULT -> ifoldl' f ifoldl'_sat ipv3; + }; }; }; end Rec } ===================================== testsuite/tests/simplCore/should_compile/T23083.stderr ===================================== @@ -13,10 +13,10 @@ T23083.g :: ((GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer T23083.g = \ (f [Occ=Once1!] :: (GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> GHC.Internal.Bignum.Integer.Integer) (h [Occ=OnceL1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> let { - sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer + g_sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer [LclId, Unf=OtherCon []] - sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in - f sat + g_sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in + f g_sat -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T23083.$trModule4 :: GHC.Prim.Addr# ===================================== testsuite/tests/simplStg/should_compile/T15226b.stderr ===================================== @@ -8,13 +8,13 @@ T15226b.bar1 T15226b.Str (GHC.Internal.Maybe.Maybe a) #) [GblId, Arity=2, Str=, Cpr=1(, 1), Unf=OtherCon []] = {} \r [x void] - case x of sat { + case x of bar1_sat { __DEFAULT -> let { - sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) + bar1_sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) [LclId, Unf=OtherCon []] = - T15226b.Str! [sat]; - } in GHC.Internal.Types.MkSolo# [sat]; + T15226b.Str! [bar1_sat]; + } in GHC.Internal.Types.MkSolo# [bar1_sat]; }; T15226b.bar ===================================== testsuite/tests/simplStg/should_compile/T19717.stderr ===================================== @@ -6,14 +6,14 @@ Foo.f :: forall {a}. a -> [GHC.Internal.Maybe.Maybe a] case x of x1 { __DEFAULT -> let { - sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a + f_sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a [LclId, Unf=OtherCon []] = GHC.Internal.Maybe.Just! [x1]; } in let { - sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] + f_sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] [LclId, Unf=OtherCon []] = - :! [sat GHC.Internal.Types.[]]; - } in : [sat sat]; + :! [f_sat GHC.Internal.Types.[]]; + } in : [f_sat f_sat]; }; View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a204de6a1d61e50959ee380288af73fa04a3e0d1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a204de6a1d61e50959ee380288af73fa04a3e0d1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 14:24:26 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 04 Feb 2025 09:24:26 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: ghc-toolchain: Parse i686 triples Message-ID: <67a2231a9ff9_5e75c3580c564dd@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 2c0bda8e by Ben Gamari at 2025-02-04T09:24:09-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 3f798e2c by Cheng Shao at 2025-02-04T09:24:10-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - 2 changed files: - compiler/GHC/ByteCode/Asm.hs - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -168,15 +167,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eabffd144dea36db311b12b275f6e3cafe9543b5...3f798e2cb027e73a318574899345fa6d8c59b13d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eabffd144dea36db311b12b275f6e3cafe9543b5...3f798e2cb027e73a318574899345fa6d8c59b13d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 14:51:59 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Tue, 04 Feb 2025 09:51:59 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/backports-9.8 Message-ID: <67a2298f8233_277d212bc1812f9@gitlab.mail> Ben Gamari pushed new branch wip/backports-9.8 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/backports-9.8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 15:01:24 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Tue, 04 Feb 2025 10:01:24 -0500 Subject: [Git][ghc/ghc][master] gitlab-ci: Don't use .full-ci to run test-primops Message-ID: <67a22bc4aa3b4_277d23972e068a2@gitlab.mail> Ben Gamari pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 1 changed file: - .gitlab-ci.yml Changes: ===================================== .gitlab-ci.yml ===================================== @@ -909,7 +909,10 @@ test-primops-label: extends: .test-primops-validate-template rules: - if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/' - - *full-ci + # We do not use *.full-ci here since that would imply running in nightly + # where we do not have the normal validate jobs. We have the -nightly job + # below to handle this case. + - if: '$CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/' test-primops-nightly: extends: .test-primops View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9a59b026608c339ed7872f3d4b8a66b77c52b967 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9a59b026608c339ed7872f3d4b8a66b77c52b967 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 16:21:10 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 04 Feb 2025 11:21:10 -0500 Subject: [Git][ghc/ghc][wip/specialise-assembler] perf: Speed up bytecode assembler by specialising assembleI function Message-ID: <67a23e76e4ad9_348bfe585a84485@gitlab.mail> Matthew Pickering pushed to branch wip/specialise-assembler at Glasgow Haskell Compiler / GHC Commits: 7c9d6afe by Matthew Pickering at 2025-02-04T16:20:52+00:00 perf: Speed up bytecode assembler by specialising assembleI function By specialising the assembleI function for the two intepreters we avoid having to materialise the intermediate free-monad like structure. The resulting generated code is much more direct. - - - - - 4 changed files: - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Data/FlatBag.hs - compiler/GHC/Data/SmallArray.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -1,8 +1,12 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +{-# LANGUAGE PatternSynonyms #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- +-- -- (c) The University of Glasgow 2002-2006 -- @@ -12,10 +16,11 @@ module GHC.ByteCode.Asm ( bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, - mkNativeCallInfoLit + mkNativeCallInfoLit, assembleRunAsm ) where -import GHC.Prelude +import GHC.Prelude hiding ( any ) + import GHC.ByteCode.Instr import GHC.ByteCode.InfoTable @@ -36,6 +41,9 @@ import GHC.Utils.Panic import GHC.Core.TyCon import GHC.Data.FlatBag import GHC.Data.SizedSeq +import GHC.Data.SmallArray + + import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.Cmm.Expr @@ -45,11 +53,11 @@ import GHC.Platform import GHC.Platform.Profile import Control.Monad -import Control.Monad.Trans.Class -import Control.Monad.Trans.State.Strict +import qualified Control.Monad.Trans.State.Strict as MTL import qualified Data.Array.Unboxed as Array -import Data.Array.Base ( UArray(..) ) +import qualified Data.Array.IO as Array +import Data.Array.Base ( UArray(..), unsafeWrite, numElements, unsafeFreeze ) import Foreign hiding (shiftL, shiftR) import Data.Char ( ord ) @@ -58,6 +66,10 @@ import Data.Maybe (fromMaybe) import qualified Data.Map.Strict as Map import GHC.Float (castFloatToWord32, castDoubleToWord64) +import qualified Data.List as List ( any ) +import GHC.Exts + + -- ----------------------------------------------------------------------------- -- Unlinked BCOs @@ -134,9 +146,9 @@ assembleBCOs interp profile proto_bcos tycons top_strs modbreaks spt_entries = d -- mallocStrings :: Interp -> FlatBag UnlinkedBCO -> IO (FlatBag UnlinkedBCO) mallocStrings interp ulbcos = do - let bytestrings = reverse (execState (mapM_ collect ulbcos) []) + let bytestrings = reverse (MTL.execState (mapM_ collect ulbcos) []) ptrs <- interpCmd interp (MallocStrings bytestrings) - return (evalState (mapM splice ulbcos) ptrs) + return (MTL.evalState (mapM splice ulbcos) ptrs) where splice bco at UnlinkedBCO{..} = do lits <- mapM spliceLit unlinkedBCOLits @@ -144,10 +156,10 @@ mallocStrings interp ulbcos = do return bco { unlinkedBCOLits = lits, unlinkedBCOPtrs = ptrs } spliceLit (BCONPtrStr _) = do - rptrs <- get + rptrs <- MTL.get case rptrs of (RemotePtr p : rest) -> do - put rest + MTL.put rest return (BCONPtrWord (fromIntegral p)) _ -> panic "mallocStrings:spliceLit" spliceLit other = return other @@ -160,8 +172,8 @@ mallocStrings interp ulbcos = do mapM_ collectPtr unlinkedBCOPtrs collectLit (BCONPtrStr bs) = do - strs <- get - put (bs:strs) + strs <- MTL.get + MTL.put (bs:strs) collectLit _ = return () collectPtr (BCOPtrBCO bco) = collect bco @@ -176,6 +188,47 @@ assembleOneBCO interp profile pbco = do UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) return ubco' + +{-# NOINLINE inspectInstrs #-} +inspectInstrs :: Platform -> Bool -> Word -> [BCInstr] -> InspectState +inspectInstrs platform long_jump e instrs = + inspectAsm long_jump e (mapM_ (assembleI @InspectAsm platform) instrs) + +data RunAsmReader = RunAsmReader { isn_array :: {-# UNPACK #-} !(Array.IOUArray Int Word16) + , ptr_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCOPtr) + , lit_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCONPtr ) + } + +data RunAsmResult = RunAsmResult { final_isn_array :: !(Array.UArray Int Word16) + , final_ptr_array :: !(SmallArray BCOPtr) + , final_lit_array :: !(SmallArray BCONPtr) } + +-- How many words we have written so far. +data AsmState = AsmState { nisn :: !Int, nptr :: !Int, nlit :: !Int } + + +{-# NOINLINE runInstrs #-} +runInstrs :: Platform -> Bool -> InspectState -> [BCInstr] -> IO RunAsmResult +runInstrs platform long_jumps is_state instrs = do + isn_array <- Array.newArray_ (0, (fromIntegral $ instrCount is_state) - 1) + ptr_array <- newSmallArrayIO (fromIntegral $ ptrCount is_state) undefined + lit_array <- newSmallArrayIO (fromIntegral $ litCount is_state) undefined + let env :: LocalLabel -> Word + env lbl = fromMaybe + (pprPanic "assembleBCO.findLabel" (ppr lbl)) + (Map.lookup lbl (lblEnv is_state)) + let initial_state = AsmState 0 0 0 + let initial_reader = RunAsmReader{..} + runAsm long_jumps env initial_reader initial_state (mapM_ (\i -> assembleRunAsm platform i) instrs) + final_isn_array <- unsafeFreeze isn_array + final_ptr_array <- unsafeFreezeSmallArrayIO ptr_array + final_lit_array <- unsafeFreezeSmallArrayIO lit_array + return $ RunAsmResult {..} + +{-# NOINLINE assembleRunAsm #-} +assembleRunAsm :: Platform -> BCInstr -> RunAsm () +assembleRunAsm p i = assembleI @RunAsm p i + assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm @@ -184,9 +237,7 @@ assembleBCO platform , protoBCOBitmapSize = bsize , protoBCOArity = arity }) = do -- pass 1: collect up the offsets of the local labels. - let asm = mapM_ (assembleI platform) instrs - - initial_offset = 0 + let initial_offset = 0 -- Jump instructions are variable-sized, there are long and short variants -- depending on the magnitude of the offset. However, we can't tell what @@ -196,30 +247,25 @@ assembleBCO platform -- and if the final size is indeed small enough for short jumps, we are -- done. Otherwise, we repeat the calculation, and we force all jumps in -- this BCO to be long. - (n_insns0, lbl_map0) = inspectAsm platform False initial_offset asm - ((n_insns, lbl_map), long_jumps) - | isLargeW (fromIntegral $ Map.size lbl_map0) - || isLargeW n_insns0 - = (inspectAsm platform True initial_offset asm, True) - | otherwise = ((n_insns0, lbl_map0), False) - - env :: LocalLabel -> Word - env lbl = fromMaybe - (pprPanic "assembleBCO.findLabel" (ppr lbl)) - (Map.lookup lbl lbl_map) + is0 = inspectInstrs platform False initial_offset instrs + (is1, long_jumps) + | isLargeInspectState is0 + = (inspectInstrs platform True initial_offset instrs, True) + | otherwise = (is0, False) + -- pass 2: run assembler and generate instructions, literals and pointers - let initial_state = (emptySS, emptySS, emptySS) - (final_insns, final_lits, final_ptrs) <- flip execStateT initial_state $ runAsm platform long_jumps env asm + RunAsmResult{..} <- runInstrs platform long_jumps is1 instrs -- precomputed size should be equal to final size - massertPpr (n_insns == sizeSS final_insns) + massertPpr (fromIntegral (instrCount is1) == numElements final_isn_array + && fromIntegral (ptrCount is1) == sizeofSmallArray final_ptr_array + && fromIntegral (litCount is1) == sizeofSmallArray final_lit_array) (text "bytecode instruction count mismatch") - let asm_insns = ssElts final_insns - !insns_arr = mkBCOByteArray $ Array.listArray (0 :: Int, fromIntegral n_insns - 1) asm_insns + let !insns_arr = mkBCOByteArray $ final_isn_array !bitmap_arr = mkBCOByteArray $ mkBitmapArray bsize bitmap - ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSizedSeq final_lits) (fromSizedSeq final_ptrs) + ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSmallArray final_lit_array) (fromSmallArray final_ptr_array) -- 8 Aug 01: Finalisers aren't safe when attached to non-primitive -- objects, since they might get run too early. Disable this until @@ -236,10 +282,6 @@ mkBitmapArray bsize bitmap = Array.listArray (0, length bitmap) $ fromIntegral bsize : map (fromInteger . fromStgWord) bitmap --- instrs nonptrs ptrs -type AsmState = (SizedSeq Word16, - SizedSeq BCONPtr, - SizedSeq BCOPtr) data Operand = Op Word @@ -259,39 +301,9 @@ truncHalfWord platform w = case platformWordSize platform of PW8 | w <= 4294967295 -> Op (fromIntegral w) _ -> pprPanic "GHC.ByteCode.Asm.truncHalfWord" (ppr w) -data Assembler a - = AllocPtr (IO BCOPtr) (Word -> Assembler a) - | AllocLit [BCONPtr] (Word -> Assembler a) - | AllocLabel LocalLabel (Assembler a) - | Emit Word16 [Operand] (Assembler a) - | NullAsm a - deriving (Functor) - -instance Applicative Assembler where - pure = NullAsm - (<*>) = ap - -instance Monad Assembler where - NullAsm x >>= f = f x - AllocPtr p k >>= f = AllocPtr p (k >=> f) - AllocLit l k >>= f = AllocLit l (k >=> f) - AllocLabel lbl k >>= f = AllocLabel lbl (k >>= f) - Emit w ops k >>= f = Emit w ops (k >>= f) - -ioptr :: IO BCOPtr -> Assembler Word -ioptr p = AllocPtr p return - -ptr :: BCOPtr -> Assembler Word -ptr = ioptr . return - -lit :: [BCONPtr] -> Assembler Word -lit l = AllocLit l return - -label :: LocalLabel -> Assembler () -label w = AllocLabel w (return ()) -emit :: Word16 -> [Operand] -> Assembler () -emit w ops = Emit w ops (return ()) +ptr :: MonadAssembler m => BCOPtr -> m Word +ptr = ioptr . return type LabelEnv = LocalLabel -> Word @@ -302,36 +314,130 @@ largeOp long_jumps op = case op of IOp i -> isLargeI i LabelOp _ -> long_jumps -runAsm :: Platform -> Bool -> LabelEnv -> Assembler a -> StateT AsmState IO a -runAsm platform long_jumps e = go +newtype RunAsm a = RunAsm' { runRunAsm :: Bool + -> LabelEnv + -> RunAsmReader + -> AsmState + -> IO (AsmState, a) } + +pattern RunAsm :: (Bool -> LabelEnv -> RunAsmReader -> AsmState -> IO (AsmState, a)) + -> RunAsm a +pattern RunAsm m <- RunAsm' m where - go (NullAsm x) = return x - go (AllocPtr p_io k) = do - p <- lift p_io - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_p1 = addToSS st_p0 p - in (sizeSS st_p0, (st_i0,st_l0,st_p1)) - go $ k w - go (AllocLit lits k) = do - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_l1 = addListToSS st_l0 lits - in (sizeSS st_l0, (st_i0,st_l1,st_p0)) - go $ k w - go (AllocLabel _ k) = go k - go (Emit w ops k) = do - let largeArgs = any (largeOp long_jumps) ops - opcode - | largeArgs = largeArgInstr w - | otherwise = w - words = concatMap expand ops - expand (SmallOp w) = [w] - expand (LabelOp w) = expand (Op (e w)) - expand (Op w) = if largeArgs then largeArg platform (fromIntegral w) else [fromIntegral w] - expand (IOp i) = if largeArgs then largeArg platform (fromIntegral i) else [fromIntegral i] - state $ \(st_i0,st_l0,st_p0) -> - let st_i1 = addListToSS st_i0 (opcode : words) - in ((), (st_i1,st_l0,st_p0)) - go k + RunAsm m = RunAsm' (oneShot $ \a -> oneShot $ \b -> oneShot $ \c -> oneShot $ \d -> m a b c d) +{-# COMPLETE RunAsm #-} + +instance Functor RunAsm where + fmap f (RunAsm x) = RunAsm (\a b c !s -> fmap (fmap f) (x a b c s)) + +instance Applicative RunAsm where + pure x = RunAsm $ \_ _ _ !s -> pure (s, x) + (RunAsm f) <*> (RunAsm x) = RunAsm $ \a b c !s -> do + (!s', f') <- f a b c s + (!s'', x') <- x a b c s' + return (s'', f' x') + {-# INLINE (<*>) #-} + + +instance Monad RunAsm where + return = pure + (RunAsm m) >>= f = RunAsm $ \a b c !s -> m a b c s >>= \(s', r) -> runRunAsm (f r) a b c s' + {-# INLINE (>>=) #-} + +runAsm :: Bool -> LabelEnv -> RunAsmReader -> AsmState -> RunAsm a -> IO a +runAsm long_jumps e r s (RunAsm'{runRunAsm}) = fmap snd $ runRunAsm long_jumps e r s + +-- Unrolled to avoid allocating intermediate lists. +expand :: PlatformWordSize -> Bool -> Operand -> RunAsm () +expand word_size largeArgs o = do + e <- askEnv + case o of + (SmallOp w) -> writeIsn w + (LabelOp w) -> let !r = e w in handleLargeArg r + (Op w) -> handleLargeArg w + (IOp i) -> handleLargeArg i + + where + handleLargeArg :: Integral a => a -> RunAsm () + handleLargeArg w = + if largeArgs + then largeArg word_size (fromIntegral w) + else writeIsn (fromIntegral w) + + +{-# INLINE any #-} +-- Any is unrolled manually so that the call in `emit` can be eliminated without +-- relying on SpecConstr (which does not work across modules). +any :: (a -> Bool) -> [a] -> Bool +any _ [] = False +any f [x] = f x +any f [x,y] = f x && f y +any f [x,y,z] = f x && f y && f z +any f [x1,x2,x3,x4] = f x1 && f x2 && f x3 && f x4 +any f [x1,x2,x3,x4, x5] = f x1 && f x2 && f x3 && f x4 && f x5 +any f [x1,x2,x3,x4,x5,x6] = f x1 && f x2 && f x3 && f x4 && f x5 && f x6 +any f xs = List.any f xs + +lift :: IO a -> RunAsm a +lift io = RunAsm $ \_ _ _ s -> io >>= \a -> pure (s, a) + +askLongJumps :: RunAsm Bool +askLongJumps = RunAsm $ \a _ _ s -> pure (s, a) + +askEnv :: RunAsm LabelEnv +askEnv = RunAsm $ \_ b _ s -> pure (s, b) + +writePtr :: BCOPtr -> RunAsm Word +writePtr w + = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO ptr_array (nptr asm) w + let !n' = nptr asm + 1 + let !asm' = asm { nptr = n' } + return (asm', fromIntegral (nptr asm)) + +writeLit :: BCONPtr -> RunAsm Word +writeLit w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO lit_array (nlit asm) w + let !n' = nlit asm + 1 + let !asm' = asm { nlit = n' } + return (asm', fromIntegral (nlit asm)) + +writeLits :: [BCONPtr] -> RunAsm Word +writeLits [] = error "empty" +writeLits [l] = writeLit l +writeLits [l1,l2] = writeLit l1 <* writeLit l2 +writeLits (l:ls) = writeLit l <* mapM_ writeLit ls + +writeIsn :: Word16 -> RunAsm () +writeIsn w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + unsafeWrite isn_array (nisn asm) w + let !n' = nisn asm + 1 + let !asm' = asm { nisn = n' } + return (asm', ()) + + +instance MonadAssembler RunAsm where + ioptr p_io = do + p <- lift p_io + writePtr p + lit lits = writeLits lits + + label _ = return () + + emit pwordsize w ops = do + long_jumps <- askLongJumps + let largeArgs = any (largeOp long_jumps) ops + let opcode + | largeArgs = largeArgInstr w + | otherwise = w + writeIsn opcode + mapM_ (expand pwordsize largeArgs) ops + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + type LabelEnvMap = Map LocalLabel Word @@ -342,27 +448,81 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } +isLargeInspectState :: InspectState -> Bool +isLargeInspectState InspectState{..} = + isLargeW (fromIntegral $ Map.size lblEnv) + || isLargeW instrCount -inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) -inspectAsm platform long_jumps initial_offset - = go (InspectState initial_offset 0 0 Map.empty) - where - go s (NullAsm _) = (instrCount s, lblEnv s) - go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) - where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) - where n = litCount s - go s (AllocLabel lbl k) = go s' k - where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } - go s (Emit _ ops k) = go s' k - where - s' = s { instrCount = instrCount s + size } - size = sum (map count ops) + 1 +newtype InspectEnv = InspectEnv { _inspectLongJumps :: Bool + } + +newtype InspectAsm a = InspectAsm { runInspectAsm :: InspectEnv -> InspectState -> (# InspectState, a #) } + +instance Functor InspectAsm where + fmap f (InspectAsm k) = InspectAsm $ \a b -> case k a b of + (# b', c #) -> (# b', f c #) + +instance Applicative InspectAsm where + pure x = InspectAsm $ \_ s -> (# s, x #) + (InspectAsm f) <*> (InspectAsm x) = InspectAsm $ \a b -> case f a b of + (# s', f' #) -> + case x a s' of + (# s'', x' #) -> (# s'', f' x' #) + +instance Monad InspectAsm where + return = pure + (InspectAsm m) >>= f = InspectAsm $ \ a b -> case m a b of + (# s', a' #) -> runInspectAsm (f a') a s' + +get_ :: InspectAsm InspectState +get_ = InspectAsm $ \_ b -> (# b, b #) + +put_ :: InspectState -> InspectAsm () +put_ !s = InspectAsm $ \_ _ -> (# s, () #) + +modify_ :: (InspectState -> InspectState) -> InspectAsm () +modify_ f = InspectAsm $ \_ s -> let !s' = f s in (# s', () #) + +ask_ :: InspectAsm InspectEnv +ask_ = InspectAsm $ \a b -> (# b, a #) + +inspectAsm :: Bool -> Word -> InspectAsm () -> InspectState +inspectAsm long_jumps initial_offset (InspectAsm s) = + case s (InspectEnv long_jumps) (InspectState initial_offset 0 0 Map.empty) of + (# res, () #) -> res +{-# INLINE inspectAsm #-} + +instance MonadAssembler InspectAsm where + ioptr _ = do + s <- get_ + let n = ptrCount s + put_ (s { ptrCount = n + 1 }) + return n + + lit ls = do + s <- get_ + let n = litCount s + put_ (s { litCount = n + strictGenericLength ls }) + return n + + label lbl = modify_ (\s -> s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) }) + + emit pwordsize _ ops = do + InspectEnv long_jumps <- ask_ + let size = sum (map count ops) + 1 largeOps = any (largeOp long_jumps) ops count (SmallOp _) = 1 count (LabelOp _) = count (Op 0) - count (Op _) = if largeOps then largeArg16s platform else 1 - count (IOp _) = if largeOps then largeArg16s platform else 1 + count (Op _) = if largeOps then largeArg16s pwordsize else 1 + count (IOp _) = if largeOps then largeArg16s pwordsize else 1 + s <- get_ + put_ (s { instrCount = instrCount s + size }) + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + -- Bring in all the bci_ bytecode constants. #include "Bytecodes.h" @@ -370,47 +530,58 @@ inspectAsm platform long_jumps initial_offset largeArgInstr :: Word16 -> Word16 largeArgInstr bci = bci_FLAG_LARGE_ARGS .|. bci -largeArg :: Platform -> Word64 -> [Word16] -largeArg platform w = case platformWordSize platform of - PW8 -> [fromIntegral (w `shiftR` 48), - fromIntegral (w `shiftR` 32), - fromIntegral (w `shiftR` 16), - fromIntegral w] +{-# INLINE largeArg #-} +largeArg :: PlatformWordSize -> Word64 -> RunAsm () +largeArg wsize w = case wsize of + PW8 -> do writeIsn (fromIntegral (w `shiftR` 48)) + writeIsn (fromIntegral (w `shiftR` 32)) + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) PW4 -> assertPpr (w < fromIntegral (maxBound :: Word32)) - (text "largeArg too big:" <+> ppr w) $ - [fromIntegral (w `shiftR` 16), - fromIntegral w] + (text "largeArg too big:" <+> ppr w) $ do + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) -largeArg16s :: Platform -> Word -largeArg16s platform = case platformWordSize platform of +largeArg16s :: PlatformWordSize -> Word +largeArg16s pwordsize = case pwordsize of PW8 -> 4 PW4 -> 2 -assembleI :: Platform +class Monad m => MonadAssembler m where + ioptr :: IO BCOPtr -> m Word + lit :: [BCONPtr] -> m Word + label :: LocalLabel -> m () + emit :: PlatformWordSize -> Word16 -> [Operand] -> m () + +{-# SPECIALISE assembleI :: Platform -> BCInstr -> InspectAsm () #-} +{-# SPECIALISE assembleI :: Platform -> BCInstr -> RunAsm () #-} + +assembleI :: forall m . MonadAssembler m + => Platform -> BCInstr - -> Assembler () + -> m () assembleI platform i = case i of - STKCHECK n -> emit bci_STKCHECK [Op n] - PUSH_L o1 -> emit bci_PUSH_L [wOp o1] - PUSH_LL o1 o2 -> emit bci_PUSH_LL [wOp o1, wOp o2] - PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] - PUSH8 o1 -> emit bci_PUSH8 [bOp o1] - PUSH16 o1 -> emit bci_PUSH16 [bOp o1] - PUSH32 o1 -> emit bci_PUSH32 [bOp o1] - PUSH8_W o1 -> emit bci_PUSH8_W [bOp o1] - PUSH16_W o1 -> emit bci_PUSH16_W [bOp o1] - PUSH32_W o1 -> emit bci_PUSH32_W [bOp o1] + STKCHECK n -> emit_ bci_STKCHECK [Op n] + PUSH_L o1 -> emit_ bci_PUSH_L [wOp o1] + PUSH_LL o1 o2 -> emit_ bci_PUSH_LL [wOp o1, wOp o2] + PUSH_LLL o1 o2 o3 -> emit_ bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] + PUSH8 o1 -> emit_ bci_PUSH8 [bOp o1] + PUSH16 o1 -> emit_ bci_PUSH16 [bOp o1] + PUSH32 o1 -> emit_ bci_PUSH32 [bOp o1] + PUSH8_W o1 -> emit_ bci_PUSH8_W [bOp o1] + PUSH16_W o1 -> emit_ bci_PUSH16_W [bOp o1] + PUSH32_W o1 -> emit_ bci_PUSH32_W [bOp o1] PUSH_G nm -> do p <- ptr (BCOPtrName nm) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_BCO proto -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_ALTS proto pk -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit (push_alts pk) [Op p] + emit_ (push_alts pk) [Op p] PUSH_ALTS_TUPLE proto call_info tuple_proto -> do let ul_bco = assembleBCO platform proto ul_tuple_bco = assembleBCO platform @@ -419,121 +590,125 @@ assembleI platform i = case i of p_tup <- ioptr (liftM BCOPtrBCO ul_tuple_bco) info <- word (fromIntegral $ mkNativeCallInfoSig platform call_info) - emit bci_PUSH_ALTS_T + emit_ bci_PUSH_ALTS_T [Op p, Op info, Op p_tup] - PUSH_PAD8 -> emit bci_PUSH_PAD8 [] - PUSH_PAD16 -> emit bci_PUSH_PAD16 [] - PUSH_PAD32 -> emit bci_PUSH_PAD32 [] + PUSH_PAD8 -> emit_ bci_PUSH_PAD8 [] + PUSH_PAD16 -> emit_ bci_PUSH_PAD16 [] + PUSH_PAD32 -> emit_ bci_PUSH_PAD32 [] PUSH_UBX8 lit -> do np <- literal lit - emit bci_PUSH_UBX8 [Op np] + emit_ bci_PUSH_UBX8 [Op np] PUSH_UBX16 lit -> do np <- literal lit - emit bci_PUSH_UBX16 [Op np] + emit_ bci_PUSH_UBX16 [Op np] PUSH_UBX32 lit -> do np <- literal lit - emit bci_PUSH_UBX32 [Op np] + emit_ bci_PUSH_UBX32 [Op np] PUSH_UBX lit nws -> do np <- literal lit - emit bci_PUSH_UBX [Op np, wOp nws] - + emit_ bci_PUSH_UBX [Op np, wOp nws] -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode PUSH_ADDR nm -> do np <- lit [BCONPtrAddr nm] - emit bci_PUSH_UBX [Op np, SmallOp 1] - - PUSH_APPLY_N -> emit bci_PUSH_APPLY_N [] - PUSH_APPLY_V -> emit bci_PUSH_APPLY_V [] - PUSH_APPLY_F -> emit bci_PUSH_APPLY_F [] - PUSH_APPLY_D -> emit bci_PUSH_APPLY_D [] - PUSH_APPLY_L -> emit bci_PUSH_APPLY_L [] - PUSH_APPLY_P -> emit bci_PUSH_APPLY_P [] - PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP [] - PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP [] - PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP [] - PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP [] - PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP [] - - SLIDE n by -> emit bci_SLIDE [wOp n, wOp by] - ALLOC_AP n -> emit bci_ALLOC_AP [truncHalfWord platform n] - ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [truncHalfWord platform n] - ALLOC_PAP arity n -> emit bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] - MKAP off sz -> emit bci_MKAP [wOp off, truncHalfWord platform sz] - MKPAP off sz -> emit bci_MKPAP [wOp off, truncHalfWord platform sz] - UNPACK n -> emit bci_UNPACK [wOp n] + emit_ bci_PUSH_UBX [Op np, SmallOp 1] + + PUSH_APPLY_N -> emit_ bci_PUSH_APPLY_N [] + PUSH_APPLY_V -> emit_ bci_PUSH_APPLY_V [] + PUSH_APPLY_F -> emit_ bci_PUSH_APPLY_F [] + PUSH_APPLY_D -> emit_ bci_PUSH_APPLY_D [] + PUSH_APPLY_L -> emit_ bci_PUSH_APPLY_L [] + PUSH_APPLY_P -> emit_ bci_PUSH_APPLY_P [] + PUSH_APPLY_PP -> emit_ bci_PUSH_APPLY_PP [] + PUSH_APPLY_PPP -> emit_ bci_PUSH_APPLY_PPP [] + PUSH_APPLY_PPPP -> emit_ bci_PUSH_APPLY_PPPP [] + PUSH_APPLY_PPPPP -> emit_ bci_PUSH_APPLY_PPPPP [] + PUSH_APPLY_PPPPPP -> emit_ bci_PUSH_APPLY_PPPPPP [] + + SLIDE n by -> emit_ bci_SLIDE [wOp n, wOp by] + ALLOC_AP n -> emit_ bci_ALLOC_AP [truncHalfWord platform n] + ALLOC_AP_NOUPD n -> emit_ bci_ALLOC_AP_NOUPD [truncHalfWord platform n] + ALLOC_PAP arity n -> emit_ bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] + MKAP off sz -> emit_ bci_MKAP [wOp off, truncHalfWord platform sz] + MKPAP off sz -> emit_ bci_MKPAP [wOp off, truncHalfWord platform sz] + UNPACK n -> emit_ bci_UNPACK [wOp n] PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)] - emit bci_PACK [Op itbl_no, wOp sz] + emit_ bci_PACK [Op itbl_no, wOp sz] LABEL lbl -> label lbl TESTLT_I i l -> do np <- int i - emit bci_TESTLT_I [Op np, LabelOp l] + emit_ bci_TESTLT_I [Op np, LabelOp l] TESTEQ_I i l -> do np <- int i - emit bci_TESTEQ_I [Op np, LabelOp l] + emit_ bci_TESTEQ_I [Op np, LabelOp l] TESTLT_W w l -> do np <- word w - emit bci_TESTLT_W [Op np, LabelOp l] + emit_ bci_TESTLT_W [Op np, LabelOp l] TESTEQ_W w l -> do np <- word w - emit bci_TESTEQ_W [Op np, LabelOp l] + emit_ bci_TESTEQ_W [Op np, LabelOp l] TESTLT_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTLT_I64 [Op np, LabelOp l] + emit_ bci_TESTLT_I64 [Op np, LabelOp l] TESTEQ_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTEQ_I64 [Op np, LabelOp l] + emit_ bci_TESTEQ_I64 [Op np, LabelOp l] TESTLT_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I32 [Op np, LabelOp l] + emit_ bci_TESTLT_I32 [Op np, LabelOp l] TESTEQ_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I32 [Op np, LabelOp l] + emit_ bci_TESTEQ_I32 [Op np, LabelOp l] TESTLT_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I16 [Op np, LabelOp l] + emit_ bci_TESTLT_I16 [Op np, LabelOp l] TESTEQ_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I16 [Op np, LabelOp l] + emit_ bci_TESTEQ_I16 [Op np, LabelOp l] TESTLT_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I8 [Op np, LabelOp l] + emit_ bci_TESTLT_I8 [Op np, LabelOp l] TESTEQ_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I8 [Op np, LabelOp l] + emit_ bci_TESTEQ_I8 [Op np, LabelOp l] TESTLT_W64 w l -> do np <- word64 w - emit bci_TESTLT_W64 [Op np, LabelOp l] + emit_ bci_TESTLT_W64 [Op np, LabelOp l] TESTEQ_W64 w l -> do np <- word64 w - emit bci_TESTEQ_W64 [Op np, LabelOp l] + emit_ bci_TESTEQ_W64 [Op np, LabelOp l] TESTLT_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W32 [Op np, LabelOp l] + emit_ bci_TESTLT_W32 [Op np, LabelOp l] TESTEQ_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W32 [Op np, LabelOp l] + emit_ bci_TESTEQ_W32 [Op np, LabelOp l] TESTLT_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W16 [Op np, LabelOp l] + emit_ bci_TESTLT_W16 [Op np, LabelOp l] TESTEQ_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W16 [Op np, LabelOp l] + emit_ bci_TESTEQ_W16 [Op np, LabelOp l] TESTLT_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W8 [Op np, LabelOp l] + emit_ bci_TESTLT_W8 [Op np, LabelOp l] TESTEQ_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W8 [Op np, LabelOp l] + emit_ bci_TESTEQ_W8 [Op np, LabelOp l] TESTLT_F f l -> do np <- float f - emit bci_TESTLT_F [Op np, LabelOp l] + emit_ bci_TESTLT_F [Op np, LabelOp l] TESTEQ_F f l -> do np <- float f - emit bci_TESTEQ_F [Op np, LabelOp l] + emit_ bci_TESTEQ_F [Op np, LabelOp l] TESTLT_D d l -> do np <- double d - emit bci_TESTLT_D [Op np, LabelOp l] + emit_ bci_TESTLT_D [Op np, LabelOp l] TESTEQ_D d l -> do np <- double d - emit bci_TESTEQ_D [Op np, LabelOp l] - TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l] - TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l] - CASEFAIL -> emit bci_CASEFAIL [] - SWIZZLE stkoff n -> emit bci_SWIZZLE [wOp stkoff, IOp n] - JMP l -> emit bci_JMP [LabelOp l] - ENTER -> emit bci_ENTER [] - RETURN rep -> emit (return_non_tuple rep) [] - RETURN_TUPLE -> emit bci_RETURN_T [] + emit_ bci_TESTEQ_D [Op np, LabelOp l] + TESTLT_P i l -> emit_ bci_TESTLT_P [SmallOp i, LabelOp l] + TESTEQ_P i l -> emit_ bci_TESTEQ_P [SmallOp i, LabelOp l] + CASEFAIL -> emit_ bci_CASEFAIL [] + SWIZZLE stkoff n -> emit_ bci_SWIZZLE [wOp stkoff, IOp n] + JMP l -> emit_ bci_JMP [LabelOp l] + ENTER -> emit_ bci_ENTER [] + RETURN rep -> emit_ (return_non_tuple rep) [] + RETURN_TUPLE -> emit_ bci_RETURN_T [] CCALL off m_addr i -> do np <- addr m_addr - emit bci_CCALL [wOp off, Op np, SmallOp i] - PRIMCALL -> emit bci_PRIMCALL [] + emit_ bci_CCALL [wOp off, Op np, SmallOp i] + PRIMCALL -> emit_ bci_PRIMCALL [] BRK_FUN arr tick_mod tickx info_mod infox cc -> do p1 <- ptr (BCOPtrBreakArray arr) tick_addr <- addr tick_mod info_addr <- addr info_mod np <- addr cc - emit bci_BRK_FUN [ Op p1 + emit_ bci_BRK_FUN [ Op p1 , Op tick_addr, Op info_addr , SmallOp tickx, SmallOp infox , Op np ] #if MIN_VERSION_rts(1,0,3) BCO_NAME name -> do np <- lit [BCONPtrStr name] - emit bci_BCO_NAME [Op np] + emit_ bci_BCO_NAME [Op np] #endif + + where + emit_ = emit word_size + + literal :: Literal -> m Word literal (LitLabel fs _) = litlabel fs literal LitNullAddr = word 0 literal (LitFloat r) = float (fromRational r) @@ -573,16 +748,16 @@ assembleI platform i = case i of -- Note that we only support host endianness == target endianness for now, -- even with the external interpreter. This would need to be fixed to -- support host endianness /= target endianness - int :: Int -> Assembler Word + int :: Int -> m Word int i = word (fromIntegral i) - float :: Float -> Assembler Word + float :: Float -> m Word float f = word32 (castFloatToWord32 f) - double :: Double -> Assembler Word + double :: Double -> m Word double d = word64 (castDoubleToWord64 d) - word64 :: Word64 -> Assembler Word + word64 :: Word64 -> m Word word64 ww = case word_size of PW4 -> let !wl = fromIntegral ww @@ -592,17 +767,17 @@ assembleI platform i = case i of BigEndian -> words [wh,wl] PW8 -> word (fromIntegral ww) - word8 :: Word8 -> Assembler Word + word8 :: Word8 -> m Word word8 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 8)) - word16 :: Word16 -> Assembler Word + word16 :: Word16 -> m Word word16 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 16)) - word32 :: Word32 -> Assembler Word + word32 :: Word32 -> m Word word32 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> case word_size of ===================================== compiler/GHC/ByteCode/Types.hs ===================================== @@ -21,7 +21,7 @@ module GHC.ByteCode.Types , CgBreakInfo(..) , ModBreaks (..), BreakIndex, emptyModBreaks , CCostCentre - , FlatBag, sizeFlatBag, fromSizedSeq, elemsFlatBag + , FlatBag, sizeFlatBag, fromSmallArray, elemsFlatBag ) where import GHC.Prelude ===================================== compiler/GHC/Data/FlatBag.hs ===================================== @@ -8,13 +8,11 @@ module GHC.Data.FlatBag , mappendFlatBag -- * Construction , fromList - , fromSizedSeq + , fromSmallArray ) where import GHC.Prelude -import GHC.Data.SizedSeq (SizedSeq, ssElts, sizeSS) - import Control.DeepSeq import GHC.Data.SmallArray @@ -125,5 +123,10 @@ fromList n elts = -- | Convert a 'SizedSeq' into its flattened representation. -- A 'FlatBag a' is more memory efficient than '[a]', if no further modification -- is necessary. -fromSizedSeq :: SizedSeq a -> FlatBag a -fromSizedSeq s = fromList (sizeSS s) (ssElts s) +fromSmallArray :: SmallArray a -> FlatBag a +fromSmallArray s = case sizeofSmallArray s of + 0 -> EmptyFlatBag + 1 -> UnitFlatBag (indexSmallArray s 0) + 2 -> TupleFlatBag (indexSmallArray s 0) (indexSmallArray s 1) + _ -> FlatBag s + ===================================== compiler/GHC/Data/SmallArray.hs ===================================== @@ -16,11 +16,18 @@ module GHC.Data.SmallArray , mapSmallArray , foldMapSmallArray , rnfSmallArray + + -- * IO Operations + , SmallMutableArrayIO + , newSmallArrayIO + , writeSmallArrayIO + , unsafeFreezeSmallArrayIO ) where import GHC.Exts import GHC.Prelude +import GHC.IO import GHC.ST import Control.DeepSeq @@ -28,6 +35,8 @@ data SmallArray a = SmallArray (SmallArray# a) data SmallMutableArray s a = SmallMutableArray (SmallMutableArray# s a) +type SmallMutableArrayIO a = SmallMutableArray RealWorld a + newSmallArray :: Int -- ^ size -> a -- ^ initial contents @@ -37,6 +46,9 @@ newSmallArray newSmallArray (I# sz) x s = case newSmallArray# sz x s of (# s', a #) -> (# s', SmallMutableArray a #) +newSmallArrayIO :: Int -> a -> IO (SmallMutableArrayIO a) +newSmallArrayIO sz x = IO $ \s -> newSmallArray sz x s + writeSmallArray :: SmallMutableArray s a -- ^ array -> Int -- ^ index @@ -46,6 +58,12 @@ writeSmallArray {-# INLINE writeSmallArray #-} writeSmallArray (SmallMutableArray a) (I# i) x = writeSmallArray# a i x +writeSmallArrayIO :: SmallMutableArrayIO a + -> Int + -> a + -> IO () +writeSmallArrayIO a ix v = IO $ \s -> (# writeSmallArray a ix v s, () #) + -- | Copy and freeze a slice of a mutable array. freezeSmallArray @@ -69,6 +87,9 @@ unsafeFreezeSmallArray (SmallMutableArray ma) s = case unsafeFreezeSmallArray# ma s of (# s', a #) -> (# s', SmallArray a #) +unsafeFreezeSmallArrayIO :: SmallMutableArrayIO a -> IO (SmallArray a) +unsafeFreezeSmallArrayIO arr = IO $ \s -> unsafeFreezeSmallArray arr s + -- | Get the size of a 'SmallArray' sizeofSmallArray :: SmallArray a View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c9d6afe6a1e9bec12c5f2db226aa68b84ecc63c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c9d6afe6a1e9bec12c5f2db226aa68b84ecc63c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 16:24:54 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 04 Feb 2025 11:24:54 -0500 Subject: [Git][ghc/ghc][wip/name-to-clabel] perf: nameToCLabel: Directly manipulate ByteString rather than going via strings Message-ID: <67a23f568923_348bf96380445253@gitlab.mail> Matthew Pickering pushed to branch wip/name-to-clabel at Glasgow Haskell Compiler / GHC Commits: f7a605eb by Matthew Pickering at 2025-02-04T16:23:56+00:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 1 changed file: - compiler/GHC/ByteCode/Linker.hs Changes: ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -210,9 +211,9 @@ linkFail who what nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastString label +nameToCLabel n suffix = mkFastStringByteString label where - encodeZ = zString . zEncodeFS + encodeZ = fastZStringToByteString . zEncodeFS (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. @@ -222,11 +223,14 @@ nameToCLabel n suffix = mkFastString label modulePart = encodeZ (moduleNameFS modName) occPart = encodeZ $ occNameMangledFS (nameOccName n) - label = concat - [ if pkgKey == mainUnit then "" else packagePart ++ "_" - , modulePart - , '_':occPart - , '_':suffix + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix ] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f7a605eb989f88df4282556fb56cd4ea5debaf28 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f7a605eb989f88df4282556fb56cd4ea5debaf28 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 17:38:18 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 04 Feb 2025 12:38:18 -0500 Subject: [Git][ghc/ghc][wip/T23109] 1000 commits: ghcup-metadata: Various fixes from 9.10.1 Message-ID: <67a2508a3abb3_348bf1f89a5c536eb@gitlab.mail> Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 72b54c07 by Rodrigo Mesquita at 2024-08-01T00:47:29-04:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - bfe4b3d3 by doyougnu at 2024-08-01T00:48:06-04:00 Rts linker: add case for pc-rel 64 relocation part of the upstream haskell.nix patches - - - - - 5843c7e3 by doyougnu at 2024-08-01T00:48:42-04:00 RTS linker: aarch64: better debug information Dump better debugging information when a symbol address is null. Part of the haskell.nix patches upstream project Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - c2e9c581 by Rodrigo Mesquita at 2024-08-01T00:49:18-04:00 base: Add haddocks to HasExceptionContext Fixes #25091 - - - - - f954f428 by Sylvain Henry at 2024-08-01T00:49:59-04:00 Only lookup ghcversion.h file in the RTS include-dirs by default. The code was introduced in 3549c952b535803270872adaf87262f2df0295a4. It used `getPackageIncludePath` which name doesn't convey that it looks into all include paths of the preload units too. So this behavior is probably unintentional and it should be ok to change it. Fix #25106 - - - - - 951ce3d5 by Matthew Pickering at 2024-08-01T00:50:35-04:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - bae1fea4 by sheaf at 2024-08-01T00:51:15-04:00 PMC: suggest in-scope COMPLETE sets when possible This commit modifies GHC.HsToCore.Pmc.Solver.generateInhabitingPatterns to prioritise reporting COMPLETE sets in which all of the ConLikes are in scope. This avoids suggesting out of scope constructors when displaying an incomplete pattern match warning, e.g. in baz :: Ordering -> Int baz = \case EQ -> 5 we prefer: Patterns of type 'Ordering' not matched: LT GT over: Patterns of type 'Ordering' not matched: OutOfScope Fixes #25115 - - - - - ff158fcd by Tommy Bidne at 2024-08-02T01:14:32+12:00 Print exception metadata in default handler CLC proposals 231 and 261: - Add exception type metadata to SomeException's displayException. - Add "Exception" header to default exception handler. See: https://github.com/haskell/core-libraries-committee/issues/231 https://github.com/haskell/core-libraries-committee/issues/261 Update stm submodule for test fixes. - - - - - 8b2f70a2 by Andrei Borzenkov at 2024-08-01T23:00:46-04:00 Type syntax in expressions (#24159, #24572, #24226) This patch extends the grammar of expressions with syntax that is typically found only in types: * function types (a -> b), (a ->. b), (a %m -> b) * constrained types (ctx => t) * forall-quantification (forall tvs. t) The new forms are guarded behind the RequiredTypeArguments extension, as specified in GHC Proposal #281. Examples: {-# LANGUAGE RequiredTypeArguments #-} e1 = f (Int -> String) -- function type e2 = f (Int %1 -> String) -- linear function type e3 = f (forall a. Bounded a => a) -- forall type, constraint The GHC AST and the TH AST have been extended as follows: syntax | HsExpr | TH.Exp ---------------+----------+-------------- a -> b | HsFunArr | ConE (->) a %m -> b | HsFunArr | ConE FUN ctx => t | HsQual | ConstrainedE forall a. t | HsForAll | ForallE forall a -> t | HsForAll | ForallVisE Additionally, a new warning flag -Wview-pattern-signatures has been introduced to aid with migration to the new precedence of (e -> p :: t). Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com> - - - - - 66e7f57d by Brandon Chinn at 2024-08-01T21:50:58-07:00 Implement MultilineStrings (#24390) This commit adds support for multiline strings, proposed at https://github.com/ghc-proposals/ghc-proposals/pull/569. Multiline strings can now be written as: myString = """ this is a multiline string """ The multiline string will have leading indentation stripped away. Full details of this post-processing may be found at the new GHC.Parser.String module. In order to cleanly implement this and maximize reusability, I broke out the lexing logic for strings out of Lexer.x into a new GHC.Parser.String module, which lexes strings with any provided "get next character" function. This also gave us the opportunity to clean up this logic, and even optimize it a bit. With this change, parsing string literals now takes 25% less time and 25% less space. - - - - - cf47b96f by Rodrigo Mesquita at 2024-08-03T05:59:40-04:00 hi: Stable sort avails Sorting the Avails in DocStructures is required to produce fully deterministic interface files in presence of re-exported modules. Fixes #25104 - - - - - af2ae742 by M. Taimoor Zaeem at 2024-08-03T18:52:50+05:00 haddock: decrease margin on top of small headings - - - - - a1e42e7a by Rodrigo Mesquita at 2024-08-05T21:03:04-04:00 hi: Deterministic ImportedMods in Usages The `mi_usages` field of the interface files must use a deterministic list of `Usage`s to guarantee a deterministic interface. However, this list was, in its origins, constructed from a `ModuleEnv` which uses a non-deterministic ordering that was leaking into the interface. Specifically, ImportedMods = ModuleEnv ... would get converted to a list and then passed to `mkUsageInfo` to construct the Usages. The solution is simple. Back `ImportedMods` with a deterministic map. `Map Module ...` is enough, since the Ord instance for `Module` already uses a stable, deterministic, comparison. Fixes #25131 - - - - - eb1cb536 by Serge S. Gulin at 2024-08-06T08:54:55+00:00 testsuite: extend size performance tests with gzip (fixes #25046) The main purpose is to create tests for minimal app (hello world and its variations, i.e. unicode used) distribution size metric. Many platforms support distribution in compressed form via gzip. It would be nice to collect information on how much size is taken by the executional bundle for each platform at minimal edge case. 2 groups of tests are added: 1. We extend javascript backend size tests with gzip-enabled versions for all cases where an optimizing compiler is used (for now it is google closure compiler). 2. We add trivial hello world tests with gzip-enabled versions for all other platforms at CI pipeline where no external optimizing compiler is used. - - - - - d94410f8 by Rodrigo Mesquita at 2024-08-07T11:49:19-04:00 ghc-internal: @since for backtraceDesired Fixes point 1 in #25052 - - - - - bfe600f5 by Rodrigo Mesquita at 2024-08-07T11:49:19-04:00 ghc-internal: No trailing whitespace in exceptions Fixes #25052 - - - - - 62650d9f by Andreas Klebinger at 2024-08-07T11:49:54-04:00 Add since annotation for -fkeep-auto-rules. This partially addresses #25082. - - - - - 5f0e23fd by Andreas Klebinger at 2024-08-07T11:49:54-04:00 Mention `-fkeep-auto-rules` in release notes. It was added earlier but hadn't appeared in any release notes yet. Partially addresses #25082. - - - - - 7446a09a by Sylvain Henry at 2024-08-07T11:50:35-04:00 Cmm: don't perform unsound optimizations on 32-bit compiler hosts - beef61351b240967b49169d27a9a19565cf3c4af enabled the use of MO_Add/MO_Sub for 64-bit operations in the C and LLVM backends - 6755d833af8c21bbad6585144b10e20ac4a0a1ab did the same for the x86 NCG backend However we store some literal values as `Int` in the compiler. As a result, some Cmm optimizations transformed target 64-bit literals into compiler `Int`. If the compiler is 32-bit, this leads to computing with wrong literals (see #24893 and #24700). This patch disables these Cmm optimizations for 32-bit compilers. This is unsatisfying (optimizations shouldn't be compiler-word-size dependent) but it fixes the bug and it makes the patch easy to backport. A proper fix would be much more invasive but it shall be implemented in the future. Co-authored-by: amesgen <amesgen at amesgen.de> - - - - - d59faaf2 by Vladislav Zavialov at 2024-08-07T11:51:11-04:00 docs: Update info on RequiredTypeArguments Add a section on "types in terms" that were implemented in 8b2f70a202 and remove the now outdated suggestion of using `type` for them. - - - - - 39fd6714 by Sylvain Henry at 2024-08-07T11:51:52-04:00 JS: fix minor typo in base's jsbits - - - - - e7764575 by Sylvain Henry at 2024-08-07T11:51:52-04:00 RTS: remove hack to force old cabal to build a library with only JS sources Need to extend JSC externs with Emscripten RTS definitions to avoid JSC_UNDEFINED_VARIABLE errors when linking without the emcc rts. Fix #25138 Some recompilation avoidance tests now fail. This is tracked with the other instances of this failure in #23013. My hunch is that they were working by chance when we used the emcc linker. Metric Decrease: T24602_perf_size - - - - - d1a40233 by Brandon Chinn at 2024-08-07T11:53:08-04:00 Support multiline strings in type literals (#25132) - - - - - 610840eb by Sylvain Henry at 2024-08-07T11:53:50-04:00 JS: fix callback documentation (#24377) Fix #24377 - - - - - 6ae4b76a by Zubin Duggal at 2024-08-13T13:36:57-04:00 haddock: Build haddock-api and haddock-library using hadrian We build these two packages as regular boot library dependencies rather than using the `in-ghc-tree` flag to include the source files into the haddock executable. The `in-ghc-tree` flag is moved into haddock-api to ensure that haddock built from hackage can still find the location of the GHC bindist using `ghc-paths`. Addresses #24834 This causes a metric decrease under non-release flavours because under these flavours libraries are compiled with optimisation but executables are not. Since we move the bulk of the code from the haddock executable to the haddock-api library, we see a metric decrease on the validate flavours. Metric Decrease: haddock.Cabal haddock.base haddock.compiler - - - - - 51ffba5d by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Add an extension field to HsRecFields This is the Right Thing to Do™. And it prepares for storing a multiplicity coercion there. First step of the plan outlined here and below https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12947#note_573091 - - - - - 4d2faeeb by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Add test for #24961 - - - - - 623b4337 by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Ensures that omitted record fields in pattern have multiplicity Many Omitted fields were simply ignored in the type checker and produced incorrect Core code. Fixes #24961 Metric Increase: RecordUpdPerf - - - - - c749bdfd by Sylvain Henry at 2024-08-13T13:38:41-04:00 AARCH64 linker: skip NONE relocations This patch is part of the patches upstreamed from haskell.nix. See https://github.com/input-output-hk/haskell.nix/pull/1960 for the original report/patch. - - - - - 682a6a41 by Brandon Chinn at 2024-08-13T13:39:17-04:00 Support multiline strings in TH - - - - - ee0a9c18 by Matthew Pickering at 2024-08-14T14:27:39-04:00 Extend -reexported-module flag to support module renaming The -reexported-module flag now supports renaming -rexported-modules. ``` -rexported-module "A as B" ``` This feature is only relevant to multi-component sessions. Fixes #25139 - - - - - e9496000 by Arnaud Spiwack at 2024-08-14T14:28:20-04:00 Don't restrict eta-reduction of linear functions This commit simply removes code. All the supporting implementation has been done as part of !12883. Closes #25129 - - - - - 2bb4156e by sheaf at 2024-08-14T14:28:56-04:00 Allow @ character in C labels Generated symbol names can include the '@' character, for example when using `__attribute__((vectorcall))`. - - - - - 7602ca23 by Sylvain Henry at 2024-08-14T14:29:36-04:00 Linker: replace blind tuple with a datatype + docs - - - - - bdd77b9e by sheaf at 2024-08-16T12:47:11-04:00 isIrrefutableHsPat: look up ConLikes in the HscEnv At GhcRn stage, in isIrrefutableHsPat we only looked up data constructors in the RdrEnv, which meant that we lacked fallibility information for out-of-scope constructors (which can arise from Template Haskell splices). Instead, we use 'lookupGREInfo', which looks up the information in the type environment. This was the correct function to call all along, but was not used in 572fbc44 due to import cycle reasons. The appropriate functions, 'irrefutableConLike{Rn,Tc}' have been moved to 'GHC.Rename.Env', which avoids import cycles. Fixes #25164 - - - - - 4bee377c by Sylvain Henry at 2024-08-16T12:47:53-04:00 Linker: some refactoring to prepare for #24886 - Rename LoadedBCOs into LazyBCOs - Bundle SptEntries with CompiledByteCode and removed [SptEntry] field from the BCOs constructor - Rename Linkable's LM constructor into Linkable: in the past we had LM and LP for Module and Package, now we only have the former. - Rename Unlinked into LinkablePart (and linkableUnlinked into linkableParts) - Use NonEmpty to encode invariant in Linkable's linkableParts type - Add helpers: linkableLibs, linkableBCOs, etc. - Add documentation - Remove partial nameOfObject - Rename nameOfObject_maybe into linkablePartPath - Rename byteCodeOfObject into linkablePartAllBCOs. - Refactor linkablePartAllBCOs to avoid a panic if a LazyBCO has a C stub. Document the fact that LazyBCOs are returned in this case (contrary to linkableBCOs which only returns non-lazy ones) Refactoring done while trying to understand how to adapt the linker code to support the JS backend too (cf #24886). - - - - - fa0dbaca by Mario Blažević at 2024-08-17T03:31:32+00:00 Implements the Exportable Named Default proposal (#24305) This squashed commit adds support for exportable named defaults, the accepted GHC proposal at https://github.com/ghc-proposals/ghc-proposals/pull/409 The proposal extends the Haskell '98 declarations default (Int, Double) which were implicitly always applying to Num class alone, to allow specifying an arbitrary single-parameter class: default IsString (Text, String) The effect of this declaration would be to eliminate the ambiguous type errors around string literals when OverloadedStrings extension is active. The declaration by itself has effect only in its module, so the proposal also adds the ability to export class defaults: module MyModule (default IsIstring) Once the language extension is published and established, we can consider using it in base and other libraries. See Note [Named default declarations] in GHC.Tc.Gen.Default for implementation details. - - - - - 1deba6b2 by Simon Peyton Jones at 2024-08-17T13:58:13-04:00 Make kick-out more selective This MR revised the crucial kick-out criteria in the constraint solver. Ticket #24984 showed an example in which * We were kicking out unnecessarily * That gave rise to extra work, of course * But it /also/ led to exponentially-sized coercions due to lack of sharing in coercions (something we want to fix separately #20264) This MR sharpens up the kick-out criteria; specifially in (KK2) we look only under type family applications if (fs>=fw). This forced me to understand the existing kick-out story, and I ended up rewriting many of the careful Notes in GHC.Tc.Solver.InertSet. Especially look at the new `Note [The KickOut Criteria]` The proof of termination is not air-tight, but it is better than before, and both Richard and I think it's correct :-). - - - - - 88488847 by Cheng Shao at 2024-08-18T04:44:01+02:00 testsuite: remove undesired -fasm flag from test ways This patch removes the -fasm flag from test ways, except ways like optasm that explicitly state they are meant to be compiled with NCG backend. Most test ways should use the default codegen backend, and the precense of -fasm can cause stderr mismatches like this when GHC is configured with the unregisterised backend: ``` --- /dev/null +++ /tmp/ghctest-3hydwldj/test spaces/testsuite/tests/profiling/should_compile/prof-late-cc.run/prof-late-cc.comp.stderr.normalised @@ -0,0 +1,2 @@ +when making flags consistent: warning: [GHC-74335] [-Winconsistent-flags (in -Wdefault)] + Target platform uses unregisterised ABI, so compiling via C *** unexpected failure for prof-late-cc(prof_no_auto) ``` This has been breaking the wasm unreg nightly job since !12595 landed. - - - - - 3a145315 by Cheng Shao at 2024-08-18T13:05:45-04:00 ghci: fix isMinTTY.h casing for Windows targets This commit fixes isMinTTY.h casing in isMinTTY.c that's compiled for Windows targets. While this looks harmless given Windows filesystems are case-insensitive by default, it does cause a compilation warning with recent versions of clang, so we might as well fix the casing: ``` driver\ghci\isMinTTY.c:10:10: error: warning: non-portable path to file '"isMinTTY.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] | 10 | #include "isMINTTY.h" | ^ #include "isMINTTY.h" ^~~~~~~~~~~~ "isMinTTY.h" 1 warning generated. ``` - - - - - 5f972bfb by Zubin Duggal at 2024-08-21T03:18:15-04:00 compiler: Fix pretty printing of ticked prefix constructors (#24237) - - - - - ef0a08e7 by Mike Pilgrem at 2024-08-21T03:18:57-04:00 Fix #15773 Clarify further -rtsopts 'defaults' in docs - - - - - 05a4be58 by Sebastian Graf at 2024-08-21T03:19:33-04:00 Improve efficiency of `assertError` (#24625) ... by moving `lazy` to the exception-throwing branch. It's all documented in `Note [Strictness of assertError]`. - - - - - c29b2b5a by sheaf at 2024-08-21T13:11:30-04:00 GHCi debugger: drop record name spaces for Ids When binding new local variables at a breakpoint, we should create Ids with variable namespace, and not record field namespace. Otherwise the rest of the compiler falls over because the IdDetails are wrong. Fixes #25109 - - - - - bd82ac9f by Hécate Kleidukos at 2024-08-21T13:12:12-04:00 base: Final deprecation of GHC.Pack The timeline mandated by #21461 has come to its term and after two years and four minor releases, we are finally removing GHC.Pack from base. Closes #21536 - - - - - 5092dbff by Sylvain Henry at 2024-08-21T13:12:54-04:00 JS: support rubbish static literals (#25177) Support for rubbish dynamic literals was added in #24664. This patch does the same for static literals. Fix #25177 - - - - - b5a2c061 by Phil de Joux at 2024-08-21T13:13:33-04:00 haddock docs: prefix comes before, postfix comes after - - - - - 6fde3685 by Marcin Szamotulski at 2024-08-21T23:15:39-04:00 haddock: include package info with --show-interface - - - - - 7e02111b by Andreas Klebinger at 2024-08-21T23:16:15-04:00 Document the (x86) SIMD macros. Fixes #25021. - - - - - 05116c83 by Rodrigo Mesquita at 2024-08-22T10:37:44-04:00 ghc-internal: Derive version from ghc's version Fixes #25005 - - - - - 73f5897d by Ben Gamari at 2024-08-22T10:37:44-04:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.14. - - - - - 821d0a9a by Cheng Shao at 2024-08-22T10:38:22-04:00 compiler: Store ForeignStubs and foreign C files in interfaces This data is used alongside Core bindings to reconstruct intermediate build products when linking Template Haskell splices with bytecode. Since foreign stubs and files are generated in the pipeline, they were lost with only Core bindings stored in interfaces. The interface codec type `IfaceForeign` contains a simplified representation of `ForeignStubs` and the set of foreign sources that were manually added by the user. When the backend phase writes an interface, `mkFullIface` calls `encodeIfaceForeign` to read foreign source file contents and assemble `IfaceForeign`. After the recompilation status check of an upstream module, `initWholeCoreBindings` calls `decodeIfaceForeign` to restore `ForeignStubs` and write the contents of foreign sources to the file system as temporary files. The restored foreign inputs are then processed by `hscInteractive` in the same manner as in a regular pipeline. When linking the stub objects for splices, they are excluded from suffix adjustment for the interpreter way through a new flag in `Unlinked`. For details about these processes, please consult Note [Foreign stubs and TH bytecode linking]. Metric Decrease: T13701 - - - - - f0408eeb by Cheng Shao at 2024-08-23T10:37:10-04:00 git: remove a.out and include it in .gitignore a.out is a configure script byproduct. It was mistakenly checked into the tree in !13118. This patch removes it, and include it in .gitignore to prevent a similar error in the future. - - - - - 1f95c5e4 by Matthew Pickering at 2024-08-23T10:37:46-04:00 docs: Fix code-block syntax on old sphinx version This code-block directive breaks the deb9 sphinx build. Fixes #25201 - - - - - 27dceb42 by Sylvain Henry at 2024-08-26T11:05:11-04:00 JS: add basic support for POSIX *at functions (#25190) openat/fstatat/unlinkat/dup are now used in the recent release of the `directory` and `file-io` packages. As such, these functions are (indirectly) used in the following tests one we'll bump the `directory` submodule (see !13122): - openFile008 - jsOptimizer - T20509 - bkpcabal02 - bkpcabal03 - bkpcabal04 - - - - - c68be356 by Matthew Pickering at 2024-08-26T11:05:11-04:00 Update directory submodule to latest master The primary reason for this bump is to fix the warning from `ghc-pkg check`: ``` Warning: include-dirs: /data/home/ubuntu/.ghcup/ghc/9.6.2/lib/ghc-9.6.2/lib/../lib/aarch64-linux-ghc-9.6.2/directory-1.3.8.1/include doesn't exist or isn't a directory ``` This also requires adding the `file-io` package as a boot library (which is discussed in #25145) Fixes #23594 #25145 - - - - - 4ee094d4 by Matthew Pickering at 2024-08-26T11:05:47-04:00 Fix aarch64-alpine target platform description We are producing bindists where the target triple is aarch64-alpine-linux when it should be aarch64-unknown-linux This is because the bootstrapped compiler originally set the target triple to `aarch64-alpine-linux` which is when propagated forwards by setting `bootstrap_target` from the bootstrap compiler target. In order to break this chain we explicitly specify build/host/target for aarch64-alpine. This requires a new configure flag `--enable-ignore-` which just switches off a validation check that the target platform of the bootstrap compiler is the same as the build platform. It is the same, but the name is just wrong. These commits can be removed when the bootstrap compiler has the correct target triple (I looked into patching this on ci-images, but it looked hard to do correctly as the build/host platform is not in the settings file). Fixes #25200 - - - - - e0e0f2b2 by Matthew Pickering at 2024-08-26T11:05:47-04:00 Bump nixpkgs commit for gen_ci script - - - - - 63a27091 by doyougnu at 2024-08-26T20:39:30-04:00 rts: win32: emit additional debugging information -- migration from haskell.nix - - - - - aaab3d10 by Vladislav Zavialov at 2024-08-26T20:40:06-04:00 Only export defaults when NamedDefaults are enabled (#25206) This is a reinterpretation of GHC Proposal #409 that avoids a breaking change introduced in fa0dbaca6c "Implements the Exportable Named Default proposal" Consider a module M that has no explicit export list: module M where default (Rational) Should it export the default (Rational)? The proposal says "yes", and there's a test case for that: default/DefaultImport04.hs However, as it turns out, this change in behavior breaks existing programs, e.g. the colour-2.3.6 package can no longer be compiled, as reported in #25206. In this patch, we make implicit exports of defaults conditional on the NamedDefaults extension. This fix is unintrusive and compliant with the existing proposal text (i.e. it does not require a proposal amendment). Should the proposal be amended, we can go for a simpler solution, such as requiring all defaults to be exported explicitly. Test case: testsuite/tests/default/T25206.hs - - - - - 3a5bebf8 by Matthew Pickering at 2024-08-28T14:16:42-04:00 simplifier: Fix space leak during demand analysis The lazy structure (a list) in a strict field in `DmdType` is not fully forced which leads to a very large thunk build-up. It seems there is likely still more work to be done here as it seems we may be trading space usage for work done. For now, this is the right choice as rather than using all the memory on my computer, compilation just takes a little bit longer. See #25196 - - - - - c2525e9e by Ryan Scott at 2024-08-28T14:17:17-04:00 Add missing parenthesizeHsType in cvtp's InvisP case We need to ensure that when we convert an `InvisP` (invisible type pattern) to a `Pat`, we parenthesize it (at precedence `appPrec`) so that patterns such as `@(a :: k)` will parse correctly when roundtripped back through the parser. Fixes #25209. - - - - - 1499764f by Sjoerd Visscher at 2024-08-29T16:52:56+02:00 Haddock: Add no-compilation flag This flag makes sure to avoid recompilation of the code when generating documentation by only reading the .hi and .hie files, and throw an error if it can't find them. - - - - - 768fe644 by Andreas Klebinger at 2024-09-03T13:15:20-04:00 Add functions to check for weakly pinned arrays. This commit adds `isByteArrayWeaklyPinned#` and `isMutableByteArrayWeaklyPinned#` primops. These check if a bytearray is *weakly* pinned. Which means it can still be explicitly moved by the user via compaction but won't be moved by the RTS. This moves us one more stop closer to nailing down #22255. - - - - - b16605e7 by Arsen Arsenović at 2024-09-03T13:16:05-04:00 ghc-toolchain: Don't leave stranded a.outs when testing for -g0 This happened because, when ghc-toolchain tests for -g0, it does so by compiling an empty program. This compilation creates an a.out. Since we create a temporary directory, lets place the test program compilation in it also, so that it gets cleaned up. Fixes: 25b0b40467d0a12601497117c0ad14e1fcab0b74 Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/25203 - - - - - 83e70b14 by Torsten Schmits at 2024-09-03T13:16:41-04:00 Build foreign objects for TH with interpreter's way when loading from iface Fixes #25211 When linking bytecode for TH from interface core bindings with `-fprefer-byte-code`, foreign sources are loaded from the interface as well and compiled to object code in an ad-hoc manner. The results are then loaded by the interpreter, whose way may differ from the current build's target way. This patch ensures that foreign objects are compiled with the interpreter's way. - - - - - 0d3bc2fa by Cheng Shao at 2024-09-04T07:20:06-04:00 rts: fix checkClosure error message This patch fixes an error message in checkClosure() when the closure has already been evacuated. The previous logic was meant to print the evacuated closure's type in the error message, but it was completely wrong, given info was not really an info table, but a tagged pointer that points to the closure's new address. - - - - - fb0a4e5c by Sven Tennie at 2024-09-04T07:20:43-04:00 MO_AcquireFence: Less restrictive barrier GCC and CLang translate the built-in `atomic_thread_fence(memory_order_acquire)` to `dmb ishld`, which is a bit less restrictive than `dmb ish` (which also implies stores.) - - - - - a45f1488 by Fendor at 2024-09-04T20:22:00-04:00 testsuite: Add support to capture performance metrics via 'perf' Performance metrics collected via 'perf' can be more accurate for run-time performance than GHC's rts, due to the usage of hardware counters. We allow performance tests to also record PMU events according to 'perf list'. - - - - - ce61fca5 by Fendor at 2024-09-04T20:22:00-04:00 gitlab-ci: Add nightly job for running the testsuite with perf profiling support - - - - - 6dfb9471 by Fendor at 2024-09-04T20:22:00-04:00 Enable perf profiling for compiler performance tests - - - - - da306610 by sheaf at 2024-09-04T20:22:41-04:00 RecordCon lookup: don't allow a TyCon This commit adds extra logic when looking up a record constructor. If GHC.Rename.Env.lookupOccRnConstr returns a TyCon (as it may, due to the logic explained in Note [Pattern to type (P2T) conversion]), we emit an error saying that the data constructor is not in scope. This avoids the compiler falling over shortly thereafter, in the call to 'lookupConstructorInfo' inside 'GHC.Rename.Env.lookupRecFieldOcc', because the record constructor would not have been a ConLike. Fixes #25056 - - - - - 9c354beb by Matthew Pickering at 2024-09-04T20:23:16-04:00 Use deterministic names for temporary files When there are multiple threads they can race to create a temporary file, in some situations the thread will create ghc_1.c and in some it will create ghc_2.c. This filename ends up in the debug info for object files after compiling a C file, therefore contributes to object nondeterminism. In order to fix this we store a prefix in `TmpFs` which serves to namespace temporary files. The prefix is populated from the counter in TmpFs when the TmpFs is forked. Therefore the TmpFs must be forked outside the thread which consumes it, in a deterministic order, so each thread always receives a TmpFs with the same prefix. This assumes that after the initial TmpFs is created, all other TmpFs are created from forking the original TmpFs. Which should have been try anyway as otherwise there would be file collisions and non-determinism. Fixes #25224 - - - - - 59906975 by Hécate Kleidukos at 2024-09-05T10:57:15-04:00 Silence x-partial in Haddock.Backends.Xhtml This is an unfortunate consequence of two mechanisms: * GHC provides (possibly-empty) lists of names * The functions that retrieve those names are not equipped to do error reporting, and thus accept these lists at face value. They will have to be attached an effect for error reporting in a later refactoring - - - - - 8afbab62 by Hécate Kleidukos at 2024-09-05T10:57:15-04:00 hadrian: Support loading haddock in ghci There is one tricky aspect with wired-in packages where the boot package is built with `-this-unit-id ghc` but the dependency is reported as `-package-id ghc-9.6...`. This has never been fixed in GHC as the situation of loading wired-in packages into the multi-repl seems like quite a niche feature that is always just easier to workaround. - - - - - 6cac9eb8 by Matthew Pickering at 2024-09-05T10:57:15-04:00 hadrian/multi: Load all targets when ./hadrian/ghci-multi is called This seems to make a bit more sense than just loading `ghc` component (and dependencies). - - - - - 7d84df86 by Matthew Pickering at 2024-09-05T10:57:51-04:00 ci: Beef up determinism interface test There have recently been some determinism issues with the simplifier and documentation. We enable more things to test in the ABI test to check that we produce interface files deterministically. - - - - - 5456e02e by Sylvain Henry at 2024-09-06T11:57:01+02:00 Transform some StgRhsClosure into StgRhsCon after unarisation (#25166) Before unarisation we may have code like: Test.foo :: Test.D [GblId, Unf=OtherCon []] = \u [] case (# |_| #) [GHC.Types.(##)] of sat_sAw [Occ=Once1] { __DEFAULT -> Test.D [GHC.Types.True sat_sAw]; }; After unarisation we get: Test.foo :: Test.D [GblId, Unf=OtherCon []] = {} \u [] Test.D [GHC.Types.True 2#]; Notice that it's still an Updatable closure for no reason anymore. This patch transforms appropriate StgRhsClosures into StgRhsCons after unarisation, allowing these closures to be statically allocated. Now we get the expected: Test.foo :: Test.D [GblId, Unf=OtherCon []] = Test.D! [GHC.Types.True 2#]; Fix #25166 To avoid duplicating code, this patch refactors the mk(Top)StgRhs functions and put them in a GHC.Stg.Make module alongside the new mk(Top)StgRhsCon_maybe functions. - - - - - 958b4518 by Hécate Kleidukos at 2024-09-06T16:40:56-04:00 haddock: Add missing requirements.txt for the online manual - - - - - 573f9833 by Sven Tennie at 2024-09-08T09:58:21+00:00 AArch64: Implement takeRegRegMoveInstr This has likely been forgotten. - - - - - 20b0de7d by Hécate Kleidukos at 2024-09-08T14:19:28-04:00 haddock: Configuration fix for ReadTheDocs - - - - - 03055c71 by Sylvain Henry at 2024-09-09T14:58:15-04:00 JS: fake support for native adjustors (#25159) The JS backend doesn't support adjustors (I believe) and in any case if it ever supports them it will be a native support, not one via libffi. - - - - - 5bf0e6bc by Sylvain Henry at 2024-09-09T14:58:56-04:00 JS: remove redundant h$lstat It was introduced a second time by mistake in 27dceb42376c34b99a38e36a33b2abc346ed390f (cf #25190) - - - - - ffbc2ab0 by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Refactor only newSysLocalDs * Change newSysLocalDs to take a scaled type * Add newSysLocalMDs that takes a type and makes a ManyTy local Lots of files touched, nothing deep. - - - - - 7124e4ad by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Don't introduce 'nospec' on the LHS of a RULE This patch address #25160. The main payload is: * When desugaring the LHS of a RULE, do not introduce the `nospec` call for non-canonical evidence. See GHC.Core.InstEnv Note [Coherence and specialisation: overview] The `nospec` call usually introdued in `dsHsWrapper`, but we don't want it on the LHS of a RULE (that's what caused #25160). So now `dsHsWrapper` takes a flag to say if it's on the LHS of a RULE. See wrinkle (NC1) in `Note [Desugaring non-canonical evidence]` in GHC.HsToCore.Binds. But I think this flag will go away again when I have finished with my (entirely separate) speciaise-on-values patch (#24359). All this meant I had to re-understand the `nospec` stuff and coherence, and that in turn made me do some refactoring, and add a lot of new documentation The big change is that in GHC.Core.InstEnv, I changed the /type synonym/ `Canonical` into a /data type/ `CanonicalEvidence` and documented it a lot better. That in turn made me realise that CalLStacks were being treated with a bit of a hack, which I documented in `Note [CallStack and ExecptionContext hack]`. - - - - - 663daf8d by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Add defaulting of equalities This MR adds one new defaulting strategy to the top-level defaulting story: see Note [Defaulting equalities] in GHC.Tc.Solver. This resolves #25029 and #25125, which showed that users were accidentally relying on a GHC bug, which was fixed by commit 04f5bb85c8109843b9ac2af2a3e26544d05e02f4 Author: Simon Peyton Jones <simon.peytonjones at gmail.com> Date: Wed Jun 12 17:44:59 2024 +0100 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. This fix gave rise to a number of user complaints; but the improved defaulting story of this MR largely resolves them. On the way I did a bit of refactoring, of course * Completely restructure the extremely messy top-level defaulting code. The new code is in GHC.Tc.Solver.tryDefaulting, and is much, much, much esaier to grok. - - - - - e28cd021 by Andrzej Rybczak at 2024-09-10T00:41:18-04:00 Don't name a binding pattern It's a keyword when PatternSynonyms are set. - - - - - b09571e2 by Simon Peyton Jones at 2024-09-10T00:41:54-04:00 Do not use an error thunk for an absent dictionary In worker/wrapper we were using an error thunk for an absent dictionary, but that works very badly for -XDictsStrict, or even (as #24934 showed) in some complicated cases involving strictness analysis and unfoldings. This MR just uses RubbishLit for dictionaries. Simple. No test case, sadly because our only repro case is rather complicated. - - - - - 8bc9f5f6 by Hécate Kleidukos at 2024-09-10T00:42:34-04:00 haddock: Remove support for applehelp format in the Manual - - - - - 9ca15506 by doyougnu at 2024-09-10T10:46:38-04:00 RTS linker: add support for hidden symbols (#25191) Add linker support for hidden symbols. We basically treat them as weak symbols. Patch upstreamed from haskell.nix Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 3b2dc826 by Sven Tennie at 2024-09-10T10:47:14-04:00 Fix C warnings (#25237) GCC 14 treats the fixed warnings as errors by default. I.e. we're gaining GCC 14 compatibility with these fixes. - - - - - 05715994 by Sylvain Henry at 2024-09-10T10:47:55-04:00 JS: fix codegen of static string data Before this patch, when string literals are made trivial, we would generate `h$("foo")` instead of `h$str("foo")`. This was introduced by mistake in 6bd850e887b82c5a28bdacf5870d3dc2fc0f5091. - - - - - 949ebced by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Re-organise cross-OS compatibility layer - - - - - 84ac9a99 by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Remove CPP for obsolete GHC and Cabal versions - - - - - 370d1599 by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Move the changelog file to the 'extra-doc-files' section in the cabal file - - - - - cfbff65a by Simon Peyton Jones at 2024-09-10T19:20:16-04:00 Add ZonkAny and document it This MR fixed #24817 by adding ZonkAny, which takes a Nat argument. See Note [Any types] in GHC.Builtin.Types, especially wrinkle (Any4). - - - - - 0167e472 by Matthew Pickering at 2024-09-11T02:41:42-04:00 hadrian: Make sure ffi headers are built before using a compiler When we are using ffi adjustors then we rely on `ffi.h` and `ffitarget.h` files during code generation when compiling stubs. Therefore we need to add this dependency to the build system (which this patch does). Reproducer, configure with `--enable-libffi-adjustors` and then build "_build/stage1/libraries/ghc-prim/build/GHC/Types.p_o". Observe that this fails before this patch and works afterwards. Fixes #24864 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 0f696958 by Rodrigo Mesquita at 2024-09-11T02:42:18-04:00 base: Deprecate BCO primops exports from GHC.Exts See https://github.com/haskell/core-libraries-committee/issues/212. These reexports will be removed in GHC 9.14. - - - - - cf0e7729 by Alan Zimmerman at 2024-09-11T02:42:54-04:00 EPA: Remove Anchor = EpaLocation synonym This just causes confusion. - - - - - 8e462f4d by Andrew Lelechenko at 2024-09-11T22:20:37-04:00 Bump submodule deepseq to 1.5.1.0 - - - - - aa4500ae by Sebastian Graf at 2024-09-11T22:21:13-04:00 User's guide: Fix the "no-backtracking" example of -XOrPatterns (#25250) Fixes #25250. - - - - - 1c479c01 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add Native Code Generator (NCG) This architecture wasn't supported before. Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 51b678e1 by Sven Tennie at 2024-09-12T10:39:38+00:00 Adjust test timings for slower computers Increase the delays a bit to be able to run these tests on slower computers. The reference was a Lichee Pi 4a RISCV64 machine. - - - - - a0e41741 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add RTS linker This architecture wasn't supported before. Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - d365b1d4 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Ignore divbyzero test The architecture's behaviour differs from the test's expectations. See comment in code why this is okay. - - - - - abf3d699 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Enable MulMayOflo_full test It works and thus can be tested. - - - - - 38c7ea8c by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: LibffiAdjustor: Ensure code caches are flushed RISCV64 needs a specific code flushing sequence (involving fence.i) when new code is created/loaded. - - - - - 7edc6965 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add additional linker symbols for builtins We're relying on some GCC/Clang builtins. These need to be visible to the linker (and not be stripped away.) - - - - - 92ad3d42 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add GHCi support As we got a RTS linker for this architecture now, we can enable GHCi for it. - - - - - a145f701 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Set codeowners of the NCG - - - - - 8e6d58cf by Sven Tennie at 2024-09-12T10:39:38+00:00 Add test for C calling convention Ensure that parameters and return values are correctly processed. A dedicated test (like this) helps to get the subtleties of calling conventions easily right. The test is failing for WASM32 and marked as fragile to not forget to investigate this (#25249). - - - - - fff55592 by Torsten Schmits at 2024-09-12T21:50:34-04:00 finder: Add `IsBootInterface` to finder cache keys - - - - - cdf530df by Alan Zimmerman at 2024-09-12T21:51:10-04:00 EPA: Sync ghc-exactprint to GHC - - - - - 1374349b by Sebastian Graf at 2024-09-13T07:52:11-04:00 DmdAnal: Fast path for `multDmdType` (#25196) This is in order to counter a regression exposed by SpecConstr. Fixes #25196. - - - - - 80769bc9 by Andrew Lelechenko at 2024-09-13T07:52:47-04:00 Bump submodule array to 0.5.8.0 - - - - - 49ac3fb8 by Sylvain Henry at 2024-09-16T10:33:01-04:00 Linker: add support for extra built-in symbols (#25155) See added Note [Extra RTS symbols] and new user guide entry. Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie at gmail.com> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 3939a8bf by Samuel Thibault at 2024-09-16T10:33:44-04:00 GNU/Hurd: Add getExecutablePath support GNU/Hurd exposes it as /proc/self/exe just like on Linux. - - - - - d3b19851 by Sylvain Henry at 2024-09-17T11:03:28-04:00 RTS: expose closure_sizeW_ (#25252) C code using the closure_sizeW macro can't be linked with the RTS linker without this patch. It fails with: ghc-9.11.20240911: Failed to lookup symbol: closure_sizeW_ Fix #25252 Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie at gmail.com> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 137bf74d by Sebastian Graf at 2024-09-17T11:04:05-04:00 HsExpr: Inline `HsWrap` into `WrapExpr` This nice refactoring was suggested by Simon during review: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13261#note_583374 Fixes #25264. - - - - - 7fd9e5e2 by Sebastian Graf at 2024-09-17T11:04:05-04:00 Pmc: Improve Desugaring of overloaded list patterns (#25257) This actually makes things simpler. Fixes #25257. - - - - - e4169ba9 by Ben Gamari at 2024-09-18T07:55:28-04:00 configure: Correctly report when subsections-via-symbols is disabled As noted in #24962, currently subsections-via-symbols is disabled on AArch64/Darwin due to alleged breakage. However, `configure` reports to the user that it is enabled. Fix this. - - - - - 9d20a787 by Mario Blažević at 2024-09-18T07:56:08-04:00 Modified the default export implementation to match the amended spec - - - - - 35eb4f42 by Sylvain Henry at 2024-09-18T07:57:00-04:00 FFI: don't ppr Id/Var symbols with debug info (#25255) Even if `-dpp-debug` is enabled we should still generate valid C code. So we disable debug info printing when rendering with Code style. - - - - - 9e96dad8 by Sebastian Graf at 2024-09-21T17:47:59-04:00 Demand: Combine examples into Note (#25107) Just a leftover from !13060. Fixes #25107. - - - - - 21aaa34b by sheaf at 2024-09-21T17:48:36-04:00 Use x86_64-unknown-windows-gnu target for LLVM on Windows - - - - - 992a7624 by sheaf at 2024-09-21T17:48:36-04:00 LLVM: use -relocation-model=pic on Windows This is necessary to avoid the segfaults reported in #22487. Fixes #22487 - - - - - c50d29be by Ryan Hendrickson at 2024-09-21T17:49:15-04:00 compiler: Use type abstractions when deriving For deriving newtype and deriving via, in order to bring type variables needed for the coercions into scope, GHC generates type signatures for derived class methods. As a simplification, drop the type signatures and instead use type abstractions to bring method type variables into scope. - - - - - f04fd0ae by Zubin Duggal at 2024-09-21T17:49:51-04:00 driver: Ensure we run driverPlugin for staticPlugins (#25217) driverPlugins are only run when the plugin state changes. This meant they were never run for static plugins, as their state never changes. We need to keep track of whether a static plugin has been initialised to ensure we run static driver plugins at least once. This necessitates an additional field in the `StaticPlugin` constructor as this state has to be bundled with the plugin itself, as static plugins have no name/identifier we can use to otherwise reference them - - - - - 620becd7 by Andreas Klebinger at 2024-09-21T17:50:27-04:00 Allow unknown fd device types for setNonBlockingMode. This allows fds with a unknown device type to have blocking mode set. This happens for example for fds from the inotify subsystem. Fixes #25199. - - - - - c76e25b3 by Hécate Kleidukos at 2024-09-21T17:51:07-04:00 Use Hackage version of Cabal 3.14.0.0 for Hadrian. We remove the vendored Cabal submodule. Also update the bootstrap plans Fixes #25086 - - - - - 6c83fd7f by Zubin Duggal at 2024-09-21T17:51:07-04:00 ci: Ensure we source ci.sh in any jobs that run commands outside of ci.sh ci.sh sets up the toolchain environment, including paths for the cabal directory, the toolchain binaries etc. If we run any commands outside of ci.sh, unless we source ci.sh we will use the wrong values for these environment variables. In particular, I ran into an issue where the cabal invocation `hadrian/ghci` was using an old index state despite `ci.sh setup` updating and setting the correct index state. This is because `ci.sh` sets the `CABAL_DIR` to a different place, which is where the index was downloaded to, but we were using the default cabal directory outside ci.sh The solution is to source the correct environment `ci.sh` using `. ci.sh setup` - - - - - 9586998d by Sven Tennie at 2024-09-21T17:51:43-04:00 ghc-toolchain: Set -fuse-ld even for ld.bfd This reflects the behaviour of the autoconf scripts. - - - - - d7016e0d by Sylvain Henry at 2024-09-21T17:52:24-04:00 Parser: be more careful when lexing extended literals (#25258) Previously we would lex invalid prefixes like "8#Int3" as [8#Int, 3]. A side-effect of this patch is that we now allow negative unsigned extended literals. They trigger an overflow warning later anyway. - - - - - ca67d7cb by Zubin Duggal at 2024-09-22T02:34:06-04:00 rts: Ensure we dump new Cost Centres added by freshly loaded objects to the eventlog. To do this, we keep track of the ID of the last cost centre we dumped in DUMPED_CC_ID, and call dumpCostCentresToEventLog from refreshProfilingCCSs, which will dump all the new cost centres up to the one we already dumped in DUMPED_CC_ID. Fixes #24148 - - - - - c0df5aa9 by Alan Zimmerman at 2024-09-22T02:34:42-04:00 EPA: Replace AnnsModule am_main with EpTokens Working towards removing `AddEpAnn` - - - - - 2a551cd5 by Matthew Pickering at 2024-09-24T16:33:50+05:30 ci: Run abi-test on test-abi label - - - - - ab4039ac by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 testsuite: Add a test for object determinism Extends the abi_test with an object determinism check Also includes a standalone test to be run by developers manually when debugging issues with determinism. - - - - - d62c18d8 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Sampling uniques in the CG To achieve object determinism, the passes processing Cmm and the rest of the code generation pipeline musn't create new uniques which are non-deterministic. This commit changes occurrences of non-deterministic unique sampling within these code generation passes by a deterministic unique sampling strategy by propagating and threading through a deterministic incrementing counter in them. The threading is done implicitly with `UniqDSM` and `UniqDSMT`. Secondly, the `DUniqSupply` used to run a `UniqDSM` must be threaded through all passes to guarantee uniques in different passes are unique amongst them altogether. Specifically, the same `DUniqSupply` must be threaded through the CG Streaming pipeline, starting with Driver.Main calling `StgToCmm.codeGen`, `cmmPipeline`, `cmmToRawCmm`, and `codeOutput` in sequence. To thread resources through the `Stream` abstraction, we use the `UniqDSMT` transformer on top of `IO` as the Monad underlying the Stream. `UniqDSMT` will thread the `DUniqSupply` through every pass applied to the `Stream`, for every element. We use @type CgStream = Stream (UniqDSMT IO)@ for the Stream used in code generation which that carries through the deterministic unique supply. See Note [Deterministic Uniques in the CG] - - - - - 3bbe4af4 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Cmm unique renaming pass To achieve object determinism, we need to prevent the non-deterministic uniques from leaking into the object code. We can do this by deterministically renaming the non-external uniques in the Cmm groups that are yielded right after StgToCmm. The key to deterministic renaming is observing that the order of declarations, instructions, and data in the Cmm groups are already deterministic (modulo other determinism bugs), regardless of the uniques. We traverse the Cmm AST in this deterministic order and rename the uniques, incrementally, in the order they are found, thus making them deterministic. This renaming is guarded by -fobject-determinism which is disabled by default for now. This is one of the key passes for object determinism. Read about the overview of object determinism and a more detailed explanation of this pass in: * Note [Object determinism] * Note [Renaming uniques deterministically] Significantly closes the gap to #12935 - - - - - 8357ed50 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: DCmmGroup vs CmmGroup Part of our strategy in producing deterministic objects, namely, renaming all Cmm uniques in order, depend on the object code produced having a deterministic order (say, A_closure always comes before B_closure). However, the use of LabelMaps in the Cmm representation invalidated this requirement because the LabelMaps elements would already be in a non-deterministic order (due to the original uniques), and the renaming in sequence wouldn't work because of that non-deterministic order. Therefore, we now start off with lists in CmmGroup (which preserve the original order), and convert them into LabelMaps (for performance in the code generator) after the uniques of the list elements have been renamed. See Note [DCmmGroup vs CmmGroup or: Deterministic Info Tables] and #12935. Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 0e675fb8 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Don't print unique in pprFullName This unique was leaking as part of the profiling description in info tables when profiling was enabled, despite not providing information relevant to the profile. - - - - - 340f58b0 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: UDFM for distinct-constructor-tables In order to produce deterministic objects when compiling with -distinct-constructor-tables, we also have to update the data constructor map to be backed by a deterministic unique map (UDFM) rather than a non-deterministic one (UniqMap). - - - - - 282f37a0 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: InfoTableMap uniques in generateCgIPEStub Fixes object determinism when using -finfo-table-map Make sure to also deterministically rename the IPE map (as per Note [Renaming uniques deterministically]), and to use a deterministic unique supply when creating new labels for the IPE information to guarantee deterministic objects when IPE information is requested. Note that the Cmm group produced in generateCgIPEStub must /not/ be renamed because renaming uniques is not idempotent, and the references to the previously renamed code in the IPE Cmm group would be renamed twice and become invalid references to non-existent symbols. We do need to det-rename the InfoTableMap that is created in the conversion from Core to Stg. This is not a problem since that map won't refer any already renamed names (since it was created before the renaming). - - - - - 7b37afc9 by Zubin Duggal at 2024-09-24T16:33:50+05:30 ci: Allow abi-test to fail. We are not fully deterministic yet, see #12935 for work that remains to be done. - - - - - a63ee33a by Simon Peyton Jones at 2024-09-25T17:08:24-04:00 Add Given injectivity for built-in type families Ticket #24845 asks (reasonably enough) that if we have [G] a+b ~ 0 then we also know [G] a ~ 0, b ~ 0 and similar injectivity-like facts for other built-in type families. The status quo was that we never generate evidence for injectivity among Givens -- but it is quite reasonnable to do so. All we need is to have /evidence/ for the new constraints This MR implements that goal. I also took the opportunity to * Address #24978: refactoring UnivCo * Fix #25248, which was a consequences of the previous formulation of UnivCo As a result this MR touches a lot of code. The big things are: * Coercion constructor UnivCo now takes a [Coercion] as argument to express the coercions on which the UnivCo depends. A nice consequence is that UnivCoProvenance now has no free variables, simpler in a number of places. * Coercion constructors AxiomInstCo and AxiomRuleCo are combined into AxiomCo. The new AxiomCo, carries a (slightly oddly named) CoAxiomRule, which itself is a sum type of the various forms of built-in axiom. See Note [CoAxiomRule] in GHC.Core.Coercion.Axiom A merit of this is that we can separate the case of open and closed type families, and eliminate the redundant `BranchIndex` in the former case. * Much better representation for data BuiltInSynFamily, which means we no longer need to enumerate built-in axioms as well as built-in tycons. * There is a massive refactor in GHC.Builtin.Types.Literals, which contains all the built-in axioms for type-level operations (arithmetic, append, cons etc). A big change is that instead of redundantly having (a) a hand-written matcher, and (b) a template-based "proves" function, which were hard to keep in sync, the two are derive from one set of human-supplied info. See GHC.Builtin.Types.Literals.mkRewriteAxiom, and friends. * Significant changes in GHC.Tc.Solver.Equality to account for the new opportunity for Given/Given equalities. Smaller things * Improve pretty-printing to avoid parens around atomic coercions. * Do proper eqType in findMatchingIrreds, not `eqTypeNoKindCheck`. Looks like a bug, Richard agrees. * coercionLKind and coercionRKind are hot functions. I refactored the implementation (which I had to change anyway) to increase sharing. See Note [coercionKind performance] in GHC.Core.Coercion * I wrote a new Note [Finding orphan names] in GHC.Core.FVs about orphan names * I improved the `is_concrete` flag in GHC.Core.Type.buildSynTyCon, to avoid calling tyConsOfType. I forget exactly why I did this, but it's definitely better now. * I moved some code from GHC.Tc.Types.Constraint into GHC.Tc.Types.CtLocEnv and I renamed the module GHC.Tc.Types.CtLocEnv to GHC.Tc.Types.CtLoc - - - - - dd8ef342 by Ryan Scott at 2024-09-25T17:09:01-04:00 Resolve ambiguous method-bound type variables in vanilla defaults and GND When defining an instance of a class with a "vanilla" default, such as in the following example (from #14266): ```hs class A t where f :: forall x m. Monoid x => t m -> m f = <blah> instance A [] ``` We have to reckon with the fact that the type of `x` (bound by the type signature for the `f` method) is ambiguous. If we don't deal with the ambiguity somehow, then when we generate the following code: ```hs instance A [] where f = $dmf @[] -- NB: the type of `x` is still ambiguous ``` Then the generated code will not typecheck. (Issue #25148 is a more recent example of the same problem.) To fix this, we bind the type variables from the method's original type signature using `TypeAbstractions` and instantiate `$dmf` with them using `TypeApplications`: ```hs instance A [] where f @x @m = $dmf @[] @x @m -- `x` is no longer ambiguous ``` Note that we only do this for vanilla defaults and not for generic defaults (i.e., defaults using `DefaultSignatures`). For the full details, see `Note [Default methods in instances] (Wrinkle: Ambiguous types from vanilla method type signatures)`. The same problem arose in the code generated by `GeneralizedNewtypeDeriving`, as we also fix it here using the same technique. This time, we can take advantage of the fact that `GeneralizedNewtypeDeriving`-generated code _already_ brings method-bound type variables into scope via `TypeAbstractions` (after !13190), so it is very straightforward to visibly apply the type variables on the right-hand sides of equations. See `Note [GND and ambiguity]`. Fixes #14266. Fixes #25148. - - - - - 0a4da5d2 by ARATA Mizuki at 2024-09-25T17:09:41-04:00 Document primitive string literals and desugaring of string literals Fixes #17474 and #17974 Co-authored-by: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - ad0731ad by Zubin Duggal at 2024-09-25T17:10:18-04:00 rts: Fix segfault when using non-moving GC with profiling `nonMovingCollect()` swaps out the `static_flag` value used as a sentinel for `gct->scavenged_static_objects`, but the subsequent call `resetStaticObjectForProfiling()` sees the old value of `static_flag` used as the sentinel and segfaults. So we must call `resetStaticObjectForProfiling()` before calling `nonMovingCollect()` as otherwise it looks for the incorrect sentinel value Fixes #25232 and #23958 Also teach the testsuite driver about nonmoving profiling ways and stop disabling metric collection when nonmoving GC is enabled. - - - - - e7a26d7a by Sylvain Henry at 2024-09-25T17:11:00-04:00 Fix interaction between fork and kqueue (#24672) A kqueue file descriptor isn't inherited by a child created with fork. As such we mustn't try to close this file descriptor as we would close a random one, e.g. the one used by timerfd. Fix #24672 - - - - - 6863503c by Simon Peyton Jones at 2024-09-25T17:11:37-04:00 Improve GHC.Tc.Solver.defaultEquality This MR improves GHC.Tc.Solver.defaultEquality to solve #25251. The main change is to use checkTyEqRhs to check the equality, so that we do promotion properly. But within that we needed a small enhancement to LC_Promote. See Note [Defaulting equalites] (DE4) and (DE5) The tricky case is (alas) hard to trigger, so I have not added a regression test. - - - - - 97a6c6c3 by Sylvain Henry at 2024-09-25T17:12:18-04:00 JS: fix h$withCStringOnHeap helper (#25288) strlen returns the length of the string without the \0 terminating byte, hence CString weren't properly allocated on the heap (ending \0 byte was missing). - - - - - 5f7c20bc by Ben Gamari at 2024-09-26T04:14:05-04:00 base: Propagate `error` CallStack to thrown exception Previously `errorCallWithCallStackException` failed to propagate its `CallStack` argument, which represents the call-chain of the preceding `error` call, to the exception that it returned. Consequently, the call-stack of `error` calls were quite useless. Unfortunately, this is the second time that I have fixed this but it seems the first must have been lost in rebasing. Fixes a bug in the implementation of CLC proposal 164 <https://github.com/haskell/core-libraries-committee/issues/164> Fixes #24807. - - - - - c20d5186 by Matthew Pickering at 2024-09-26T04:14:42-04:00 driver: Fix -working-dir for foreign files -working-dir definitely needs more serious testing, there are some easy ways to test this. * Modify Cabal to call ghc using -working-dir rather than changing directory. * Modify the testsuite to run ghc using `-working-dir` rather than running GHC with cwd = temporary directory. However this will have to wait until after 9.12. Fixes #25150 - - - - - 88eaa7ac by Sylvain Henry at 2024-09-26T04:15:24-04:00 Enum deriving: reuse predError, succError, toEnumError Reuse predError, succError, and toEnumError when deriving Enum instances to avoid generating different error strings per instance. E.g. before this patch for every instance for a type FOO we would generate a string: "pred{FOO}: tried to take `pred' of first tag in enumeration"# - - - - - e9fa1163 by Sylvain Henry at 2024-09-26T04:15:24-04:00 Enum deriving: generate better code (#16364) Generate better code for Enum.toEnum: check both the lower and the upper bounds at once with an unsigned comparison. Initially I've used a type ascription with a call to 'fromIntegral', hence the slight refactoring of nlAscribe. Using 'fromIntegral' was problematic (too low in the module hierarchy) so 'enumIntToWord' was introduced instead. Combined with the previous commit, T21839c ghc/alloc decrease by 5% Metric Decrease: T21839c - - - - - 383af074 by Sylvain Henry at 2024-09-26T04:16:06-04:00 Core: add absorb rules for binary or/and (#16351) Rules: x or (x and y) ==> x x and (x or y) ==> x - - - - - 783c8b29 by Matthew Pickering at 2024-09-26T12:07:44-04:00 Don't compile `asBox` with -fprof-late The `asBox` function is intended to store exactly the closure which the user passes to it. Placing a cost centre on asBox introduces a thunk, which violates this expectation and can change the result of using asBox when profiling is enabled. See #25212 for more details and ample opportunity to discuss if this is a bug or not. - - - - - 0967dcc7 by Matthew Pickering at 2024-09-26T12:07:44-04:00 Fix normalisation of .prof files Fix 1: If a cost centre contained CAF then the normalisation was corrupted, now only check if CAF is at the start of a line. Fix 2: "no location info" contain a space, which messed up the next normalisation logic which assumed that columns didn't have spaced in. - - - - - 9eda1cb9 by Matthew Pickering at 2024-09-26T12:07:44-04:00 testsuite: Fix normalisation of prof_files removing newlines These normalisation steps were collapsing lines together, which made subsequent normalisation steps fail. ``` foo x y z CAF x y z qux x y z ``` was getting normalised to ``` foo x y z qux x y z ``` which means that subsequent line based filters would not work correctly. - - - - - 2b25f9e2 by Matthew Pickering at 2024-09-26T12:07:44-04:00 packaging: Enable late-ccs for release flavour This enables late cost centres when building profiled libraries and subsequently greatly improves the resolution of cost centre stacks when profiling. This patch also introduces the `grep_prof` test modifier which is used to apply a further filter to the .prof file before they are compared. Fixes #21732 ------------------------- Metric Increase: libdir ------------------------- - - - - - bb030d0d by Brandon Chinn at 2024-09-26T12:08:21-04:00 Replace manual string lexing (#25158) Metric Increase: MultilineStringsPerf This commit replaces the manual string lexing logic with native Alex lexing syntax. This aligns the lexer much closer to the Haskell Report, making it easier to see how the implementation and spec relate. This slightly increases memory usage when compiling multiline strings because we now have two distinct phases: lexing the multiline string with Alex and post-processing the string afterwards. Before, these were done at the same time, but separating them allows us to push as much logic into normal Alex lexing as possible. Since multiline strings are a new feature, this regression shouldn't be too noticeable. We can optimize this over time. - - - - - 16742987 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Revert !4655: Stop 'import "base" Prelude' removing implicit Prelude import This behaviour is problematic for the principle reason that `import Prelude` may not refer to the `base` package, and in which case importing an entirely unrelated module causing your implicit prelude to leave the scope is extremely surprising. See the added test for this example. Discussion on #17045. The secondary reason for reverting this patch is that "base" can't be a wired in package any more (see #24903), so we have to remove special logic which singles out base from the compiler. The rule for implicit shadowing is now simply: * If you write import Prelude (..) then you don't get an implicit prelude import * If you write import "foobar" Prelude (..) for all pkgs foobar, you get an implicit import of prelude. If you want to write a package import of Prelude, then you can enable `NoImplicitPrelude` for the module in question to recover the behaviour of ghc-9.2-9.10. Fixes #17045 - - - - - 57c50f41 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Rename COMPILING_BASE_PACKAGE to COMPILING_GHC_INTERNAL_PACKAGE The COMPILING_BASE_PACKAGE macro is concerned with issues defining symbols and using symbols in the same compilation unit. However, these symbols now exist in ghc-internal rather than base, so we should rename the macro accordingly. The code is guards is likely never used as we never produce windows DLLs but it is simpler to just perform the renaming for now. These days there is little doubt that this macro defined in this ad-hoc manner would be permitted to exist, but these days are not those days. Fixes #25221 - - - - - 70764243 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Preload ghc-internal rather than base This occurence of baseUnitId was missed when moving the bulk of internal definitions into `ghc-internal`. We need to remove this preloading of `base` now because `base` should not be wired in. Towards #24903 - - - - - 12915609 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Remove Data.List compat warning There is currently a warning implemented in -Wcompat which warns you when importing Data.List in a non-qualified manner. ``` A.hs:3:8: warning: [-Wcompat-unqualified-imports] To ensure compatibility with future core libraries changes imports to Data.List should be either qualified or have an explicit import list. | 3 | import Data.List | ^^^^^^^^^ Ok, one module loaded. ``` GHC ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/17244 CLC discussion: https://groups.google.com/g/haskell-core-libraries/c/q3zHLmzBa5E This warning was implemented as part of the migration to making Data.List monomorphic again (and to be used like Data.Set, Data.Map etc). That doesn't seem like it happened, and I imagine that the current CLC would require a new proposal anyway in order to do that now. It's not clear in any case what "future core libraries changes" we are waiting to happen before this warning can be removed. Given the first phase of the proposal has lasted 5 years it doesn't seem that anyone is motivated to carry the proposal to completion. It does seem a bit unnecessary to include a warning in the compiler about "future changes to the module" when there's no timeline or volunteer to implement these changes. The removal of this warning was discussed again at: https://github.com/haskell/core-libraries-committee/issues/269 During the discussion there was no new enthusiasm to move onto the next stages of the proposal so we are removing the warning to unblock the reinstallable "base" project (#24903) Fixes #24904 - - - - - d4e4d498 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Move Control.Monad.Zip into ghc-internal mzip is wired in and therefore needs to be in ghc-internal. Fixes #25222 Towards #24903 - - - - - d3dacdfb by Matthew Pickering at 2024-09-26T12:08:57-04:00 Unwire the base package This patch just removes all the functions related to wiring-in the base package and the `-this-unit-id=base` flag from the cabal file. After this commit "base" becomes just like any other package and the door is opened to moving base into an external repo and releasing base on a separate schedule to the rest of ghc. Closes #24903 - - - - - 1b39363b by Patrick at 2024-09-27T06:10:19-04:00 Add entity information to HieFile #24544 Enhanced HieFile to capture entity information for identifiers, enabling better support for language tools and protocols. See issue #24544 for more details. Work have been done: * Introduction of new data type `EntityInfo` in `GHC.Iface.Ext.Types`. * Add extra field `hie_entity_infos :: NameEntityInfo` to `HieFile` to store the mapping from entity name to corresponding entity infos in `GHC.Iface.Ext.Types`. * Compute `EntityInfo` for each entity name in the HieAst from `TyThing, Id, OccName` when generating the `HieFile` in `GHC.Iface.Ext.Ast`. * Add test T24544 to test the generation of `EntityInfo`. - - - - - 4f3618d8 by sheaf at 2024-09-27T06:10:57-04:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 10e431ef by sheaf at 2024-09-27T06:10:57-04:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 8238fb2d by sheaf at 2024-09-27T06:10:57-04:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 2cb7b748 by sheaf at 2024-09-27T06:10:57-04:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 0d2428d6 by sheaf at 2024-09-27T06:10:57-04:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - e6c19a41 by sheaf at 2024-09-27T06:10:57-04:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - f496ff7f by sheaf at 2024-09-27T06:10:57-04:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 5dd2a423 by sheaf at 2024-09-27T06:10:57-04:00 Add test for C calls & SIMD vectors - - - - - f824e1ee by sheaf at 2024-09-27T06:10:58-04:00 Add test for #25169 - - - - - d54db7f3 by sheaf at 2024-09-27T06:10:58-04:00 Fix #25169 using Plan A from the ticket We now compile certain low-level Cmm functions in the RTS multiple times, with different levels of vector support. We then dispatch at runtime in the RTS, based on what instructions are supported. See Note [realArgRegsCover] in GHC.Cmm.CallConv. Fixes #25169 ------------------------- Metric Increase: T10421 T12425 T18730 T1969 T9198 ------------------------- - - - - - d5f8778a by sheaf at 2024-09-27T06:10:58-04:00 Fix C calls with SIMD vectors This commit fixes the code generation for C calls, to take into account the calling convention. This is particularly tricky on Windows, where all vectors are expected to be passed by reference. See Note [The Windows X64 C calling convention] in GHC.CmmToAsm.X86.CodeGen. - - - - - f64bd564 by sheaf at 2024-09-27T06:10:58-04:00 X86 CodeGen: refactor getRegister CmmLit This refactors the code dealing with loading literals into registers, removing duplication and putting all the code in a single place. It also changes which XOR instruction is used to place a zero value into a register, so that we use VPXOR for a 128-bit integer vector when AVX is supported. - - - - - ab12de6b by sheaf at 2024-09-27T06:10:58-04:00 X86 genCCall: promote arg before calling evalArgs The job of evalArgs is to ensure each argument is put into a temporary register, so that it can then be loaded directly into one of the argument registers for the C call, without the generated code clobbering any other register used for argument passing. However, if we promote arguments after calling evalArgs, there is the possibility that the code used for the promotion will clobber a register, defeating the work of evalArgs. To avoid this, we first promote arguments, and only then call evalArgs. - - - - - 8fd12429 by sheaf at 2024-09-27T06:10:58-04:00 X86 genCCall64: simplify loadArg code This commit simplifies the argument loading code by making the assumption that it is safe to directly load the argument into register, because doing so will not clobber any previous assignments. This assumption is borne from the use of 'evalArgs', which evaluates any arguments which might necessitate non-trivial code generation into separate temporary registers. - - - - - 12504a9f by sheaf at 2024-09-27T06:10:58-04:00 LLVM: propagate GlobalRegUse information This commit ensures we keep track of how any particular global register is being used in the LLVM backend. This informs the LLVM type annotations, and avoids type mismatches of the following form: argument is not of expected type '<2 x double>' call ccc <2 x double> (<2 x double>) (<4 x i32> arg) - - - - - 2bb1e8df by Cheng Shao at 2024-09-27T06:11:35-04:00 Link bytecode from interface-stored core bindings in oneshot mode !13042 Part of #T25090 If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use Core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). When an interface is loaded into the EPS in `loadInterface` that has dehydrated Core bindings, an entry is added to the new field `eps_iface_bytecode`, containing an IO action that produces a bytecode `Linkable`, lazily processing the `mi_extra_decls` by calling `loadIfaceByteCode`. When Template Haskell dependencies are resolved in `getLinkDeps`, this action is looked up after loading a module's interface. If it exists, the action is evaluated and the bytecode is added to the set of `Linkable`s used for execution of the splice; otherwise it falls back on the traditional object file. Metric Decrease: MultiLayerModules T13701 - - - - - 7cb7172e by Matthew Pickering at 2024-09-27T06:12:12-04:00 ci: Fix variable inheritence for ghcup-metadata testing job Downstream in ghcup-ci we use the CONFIGURE_ARGS variable to determine how to setup all the different jobs. On the downstream trigger this was being inherited from the default setting in .gitlab.yml file. Therefore this led to job failures as the necessary CONFIGURE_ARGS were not being passed to the configure script when installing the bindist. See docs: * https://docs.gitlab.com/ee/ci/yaml/#inherit * https://docs.gitlab.com/ee/ci/yaml/#triggerforward 1. inherit:variables:fals - This stops the global variables being inherited into the job and hence forwarded onto the downstream job. 2. trigger:forward:* - yaml_variables: true (default) pass yaml variables to downstream, this is important to pass the upstream pipeline id to downstream. - pipeline_variables: false (default) but don't pass pipeline variables (normal environment variables). Fixes #25294 - - - - - 9ffd6163 by Leo at 2024-09-27T16:26:01+05:30 Fix typo in Prelude doc for (>>=) Fix a minor typo ("equivialent" instead of "equivalent") in the documentation for (>>=) in the prelude. - - - - - 5745dbd3 by Vladislav Zavialov at 2024-09-27T16:26:52+05:30 Wildcard binders in type declarations (#23501) Add support for wildcard binders in type declarations: type Const a b = a -- BEFORE: the `b` had to be named -- even if unused on the RHS type Const a _ = a -- AFTER: the compiler accepts -- a wildcard binder `_` The new feature is part of GHC Proposal #425 "Invisible binders in type declarations", and more specifically its amendment #641. Just like a named binder, a wildcard binder `_` may be: * plain: _ * kinded: (_ :: k -> Type) * invisible, plain: @_ * invisible, kinded: @(_ :: k -> Type) Those new forms of binders are allowed to occur on the LHSs of data, newtype, type, class, and type/data family declarations: data D _ = ... newtype N _ = ... type T _ = ... class C _ where ... type family F _ data family DF _ (Test case: testsuite/tests/typecheck/should_compile/T23501a.hs) However, we choose to reject them in forall telescopes and type family result variable binders (the latter being part of the TypeFamilyDependencies extension): type family Fd a = _ -- disallowed (WildcardBndrInTyFamResultVar) fn :: forall _. Int -- disallowed (WildcardBndrInForallTelescope) (Test case: testsuite/tests/rename/should_fail/T23501_fail.hs) See the new Notes: * Note [Type variable binders] * Note [Wildcard binders in disallowed contexts] To accommodate the new forms of binders, HsTyVarBndr was changed as follows (demonstrated without x-fields for clarity) -- BEFORE (ignoring x-fields and locations) data HsTyVarBndr flag = UserTyVar flag Name | KindedTyVar flag Name HsKind -- AFTER (ignoring x-fields and locations) data HsTyVarBndr flag = HsTvb flag HsBndrVar HsBndrKind data HsBndrVar = HsBndrVar Name | HsBndrWildCard data HsBndrKind = HsBndrNoKind | HsBndrKind LHsKind The rest of the patch is downstream from this change. To avoid a breaking change to the TH AST, we generate fresh names to replace wildcard binders instead of adding a dedicated representation for them (as discussed in #641). And to put a cherry on top of the cake, we now allow wildcards in kind-polymorphic type variable binders in constructor patterns, see Note [Type patterns: binders and unifiers] and the tyPatToBndr function in GHC.Tc.Gen.HsType; example: fn (MkT @(_ :: forall k. k -> Type) _ _) = ... (Test case: testsuite/tests/typecheck/should_compile/T23501b.hs) - - - - - ff2bdca2 by Matthew Pickering at 2024-09-27T16:27:08+05:30 ci: Push perf notes from wasm jobs It was observed in #25299 that we were failing to push performance numbers from the wasm jobs. In future we might want to remove this ad-hoc check but for now it's easier to add another special case. Towards #25299 - - - - - 4c76f75c by Zubin Duggal at 2024-09-27T16:44:00+05:30 Bump GHC version to 9.12 - - - - - e4ac1b0d by Zubin Duggal at 2024-09-27T19:12:24+05:30 Bump GHC version to 9.13 - - - - - da20cac1 by Andreas Klebinger at 2024-10-02T22:18:48-04:00 SpecConstr: Introduce a separate argument limit for forced specs. We used to put no limit at all on specializations forced via the SPEC argument. This isn't always reasonable so we introduce a very high limit that applies to forced specializations, a flag to control it, and we now emit a warning if we fail a specialization because we exceed the warning. Fixes #25197 - - - - - 39497eed by Andreas Klebinger at 2024-10-02T22:19:24-04:00 ghc-experimental: Expose primops and ghc extensions via GHC.PrimOps This will be the new place for functions that would have gone into GHC.Exts in the past but are not stable enough to do so now. Addresses #25242 - - - - - e9dc2690 by Sylvain Henry at 2024-10-02T22:20:06-04:00 RTS: cleanup timerfd file descriptors after a fork (#25280) When we init a timerfd-based ticker, we should be careful to cleanup the old file descriptors (e.g. after a fork). - - - - - 64e876bc by Rodrigo Mesquita at 2024-10-02T22:20:43-04:00 determinism: Deterministic MonadGetUnique LlvmM Update LlvmM to thread a unique deterministic supply (using UniqDSMT), and use it in the MonadGetUnique instance. This makes uniques sampled from LlvmM deterministic, which guarantees object determinism with -fllvm. Fixes #25274 - - - - - 36bbb167 by Matthew Pickering at 2024-10-02T22:21:18-04:00 Bump LLVM upper bound to allow LLVM 19 Also bumps the ci-images commit so that the deb12 images uses LLVM 19 for testing. ------------------------- Metric Decrease: size_hello_artifact_gzip size_hello_unicode_gzip ------------------------- Fixes #25295 - - - - - 0029ca91 by Matthew Pickering at 2024-10-02T22:21:54-04:00 configure: Allow happy-2.0.2 happy-2.0.2 can be used to compile GHC. happy-2.0 and 2.0.1 have bugs which make it unsuitable to use. The version bound is now == 1.20.* || >= 2.0.2 && < 2.1 Fixes #25276 - - - - - 92976985 by ARATA Mizuki at 2024-10-02T22:22:35-04:00 Use bundled llc/opt on Windows (#22438) - - - - - af59749a by Matthew Pickering at 2024-10-02T22:23:11-04:00 Fix registerArch for riscv64 The register allocator doesn't support vector registers on riscv64, therefore advertise as NoVectors. Fixes #25314 - - - - - a49e66fc by Matthew Pickering at 2024-10-02T22:23:11-04:00 riscv: Avoid using csrr instruction to test for vector registers The csrr instruction isn't allowed in qemu user-mode, and raises an illegal instruction error when it is encountered. Therefore for now, we just hard-code that there is no support for vector registers since the rest of the compiler doesn't support vector registers for riscv. Fixes #25312 - - - - - 115a30e9 by Andreas Klebinger at 2024-10-02T22:23:11-04:00 Add support for fp min/max to riscv Fixes #25313 - - - - - f28b5992 by Ben Gamari at 2024-10-02T22:23:47-04:00 testsuite/perf: Report better error message on malformed note Previously a malformed perf note resulted in very poor errors. Here we slight improve this situation. - - - - - 51377508 by Ben Gamari at 2024-10-02T22:23:47-04:00 testsuite: Handle division-by-zero more gracefully Previously we would fail with an ZeroDivisionError. Fixes #25321 - - - - - 50490075 by Matthew Pickering at 2024-10-03T05:55:13-04:00 ci: Add nightly & release ubuntu-22.04 jobs This adds build of bindists on ubuntu-22.04 on nightly and release pipelines. We also update ghcup-metadata to provide ubuntu-22.04 bindists on ubuntu-22.04. Fixes #25317 - - - - - 9cf1cef5 by Zubin Duggal at 2024-10-03T05:55:49-04:00 haddock: Bump binary interface version to 46. This allows haddock to give good error messages when being used on mismatched interface files. We bump to 46 since GHC 9.12 uses version 45: https://gitlab.haskell.org/ghc/ghc/-/commit/362afd632032ee8f174690c3ffe0015076b83ce6 This should have been done in e4ac1b0d281b85a0144d1ef6f84a1df00e236052 but was overlooked. - - - - - 2293c0b7 by Andreas Klebinger at 2024-10-03T05:56:25-04:00 Change versionig of ghc-experimental to follow ghc versions. Just like ghc-internal it will now use the @ProjectVersionForLib@ macro for versioning. This means for ghc=9.10.1, ghc-experimental's version will be 9.1001.0 and so on. This fixes #25289 - - - - - 876d6e0e by Ben Gamari at 2024-10-04T15:07:53+01:00 base: Add `HasCallStack` constraint to `ioError` As proposed in core-libraries-committee#275. - - - - - 9bfd9fd0 by Matthew Pickering at 2024-10-04T15:08:03+01:00 Fix toException method for ExceptionWithContext Fixes #25235 - - - - - ac004028 by Matthew Pickering at 2024-10-04T15:09:07+01:00 Exception rethrowing Basic changes: * Change `catch` function to propagate exceptions using the WhileHandling mechanism. * Introduce `catchNoPropagate`, which does the same as before, but passes an exception which can be rethrown. * Introduce `rethrowIO` combinator, which rethrows an exception with a context and doesn't add a new backtrace. * Introduce `tryWithContext` for a variant of `try` which can rethrow the exception with it's original context. * onException is modified to rethrow the original error rather than creating a new callstack. * Functions which rethrow in GHC.Internal.IO.Handle.FD, GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and GHC.Internal.System.IO.Error are modified to not add a new callstack. Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202> - - - - - bcb293f2 by Cheng Shao at 2024-10-04T17:59:28-04:00 testsuite: remove accidentally checked in debug print logic - - - - - 68e2da5a by Rodrigo Mesquita at 2024-10-05T10:36:15-04:00 Deprecation for WarnCompatUnqualifiedImports Fixes #25330 - - - - - 4327f0e8 by Andrew Lelechenko at 2024-10-05T10:36:52-04:00 Restrict Data.List.NonEmpty.unzip to NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) Implementing the final phase of CLC proposal https://github.com/haskell/core-libraries-committee/issues/86 - - - - - ceca9efb by Cheng Shao at 2024-10-06T02:18:31+00:00 driver: fix runWorkerLimit on wasm This commit fixes link-time unresolved symbol errors for sem_open etc on wasm, by making runWorkerLimit always behave single-threaded. This avoids introducing the jobserver logic into the final wasm module and thus avoids referencing the posix semaphore symbols. - - - - - 135fd1ac by Torsten Schmits at 2024-10-06T02:18:31+00:00 Parallelize getRootSummary computations in dep analysis downsweep This reuses the upsweep step's infrastructure to process batches of modules in parallel. I benchmarked this by running `ghc -M` on two sets of 10,000 modules; one with a linear dependency chain and the other with a binary tree. Comparing different values for the number of modules per thread suggested an optimum at `length targets `div` (n_cap * 2)`, with results similar to this one (6 cores, 12 threads): ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 1.775 s ± 0.026 s [User: 1.377 s, System: 0.399 s] Range (min … max): 1.757 s … 1.793 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 876.2 ms ± 20.9 ms [User: 1833.2 ms, System: 518.6 ms] Range (min … max): 856.2 ms … 898.0 ms 3 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 793.5 ms ± 23.2 ms [User: 2318.9 ms, System: 718.6 ms] Range (min … max): 771.9 ms … 818.0 ms 3 runs ``` Results don't differ much when the batch size is reduced to a quarter of that, but there's significant thread scheduling overhead for a size of 1: ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 2.611 s ± 0.029 s [User: 2.851 s, System: 0.783 s] Range (min … max): 2.591 s … 2.632 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 1.189 s ± 0.007 s [User: 2.707 s, System: 1.103 s] Range (min … max): 1.184 s … 1.194 s 2 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 1.097 s ± 0.006 s [User: 2.938 s, System: 1.300 s] Range (min … max): 1.093 s … 1.101 s 2 runs ``` Larger batches also slightly worsen performance. - - - - - 535a2117 by Daniel Díaz at 2024-10-06T09:51:46-04:00 Clarify the meaning of "exactly once" in LinearTypes Solves documentaion issue #25084. - - - - - 92f8939a by Krzysztof Gogolewski at 2024-10-06T09:52:22-04:00 Only allow (a => b) :: Constraint rather than CONSTRAINT rep Fixes #25243 - - - - - 4a2f0f13 by Alan Zimmerman at 2024-10-07T05:16:54-04:00 EPA: Remove unused hsCaseAnnsRest We never populate it, so remove it. - - - - - 5099057b by John Paul Adrian Glaubitz at 2024-10-07T05:17:40-04:00 rts: Fix invocation of __ieee_set_fp_control() on alpha-linux Fixes the following error when building GHC on alpha-linux: rts/posix/Signals.c: In function ‘initDefaultHandlers’: rts/posix/Signals.c:709:5: error: error: implicit declaration of function ‘ieee_set_fp_control’ [-Wimplicit-function-declaration] 709 | ieee_set_fp_control(0); | ^~~~~~~~~~~~~~~~~~~ | 709 | ieee_set_fp_control(0); | - - - - - c9590ba0 by Teo Camarasu at 2024-10-07T05:18:17-04:00 Add changelog entries for !12479 - - - - - bf9c9566 by Matthew Pickering at 2024-10-07T13:19:30-04:00 javascript: Read fields of ObjectBlock lazily When linking a module with a large dependency footprint too much of the object files were forced during linking. This lead to a large amount of memory taken up by thunks which would never be forced On the PartialDownsweep test this halves the memory required (from 25G to 13G). Towards #25324 ------------------------- Metric Increase: size_hello_obj ------------------------- - - - - - 571329df by Matthew Pickering at 2024-10-07T13:20:06-04:00 ci: Run the i386 validation job when i386 label is set This is helpful when making changes to base and must update the javascript and i386 base exports files. - - - - - e68f9aaf by Matthew Pickering at 2024-10-07T13:20:42-04:00 Rewrite partitionByWorkerSize to avoid pattern match checker bug With `-g3` the pattern match checker would warn about these incomplete patterns. This affects the debug_info builds on CI. ``` Pattern match(es) are non-exhaustive In an equation for ‘go’: Patterns of type ‘[a]’, ‘[a]’, ‘[SpecFailWarning]’ not matched: (_:_) _ _ | 2514 | go [] small warnings = (small, warnings) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ``` Workaround for #25338 - - - - - d915dc8b by Arnaud Spiwack at 2024-10-07T19:23:00-04:00 Remove the wrapper/coercion-passing logic for submultiplicity checks Instead, we use a dedicated DelayedError, which is emitted systematically on submultiplicity checks, but is suppressed if we can indeed solve the submultiplicity constraint with a reflexivity coercion. This way, we don't have to return anything from `tcSubMult`, which now looks like a regular constraint check, the rest is implementation detail. This removes all of the strange boilerplate that I'd been struggling with under the previous implementation. Even if submultiplicity checks are not properly constraints, this way it's contained entirely within a `WantedConstraint`. Much more pleasant. Closes #25128. - - - - - 1d226116 by Sven Tennie at 2024-10-07T19:23:37-04:00 AArch64: Implement switch/jump tables (#19912) This improves the performance of Cmm switch statements (compared to a chain of if statements.) - - - - - 3fe621dd by Mario Blažević at 2024-10-07T19:24:18-04:00 Fixes #25256, missing parens inside TH-printed pattern type signature - - - - - ea4b4391 by ARATA Mizuki at 2024-10-07T19:24:59-04:00 Better documentation for floatRange function Closes #16479 - - - - - ff09205c by Andreas Klebinger at 2024-10-07T19:25:35-04:00 Adjust progress message for hadrian to include cwd. Fixes #25335 - - - - - 5fd320da by Sven Tennie at 2024-10-07T19:26:12-04:00 CCallConv test: Align argument types The C calling convention / standard requires that arguments and their values are of the same type. - - - - - c6e5fd3d by Cheng Shao at 2024-10-07T19:26:47-04:00 hadrian: remove unused ghciWithDebugger field from flavour config This patch removes the ghciWithDebugger field from flavour config since it's actually not used anywhere. - - - - - 9c9c790d by sheaf at 2024-10-07T19:27:23-04:00 user's guide: update docs for X86 CPU flags This commit updates the section of the user's guide pertaining to X86 feature flags with the following changes: - the NCG backend now supports SIMD, so remove all text that says the contrary, - the LLVM backend does not "automatically detect" features, so remove any text that makes that claim. - - - - - a1ecc826 by Sven Tennie at 2024-10-08T13:36:03-04:00 ci: RISCV64 cross-compile testing This adds a validation job which tests that we can build a riscv64 cross compiler and build a simple program using it. We do not currently run the whole testsuite. Towards #25254 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - d5c2577f by Arnaud Spiwack at 2024-10-08T13:36:44-04:00 Remove unused accumulators in partition_errors - - - - - 55609880 by Andrzej Rybczak at 2024-10-09T16:41:46-04:00 Fix typo in the @since annotation of annotateIO - - - - - ef481813 by Alan Zimmerman at 2024-10-09T16:42:23-04:00 EPA: Remove [AddEpAnn] from (most of) HsExpr EPA: introduce EpAnnLam for lambda annotationsi, and remove `glAA` from `Parser.y`, it is the same as `glR` EPA: Remove unused annotation from XOpApp EPA: Use EpToken for XNPat and XNegApp EPA: specific anns for XExplicitTuple / XTuplePat / sumPatParens. EPA: Use specific annotation for MultiIf EPA: Move annotations into FunRhs EPA: Remove [AddEpAnn] from SigPat and ExprWithTySig EPA: Remove [AddEpAnn] from ArithSeq EPA: Remove [AddEpAnn] from HsProc EPA: Remove [AddEpAnn] from HsStatic EPA: Remove [AddEpAnn] from BindStmt EPA: Remove [AddEpAnn] from TransStmt EPA: Remove [AddEpAnn] from HsTypedSplice EPA: Remove [AddEpAnn] from HsUntypedSpliceExpr - - - - - 69960230 by Fabian Thorand at 2024-10-10T19:03:59+00:00 Handle exceptions from IO manager backend If an IO manager backend throws, it will not actually have registered the file descriptor. However, at that point, the IO manager state was already updated to assume the file descriptor is being tracked, leading to errors and an eventual deadlock down the line as documented in the issue #21969. The fix for this is to undo the IO manager state change in case the backend throws (just as we already do when the backend signals that the file type is not supported). The exception then bubbles up to user code. That way we make sure that 1. the bookkeeping state of the IO manager is consistent with the actions taken by the backend, even in the presence of unexpected failures, and 2. the error is not silent and visible to user code, making failures easier to debug. - - - - - 1587cccf by Hassan Al-Awwadi at 2024-10-11T03:52:36-04:00 Put RdrName in the foExt field of FieldOcc The main purpose of this commit is to rip RdrName out of FieldOcc, in accordance with #21592, and as a side note it has simplified the method we use to deal with ambiguity somewhat. To do the first, we make FieldOccs store (LIdP p) instead of always storing Located RdrName, and moved the readername to the extension points where necessary. For the second, well, we just turn an ambiguous RdrName into a unbound Name through mkUnboundName. Later during disambiguateRecordBinds of the type checking phase, we will try and do type-directed disambiguation based on the rdrName field (for now), so this hack works out fine. See Note [Ambiguous FieldOcc in record updates] for more details. There are two additional minor changes in this commit: * The HsRecSel constructor of HsExpr has been moved to the extension constuctors, since its really GHC specific. * HsProjection no longer has a Located DotFieldOcc as a field, but just a regular DotFieldOcc, since DotFieldOcc already wraps a located FieldLabelString co-authored by: @Jade <Jade512 at proton.me> @alt-romes <rodrigo.m.mesquita at gmail.com> - - - - - 2338a971 by Cheng Shao at 2024-10-11T03:53:13-04:00 driver: bail out when -fllvm is passed to GHC not configured with LLVM This patch makes GHC bail out with an proper error message when it's not configured with LLVM but users attempt to pass -fllvm, see #25011 and added comment for details. Fixes #25011 Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - 78ad81ec by Cristiano Moraes at 2024-10-11T03:53:55-04:00 configure: Find C++ probing when GCC version is the latest but G++ is old #23118 - - - - - 083703a1 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Consider Wanteds with rewriters as insoluble This MR fixes #25325 See GHC.Tc.Types.Constraint, Note [Insoluble Wanteds], especially (IW2) There is a small change in the error message for T14172, but it looks entirely acceptable to me. - - - - - 0dfaeb66 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Wibbles - - - - - 09d24d82 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Spelling errors - - - - - 694489ed by sheaf at 2024-10-11T03:55:14-04:00 LLVM: use sse4.2 instead of sse42 LLVM expects the former instead of the latter since version 3.4. Fixes #25019 - - - - - 06ae8507 by sheaf at 2024-10-11T03:55:14-04:00 LLVM: make SSE4.2 imply +popcnt For consistency with the NCG as well as with Clang and GCC, we make the SSE4.2 feature flag imply +popcnt when using the LLVM backend. Fixes #25353 - - - - - 3fe843c7 by Cheng Shao at 2024-10-11T03:55:50-04:00 Drop obsolete libffi Makefile This patch drops obsolete libffi Makefile from the tree, given it's completely unused since removal of make build system in !7094. - - - - - df70405c by Ben Gamari at 2024-10-11T03:56:26-04:00 ghc-internal: Fix incomplete matches on IOError As noted in #25362, these incomplete matches were previously not being warned about. They were easily addressed by use of `GHC.Internal.Event.Windows.withException`. Closes #25362. - - - - - 8584504b by Matthew Pickering at 2024-10-11T03:57:02-04:00 compiler: Fix orientation of GHC.Hs.Doc boot file We should be free to import things from Language.Haskell.Syntax in GHC modules. Therefore the the boot file for the loop between ImpExp and GHC.Hs.Doc was in the wrong place. Issue #21592 - - - - - d029f170 by Ben Gamari at 2024-10-11T23:43:17-04:00 testsuite: Normalise trailing digits from hole fits output The type variables in the holes fit output from `abstract_refinement_hole_fits` is quite sensitive to compiler configuration. Specifically, a slight change in the inlining behavior of `throw` changes type variable naming in `(>>=)` and a few others. Ideally we would make hole fits output more deterministic but in the meantime we simply normalise this difference away as it not relevant to the test's goal. - - - - - da5d7d0d by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Add test for #25066 - - - - - eb7ddae1 by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Fix #25066 As noted in #25066, the exception backtrace proposal introduced a rather subtle performance regression due to simplification producing Core which the demand analyser concludes may diverge with a precise exception. The nature of the problem is more completely described in the new Note [Hiding precise exception signature in throw]. The (rather hacky) solution we use here hides the problematic optimisation through judicious use of `noinline`. Ultimately however we will want a more principled solution (e.g. #23847). Fixes #255066 CLC proposal: https://github.com/haskell/core-libraries-committee/issues/290 Metric Decrease: T9872d - - - - - 0060ece7 by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Improve documentation of Control.Exception.Backtrace - - - - - 18f532f3 by Ben Gamari at 2024-10-11T23:43:53-04:00 Bump process submodule to v1.6.25.0 - - - - - a9a3badf by Hassan Al-Awwadi at 2024-10-11T23:44:29-04:00 Move HsInteger and HsRat to an extension constructor These constructors were only used during the TC stage, or during template haskell. It seemed clear that it was independent of the source syntax represented in L.H.S, and thus we removed it according to #21592. - - - - - 4dd30cba by Artem Pelenitsyn at 2024-10-11T23:45:09-04:00 Docs: Linear types: link Strict Patterns subsection Also, fix a bug in RST with missing newline before a listing. Co-authored-by: Arnaud Spiwack <arnaud at spiwack.net> - - - - - adca5f2b by Ben Gamari at 2024-10-11T23:45:45-04:00 users guide: Address remaining TODOs in eventlog format docs Closes #25296. - - - - - 9291c125 by Sylvain Henry at 2024-10-11T23:46:26-04:00 Fix z-encoding of tuples (#25364) Tuples with prefix/suffix strings weren't always properly encoded with their shortcut notations. Fix this. - - - - - c08b68bc by Sven Tennie at 2024-10-11T23:47:01-04:00 Delete constants that can be deduced There are macros in MachRegs.h to figure those out. - - - - - 8b402da2 by Zubin Duggal at 2024-10-12T20:36:57+00:00 hadrian: Handle broken symlinks properly when creating source dist directories If we have a broken symlink in the repository, don't try to `need` the symlink or the target of the symlink. Attempting to do so has `shake` attempt to read the target to compute its hash, which fails because the target doesn't exist. - - - - - 16f97667 by Zubin Duggal at 2024-10-12T20:36:57+00:00 hadrian: exclude cabal.project.symlink.broken from source archives Cabal 3.14 introduced a broken symlink in its testsuite. Unfortunately, this broke our source distribution as we use use `tar --dereference` to avoid issues with symlink compatibility on windows, and `tar --dereference` chokes when it encounters any broken symlinks. We can't get rid of `--dereference` because symlinks are generally broken on windows, so the only option is to exclude this file from source archives. see also https://github.com/haskell/cabal/issues/10442 - - - - - f1a2c9fc by Zubin Duggal at 2024-10-12T20:36:57+00:00 Bump Cabal submodule to 3.14 Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: haddock.Cabal - - - - - 745dd590 by Ben Gamari at 2024-10-14T09:13:12-04:00 users-guide: Document GHCi :where command Resolve #24509. - - - - - e9cc4699 by Alan Zimmerman at 2024-10-14T09:13:48-04:00 EPA: Remove [AddEpAnn] from IE, Pat and some Tys EPA: Remove [AddEpAnn] from LazyPat EPA: Remove [AddEpAnn] from RecordCon/RecordUpd/ConPat EPA: Remove [AddEpAnn] from HsFieldBind EPA: Remove [AddEpAnn] from PatSynBind EPA: Remove [AddEpAnn] from IPBind EPA: Remove [AddEpAnn] from FixSig EPA: Remove [AddEpAnn] from activation rules EPA: Remove [AddEpann] from SpecInstSig EPA: Remove [AddEpAnn] from MinimalSig EPA: Remove [AddEpAnn] from SCCFunSig EPA: Remove [AddEpAnn] from CompleteMatchSig EPA: Remove [AddEpAnn] from AnnSig, as used in PatSynSig, ClassOpSig, TypeSig EPA: Remove [AddEpAnn] from IEThingAbs EPA: Remove [AddEpAnn] from IEThingAll / IEThingWith EPA: Remove [AddEpAnn] from IEModuleContents EPA: Remove [AddEpAnn] from HsOpTy EPA: Remove [AddEpAnn] for various binders EPA: Remove [AddEpAnn] for HsIParamTy - - - - - 81a570bf by Sebastian Graf at 2024-10-14T22:15:31-04:00 Desugaring, plus -Wincomplete-record-selectors This commit does several related things: * Major refactor of the handling of applications in the desugarer. Now all applications are handled in `dsApp`, `ds_app` and related functions. This dramatically simplifies the code and removes complicated cruft that had accumulated. Hooray. Fixes #25281. * Improve the handling of -Wincomplete-record-selectors. We now incorporate the result type of unsaturated record selector applications as well as consider long-distance information in getField applications. Plus, the implmentation now builds the improved `dsApp` stuff above, so it is much easier to understand. Plus, incorporates improved error message wording suggested by Adam Gundry in !12685. Fixes #24824, #24891 See the long Note [Detecting incomplete record selectors] * Add -Wincomplete-record-selectors to -Wall, as specified in GHC Proposal 516. To do this, I also had to add -Wno-incomplete-record-selectors to the build flags for Cabal in GHC's CI. See hadrian/src/Settings/Warnings.hs. We can remove this when Cabal is updated so that it doesn't trigger the warning: https://github.com/haskell/cabal/issues/10402 2.6% decrease in compile time allocation in RecordUpPerf Metric Decrease: RecordUpdPerf - - - - - ae7bc08e by Simon Peyton Jones at 2024-10-14T22:15:31-04:00 Elmininate incomplete record selectors This patch is a pure refactor of GHC's source code, to avoid the use of partial record selectors. It was provoked by adding -Wincomplete-record-selectors to -Wall (as the GHC Proposal specified), which in turn showed up lots of places where GHC was using incomplete record selectors. This patch does mostly-simple refactoring to make it clear to the pattern match checker that there is in fact no partiality. There is one externally-visible change: I changed the data type HoleFit to split out the two cases data HoleFit = TcHoleFit TcHoleFit | RawHoleFit SDoc data TcHoleFit = HoleFit { ...lots of fields } There are large swathes of code that just deal with `TcHoleFit`, and having it as a separate data types makes it apparent that `RawHoleFit` can't occur. This makes it much better -- but the change is visible in the HolePlugin interface. I decided that there are so few clients of this API that it's worth the change. I moved several functions from Language.Haskell.Syntax to GHC.Hs. Reason, when instantiated at (GhcPass _), the extension data construtcor is guaranteed unused, and that justifies omitted patterns in these functions. By putting them in GHC.Hs.X I can specialise the type for (GhcPass _) and thereby make the function total. An interesting side-light is that there were a few local function definitions without a type signature, like this one in GHC.Parser.Header convImport (L _ i) = (ideclPkgQual i, reLoc $ ideclName i) This is fully closed, and so is generalised; but that generalises it to any old pass, not (GhcPass _), so GHC rightly complains about the use of the selector `ideclPkgQual`. I added a type signature to `i`, thus convImport (L _ (i::ImportDecl GhcPs)) = (ideclPkgQual i, reLoc $ ideclName i) which specialised the function enough to make the record selector complete. Quite a surprising consequence of local let-generalisation! - - - - - 6a067226 by Simon Peyton Jones at 2024-10-14T22:15:31-04:00 Add -Werror=-Wno-error=incomplete-record-selectors to hadrian-multi In the main MR, -Wall now includes -Wincomplete-record-selectors. However `hadrian-multi` has many, many warnings about incomplete record selectors, so this patch stops those warnings being treated as errors. (See discussion on !13308.) A better fix would be to remove the use of incomplete record selectors, since each of them represents a potential crash. - - - - - edeafc14 by Ben Gamari at 2024-10-14T22:16:08-04:00 users-guide: Document field coalescence - - - - - 55b83587 by ARATA Mizuki at 2024-10-14T22:16:49-04:00 LLVM backend: Use correct rounding for Float literals Fixes #22033 - - - - - e59fe5c6 by Hassan Al-Awwadi at 2024-10-15T08:25:33+00:00 Changed import from Ghc. module to L.H.S module Progresses #21592 For some reason we still imported GHC.Types.Fixity when the definitino of Fixity and LexicalFixity have already been moved to Language.Haskell.Syntax.Basic. This fixes that for - - - - - ab1767d5 by Simon Peyton Jones at 2024-10-15T23:45:04-04:00 Add a release-notes entry for -Wincomplete-record-selectors - - - - - 6f0a62db by ur4t at 2024-10-16T15:33:43+00:00 GHCi: fix improper location of ghci_history file Fixes #24266 - - - - - 5f67db48 by Alan Zimmerman at 2024-10-17T05:18:43-04:00 EPA: Remove [AddEpAnn] commit 3 EPA: Remove [AddEpAnn] from HsDocTy EPA: Remove [AddEpAnn] from HsBangTy EPA: Remove [AddEpAnn] from HsExplicitListTy EPA: Remove [AddEpAnn] from HsExplicitTupleTy EPA: Remove [AddEpAnn] from HsTypedBracket EPA: Remove [AddEpAnn] from HsUntypedBracket EPA: Remove [AddEpAnn] from PatBuilderOpApp EPA: break out 'EpToken "|"' from ClassDecl anns EPA: Remove [AddEpAnn] from ClassDecl EPA: Remove [AddEpAnn] from SynDecl - - - - - fbbbd010 by Daan Rijks at 2024-10-17T05:19:19-04:00 Expand the haddocks for Control.Category - - - - - 076c1a10 by Andrew Lelechenko at 2024-10-17T05:19:19-04:00 documentation: more examples for Control.Category - - - - - 90891962 by Cheng Shao at 2024-10-17T16:41:18+00:00 ghci: mitigate host/target word size mismatch in BCOByteArray serialization This patch mitigates a severe host/target word size mismatch issue in BCOByteArray serialization logic introduced since !12142, see added note for detailed explanation. - - - - - 839ac52e by Cheng Shao at 2024-10-17T16:41:18+00:00 ghci: use plain malloc for mkConInfoTable on non-TNTC platforms This patch avoids using mmap() to allocate executable memory for mkConInfoTable on platforms without tables-next-to-code, see added comment for explanation. - - - - - a998f69d by Cheng Shao at 2024-10-17T16:41:18+00:00 ghc-internal: add missing CPPs for wasm This patch adds some missing CPP guards to ghc-internal, given those functions are non existent on wasm and would cause linking issues. - - - - - 71a471e7 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: rename prelude.js to prelude.mjs This commit renames prelude.js to prelude.mjs for wasm backend rts jsbits, and slightly adjusts the jsbits contents. This is for preparing the implementation of dyld.mjs that contains wasm dynamic linker logic, which needs to import prelude.mjs as a proper ESM module. - - - - - 33d9db17 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: add __wrapped_freeJSVal This commit wraps imported freeJSVal in a __wrapped_freeJSVal C function for wasm backend RTS. In general, wasm imports are only supposed to be directly called by C; they shouldn't be used as function pointers, which confuses wasm-ld at link-time when generating shared libraries. - - - - - 0d0a16a8 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: correct stale link in comment - - - - - 90a35c41 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: drop interpretBCO support from non-dyn ways on wasm This commit drops interpretBCO support from non dynamic rts ways on wasm. The bytecode interpreter is only useful when the RTS linker also works, and on wasm it only works for dynamic ways anyway. An additional benefit of dropping interpretBCO is reduction in code size of linked wasm modules, especially since interpretBCO references ffi_call which is an auto-generated large function in libffi-wasm and unused by most user applications. - - - - - 98a32ec5 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: don't build predefined GloblRegs for wasm PIC mode This commit wraps the predefined GlobalRegs in Wasm.S under a CPP guard to prevent building for PIC mode. When building dynamic ways of RTS, the wasm globals that represent STG GlobalRegs will be created and supplied by dyld.mjs. The current wasm dylink convention doesn't properly support exporting relocatable wasm globals at all, any wasm global exported by a .so is assumed to be a GOT.mem entry. - - - - - bef94bde by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: fix conflicting StgRun definitions on wasm This commit fixes conflicting StgRun definition when building dynamic ways of RTS for wasm in unregisterised mode. - - - - - a6a82cdb by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: use targetSupportsRPaths predicate This commit changes the hostSupportsRPaths predicate to targetSupportsRPaths and use that to decide whether to pass RPATH-related link-time options. It's not applied to stage0, we should just use the default link-time options of stageBoot ghc. - - - - - f232c872 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: disable internal-interpreter of ghc library when cross compiling This commit disable the internal-interpreter flag of ghc library when cross compiling, only external interpreter works in such cases. - - - - - 577c1819 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: enable internal-interpreter for ghc-bin stage0 This commit enables internal-interpreter flag for ghc-bin even when compiling stage0, as long as target supports ghci. It enables ghci functionality for cross targets that support ghci, since cross ghc-bin is really stage0. - - - - - c247f2ee by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: fix CFLAGS for gmp shared objs on wasm This commit adds -fvisibility=default to CFLAGS of gmp when building for wasm. This is required to generate the ghc-bignum shared library without linking errors. Clang defaults to -fvisibility=hidden for wasm targets, which will cause issues when a symbol is expected to be exported in a shared library but without explicit visibility attribute annotation. - - - - - 775410fd by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: re-enable PIC for gmp on wasm This commit re-enables --with-pic=yes configuration option of gmp when building for wasm, given we're about to include support for shared libraries, TH and ghci. - - - - - b45080a3 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: add the host_fully_static flavour transformer This commit adds the host_fully_static flavour transformer to hadrian, which ensures stage0 is fully statically linked while still permitting stage1 libdir to contain shared libraries. This is intended to be used by the wasm backend to build portable linux bindists that contain wasm shared libraries. - - - - - 5043507c by Cheng Shao at 2024-10-17T16:41:18+00:00 ci: update wasm jobs configuration This commit bumps ci-image revision to use updated wasm toolchain, and use host_fully_static instead of fully_static for wasm jobs so to ensure wasm shared libraries can be properly built. - - - - - 2956a3f7 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian/testsuite: implement config.cross logic This commit implements the config.cross field in the testsuite driver. It comes from the "cross compiling" ghc info field for both in-tree/out-of-tree GHC, and is an accurate predicate of whether we're cross-compiling or not (compared to the precense of target emulator), and is useful to implement predicates to assert the precense of internal interpreter (only available on non-cross GHC) for tests that do require it (e.g. plugins). - - - - - 8c74a0ed by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian/compiler: implement targetRTSLinkerOnlySupportsSharedLibs This patch implements the targetRTSLinkerOnlySupportsSharedLibs predicate in hadrian. Its definition in hadrian is the single source of truth, and the information propagates to ghc settings file, ghc driver and testsuite driver. It is used in various places to ensure dynamic dependency is selected when the target RTS linker only supports loading dynamic code. - - - - - b4c3c340 by Cheng Shao at 2024-10-17T16:41:18+00:00 testsuite: don't use host cpu features when testing cross ghc This patch disables CPU feature detection logic when testing cross GHC, since those features don't make sense for the target anyway. - - - - - 3c21b696 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: implement & use req_plugins predicate This commit implements req_plugins predicate to indicate that the test requires plugin functionality. Currently this means cross GHC is disabled since internal-interpreter doesn't work in cross GHC yet. - - - - - 93b8af80 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: make use of config.interp_force_dyn This commit takes config.interp_force_dyn into consideration when setting up TH/ghci way flags. - - - - - 94673d41 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: bump T17572 timeout - - - - - 2b5efc2d by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: bump T22744 pre_cmd timeout - - - - - 45102e2a by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip terminfo_so for cross ghc - - - - - 05e40406 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: fix shared library size tests for cross ghc This commit fixes shared library size tests (e.g. array_so in testsuite/tests/perf/size/all.T) when testing cross ghc. Previously, if shared library file extension of host and target differs, those tests will fail with framework errors due to not finding the right files. - - - - - fa68f833 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip ghc api tests that attempt to spawn processes inside wasm This commit skips a few ghc api tests on wasm, since they would attempt to spawn processes inside wasm, which is not supported at all. - - - - - 1241c04e by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip T22840 due to broken -dtag-inference-checks on wasm - - - - - 78c8b900 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: ensure $(ghciWayFlags) can be overridden This commit revises boilerplate.mk in testsuite as well as a few other places, to ensure the tests that do make use of $(ghciWayFlags) can receive the right $(ghciWayFlags) from testsuite driver config. - - - - - 47989ecc by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: skip rdynamic on wasm - - - - - fefb4ea1 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: skip T2615 on wasm This commit marks T2615 as skip on wasm, given LD_* environment variables aren't supported on wasm anyway. - - - - - 77c79762 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: mark MultiLayerModulesTH_Make/MultiLayerModulesTH_OneShot as fragile on wasm - - - - - 69bb4745 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: fix T16180 on wasm This commit fixes T16180 on wasm once TH support is flipped on. The fix is simply adding right asm code for wasm. - - - - - 621c753d by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: fix -fexternal-interpreter flag for JS backend Previously, -fexternal-interpreter is broken for JS backend, since GHC would attempt to launch a non-existent ghc-iserv* executable. This commit fixes it by adjusting pattern matching order in setTopSessionDynFlags. - - - - - 80aa8983 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: use interpreterDynamic predicate in preloadLib This commit use the interpreterDynamic predicate in preloadLib to decide if we should do dynLoadObjs instead of loadObj. Previously we used hostIsDynamic which was only written with non-cross internal interpreter in mind. The testsuite is also adjusted to remove hard-wired -fPIC flag for cbits (doesn't work in i386 RTS linker in vanilla way, #25260) and properly pass ghc_th_way_flags to ghc. - - - - - 74411461 by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix Cmm dynamic CLabels for wasm This commit fixes the handling of dynamic CLabels for the wasm backend. Just do the simplest handling: preserve the original CLabel, both unreg/NCG backends can handle them properly without issue. - - - - - f6abaf13 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: add necessary compile-time flags for wasm PIC mode This commit adds necessary compile-time flags when compiling for wasm PIC mode, see added comment for detailed explanation. - - - - - 9745fcfb by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: add necessary link-time flags for wasm shared libs This commit adds necessary link-time flags for wasm shared libs, see added comments for detailed explanation. - - - - - 649aae00 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: enforce -fno-use-rpaths for wasm This commit ensures the GHC driver never passes any RPATH-related link-time flags on wasm, which is not supported at all. - - - - - 47baa904 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: ensure static archives are picked when linking static .wasm modules This commit ensures static archives are picked when linking .wasm modules which are supposed to be fully static, even when ghc may be invoked with -dynamic, see added comment for explanation. - - - - - fc3a5591 by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix dynamic_too_enable for targets that require dynamic libraries This commit fixes dynamic_too_enable for targets whose RTS linker can only load dynamic code. - - - - - 94ef949e by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix checkNonStdWay for targets that require dynamic libraries This commit fixes checkNonStdWay to ensure that for targets whose RTS linker can only load dynamic code, the dynamic way of object is selected. - - - - - 88e99248 by Cheng Shao at 2024-10-17T16:41:24+00:00 ghc-bin: enforce dynamic way when the target requires so This commit makes ghc-bin use dynamic way when it is doing interactive stuff on certain targets whose RTS linker can only handle dynamic code. - - - - - 549582ef by Cheng Shao at 2024-10-17T16:41:24+00:00 hadrian/ghci: add wasm dyld This commit adds the wasm dynamic linker implementation, as well as ghci logic to call it and hadrian logic to install it to the correct location. See the top-level note in utils/jsffi/dyld.mjs for more details. - - - - - b562e3a6 by Cheng Shao at 2024-10-17T16:41:29+00:00 driver: fix getGccSearchDirectory for wasm target This commit fixes getGccSearchDirectory logic for wasm target, ensures the correct search directory containing libc.so etc can be found by GHC. getGccSearchDirectory is also exported so it can be used elsewhere to obtain the wasi-sdk libdir and pass to the dyld script. - - - - - 2d6107dc by Cheng Shao at 2024-10-17T16:41:29+00:00 driver: add wasm backend iserv logic This commit adds wasm backend iserv logic to the driver, see added comments for explanation. - - - - - 61f5baa5 by Cheng Shao at 2024-10-17T16:41:29+00:00 compiler: add PIC support to wasm backend NCG This commit adds support for generating PIC to the wasm backend NCG. - - - - - 652e7239 by Cheng Shao at 2024-10-17T16:41:29+00:00 hadrian/compiler: flip on support for shared libs & ghci for wasm This commit flips on the support for shared libs and ghci for the wasm target, given all required support logic has been added in previous commits. - - - - - 74a1f681 by Cheng Shao at 2024-10-17T16:41:29+00:00 testsuite: flip on support for shared libs, TH & ghci for wasm This commit flips on support for shared libs, TH & ghci for wasm in the testsuite, given support has been landed in previous commits. - - - - - 525d451e by Cheng Shao at 2024-10-17T23:03:34-04:00 Revert "compiler: start deprecating cmmToRawCmmHook" This reverts commit 1c064ef1f3e1aa2afc996e962ad53effa99ec5f4. Turns out the GHC-WPC project does use it to observe Cmm in the pipeline, see #25363. - - - - - 5bcfefd5 by Cheng Shao at 2024-10-17T23:04:09-04:00 rts: fix pointer overflow undefined behavior in bytecode interpreter This patch fixes an unnoticed undefined behavior in the bytecode interpreter. It can be caught by building `rts/Interpreter.c` with `-fsanitize=pointer-overflow`, the warning message is something like: ``` rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13 rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13 rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13 ``` Whenever we do something like `SpW(-1)`, the negative argument is implicitly converted to an unsigned integer type and causes pointer arithmetic overflow. It happens to be harmless for most targets since overflowing would wrap the result to desired value, but it's still coincidental and undefined behavior. Furthermore, it causes real damage to the wasm backend, given clang-20 will emit invalid wasm code that crashes at run-time for this kind of C code! (see https://github.com/llvm/llvm-project/issues/108770) The fix here is adding some explicit casts to ensure we always use the signed `ptrdiff_t` type as right hand operand of pointer arithmetic. - - - - - eb67875f by Matthew Craven at 2024-10-18T12:18:35+00:00 Bump transformers submodule The svg image files mentioned in transformers.cabal were previously not checked in, which broke sdist generation. - - - - - 366a1109 by Matthew Craven at 2024-10-18T12:18:35+00:00 Remove reference to non-existent file in haddock.cabal - - - - - 826852e9 by Matthew Craven at 2024-10-18T12:18:35+00:00 Move tests T11462 and T11525 into tests/tcplugins - - - - - dbe27152 by Matthew Craven at 2024-10-18T12:18:35+00:00 Repair the 'build-cabal' hadrian target Fixes #23117. Fixes #23281. Fixes #23490. This required: * Updating the bit-rotted compiler/Setup.hs and its setup-depends * Listing a few recently-added libraries and utilities in cabal.project-reinstall * Setting allow-boot-library-installs to 'True' since Cabal now considers the 'ghc' package itself a boot library for the purposes of this flag Additionally, the allow-newer block in cabal.project-reinstall was removed. This block was probably added because when the libraries/Cabal submodule is too new relative to the cabal-install executable, solving the setup-depends for any package with a custom setup requires building an old Cabal (from Hackage) against the in-tree version of base, and this can fail un-necessarily due to tight version bounds on base. However, the blind allow-newer can also cause the solver to go berserk and choose a stupid build plan that has no business succeeding, and the failures when this happens are dreadfully confusing. (See #23281 and #24363.) Why does setup-depends solving insist on an old version of Cabal? See: https://github.com/haskell/cabal/blob/0a0b33983b0f022b9697f7df3a69358ee9061a89/cabal-install/src/Distribution/Client/ProjectPlanning.hs#L1393-L1410 The right solution here is probably to use the in-tree cabal-install from libraries/Cabal/cabal-install with the build-cabal target rather than whatever the environment happens to provide. But this is left for future work. - - - - - b3c00c62 by Matthew Craven at 2024-10-18T12:18:35+00:00 Revert "CI: Disable the test-cabal-reinstall job" This reverts commit 38c3afb64d3ffc42f12163c6f0f0d5c414aa8255. - - - - - a04959b8 by Daneel Yaitskov at 2024-10-19T09:34:15-04:00 base: speed up traceEventIO and friends when eventlogging is turned off #17949 Check the RTS flag before doing any work with the given lazy string. Fix #17949 Co-authored-by: Michael Peyton Jones <me at michaelpj.com> Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - eff16c22 by Matthew Pickering at 2024-10-19T21:55:55-04:00 ci: Add support for ONLY_JOBS variable to trigger any validation pipeline By setting the ONLY_JOBS variable to the name of the job (or multiple jobs), the resulting pipeline will include a validation job for that pipeline. For example - if you set ONLY_JOBS="x86_64-linux-ubuntu22_04-validate" then a ubuntu22_04 job will be included in the validation pipeline. This is useful for testing specific jobs. Fixes #25332 - - - - - 280b6278 by Zubin Duggal at 2024-10-19T21:56:31-04:00 rel-eng: ghcup metadata generation: generated yaml anchors with meaningful names (cherry picked from commit d83f5bd730a8aef37d8a38b3560590d9798f8e45) - - - - - 25edf849 by Alan Zimmerman at 2024-10-19T21:57:08-04:00 EPA: Remove [AddEpAnn] Commit 4 EPA: Remove [AddEpAnn] from DataDecl This is quite a big change. The most important part is moving the annotations into HsDataDefn, using a specific annotation data type. It has a knock-on to everything that uses HsDataDefn EPA: Remove [AddEpAnn] for FunDep EPA: Remove [AddEpann] from FamilyDecl EPA: Remove [AddEpAnn] From InjectivityAnn EPA: Remove [AddEpAnn] from DefaultDecl EPA: Remove [AddEpAnn] from RuleDecls EPA: Remove [AddEpAnn] from Warnings - - - - - d5f42045 by Luite Stegeman at 2024-10-20T16:34:47-04:00 Interpreter: Add locking for communication with external interpreter This adds locking to communication with the external interpreter to prevent concurrent tasks interfering with each other. This fixes Template Haskell with the external interpreter in parallel (-j) builds. Fixes #25083 - - - - - d6bfea76 by Matthew James Kraai at 2024-10-20T16:35:29-04:00 Use monospace font for "Either a b" in fmap docs The documentation for fmap shows "`Either a b`" in the default font instead of showing "Either a b" in a monospace font. - - - - - 4bc7f9c8 by Luite Stegeman at 2024-10-20T16:36:15-04:00 Parser: remove non-ASCII characters from Parser.y Non-ASCII characters in the source causes a problem with the default Haskell Language Server setup in VSCode. Two characters seems to have been left in by accident. Workaround for #25396 - - - - - 7f61ed4e by Alan Zimmerman at 2024-10-21T06:39:45-04:00 EPA: Remove [AddEpAnn] Commit 5 EPA: Remove [AddEpAnn] from AnnPragma EPA: Remove [AddEpAnn] From ForeignDecl EPA: Remove [AddEpAnn] from RoleAnnotDecl EPA: Remove [AddEpAnn] from StandaloneKindSig EPA: Remove [AddEpAnn] From HsDeriving EPA: Remove [AddEpAnn] from ConDeclField EPA: Remove [AddEpAnn] from ConDeclGADT EPA: Remove [AddEpAnn] from ConDeclH98 EPA: Remove [AddEpAnn] from ClsInstDecl - - - - - f8694fe7 by Cheng Shao at 2024-10-21T06:40:21-04:00 wasm: bump dyld v8 heap size limit This patch adds `--max-old-space-size=8192` to wasm dyld shebang arguments to bump V8 heap size limit. The default limit (`heap_size_limit` returned by `v8.getHeapStatistics()`) is dynamically determined and a bit too low under certain workloads, and V8 would waste too much CPU time to garbage collect old generation heap more aggressively. Bumping the limit to 8G doesn't imply dyld would really take that much memory at run-time, but it lessens V8 heap stress significantly. - - - - - d328d173 by Luite Stegeman at 2024-10-21T12:39:18+00:00 Add requestTickyCounterSamples to GHC.Internal.Profiling This allows the user to request ticky counters to be written to the eventlog at specific times. See #24645 - - - - - 71765b1d by Simon Peyton Jones at 2024-10-21T20:55:00-04:00 Move defaulting code into a new module GHC.Tc.Solver had reached 4,000 lines -- although quite a lot of them are comments. This MR * Adds the new module GHC.Tc.Solver.Default, which has all the complex, but well modularised, defaulting code * Moves a bit of code from GHC.Tc.Solver into the existing GHC.Tc.Solver.Solve. Notably solveWanteds and simplifyWantedsTcM, which are called from GHC.Tc.Solver.Default It's a pure refactor. No code changes. - - - - - a398227b by Simon Peyton Jones at 2024-10-21T20:55:00-04:00 Improve the generalisation code in Solver.simplifyInfer The code in `decideQuantification` has become quite complicated. This MR straightens it out, adds a new Note, and on the way fixes #25266. See especially Note [decideAndPromoteTyVars] which is is where all the action happens in this MR. - - - - - 148059fe by Andrzej Rybczak at 2024-10-21T20:55:40-04:00 Adjust catches to properly rethrow exceptions https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13302 implemented exception rethrowing proposal, but it didn't adjust `catches`. This fixes it. - - - - - 25121dbc by doyougnu at 2024-10-22T09:38:18-04:00 linker: add --optimistic-linking flag This patch adds: - the --optimistic-linking flag which binds unknown symbols in the runtime linker to 0xDEADBEEF instead of exiting with failure - The test T25240 which tests these flags using dead code in the FFI system. - closes #25240 This patch is part of the upstreaming haskell.nix patches project. - - - - - f19e076d by doyougnu at 2024-10-22T09:38:18-04:00 ghc-internal: hide linkerOptimistic in MiscFlags - - - - - edc02197 by Cheng Shao at 2024-10-22T09:38:54-04:00 hadrian: fix bindist executable wrapper logic for cross targets This commit fixes an oversight of hadrian wrapper generation logic: when doing cross compilation, `wrapper` is called on executable names with cross prefix, therefore we must use `isSuffixOf` when matching to take the cross prefix into account. Also add missing cross prefix to ghci wrapper content and fix hsc2hs wrapper logic. - - - - - edf3bdf5 by Andreas Klebinger at 2024-10-22T16:30:42-04:00 mkTick: Push ticks through unsafeCoerce#. unsafeCoerce# doesn't exist at runtime so we should treat it like a Cast for the purpose of mkTick. This means if we have `{-# SCC foo #-} (unsafeCoerce# trivial_expr))` we now push the scope part of the cost centre up to `trivial_expr` at which point we can discard it completely if the expression is trivial enough. This fixes #25212. - - - - - 1bdb1317 by Cheng Shao at 2024-10-22T16:31:17-04:00 hadrian: enable late-CCS for perf flavour as well This patch enables late-CCS for perf flavour so that the testsuite can pass for perf as well. Fixes #25308. - - - - - fde12aba by Cheng Shao at 2024-10-22T16:31:54-04:00 hadrian: make sure ghc-bin internal-interpreter is disabled for stage0 when not cross compiling This patch disables internal-interpreter flag for stage0 ghc-bin when not cross compiling, see added comment for explanation. Fixes #25406. - - - - - 6ab8d751 by ignatiusm at 2024-10-24T01:23:35-04:00 Improve heap overflow exception message (#25198) Catch heap overflow exceptions and suggest using `+RTS -M<size>`. Fix #25198 - - - - - b3f7fb80 by Rodrigo Mesquita at 2024-10-24T01:24:12-04:00 determinism: Interface re-export list det In 'DocStructureItem' we want to make sure the 'Avails' are sorted, for interface file determinism. This commit introduces 'DetOrdAvails', a newtype that should only be constructed by sorting Avails with 'sortAvails' unless the avails are known to be deterministically ordered. This newtype is used by 'DocStructureItem' where 'Avails' was previously used to ensure the list of avails is deterministically sorted by construction. Note: Even though we order the constructors and avails in the interface file, the order of constructors in the haddock output is still determined from the order of declaration in the source. This was also true before, when the list of constructors in the interface file <docs> section was non-deterministic. Some haddock tests such as "ConstructorArgs" observe this (check the order of constructors in out/ConstructorArgs.html vs src/ConstructorArgs.hs vs its interface file) The updated tests are caused by haddock corners where the order in the source is not preserved (and was non-deterministic before this PR): * Module header in the latex backend * Re-export of pattern synonyms associated to a datatype (#25342) Fixes #25304 - - - - - e39c8c99 by Rodrigo Mesquita at 2024-10-24T01:24:12-04:00 Revert "ci: Allow abi-test to fail." After #25304, the abi-test with interface and object determinism succeeds. This reverts commit 7b37afc9f3e79559055488998ee73187886a0e00. - - - - - 7b1b0c6d by Alan Zimmerman at 2024-10-24T13:07:02-04:00 EPA: reduce [AddEpann] in AnnList Remove it from the `al_rest` field, and make `AnnList` parameterized on a type to be used in `al_rest`, for the various use cases. - - - - - 4a00731e by Rodrigo Mesquita at 2024-10-24T13:07:38-04:00 Fix -fobject-determinism flag definition The flag should be defined as an fflag to make sure the -fno-object-determinism flag is also an available option. Fixes #25397 - - - - - 55e4b9f2 by Sebastian Graf at 2024-10-25T07:01:54-04:00 CorePrep: Attach evaldUnfolding to floats to detect more values See `Note [Pin evaluatedness on floats]`. - - - - - 9f57c96d by Sebastian Graf at 2024-10-25T07:01:54-04:00 Make DataCon workers strict in strict fields (#20749) This patch tweaks `exprIsConApp_maybe`, `exprIsHNF` and friends, and Demand Analysis so that they exploit and maintain strictness of DataCon workers. See `Note [Strict fields in Core]` for details. Very little needed to change, and it puts field seq insertion done by Tag Inference into a new perspective: That of *implementing* strict field semantics. Before Tag Inference, DataCon workers are strict. Afterwards they are effectively lazy and field seqs happen around use sites. History has shown that there is no other way to guarantee taggedness and thus the STG Strict Field Invariant. Knock-on changes: * I reworked the whole narrative around "Tag inference". It's now called "EPT enforcement" and I recycyled the different overview Notes into `Note [EPT enforcement]`. * `exprIsHNF` previously used `exprOkForSpeculation` on unlifted arguments instead of recursing into `exprIsHNF`. That regressed the termination analysis in CPR analysis (which simply calls out to `exprIsHNF`), so I made it call `exprOkForSpeculation`, too. * There's a small regression in Demand Analysis, visible in the changed test output of T16859: Previously, a field seq on a variable would give that variable a "used exactly once" demand, now it's "used at least once", because `dmdTransformDataConSig` accounts for future uses of the field that actually all go through the case binder (and hence won't re-enter the potential thunk). The difference should hardly be observable. * The Simplifier's fast path for data constructors only applies to lazy data constructors now. I observed regressions involving Data.Binary.Put's `Pair` data type. * Unfortunately, T21392 does no longer reproduce after this patch, so I marked it as "not broken" in order to track whether we regress again in the future. Fixes #20749, the satisfying conclusion of an annoying saga (cf. the ideas in #21497 and #22475). Compiler perf generally improves, sometimes drastically: Baseline Test Metric value New value Change -------------------------------------------------------------------------------- ManyConstructors(normal) ghc/alloc 3,629,760,116 3,711,852,800 +2.3% BAD MultiLayerModulesTH_OneShot(normal) ghc/alloc 2,502,735,440 2,565,282,888 +2.5% BAD T12707(normal) ghc/alloc 804,399,798 791,807,320 -1.6% GOOD T17516(normal) ghc/alloc 964,987,744 1,008,383,520 +4.5% T18140(normal) ghc/alloc 75,381,152 49,860,560 -33.9% GOOD T18698b(normal) ghc/alloc 232,614,457 184,262,736 -20.8% GOOD T18923(normal) ghc/alloc 62,002,368 58,301,408 -6.0% GOOD T20049(normal) ghc/alloc 75,719,168 70,494,368 -6.9% GOOD T3294(normal) ghc/alloc 1,237,925,833 1,157,638,992 -6.5% GOOD T9233(normal) ghc/alloc 686,490,105 635,166,688 -7.5% GOOD geo. mean -0.7% minimum -33.9% maximum +4.5% I looked at T17516. It seems we do a few more simplifier iterations and end up with a larger program. It seems that some things inline more, while other things inline less. I don't see low-hanging fruit. I also looked at MultiLayerModulesTH_OneShot. It appears we generate a strange join point in the `getUnique` method of `Uniquable GHC.Unit.Types.Module` that should better call-site inline, but does not. Perhaps with !11492. NoFib does not seem affected much either: +-------------------------------++--+------------+-----------+---------------+-----------+ | || | base/ | std. err. | T20749/ (rel) | std. err. | +===============================++==+============+===========+===============+===========+ | spectral/last-piece || | 7.263e8 | 0.0% | +0.62% | 0.0% | +===============================++==+============+===========+===============+===========+ | geom mean || | +0.00% | | | | +-------------------------------++--+------------+-----------+---------------+-----------+ I had a look at last-piece. Nothing changes in stg-final, but there is a bit of ... movement around Data.Map.insert's use of GHC.Exts.lazy that is gone in stg-final. Co-Authored-By: Jaro Reinders <jaro.reinders at gmail.com> Metric Decrease: T12707 T18140 T18698b T18923 T19695 T20049 T3294 T9233 T21839c Metric Increase: ManyConstructors MultiLayerModulesTH_OneShot - - - - - 0225249a by Simon Peyton Jones at 2024-10-25T07:02:32-04:00 Some renaming This is a pure refactor, tidying up some inconsistent naming: isEqPred --> isEqClassPred isEqPrimPred --> isEqPred isReprEqPrimPred --> isReprEqPred mkPrimEqPred --> mkNomEqPred mkReprPrimEqPred --> mkReprEqPred mkPrimEqPredRold --> mkEqPredRole Plus I moved mkNomEqPred, mkReprEqPred, mkEqPredRolek from GHC.Core.Coercion to GHC.Core.Predicate where they belong. That means that Coercion imports Predicate rather than vice versa -- better. - - - - - 15a3456b by Ryan Hendrickson at 2024-10-25T07:02:32-04:00 compiler: Fix deriving with method constraints See Note [Inferred contexts from method constraints] Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com> - - - - - dbc77ce8 by Alan Zimmerman at 2024-10-25T18:20:13+01:00 EPA: Remove AddEpann commit 7 EPA: Remove [AddEpAnn] from HYPHEN in Parser.y The return value is never used, as it is part of the backpack configuration parsing. EPA: Remove last [AddEpAnn] usages Remove residual usage in GHC. It is still used - In haddock TTG extension point definitions (to be removed) - Some check-exact residual, to be removed - Comments around DisambECP in PostProcess EPA: Clean up [AddEpAnn] from check-exact There is one left, to be cleaned up when we remove AddEpann itself EPA: Remove [AddEpAnn] from haddock The TTG extension points need a value, it is not critical what that value is, in most cases. EPA: Remove AddEpAnn from HsRuleAnn EPA: Remove AddEpAnn from HsCmdArrApp - - - - - 23ddcc01 by Simon Peyton Jones at 2024-10-26T12:44:34-04:00 Fix optimisation of InstCo It turned out (#25387) that the fix to #15725 was not quite right: commit 48efbc04bd45d806c52376641e1a7ed7278d1ec7 Date: Mon Oct 15 10:25:02 2018 +0200 Fix #15725 with an extra Sym Optimising InstCo is quite subtle, and the invariants surrounding the LiftingContext in the coercion optimiser were not stated explicitly. This patch refactors the InstCo optimisation, and documents these invariants. See * Note [Optimising InstCo] * Note [The LiftingContext in optCoercion] I also did some refactoring of course: * Instead of a Bool swap-flag, I am not using GHC.Types.Basic.SwapFlag * I added some invariant-checking the coercion-construction functions in GHC.Core.Coercion.Opt. (Sadly these invariants don't hold during typechecking, becuase the types are un-zonked, so I can't put these checks in GHC.Core.Coercion.) - - - - - 589fea7f by Cheng Shao at 2024-10-27T05:36:38-04:00 ghcid: use multi repl for ghcid - - - - - d52a0475 by Andrew Lelechenko at 2024-10-27T05:37:13-04:00 documentation: add motivating section to Control.Monad.Fix - - - - - 301c3b54 by Cheng Shao at 2024-10-27T05:37:49-04:00 wasm: fix safari console error message related to import("node:timers") This patch fixes the wasm backend JSFFI prelude script to avoid calling `import("node:timers")` on non-deno hosts. Safari doesn't like it and would print an error message to the console. Fixes https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/issues/13. - - - - - 9f02dfb5 by Simon Peyton Jones at 2024-10-27T15:10:08-04:00 Add a missing tidy in UnivCo We were failing to tidy the argument coercions of a UnivCo, which led directly to #25391. The fix is, happily, trivial. I don't have a small repro case (it came up when building horde-ad, which uses typechecker plugins). It should be possible to make a repro case, by using a plugin (which builds a UnivCo) but I decided it was not worth the bother. The bug is egregious and easily fixed. - - - - - 853050c3 by Andrew Lelechenko at 2024-10-27T15:10:44-04:00 Bump text submodule to 2.1.2 - - - - - 90746a59 by Andrew Lelechenko at 2024-10-27T15:10:44-04:00 hadrian: allow -Wunused-imports for text package - - - - - 8a6691c3 by Alan Zimmerman at 2024-10-27T19:44:48+00:00 EPA: Remove AddEpAnn Commit 8/final EPA: Remove AddEpAnn from AnnList EPA: Remove AddEpAnn from GrhsAnn This is the last actual use EPA: Remove NameAdornment from NameAnn Also rework AnnContext to use EpToken, and AnnParen EPA: Remove AddEpAnn. Final removal There are now none left, except for in a large note/comment in PostProcess, describing the historical transition to the disambiguation infrastructure - - - - - d5e7990c by Alan Zimmerman at 2024-10-28T21:41:05+00:00 EPA: Remove AnnKeywordId. This was used as part of AddEpAnn, and is no longer needed. Also remove all the haddock comments about which of are attached to the various parts of the AST. This is now clearly captured in the appropriate TTG extension points, and the `ExactPrint.hs` file. - - - - - e08b8370 by Serge S. Gulin at 2024-10-29T23:17:01-04:00 JS: Re-add optimization for literal strings in genApp (fixes #23479) Based on https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10588/ Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Andrei Borzenkov <root at sandwitch.dev> Co-authored-by: Danil Berestov <goosedb at yandex.ru> ------------------------- Metric Decrease: T25046_perf_size_gzip size_hello_artifact size_hello_artifact_gzip size_hello_unicode size_hello_unicode_gzip ------------------------- - - - - - e3496ef6 by Cheng Shao at 2024-10-29T23:17:37-04:00 compiler: remove unused hscDecls/hscDeclsWithLocation This patch removes unused `hscDecls`/`hscDeclsWithLocation` functions from the compiler, to reduce maintenance burden when doing refactorings related to ghci. - - - - - b1eed26f by Cheng Shao at 2024-10-29T23:18:13-04:00 testsuite: add T25414 test case marked as broken This commit adds T25414 test case to demonstrate #25414. It is marked as broken and will be fixed by the next commit. - - - - - e70009bc by Cheng Shao at 2024-10-29T23:18:13-04:00 driver: fix foreign stub handling logic in hscParsedDecls This patch fixes foreign stub handling logic in `hscParsedDecls`. Previously foreign stubs were simply ignored here, so any feature that involve foreign stubs would not work in ghci (e.g. CApiFFI). The patch reuses `generateByteCode` logic and eliminates a large chunk of duplicate logic that implements Core to bytecode generation pipeline here. Fixes #25414. - - - - - 1d7cd7fe by Andreas Klebinger at 2024-10-30T19:14:28-04:00 Add since tag for -fwrite-if-compression in user guide. Partial fix for #25395 - - - - - b349fd1b by Alan Zimmerman at 2024-10-30T19:15:04-04:00 EPA: Remove some unused functions - - - - - f859d61c by Alan Zimmerman at 2024-10-30T19:15:04-04:00 EPA: use explicit vertical bar token for ExplicitSum / SumPat - - - - - 721ac00d by Ben Gamari at 2024-10-31T08:37:38-04:00 rts/Disassembler: Fix encoding of BRK_FUN instruction The offset of the CC field was not updated after the encoding change in b85b11994e0130ff2401dd4bbdf52330e0bcf776. Fix this. Fixes #25374. - - - - - 0bc94360 by Alan Zimmerman at 2024-10-31T08:38:15-04:00 EPA: Bring in last EpToken usages For import declarations, NameAnnCommas and NPlusKPat. And remove anchor, it is the same as epaLocationRealSrcSpan. - - - - - 0b11cdc0 by sheaf at 2024-10-31T08:38:55-04:00 Assert that ctEvCoercion is called on an equality Calling 'ctEvCoercion' on non-equality constraints is always incorrect. We add an assertion to this function to detect such cases; for example a type-checking plugin might erroneously do this. - - - - - ea458779 by doyougnu at 2024-11-01T18:11:33-04:00 ghc-internal: strict, unboxed src loc ranges - closes: #20449 - See CLC proposal: #55 - - - - - 778ac793 by Kazuki Okamoto at 2024-11-01T18:12:13-04:00 No haddock markup in doctest line - - - - - cf0deeaf by Andreas Klebinger at 2024-11-02T17:54:52-04:00 Reword -fexpose-overloaded-unfoldings docs. This should make them slightly clearer. Fixes #24844 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 1c21e7d4 by Andreas Klebinger at 2024-11-02T17:55:29-04:00 Compile T25062 simd tests even if we can't run them. Helps avoid them being utterly broken. Fixes #25341 - - - - - 573cad4b by Cheng Shao at 2024-11-02T17:56:04-04:00 Remove unused USE_REPORT_PRELUDE code paths from the tree This patch removes unused `USE_REPORT_PRELUDE` code paths from the tree. They have been present since the first git revision 4fb94ae5e5d632748fa2e6c35e259eccc5a1a3f4, and might have been useful for debugging purposes many years ago, but these code paths are never actually built. Removing these ease maintenance of relevant modules in the future, and also allows us to get rid of `CPP` extension in those modules as a nice byproduct. - - - - - 97f600c6 by Hassan Al-Awwadi at 2024-11-04T15:52:12+00:00 Refactored BooleanFormula to be in line with TTG (#21592) There are two parts to this commit. * We moved the definition of BooleanFormula over to L.H.S.BooleanFormula * We parameterized the BooleanFormula over the pass The GHC specific details of BooleanFormula remain in Ghc.Data.BooleanFormula. Because its parameterized over the pass its no longer a functor or traversable, but we defined bfMap and bfTraverse for the cases where we needed fmap and traverse originally. Most other changes are just churn. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - d4fd3580 by Andreas Klebinger at 2024-11-05T07:36:16-05:00 ghc-heap: Fix incomplete selector warnings. Use utility functions instead of selectors to read partial attributes. Part of fixing #25380. - - - - - fdd9f62a by Peter Trommler at 2024-11-05T07:36:51-05:00 PPC NCG: Implement fmin and fmax - - - - - 8e217256 by Mike Pilgrem at 2024-11-07T04:34:20-05:00 Re CLC #293 - Don't specify Data.List.NonEmpty in terms of partial See https://github.com/haskell/core-libraries-committee/issues/293 `List.init` had already been driven out of `tails1` by 21fc180bec93d964a7f4ffdf2429ef6f74b49ab6 but this specification also avoided partial `fromList`, so I preferred it. The `changelog.md` for `base` is updated, with an entry added under `base-4.22.0.0`. - - - - - 346e4cd1 by Zubin Duggal at 2024-11-07T04:34:57-05:00 release: copy zip files into the correct directory Fixes #25446 - - - - - bbdbe225 by Zubin Duggal at 2024-11-07T04:34:57-05:00 release: Sign .gz bindists too Fixes #25447 - - - - - 0c722e14 by Hécate Kleidukos at 2024-11-07T04:35:37-05:00 hadrian: Enforce the usage of GHC >=9.8.1 for ghci-multi GHC 9.6 no good when it comes to multi-repl stuff, despite being well within the range of n-2 releases for bootstrapping, when the script was adapted to load haddock, in !12851 - - - - - d8f8a1c3 by Sylvain Henry at 2024-11-07T19:27:46-05:00 Handle the special ghc-prim:GHC.Prim module in the compiler Before this patch, some custom hacks were necessary in ghc-prim's Setup.hs to register the GHC.Prim (virtual) module and in Hadrian to generate haddocks properly. In this patch we special-case this module in the compiler itself instead (which it already is, see ghcPrimIface in GHC.Iface.Load). From Cabal/Hadrian's perspective GHC.Prim is now just a normal autogenerated module. This simplification is worthwhile on its own. It was found while looking into the work needed for #24453 which aims to merge ghc-prim, ghc-bignum, and ghc-internal. It's also one step closer to remove ghc-prim's custom setup. - - - - - a55adc8e by Cheng Shao at 2024-11-07T19:28:22-05:00 Clean up obsolete CPP guarded code paths from the tree This patch cleans up obsolete CPP guarded code paths from the tree. The minimum supported boot GHC version is 9.6, and all the pre-9.6 era code paths can be removed. - - - - - 9ede97f3 by Cheng Shao at 2024-11-07T19:28:58-05:00 Remove obsolete executable wrappers from the tree The executable wrappers are handled by hadrian and bindist Makefile. The various .wrapper scripts in the tree are unused since removal of Make build system, so this patch removes them all. - - - - - 7d42b2df by tristian at 2024-11-07T19:29:40-05:00 TcRnDuplicateDecls now suggests to use the DuplicateRecordFields extension. Fixes: !24627 - - - - - e56ed179 by Zubin Duggal at 2024-11-11T15:16:35+05:30 testsuite: normalise some versions in callstacks (cherry picked from commit f230e29f30d0c1c566d4dd251807fcab76a2710e) - - - - - a28fc903 by Zubin Duggal at 2024-11-11T15:16:35+05:30 testsuite: use -fhide-source-paths to normalise some backpack tests (cherry picked from commit b19de476bc5ce5c7792e8af1354b94a4286a1a13) - - - - - ed16d303 by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite/haddock: strip version identifiers and unit hashes from html tests (cherry picked from commit fbf0889eadc410d43dd5c1657e320634b6738fa5) - - - - - e45e5836 by Zubin Duggal at 2024-11-11T15:16:36+05:30 haddock: oneshot tests can drop files if they share modtimes. Stop this by including the filename in the key. Ideally we would use `ghc -M` output to do a proper toposort Partially addresses #25372 (cherry picked from commit e78c7ef96e395f1ef41f04790aebecd0409b92b9) - - - - - 9104e6eb by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite: fix normalisation of T9930fail so that it doesn't get tripped up by ghc executable (ARGV[0]) differences (cherry picked from commit a79a587e025d42d34bb30e115fc5c7cab6c1e030) - - - - - 2c31264a by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite: normalise windows file seperators (cherry picked from commit f858875e03b9609656b542aaaaff85ad0a83878a) - - - - - 2807f91b by Zubin Duggal at 2024-11-11T15:21:30+05:30 testsuite: Also match <VERSION> placeholders when normalising callsites - - - - - c02add17 by Ben Gamari at 2024-11-12T01:22:11-05:00 configure: Check version number validity Here we verify the previously informal invariant that stable release version numbers must have three components, preventing costly failed releases. Specifically, the check fails in the following scenarios: * `version=9.13` while `RELEASE=YES` since this would imply a release made from an unstable branch * `version=9.13.0` since unstable versions should only have two components * `version=9.12` since this has the wrong number of version components for a stable branch Fixes #25390. - - - - - 747fd322 by Teo Camarasu at 2024-11-12T01:22:49-05:00 docs: link to #14474 in the template-haskell docs - - - - - 6d96bb62 by Zubin Duggal at 2024-11-12T01:23:25-05:00 testsuite: normalise execvp vs exec differences in process tests Fixes #25431 - - - - - 502e6711 by Torsten Schmits at 2024-11-12T01:24:01-05:00 fix test lint that accumulated while the checks were broken I didn't fix the issues flagged by the #ifdef linter because it were so many that it seemed like the rule has become obsolete. - - - - - 223a4cb5 by Torsten Schmits at 2024-11-12T01:24:02-05:00 test driver: fix file collection for regex linters When a testsuite linter is executed with the `tracked` strategy, the driver runs `git ls-tree` to collect eligible files. This appears to have ceased producing any paths – `ls-tree` restricts its results to the current working directory, which is `testsuite/tests/linters` in this case. As a quick fix, this patch changes the working directory to match expectations. - - - - - 9ad9ac63 by Alan Zimmerman at 2024-11-12T01:24:39-05:00 EPA: Capture location of '_' for wild card type binder And keep track of promotion status in HsExplicitTupleTy, so the round-trip ppr test works for it. Updates Haddock output too, using the PromotionFlag in HsExplicitTupleTy. Closes #25454 - - - - - c37b96fa by Cheng Shao at 2024-11-12T01:25:15-05:00 wasm: fix setImmediate() implementation for Cloudflare Workers This patch fixes setImmediate() implementation for Cloudflare Workers in the wasm backend's js prelude script. Cloudflare Workers doesn't support the MessageChannel API, and we use a setTimeout() based fallback implementation in this case. - - - - - bea8ea4c by Cheng Shao at 2024-11-12T01:25:15-05:00 wasm: fix FinalizationRegistry logic for Cloudflare Workers This patch fixes FinalizationRegistry related logic for Cloudflare Workers in wasm backend js post linker. Cloudflare Workers doesn't support FinalizationRegistry, in this case we use a dummy implementation that doesn't do anything. - - - - - 00d551bf by Cheng Shao at 2024-11-13T08:48:21-05:00 Remove obsolete cross-port script This patch removes the obsolete cross-port script in the tree. The script was based on the legacy Make build system which has been pruned from the tree long ago. For hadrian, proper support for two-stage bootstrapping onto a new unsupported platform is a work in progress in !11444. - - - - - 75a2eae4 by Cheng Shao at 2024-11-13T08:48:58-05:00 hadrian: fix bindist makefile for wasm32-wasi target This patch fixes one incoherent place between bindist makefile and hadrian logic: I forgot to include wasi/wasm32 in OsSupportsGHCi/ArchSupportsGHCi as well. And this results in incorrect settings file generated after installing the bindist, and "Use interpreter"/"Have interpreter" fields incorrectly have "NO" values where they should be "YES" like --info output of in-tree version. - - - - - 0614abef by Alan Zimmerman at 2024-11-13T08:49:34-05:00 EPA: Correctly capture leading semis in decl list Closes #25467 - - - - - 00d58ae1 by Sebastian Graf at 2024-11-13T15:21:23-05:00 DmdAnal: Make `prompt#` lazy (#25439) This applies the same treatment to `prompt#` as for `catch#`. See `Note [Strictness for mask/unmask/catch/prompt]`. Fixes #25439. - - - - - 93233a66 by Ben Gamari at 2024-11-13T15:21:59-05:00 boot: Do not attempt to update config.sub While Apple ARM hardware was new we found that the autoconf scripts included in some boot packages were too old. As a mitigation for this, we introduced logic in the `boot` script to update the `config.sub` with that from the GHC tree. However, this causes submodules which have `config.sub` committted to appear to be dirty. This is a considerable headache. Now since `config.sub` with full platform support is more common we can remove `boot`'s `config.sub` logic. Fixes #19574. - - - - - fa66fa64 by Ryan Scott at 2024-11-14T19:05:00-05:00 Add regression test for #16234 Issue #16234 was likely fixed by !9765. This adds a regression test to ensure that it remains fixed. Fixes #16234. - - - - - bfe64df8 by Matthew Pickering at 2024-11-14T19:05:36-05:00 ghc-internal: Update to Unicode 16 This patch updates the automatically generated code for querying unicode properties to unicode 16. Fixes #25402 - - - - - 1fd83f86 by Ben Gamari at 2024-11-14T19:06:13-05:00 configure: Accept happy-2.1.2 happy-2.1 was released in late Oct 2024. I have confirmed that master bootstraps with it. Here we teach configure to accept this tool. Fixes #25438. - - - - - aa58fc5b by Ben Gamari at 2024-11-14T19:06:49-05:00 rts: Tighten up invariants of PACK - - - - - 8aa4c10a by Ben Gamari at 2024-11-14T19:06:49-05:00 testsuite: Fix badly escaped literals Use raw string literals to ensure that `\s` is correctly interpreted as a character class. - - - - - 0e084029 by Ben Gamari at 2024-11-14T19:06:49-05:00 rts: Improve documentation of SLIDE bytecode instruction - - - - - 9bf3663b by Ben Gamari at 2024-11-14T19:06:49-05:00 rts/Interpreter: Assert that TEST*_P discriminators are valid - - - - - 1f668511 by Ben Gamari at 2024-11-14T19:06:49-05:00 rts/Interpreter: Improve documentation of TEST*_P instructions - - - - - 59e0a770 by Cheng Shao at 2024-11-14T19:07:25-05:00 misc: improve clangd compile_flags.txt flags This patch improves the compile_flags.txt config used to power clangd for the rts C codebase. The flags in the file are sampled & deduped from a real stage1 build with clang-19 and vastly improves the IDE accuracy when hacking the rts. For maximum code coverage under the default settings, compile_flags.txt defaults to threaded+profiled+dynamic+debug way. This does not mean profdyn needs to be actually built in _build/stage1 for IDE to work. To activate IDE for other RTS ways, simply remove one of the -D flags at the end of compile_flags.txt and restart clangd. - - - - - c2c562e0 by Ben Gamari at 2024-11-14T19:08:01-05:00 testsuite: Don't consider untracked files in dirtiness check Considering trees containing untracked files as dirty is a bridge too far. The chance of an untracked file significantly affecting measured performanced metrics is quite small whereas not collecting measurements is quite inconvenient for some workflows. We now ignore untracked files in the dirtiness check. Fixes #25471. - - - - - ed2ed6c5 by Cheng Shao at 2024-11-14T19:08:37-05:00 testsuite: add regression test T25473 This commit adds regression test T25473 marked as broken due to #25473. It will be fixed in the subsequent commit. - - - - - bd0a8b7e by Cheng Shao at 2024-11-14T19:08:37-05:00 wasm: fix foreign import javascript "wrapper" in TH/ghci This patch fixes foreign import javascript "wrapper" in wasm backend's TH/ghci by fixing the handling of dyld/finalization_registry magic variables. Fixes T25473 and closes #25473. - - - - - f1b0bc32 by Ben Gamari at 2024-11-14T19:09:13-05:00 rts/linker: Make FreeBSD declarations proper prototypes The iconv declarations for FreeBSD were previously not prototypes, leading to warnings. - - - - - 086cbbc1 by Ben Gamari at 2024-11-14T19:09:13-05:00 base: Drop redundant import in FreeBSD ExecutablePath implementation - - - - - 79ecd199 by Ben Gamari at 2024-11-14T19:09:13-05:00 compiler: Fix partial selector warnings in GHC.Runtime.Heap.Inspect - - - - - 1acb73bf by Andrew Lelechenko at 2024-11-15T06:10:47-05:00 gitlab: mention CLC in MR template - - - - - 8f2e0832 by Ben Gamari at 2024-11-15T06:11:24-05:00 rts: Allow use of GNU-stack notes on FreeBSD Previously we gated use of GNU-style non-executable stack notes to only apply on Linux. However, these are also supported by FreeBSD, which also uses ELF. Fix this. Fixes #25475. - - - - - 2c427cb0 by Ben Gamari at 2024-11-16T05:27:40-05:00 rts: Fix EINTR check in timerfd ticker When `poll` failed we previously checked that `errno == -EINTR` to silence the failure warning. However, this is wrong as `errno` values are generally not negated error codes (in contrast to many system call results, which is likely what the original author had in mind). Fixes #25477. - - - - - a0fa4941 by Ben Gamari at 2024-11-16T05:28:16-05:00 rts: Increase gen_workspace alignment to 128 bytes on AArch64 Increase to match the 128-byte cache-line size of Apple's ARMv8 implementation. Closes #25459. - - - - - 142d8afa by Ben Gamari at 2024-11-16T16:20:47-05:00 rts/RtsFlags: Refactor size parsing This makes a number of improvements mentioned in #20201: * fail if the argument cannot be parsed as a number (`-Mturtles`) * fail if an unrecognized unit is given (e.g. `-M1x`) - - - - - b7a146e5 by Ben Gamari at 2024-11-16T16:20:47-05:00 testsuite: Add tests for RTS flag parsing error handling See #20201. - - - - - ddb7afa6 by Ben Gamari at 2024-11-16T16:21:23-05:00 users guide: Mention language extensions in equality constraints discussion As suggested in #24127, mention the language extensions necessary for usage of equality constriants in their documentation. Closes #24127. - - - - - 36133dac by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide/9.14.1-notes: Fix list syntax - - - - - 888de658 by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide/debug-info: Fix duplicate flag descriptions - - - - - f120e427 by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide: Fix reference to 9.14.1 release notes - - - - - 8e975032 by Ben Gamari at 2024-11-16T16:21:59-05:00 Introduce GHC.Tc.Plugin.lookupTHName This makes it significantly more convenient (and less GHC-version-dependent) to resolve a template-haskell name into a GHC Name. As proposed in #24741. - - - - - a0e168ec by ARATA Mizuki at 2024-11-16T16:22:40-05:00 x86 NCG SIMD: Lower packFloatX4#, insertFloatX4# and broadcastFloatX4# to SSE1 instructions Fixes #25441 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 3936bf1b by sheaf at 2024-11-16T16:23:22-05:00 X86 NCG: allow VXOR at scalar floating-point types The NCG can emit VXOR instructions at scalar floating-point types, but the pretty-printer would panic instead of emitting the appropriate VXORPS/VXORPD instructions. This patch rectifies that oversight. Fixes #25455 - - - - - d9dff93a by Ben Gamari at 2024-11-16T16:23:58-05:00 rts: Fix platform-dependent pointer casts Previously we had unnecessary (and incorrect) platform-dependent casts to turn `OSThreadIds`s into a integer. We now just uniformly cast first to a `uintptr_t` (which is always safe, regardless of whether `OSThreadId` is a pointer), and then cast to the desired integral type. This fixes a warning on musl platforms. - - - - - 6d95cdb8 by Ben Gamari at 2024-11-16T16:24:34-05:00 testsuite: Mark encoding004 as broken on FreeBSD Due to #22003, CP936 fails to roundtrip: ```diff == CP936 +Failed to roundtrip given mutant byte at index 891 (251 /= 123 at index 891) +Failed to roundtrip given mutant byte at index 1605 (197 /= 69 at index 1605) +Failed to roundtrip given mutant byte at index 2411 (235 /= 107 at index 2411) +Failed to roundtrip given mutant byte at index 6480 (208 /= 80 at index 6480) +Failed to roundtrip given mutant byte at index 6482 (210 /= 82 at index 6482) +Failed to roundtrip given mutant byte at index 6484 (212 /= 84 at index 6484) +Failed to roundtrip given mutant byte at index 6496 (224 /= 96 at index 6496) +Failed to roundtrip given mutant byte at index 7243 (203 /= 75 at index 7243) +Failed to roundtrip given mutant byte at index 7277 (237 /= 109 at index 7277) +Failed to roundtrip given mutant byte at index 8027 (219 /= 91 at index 8027) +Failed to roundtrip given mutant byte at index 8801 (225 /= 97 at index 8801) ``` - - - - - 26e86984 by Ben Gamari at 2024-11-18T04:05:31-05:00 hadrian: Allow haddock options to be passed via key-value settings - - - - - 6e68b117 by Matthew Pickering at 2024-11-18T04:06:07-05:00 Exception rethrowing Basic changes: * Change `catch` function to propagate exceptions using the WhileHandling mechanism. * Introduce `catchNoPropagate`, which does the same as before, but passes an exception which can be rethrown. * Introduce `rethrowIO` combinator, which rethrows an exception with a context and doesn't add a new backtrace. * Introduce `tryWithContext` for a variant of `try` which can rethrow the exception with it's original context. * onException is modified to rethrow the original error rather than creating a new callstack. * Functions which rethrow in GHC.Internal.IO.Handle.FD, GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and GHC.Internal.System.IO.Error are modified to not add a new callstack. Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202> - - - - - a4e0d235 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00 exceptions: Improve the message layout as per #285 This commit fixes the layout of the additional information included when displaying an exception, namely the type of the exception. It also fixes the default handler's heading message to work well together with the improved display message of SomeException. CLC proposal#285 - - - - - 284ffab3 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00 Display type and callstack of exception on handler This commit changes the Exception instance of SomeException to *simply* display the underlying exception in `displayException`. The augmented exception message that included the type and backtrace of the exception are now only printed on a call to `displayExceptionWithInfo`. At a surface level, existing programs should behave the same since the `uncaughtExceptionHandler`, which is responsible for printing out uncaught exceptions to the user, will use `displayExceptionWithInfo` by default. However, unlike the instance's `displayException` method, the `uncaughtExceptionHandler` can be overriden with `setUncaughtExceptionHandler`. This makes the extra information opt-in without fixing it the instance, which can be valuable if your program wants to display uncaught exceptions to users in a user-facing way (ie without backtraces). This is what was originally agreed for CLC#231 or CLC#261 with regard to the type of the exception information. The call stack also becoming part of the default handler rather than the Exception instance is an ammendment to CLC#164. Discussion of the ammendment is part of CLC#285. - - - - - 36cddd2c by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Remove redundant CallStack from exceptions Before the exception backtraces proposal was implemented, ErrorCall accumulated its own callstack via HasCallStack constraints, but ExceptionContext is now accumulated automatically. The original ErrorCall mechanism is now redundant and we get a duplicate CallStack Updates Cabal submodule to fix their usage of ErrorCallWithLocation to ErrorCall CLC proposal#285 Fixes #25283 - - - - - 7a74330b by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Freeze call stack in error throwing functions CLC proposal#285 - - - - - 3abf31a4 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 De-duplicate displayContext and displayExceptionContext The former was unused except for one module where it was essentially re-defining displayExceptionContext. Moreover, this commit extends the fix from bfe600f5bb3ecd2c8fa71c536c63d3c46984e3f8 to displayExceptionContext too, which was missing. - - - - - c0d783f8 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Re-export NoBacktrace from Control.Exception This was originally proposed and accepted in section "2.7 Capturing Backtraces on Exceptions" of the CLC proposal for exception backtraces. However, the implementation missed this re-export, which this commit now fixes. - - - - - 802b5c3e by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Fix exception backtraces from GHCi When running the program with `runhaskell`/`runghc` the backtrace should match the backtrace one would get by compiling and running the program. But currently, an exception thrown in a program interpreted with `runhaskell` will: * Not include the original exception backtrace at all * Include the backtrace from the internal GHCi/ghc rethrowing of the original exception This commit fixes this divergence by not annotating the ghc(i) backtrace (with NoBacktrace) and making sure that the backtrace of the original exception is serialized across the boundary and rethrown with the appropriate context. Fixes #25116 The !13301 MR (not this commit in particular) improves performance of MultiLayerModules. Unfortunately, T3294 regresses on aarch64-linux-deb12 by 1% allocations. Since this patch must be merged for 9.12 ASAP, we will not be able to investigate the slight regression on this platform in time. ------------------------- Metric Decrease: MultiLayerModulesRecomp MultiLayerModulesTH_OneShot Metric Increase: T3294 ------------------------- - - - - - 3e89eb65 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 base: Add to changelog.md CLC #285 - - - - - d9326a48 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Bump array and stm submodules for testsuite The testsuites of array and stm had to be updated according to !13301. Updates submodule array and stm. - - - - - 325fcb5d by Ben Gamari at 2024-11-18T04:06:45-05:00 rts/adjustor: Clean up code style of Nativei386 adjustor - - - - - 39bb6e58 by Ben Gamari at 2024-11-18T04:06:45-05:00 rts/adjustor: Fix stack overrun error in Nativei386 adjustor We were reserving the wrong kind of adjustor context (the generic `AdjustorContext` used by other adjustor implementations, rather than the i386-specific `CCallContext`) to return the adjustor context while freeing, resulting in #25485. Fixes #25485. - - - - - 831aab22 by sheaf at 2024-11-18T21:22:36-05:00 Include diagnostic reason in -fdiagnostics-as-json This commit ensures that the -fdiagnostics-as-json output includes the diagnostic reason. This allows the full error message produced by GHC to be re-constructed from the JSON output. Fixes #25403 - - - - - 3e5bfdd3 by Ben Gamari at 2024-11-18T21:23:12-05:00 rts: Introduce printIPE This is a convenience utility for use in GDB. - - - - - 44d909a3 by Sjoerd Visscher at 2024-11-19T14:38:24-05:00 Don't store boot locations in finder cache Partially reverts commit fff55592a7b Amends add(Home)ModuleToFinder so that locations for boot files are not stored in the finder cache. Removes InstalledModule field from InstalledFound constructor since it's the same as the key that was searched for. - - - - - 64c95292 by Sjoerd Visscher at 2024-11-19T14:38:24-05:00 Concentrate boot extension logic in Finder With new mkHomeModLocation that takes an extra HscSource to add boot extensions if required. - - - - - 11bad98d by ARATA Mizuki at 2024-11-19T14:39:08-05:00 Better documentation for floating-point min/max and SIMD primitives See #25350 for floating-point min/max Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 791a47b2 by Arnaud Spiwack at 2024-11-20T14:00:05+00:00 Add test for #25185 - - - - - 374e18e5 by Arnaud Spiwack at 2024-11-20T14:09:30+00:00 Quick look: emit the multiplicity of app heads in tcValArgs Otherwise it's not scaled properly by the context, allowing unsound expressions. Fixes #25185. - - - - - 1fc02399 by sheaf at 2024-11-20T18:11:03-05:00 x86 NCG: fix regUsageOfInstr for VMOVU & friends This commit fixes the implementation of 'regUsageOfInstr' for vector operations that take an 'Operand' as the destination, by ensuring that when the destination is an address then the address should be *READ*, and not *WRITTEN*. Getting this wrong is a disaster, as it means the register allocator has incorrect information, which can lead to it discard stores to registers, segfaults ensuing. Fixes #25486 - - - - - 7bd407a6 by Brandon Chinn at 2024-11-21T14:08:15-05:00 Fix CRLF in multiline strings (#25375) - - - - - 7575709b by Rodrigo Mesquita at 2024-11-21T14:08:52-05:00 Improve reachability queries on ModuleGraph Introduces `ReachabilityIndex`, an index constructed from a `GHC.Data.Graph.Directed` `Graph` that supports fast reachability queries (in $O(1)$). This abstract data structure is exposed from `GHC.Data.Graph.Directed.Reachability`. This index is constructed from the module graph nodes and cached in `ModuleGraph`, enabling efficient reachability queries on the module graph. Previously, we'd construct a Map of Set of ModuleGraph nodes which used a lot of memory (`O(n^2)` in the number of nodes) and cache that in the `ModuleGraph`. By using the reachability index we get rid of this space leak in the module graph -- even though the index is still quadratic in the number of modules, it is much, much more space efficient due to its representation using an IntMap of IntSet as opposed to the transitive closure we previously cached. In a memory profile of MultiLayerModules with 100x100 modules, memory usage improved from 6GB residency to 2.8GB, out of which roughly 1.8GB are caused by a second space leak related to ModuleGraph. On the same program, it brings compile time from 7.5s to 5.5s. Note how we simplify `checkHomeUnitsClosed` in terms of `isReachableMany` and by avoiding constructing a second graph with the full transitive closure -- it suffices to answer the reachability query on the full graph without collapsing the transitive closure completely into nodes. Unfortunately, solving this leak means we have to do a little bit more work since we can no longer cache the result of turning vertex indices into nodes. This results in a slight regression in MultiLayerModulesTH_Make, but results in large performance and memory wins when compiling large amounts of modules. ------------------------- Metric Decrease: mhu-perf Metric Increase: MultiLayerModulesTH_Make ------------------------- - - - - - bcbcdaaf by Cheng Shao at 2024-11-21T14:09:28-05:00 driver: fix hpc undefined symbol issue in TH with -fprefer-byte-code This commit fixes an undefined symbol error in RTS linker when attempting to compile home modules with -fhpc and -fbyte-code-and-object-code/-fprefer-byte-code, see #25510 for detailed description and analysis of the bug. Also adds T25510/T25510c regression tests to test make mode/oneshot mode of the bug. - - - - - 970ada5a by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Bump ci-images For introduction of Alpine/i386 image. Thanks to Julian for the base image. Co-Authored-By: Julian Ospald <hasufell at hasufell.de> - - - - - 8115abc2 by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Add release job for i386/Alpine As requested by Mikolaj and started by Julian. Co-Authored-By: Julian Ospald <hasufell at hasufell.de> - - - - - 639f0149 by Ben Gamari at 2024-11-22T23:32:06-05:00 rts/linker/Elf: Resolve _GLOBAL_OFFSET_TABLE_ - - - - - 490d4d0a by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Mark i386 Alpine test breakages Marks the following tests as broken on i386/Alpine: * T22033 due to #25497 * simd009, T25062_V16, T25169, T22187_run due to #25498 - - - - - 536cdf09 by Cheng Shao at 2024-11-22T23:32:42-05:00 compiler: remove unused GHC.Linker.Loader.loadExpr This patch removes the unused `GHC.Linker.Loader.loadExpr` function. It was moved from `GHC.Runtime.Linker.linkExpr` in `ghc-9.0` to `GHC.Linker.Loader.loadExpr` in `ghc-9.2`, and remain completely unused and untested ever since. There's also no third party user of this function to my best knowledge, so let's remove this. Anyone who wants to write their own GHC API function to load bytecode can consult the source code in older release branches. - - - - - 6ee35024 by Drew Fenwick at 2024-11-22T23:33:26-05:00 Fix a non-compiling example in the type abstractions docs This patch adds a missing Show constraint to a code example in the User Guide's type abstractions docs to fix issue #25422. - - - - - d1172e20 by Rodrigo Mesquita at 2024-11-22T23:34:02-05:00 Re-introduce ErrorCallWithLocation with a deprecation pragma With the removal of the duplicate backtrace, part of CLC proposal #285, the constructor `ErrorCallWithLocation` was removed from base. This commit re-introduces it with a deprecation. - - - - - 1187a60a by Ben Gamari at 2024-11-22T23:34:39-05:00 testsuite: Skip tests requiring Hadrian deps in out-of-tree testsuite runs Some testsuite tests require specific tools (e.g. `check-ppr` and `check-exact`) beyond those shipped in the binary distribution. Skip these tests. Fixes #13897. - - - - - c37d7a2e by Ben Gamari at 2024-11-22T23:34:39-05:00 testsuite: Declare exactprint tests' dependency on check-exact - - - - - 454ce957 by Ben Gamari at 2024-11-22T23:35:15-05:00 ghc-internal: Fix a few cases of missing Haddock markup - - - - - a249649b by Ben Gamari at 2024-11-22T23:35:51-05:00 testsuite/GHCiPrimCall : Add missing Makefile includes - - - - - a021a493 by Ben Gamari at 2024-11-22T23:35:51-05:00 testsuite/IpeStats: Use Make rather than shell interpolation - - - - - 6e1fbda7 by Ben Gamari at 2024-11-25T03:55:44-05:00 hadrian-ghci-multi: Pass -this-package-name in unit response files As noted in #25509, the `-this-package-name` must be passed for each package to ensure that GHC can response references to the packages' exposed modules via package-qualified imports. Fix this. Closes #25509. - - - - - a05e4a9b by Simon Hengel at 2024-11-25T03:56:33-05:00 Refactoring: Use `OnOff` more consistently for `Extension` - - - - - 7536181d by Matthew Pickering at 2024-11-25T14:00:07-05:00 driver: Always link against "base" package when one shot linking The default value for base-unit-id is stored in the settings file. At install time, this can be set by using the BASE_UNIT_ID environment variable. At runtime, the value can be set by `-base-unit-id` flag. For whether all this is a good idea, see #25382 Fixes #25382 - - - - - 7f90f319 by Andreas Klebinger at 2024-11-25T14:00:44-05:00 Compacting GC: Handle black holes in large objects. As #14497 showed black holes can appear inside large objects when we capture a computation and later blackhole it like we do for AP_STACK closures. Fixes #24791 - - - - - 291388e1 by Cheng Shao at 2024-11-25T14:01:19-05:00 ci: minor nix-in-docker improvements This patch makes some minor improvements re nix-in-docker logic in the ci configuration: - Update `nixos/nix` to the latest version - Apply $CPUS to `cores`/`max-jobs` to avoid oversubscribing while allowing a reasonable degree of parallelism - Remove redundant `--extra-experimental-features nix-command` in later `nix shell` invocations, it's already configured in `/etc/nix/nix.conf` - - - - - e684c406 by Cheng Shao at 2024-11-25T14:01:57-05:00 ci: avoid depending on stack job for test-bootstrap jobs This patch makes test-bootstrap related ci jobs only depend on hadrian-ghc-in-ghci job to finish, consistent with other jobs in the full-build stage generated by gen_ci.hs. This allows the jobs to be spawned earlier and improve overall pipeline parallelism. - - - - - caaf5388 by Simon Hengel at 2024-11-25T14:02:41-05:00 Refactoring: Remove `pSupportedExts` from `ParserOpts` This is never used for lexing / parsing. It is only used by `GHC.Parser.Header.getOptions`. - - - - - 41f8365c by Arnaud Spiwack at 2024-11-25T14:03:23-05:00 Add test for #25515 - - - - - 9279619f by Arnaud Spiwack at 2024-11-25T14:03:23-05:00 Desugar record notation with correct multiplicities Simply uses the multiplicity as stored in the field. As I'm writing this commit, the only possible multiplicity is 1, but !13525 is changing this. It's actually easier to take !13525 into account. Fixes #25515. - - - - - fcc3ae6e by Andreas Klebinger at 2024-11-26T08:24:58-05:00 Clarify INLINE unfolding optimization docs. Fixes #24660 - - - - - 88c4fe1d by Cheng Shao at 2024-11-26T08:25:34-05:00 rts: remove -Wl,-U,___darwin_check_fd_set_overflow hack This patch bumps macOS minimum SDK version to 11.0 for x86_64-darwin to align it with aarch64-darwin. This allows us to get rid of the horrible -Wl,-U,___darwin_check_fd_set_overflow hack, which is causing linker warnings and testsuite failures on macOS 15. Fixes #25504. - - - - - 53f978c0 by doyougnu at 2024-11-26T16:07:26-05:00 ghc-experimental: expose GHC.RTS.Flags, GHC.Stats See this CLC proposal: - https://github.com/haskell/core-libraries-committee/issues/289 and this CLC proposal for background: - https://github.com/haskell/core-libraries-committee/issues/288 Metric Decrease: MultiLayerModulesTH_OneShot - - - - - e70d4140 by Wang Xin at 2024-11-26T16:08:10-05:00 Add -mcmodel=medium moduleflag to generated LLVM IR on LoongArch platform With the Medium code model, the jump range of the generated jump instruction is larger than that of the Small code model. It's a temporary fix of the problem descriped in https://gitlab.haskell .org/ghc/ghc/-/issues/25495. This commit requires that the LLVM used contains the code of commit 9dd1d451d9719aa91b3bdd59c0c6679 83e1baf05, i.e., version 8.0 and later. Actually we should not rely on LLVM, so the only way to solve this problem is to implement the LoongArch backend. Add new type for codemodel - - - - - df42ba16 by Andreas Klebinger at 2024-11-27T11:40:49-05:00 Cmm constant folding: Narrow results to operations bitwidth. When constant folding ensure the result is still within bounds for the given type by explicitly narrowing the results. Not doing so results in a lot of spurious assembler warnings especially when testing primops. - - - - - bf3db97e by Ben Gamari at 2024-11-27T11:41:26-05:00 ghc-toolchain: Introduce basic flag validation We verify that required flags (currently `--output` and `--triple`) are provided. The implementation is truly awful, but so is getopt. Begins to address #25500. - - - - - a104508d by Ben Gamari at 2024-11-27T11:42:03-05:00 rts: Allow ExecPage to allocate anywhere in address space Currently the ExecPage facility has two users: * GHCi, for constructing info tables, and * the adjustor allocation path Despite neither of these have any spatial locality constraints ExecPage was using the linker's `mmapAnonForLinker`, which tries hard to ensure that mappings end up nearby the executable image. This makes adjustor allocation needlessly subject to fragmentation concerns. We now instead return less constrained mappings, improving the robustness of the mechanism. Addresses #25503. - - - - - c3fc9b86 by Ben Gamari at 2024-11-27T11:42:39-05:00 base: Fix incorrect mentions of GHC.Internal.Numeric These were incorrectly changed by the automated refactoring of the `ghc-internal` migration. Fixes #25521. - - - - - a362b943 by sheaf at 2024-11-27T23:44:28-05:00 Add checkExact to toolTargets This change means that the Hadrian multi target will include exactprint. In particular, this means that HLS will work on exactprint inside the GHC tree. - - - - - e6c957e4 by Arnaud Spiwack at 2024-11-27T23:45:09-05:00 Add test for #25428 - - - - - 52d97f4e by Arnaud Spiwack at 2024-11-27T23:45:09-05:00 Don't bypass MonoLocalBind in empty patterns Fixes #25428 - - - - - 7890f2d8 by Ben Gamari at 2024-11-28T10:26:46-05:00 hadrian: Bump directory bound to >=1.3.9 Earlier versions of `directory` are racy on Windows due to #24382. Also includes necessary Hadrian bootstrap plan bump. Fixes #24382. - - - - - 0fd43ea6 by Adam Sandberg Ericsson at 2024-11-28T10:27:22-05:00 mention -Iw in +RTS -? - - - - - 6cf579b9 by Ben Gamari at 2024-11-28T10:27:59-05:00 gitlab-ci: Set GIT_SUBMODULE_FORCE_HTTPS GitLab recommends using `https://` to clone submodules and provides the `GIT_SUBMODULE_FORCE_HTTPS` variable to force this. Fixes #25528. - - - - - 5b4774f9 by sheaf at 2024-12-03T15:22:07+01:00 Remove TcRnDeprecatedInvisTyArgInConPat mechanism The combination of ScopedTypeVariables + TypeApplications now no longer enables the use of type applications in constructor patterns, as per GHC proposal #448. This completes the deprecation that begun with GHC 9.8. We also remove the -Wdeprecated-type-abstractions flag, which was introduced in GHC 9.10. - - - - - f813c8d7 by sheaf at 2024-12-03T17:10:15-05:00 Hadrian: use / when making filepaths absolute In Hadrian, we are careful to use -/- rather than </>, in order to use / instead of \ in filepaths. However, this gets ruined by the use of makeAbsolute from System.Directory, which, on Windows, changes back forward slashes to backslashes. - - - - - 292ed74e by Ben Gamari at 2024-12-03T17:10:52-05:00 rts/linker: Fix out-of-bounds mapping logic Previously the structure of `mmapInRegion` concealed a subtle bug concerning handling of `mmap` returning mappings below the beginning of the desired region. Specifically, we would reset `p = result + bytes` and then again reset `p = region->start` before looping around for another iteration. This resulted in an infinite loop on FreeBSD. Fixes #25492. - - - - - 20912f5b by Ben Gamari at 2024-12-03T17:10:52-05:00 rts/linker: Clarify debug output - - - - - f98b3ac0 by Simon Hengel at 2024-12-03T17:11:30-05:00 SysTools: Avoid race conditions when processing output (fixes #16450) - - - - - 03851b64 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 mg: Drop unnecessary HasCallStack This HasCallStack was a debugging artifact from a previous commit. - - - - - 01d213b5 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 Improve haddock of graphReachabilityCyclic - - - - - f7cbffe2 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 Refactor ModuleGraph interface The 'ModuleGraph' abstraction represents the relationship and strucutre of the modules being compiled. This structure is meant to be constructed once at the start of compilation, and never changed again. However, it's exposed interface was confusing and exposed too many footguns which led to inneficient usages of the ModuleGraph. This commit improves significantly the exported interface of ModuleGraph, taking into consideration the recent improvements around reachability queries. Since the ModuleGraph graphs and related structures (HPT, EPS) are performance critical in the sense that somewhat simple mistakes can cause bad leaks and non-linear memory usage, we want to have proper APIs that guide efficient usage. This is a good step in that direction. - - - - - b69a7f3c by David Binder at 2024-12-04T18:37:42-05:00 Use consistent capitalization for "GHC Proposal" in user guide - - - - - 18d9500d by David Binder at 2024-12-04T18:37:42-05:00 Fix reference to GHC proposal 193 in user guide - - - - - dd959406 by Ben Gamari at 2024-12-04T18:38:18-05:00 Revert "rts/Interpreter: Assert that TEST*_P discriminators are valid" This assertion was based on the misconception that `GET_TAG` was returning the pointer tag whereas it is actually returning the constructor tag. This reverts commit 9bf3663b9970851e7b5701d68147450272823197. Fixes #25527. - - - - - cad6fede by Ben Gamari at 2024-12-04T18:38:54-05:00 rts/IOManager: Drop dead code This assignment is dead code as it occurs after all branches have returned. Moreover, it can't possibly be relevant since the "available" branch already sets `flag`. Potentially fixes #25542. - - - - - 55d8304e by Ben Gamari at 2024-12-06T16:56:00-05:00 ghc-internal: Drop GHC.Internal.Data.Enum This module consists only of reexports and consequently there is no reason for it to exist. - - - - - 56b9f484 by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Introduce Data.Bounded As proposed in [CLC#208] but unfortunately `Data.Enum` was already incorrectly introduced in the `ghc-internal` refactor. [CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208 - - - - - 336d392e by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Deprecate export of Bounded from Data.Enum This begins the process of bringing us into compliance with [CLC#208]. [CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208 - - - - - dd7ca939 by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Mention incorrect Data.Enum addition in changelog - - - - - dfd1db48 by Ben Gamari at 2024-12-06T16:56:36-05:00 base: Reintroduce {Show,Enum} IoSubSystem These instances were dropped in !9676 but not approved by the CLC. Addresses #25549. - - - - - 090fc7c1 by Peter Trommler at 2024-12-07T03:41:21-05:00 Fix requirements on T25240 T25240 doesn't need RTS linker, GHCi is sufficient and GHCi can also be dynamically linked. - - - - - 3fb5d399 by Peter Trommler at 2024-12-07T03:41:21-05:00 Fix requirements for T25155 Loading C objects requires RTS linker. - - - - - 4c58bdf6 by Leary at 2024-12-07T03:42:07-05:00 TH: Add typed variants of dataToExpQ and liftData This commit introduces to template-haskell (via ghc-internal) two functions `dataToCodeQ` and `liftDataTyped`, typed variants of `dataToExpQ` and `liftData` respectively. Tested in: `dataToCodeQUnit`. - - - - - 63027593 by Serge S. Gulin at 2024-12-08T13:52:05+03:00 JS: Basic cleanup for unused stuff to simplify things. 1. Make `staticInitStat`, `staticDeclStat`, `allocUnboxedConStatic`, `allocateStaticList`, `jsStaticArg` local to modules. 2. Remove unused `hdRawStr`, `hdStrStr` from Haskell and JavaScript (`h$pstr`, `h$rstr`, `h$str`). 3. Introduce a special type `StaticAppKind` enumeration and `StaticApp` to represent boxed scalar static applications. Originally, StaticThunk supported to pass Maybe when it became Nothing for initializied thunks in an alternatie way but it is not used anymore. - - - - - a9f8f1fb by Serge S. Gulin at 2024-12-08T14:10:45+03:00 JS: Add trivial optimizations for `unpackCString` and `unpackCStringUtf8`. It became possible due of introduction strings unfloating at Sinker pass (#13185). Earns few more bytes at optimizations. - - - - - b519c06b by Serge S. Gulin at 2024-12-08T15:50:26+03:00 JS: Specialize unpackCString# CAFs (fixes #24744) Code analysis shown that such optimization would be possible out of the box if `cachedIdentForId` allowed to do that for Haskell `Id`s which are represented by few JavaScript `Ident`s. It is a usual for strings which are represented at JavaScript as a pair of 2 values: the string content and the offset where to start reading actual string from the full content. Usually offset is 0 but technically we need to allow such complex structures to be treated as "global". Enabling it there shown that `genToplevelRhs` and `globalOccs` had inaccuracies in their implementations: 1. `globalOccs` operated over JavaScript's `Ident`s but for complex structures it didn't pay attention to the fact that different Idents actually could be pointed to same Id. Now the algo is changed to calculate occurencies for Ids. 2. `genToplevelRhs` didn't assume that different Idents pointed to same Id can have mixed order of occurence. But actually the order is important. Strings are encoded into 2 variables where first is content and second is offset and their order are not interchangeable. It is fixed by regeneration Idents from collected Ids which is fine because all Idents generation is passed through the Cache and they are quasi-stable. - - - - - a8ceccf3 by Brandon Chinn at 2024-12-09T16:25:43-05:00 Fix panic in multiline string with unterminated gap (#25530) - - - - - 9e464ad0 by Brandon Chinn at 2024-12-09T16:25:43-05:00 Add test case for unterminated multiline string - - - - - ed1ed5c6 by Rodrigo Mesquita at 2024-12-09T16:26:19-05:00 Revert mapMG renaming We had previously renamed this function for consistency, but that caused unnecessary breakage - - - - - 158261f7 by Sylvain Henry at 2024-12-09T16:27:01-05:00 RTS: make Cabal flags manual Cabal shouldn't automatically try to set them. We set them explicitly. - - - - - a83b7ed6 by Matthew Stephenson at 2024-12-10T14:01:22-05:00 Add missing @since documentation for (!?) function - - - - - e745e3a3 by Ben Gamari at 2024-12-10T14:01:59-05:00 compiler: Don't attempt to TSAN-instrument SIMD operations TSAN only provides instrumentation for 8, 16, 32, and 64-bit memory loads/stores. Don't attempt to instrument wider operations. Fixes #25563. - - - - - 684c0018 by Ben Gamari at 2024-12-10T14:02:35-05:00 gitlab/ci: Don't clobber RUNTEST_ARGS Previously the logic handling `IGNORE_PERF_FAILURES` clobbered the user's `RUNTEST_ARGS`. Fix this. - - - - - 41dae5b8 by Ben Gamari at 2024-12-10T14:03:11-05:00 hadrian: Mitigate mktexfmt race At least some versions of Texlive's `mktexfmt` utility cannot be invoked concurrently in their initial run since they fail to handle failure of `mkdir` due to racing. Specifically, we see ``` | Run Xelatex: users_guide.tex => /tmp/extra-dir-9616886274866 | Run Xelatex: Haddock.tex => /tmp/extra-dir-9616886274869 This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex) restricted \write18 enabled. kpathsea: Running mktexfmt xelatex.fmt mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order): mktexfmt: /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes: mktexfmt: /builds/ghc/ghc/tmp-home/.texlive2020/texmf-config/web2c/fmtutil.cnf /usr/bin/mktexfmt: mkdir(/builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c/) failed for tree /builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c: File exists at /usr/share/texlive/tlpkg/TeXLive/TLUtils.pm line 937. I can't find the format file `xelatex.fmt'! ``` That is two `mktexfmt` invocations (for the user's guide and haddock builds) attempted to create `$HOME/texlive2020/texmf-var/web2c` and raced. One of the two `mkdir`'s consequently failed, bringing down the entire build. We avoid this by ensuring that the first `xelatex` invocation is always performed serially. Fixes #25564. - - - - - 9efbc51f by Ben Gamari at 2024-12-10T14:03:48-05:00 rts/CheckUnload: Reset old_objects if unload is skipped Previously `checkUnload` failed to reset `old_objects` when it decided not to unload (e.g. due to heap profiling being enabled). Fixes #24935. - - - - - 5192a75f by Ben Gamari at 2024-12-11T04:28:11-05:00 rts: Annotate BCOs with their Name This introduces a new bytecode instruction, `BCO_NAME`, to aid in debugging bytecode execution. This instruction is injected by `mkProtoBCO` and captures the Haskell name of the BCO. It is then printed by the disassembler, allowing ready correlation with STG dumps. - - - - - 99225996 by Ben Gamari at 2024-12-11T04:28:48-05:00 configure: Implement ld override whitelist Bring `configure` into alignment with `ghc-toolchain`, ensuring that the ld-override logic will only take effect on Linux and Windows. Fixes #25501. - - - - - 4a8fc928 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Unmark T14028 as broken on FreeBSD This now appears to pass on FreeBSD 14. Closes #19723. - - - - - d7c0eb5a by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Migrate FreeBSD runner tag to FreeBSD 14 - - - - - 7246dacc by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Reintroduce FreeBSD 14 job - - - - - 4af936da by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Allow use of newer cabal-install bindists Newer cabal-install bindists have internal directory structure. Here we detect and account for the presence of such structure. - - - - - cbf38c1b by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Enable documentation build on FreeBSD 14 - - - - - d68107fb by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Use system libffi on FreeBSD - - - - - fea3b590 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark linker_unload as broken on FreeeBSD Due to #25491. - - - - - ccf171ee by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Prefer system toolchain on FreeBSD It's not uncommon to find machines with gcc installed via ports. We should be using the system's default clang-based toolchain instead. - - - - - cfb34738 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark T21969 as broken on FreeBSD Due to #25512. - - - - - 0b64e37c by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark RestartEventLogging as broken on FreeBSD I am seeing this fail quite reproducibly. Due to #19724. - - - - - 3b412019 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark T16180 as "broken" on FreeBSD Sadly we in fact need to skip it as it merely times out during compilation. See #14012. - - - - - 57e3cab5 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Skip T16992 unless in slow speed This test has extraordinary memory requirements and tests a rather niche aspect of the compact region mechanism. It has been suggested multiple times that we shouldn't run it in the default testsuite configuration. Finally implement this. See #21890. See #21892. - - - - - f08a72eb by Ben Gamari at 2024-12-11T19:30:54-05:00 rts(setNumCapabilities): Assert that n_caps < MAX_N_CAPS It was noticed in #25560 that this would previously be allowed, resulting in a segfault. I will add a proper exception in `base` in a future commit. - - - - - e10d31ad by Ben Gamari at 2024-12-11T19:30:55-05:00 ghc-internal: Fix inconsistent FFI import types The foreign imports of `enabled_capabilities` and `getNumberOfProcessors` were declared as `CInt` whereas they are defined as `uint32_t`. - - - - - 06265655 by Ben Gamari at 2024-12-11T19:30:55-05:00 rts: Mention maximum capability count in users guide Addresses #25560. - - - - - d488470b by Ben Gamari at 2024-12-11T19:30:55-05:00 rts/Capability: Move induction variable declaration into `for`s Just a stylistic change. - - - - - 71f050b7 by Ben Gamari at 2024-12-11T19:30:55-05:00 rts: Determine max_n_capabilities at RTS startup Previously the maximum number of capabilities supported by the RTS was statically capped at 256. However, this bound is uncomfortably low given the size of today's machine. While supporting unbounded, fully-dynamic adjustment would be nice, it is complex and so instead we do something simpler: Probe the logical core count at RTS startup and use this as the static bound for the rest of our execution. This should avoid users running into the capability limit on large machines while avoiding wasting memory on a large capabilities array for most users and keeping complexity at bay. Addresses #25560. - - - - - 1e84b411 by Ben Gamari at 2024-12-11T19:30:55-05:00 testsuite: Introduce req_c_rts As suggested by @hsyl20, this is intended to mark tests that rely on the behavior of the C RTS. - - - - - 683115a4 by Ben Gamari at 2024-12-11T19:30:55-05:00 testsuite: Add test for #25560 - - - - - ef2052a8 by Ben Gamari at 2024-12-12T04:42:32-05:00 testsuite: Only run T14497_compact in normal way This test targets the compacting GC so it makes little sense to run it across all ways. Moreover, it outright conflicts with the `nonmoving` way. - - - - - 34d3e8e6 by Ben Gamari at 2024-12-12T04:43:08-05:00 rts/CheckUnload: Don't prepare to unload if we can't unload Previously `prepareUnloadCheck` would move the `objects` list to `old_objects` even when profiling (where we cannot unload). This caused us to vacate the `objects` list during major GCs, losing track of loaded objects. Fix this by ensuring that `prepareUnloadCheck` and `checkUnload` both use the same short-cutting logic. - - - - - 9c53489d by Andrei Borzenkov at 2024-12-12T15:06:42-05:00 Update GHCi :info type declaration printing (#24459) - Do not print result's kind in type families because we have full kind in SAKS and we display invisible arity using @-binders - Do not suppress significant invisible binders An invisible binder is considered significant when it meets at least one of the following two criteria: - It visibly occurs in the declaration's body - It is followed by a significant binder, so it affects positioning For non-generative type declarations (type synonyms and type families) there is one additional criterion: - It is not followed by a visible binder, so it affects the arity of a type synonym See Note [Print invisible binders in interface declarations] for more information about what is "visibly occurs" - - - - - 13fe48d4 by Matthew Pickering at 2024-12-12T15:07:19-05:00 typechecker: Perform type family consistency checks in topological order Consider a module M importing modules A, B and C. We can waste a lot of work depending on the order that the modules are checked for family consistency. Consider that C imports A and B. When compiling C we must have already checked A and B for consistency, therefore if C is processed first then A and B will not need to be checked for consistency again. If A and B are compared first, then the consistency checks will be performed against (wasted as we already performed them for C). At the moment the order which modules are checked is non-deterministic. Clearly we should engineer that C is checked before B and A, but by what scheme? A simple one is to observe that if a module M is in the transitive closure of X then the size of the consistent family set of M is less than or equal to size of the consistent family set of X. Therefore by sorting the imports by the size of the consistent family set and processing the largest first, you make sure to process modules in topological order. In practice we have observed that this strategy has reduced the amount of consistency checks performed. One solution to #25554 - - - - - 62a2b25f by Sylvain Henry at 2024-12-14T04:31:09-05:00 TNTC: set CmmProc entry_label properly (#25565) Before this patch we were renaming the entry label of a CmmProc late in the CmmToAsm pass. It led to inconsistencies and to some labels being used in info tables but not being emitted (#25565). Now we set the CmmProc entry label earlier in the StgToCmm monad and we don't renamed it afterwards. - - - - - b339e7c3 by Simon Hengel at 2024-12-14T04:31:47-05:00 Make filter functionality for system tools line-based This is more efficient as: - All existing filter functions were line-based anyway. They broke up the input into lines and then joined it back together. - We already break up the output from system tools into lines when processing it. Splitting up the output of system tools once and then filtering and processing it reduces both code and runtime complexity. - - - - - 39669077 by Simon Hengel at 2024-12-14T04:31:47-05:00 Refactoring: Don't use a `Chan` when parsing SysTools output - - - - - 64756530 by Simon Peyton Jones at 2024-12-14T22:28:04-05:00 Tidy up the handling of `assert` Fixes #25493 - - - - - 8658fbc1 by Rodrigo Mesquita at 2024-12-14T22:28:41-05:00 base: displayException for SomeAsyncException Provide a better implementation of `SomeException` for `SomeAsyncException`. The previous, implicit, implementation, would not use the `displayException` of the exception wrapped by `SomeAsyncException`. Implements CLC-Proposal#309 Closes #25513 - - - - - 2d3a0a70 by ARATA Mizuki at 2024-12-15T18:35:30-05:00 LLVM: When emitting a vector literal with ppTypeLit, include the type information Fixes #25561 - - - - - bfacc086 by Simon Peyton Jones at 2024-12-15T18:36:05-05:00 Fix signature lookup in instance declarations This fixes a bug introduced by the fix to #16610 - - - - - 80f0e02d by Simon Peyton Jones at 2024-12-16T17:13:52+00:00 Improve GHC build times Two small changes * In GHC.Data.Unboxed, never omit interface pragmas. In "fast builds" one might omit them generally, but doing so gives very bad performance for code that imports this module. * In GHC.Hs.Dump don't do type-class specialisation. For some reason it goes mad and generates vast amounts of useless code. See #25463. - - - - - 175a1355 by Simon Peyton Jones at 2024-12-16T17:13:52+00:00 Refactor Lint Refactor Lint for two reasons: * To improve performance * To prepare for type-lets The big changes are all in GHC.Core.Lint: * Change the main APIs: * `lintType` returns nothing rather than returning a `LintedType`; * `lintCoercion` return nothing rather than returning a `LintedCoercion` Reason: these functions did a lot of allocation to return a substituted type/coercion that was often discarded, or used only to extract its kind. Instead we now return nothing, and, when needed, extract the kind and substitute. * Applications are treated as a whole, by `lintApp`. By treating multiple arguments all at once we avoid performing multiple substitutions, each substituting a single type variable. This can make an absolutely huge difference. Overall this led to a pretty massive rewrite of Lint, with many smaller changes. Smaller chnages elsewhere * Rename `GHC.Core.TyCo.Subst.getSubstInScope` to `substInScopeSet` for consistency * Define and use `GHC.Core.Type.liftedTypeOrConstraintKind` Performance. This MR someimtes gives gives a very large improvement in compile time, when Lint is on. here is a selection of changes over 5% in perf/compiler (with -dcore-lint) T25196 -97.0% T14766 -89.7% T14683 -74.4% T5631 -60.9% T20261 -56.7% T18923 -17.6% T13035 -15.8% T6048 -15.8% CoOpt_Read -14.4% T9630 -10.9% T5642 -7.3% Eliminating the egregious offenders is a big win. However, in some cases the compiler allocation /increases/. Here ae the changes over 1%: T9961 1.5% T8095 2.8% T14052 3.9% T12545 4.5% T14052Type 5.5% T5030 8.0% T5321Fun 8.3% T3064 12.7% CoOpt_Singletons 15.6% T9198 16.0% LargeRecord 18.1% I looked at the two biggest increases in compile-time bytes allocated. Interestingly, they both show substantial *decreases* in actual compile time, due to much smaller GC times. I'm honestly not sure either why the allocation increases, or why the GC time decreases; but I'm going to take the win! T9198 Baseline With patch No Lint Alloc 44.6M 44.6M Mut time 0.23s 0.22s GC time 0.21s 0.21s With Lint Alloc 309M 360M Mut time 1.51s 0.85s GC time 2.97s 0.25s ------------------- LargeRecord Baseline With patch No Lint Alloc 1.37G 1.37G Mut time 2.33s 2.33s GC time 2.40s 2.42s With Lint Alloc 3.4G 4.0G Mut time 6.02s 5.68s GC time 3.67s 3.03s IMPORTANT NOTE: These changes don't show up in CI because in CI the tests in perf/compiler are all run with -dcore-lint switched off. I gathered this data with some manual runs. - - - - - 8ef2dad6 by Simon Peyton Jones at 2024-12-17T02:48:09-05:00 Add Note [Typechecking overloaded literals] See #25494. - - - - - e86b1b20 by Ben Gamari at 2024-12-17T13:51:39-05:00 testsuite: Use math.inf instead of division-by-zero This both more directly captures the intent and also fixes #25580. - - - - - 430d965a by Ben Gamari at 2024-12-17T13:52:15-05:00 rts: Fix incorrect format specifiers in era profiling Fixes #25581. - - - - - 267098ad by Andreas Klebinger at 2024-12-18T23:43:13-05:00 Document `-prof` and non `-prof` code being incompatible. Fixes #25518. - - - - - 04433916 by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metadata: output metadata fragment in CI (cherry picked from commit 52b58a660e735b20961d792d8fa9267f01247a50) - - - - - 7c78804e by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metatdata: use fedora33 for redhat Redhat 9 doesn't have libtinfo.so.5 anymore (cherry picked from commit dc86785eb43afd1bd292287c064fb5ad94fe8c7f) - - - - - 1d72cfb2 by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metadata: still use centos for redhat <9 - - - - - 3f7ebc58 by Sylvain Henry at 2024-12-19T20:40:14-05:00 Merge ghc-bignum into ghc-internal (#24453) First step towards merging ghc-bignum and ghc-prim into ghc-internal. After this patch, ghc-bignum is deprecated and is just a shallow package reexporting modules from ghc-internal and base. Use those directly instead. Move `gmp` submodule into ghc-internal directory. - - - - - ee0150c2 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00 Improve performance of deriving Show Significantly improves performance of deriving Show instances by avoiding using the very polymorphic `.` operator in favour of inlining its definition. We were generating tons of applications of it, each which had 3 type arguments! Improves on #9557 ------------------------- Metric Decrease: InstanceMatching T12707 T3294 ------------------------ - - - - - 8b266671 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00 Don't eta expand cons when deriving Data This eta expansion was introduced with the initial commit for Linear types. I believe this isn't needed any longer. My guess is it is an artifact from the initial linear types implementation: data constructors are linear, but they shouldn't need to be eta expanded to be used as higher order functions. I suppose in the early days this wasn't true. For instance, this works now: data T x = T x f = \(x :: forall y. y -> T y) -> x True f T -- ok! T is linear, but can be passed where an unrestricted higher order function is expected. I recall there being some magic around to make this work for data constructors... Since this works, there's no need to eta_expand the data constructors in the derived Data instances. - - - - - 1f67ad21 by Andrei Borzenkov at 2024-12-25T01:42:31-05:00 Flip the order of arguments of setField (#24668) GHC Proposal 583 "HasField redesign" specifies the following order of a setField function arguments as this: setField :: forall fld a b. SetField fld a b. b -> a -> a This patch flips the application order to match the spec. - - - - - 3e0c948d by Ben Gamari at 2024-12-25T01:43:08-05:00 rel-eng/upload: Add set_symlink mode This slightly eases updating of the `latest` symlinks. - - - - - 63d63f9d by Simon Peyton Jones at 2024-12-25T01:43:45-05:00 Preserve orientation when unifying kinds This MR fixes yet another manifestation of the trickiness caused by Note [Fundeps with instances, and equality orientation]. I wish there was a more robust way to do this, but this fix is a definite improvement. Fixes #25597 - - - - - 94ba9a6a by ARATA Mizuki at 2024-12-26T10:47:57-05:00 x86 NCG SIMD: Support pack/insert/broadcast/unpack of 128-bit integer vectors - - - - - 6bf0d587 by Andrew Lelechenko at 2024-12-26T10:48:33-05:00 docs: fix haddock formatting in Control.Monad.Fix - - - - - feb14af1 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Remove unnecessary irrefutable patterns from NonEmpty functions Implementation of https://github.com/haskell/core-libraries-committee/issues/107 - - - - - 6a0d91b4 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Make cons, Semigroup, IsList, and Monad instances stricter - - - - - 1249e597 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Restore some laziness in <| and Semigroup instance, improve Monad instance The Monad instance shouldn't produce the outer :| unless f a reduces to WHNF. (Notice that the b :| bs match is implicitly lazy.) - - - - - 8699d826 by Sergey Vinokurov at 2024-12-27T15:12:30+00:00 Add comment outlining Data.List.NonEmpty implementation guiding principles - - - - - 7febe00e by Sergey Vinokurov at 2024-12-27T22:24:43+00:00 Fix tests since location of ‘>>=’ changed - - - - - a928c326 by ARATA Mizuki at 2024-12-28T03:06:14-05:00 Fix LLVM version detection With a recent LLVM, `llc -version` emits the version on the first line if the vendor is set. It emits the version on the second line otherwise. Therefore, we need to check the both lines to detect the version. GHC now emits a warning if it fails to detect the LLVM version, so we can notice if the output of `llc -version` changes in the future. Also, the warning for using LLVM < 10 on s390x is removed, because we assume LLVM >= 13 now. This fixes the definition of __GLASGOW_HASKELL_LLVM__ macro. Fixes #25606 - - - - - 7f79257a by Zubin Duggal at 2024-12-29T13:04:35+00:00 Bump base, ghc-prim and template-haskell versions for 9.12 Also bump various submodules. (cherry picked from commit 6fc1fa3bdc8f53acdb19e47145789274060e498f) Bump base bound to 4.21 for GHC 9.12 (cherry picked from commit 473a201c6b55aea5bf9c9db0836a66ea1b657e04) Bump binary submodule to 0.8.9.2 (cherry picked from commit 7199869a52ab45e8856658248bf807954d58cc20) (cherry picked from commit ec2f40b45c1a3d82d17a2fc07e9ddb9218bc3940) Bump exceptions submodule to 0.10.9 (cherry picked from commit f5b5d1dc2d326368e5b173d622630d77f019b629) Bump file-io submodule to 0.1.4 (cherry picked from commit ba786681de6ac5fa49938e2cd71a5988f0f40d1f) bump os-string submodule to 2.0.6 (cherry picked from commit 3a7ffdbb832c045a55fd1ef24f546abdd9d9e30f) bump transformers submodule to 0.6.1.2 (cherry picked from commit 53b46fd437421b9e5a001edc6d1c427439d7714f) Bump directory submodule to v1.3.9.0 (cherry picked from commit 27dc2664c5404bb462092bb216c2c37b418fd1f8) Bump Win32 submodule to v2.14.1.0 (cherry picked from commit 80df88086180f5e39212b2feacf70a9d2b263c6c) Bump filepath submodule to 1.5.3.0 (cherry picked from commit 29bfae2c58a7303a081a6e7956b9f55e5faf3eeb) Bump file-io submodule to avoid usage of QuasiQuotes (cherry picked from commit 97b0dff223a6c4cc003adec448104c277f214645) Bump unix submodule to 2.8.6.0 (cherry picked from commit a1f56d6d6a99c100f88ef0a8b4d51298cf24a42d) Bump os-string submodule to 2.0.8 (cherry picked from commit 0121b76fd52ea0c0ce5d07085bc195666b63c625) Bump file-io submodule to avoid usage of QuasiQuotes (cherry picked from commit 962ceb50c8a6fc370e1c0a267f5cd5562a8cf759) Bump filepath submodule to 1.5.4.0 (cherry picked from commit 7bc6877fd5d41c6d5900678ad5e73ed30f366569) Bump file-io submodule to 0.1.5 (cherry picked from commit 9478b5aefe2877d58baf527edcf936dddbb955b7) Bump Cabal submodule to 3.14.1.0 (cherry picked from commit 5c9c3e3f79a79bb6d9a77a17c716dc3a0bcbd2aa) Bump directory submodule to 0.12.2.0 (cherry picked from commit 897906265db37af34ae2aaa016cec417f263407b) Bump array submodule for base bump Bump stm submodule for base bump Bump process submodule for base bump - - - - - f6079408 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Fix ghc-e005 after HasCallstack changes (cherry picked from commit 77f340a24561cea8a6f2ada296b3ea356ab1823c) - - - - - 3e10fa75 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Add haskeline to stage0Packages Otherwise we link against boot inplace and boot unix as boot haskeline depends on boot unix. (cherry picked from commit 90b493769ebdf3cd7be404d18462dc20ac1044df) - - - - - 4ad6aec4 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Fix TH changelog - - - - - ea3f7fd5 by Zubin Duggal at 2024-12-29T13:04:35+00:00 release: copy index.html from correct directory (cherry picked from commit cbfd0829cd61928976c9eb17ba4af18272466063) - - - - - fafb70db by Zubin Duggal at 2024-12-29T13:04:35+00:00 hadrian-multi: warn on unused imports os-string has redundant imports (cherry picked from commit dde3796be689ea57543936e22aa5ea4ef7ed995e) - - - - - c02b1e46 by Simon Peyton Jones at 2024-12-29T17:04:30-05:00 Fix in-scope set for CSE Ticket #25468 showed an assertion failure in CSE because a top-level Id was being used before it was defined. Reason: Note [Glomming] in GHC.Core.Opt.OccurAnal. Solution (used in many places): just put all the top-level bindings in scope at the beginning of CSE. Compile-time allocation wobbles up and down a tiny bit; geo mean is zero. But MultiLayerModulesTH_OneShot and hard_hole_fits increase (on some architectures only) by a bit oever 2% . I think these are just a random fluctuations. Metric Increase: MultiLayerModulesTH_OneShot hard_hole_fits - - - - - 559d4f84 by Krzysztof Gogolewski at 2024-12-30T11:53:19-05:00 Add tests for #23883 The issue has been fixed by commit f5d3e03c56ffc63. Only T23883a is the actual regression test, the remaining ones are tricky cases found during development of an independent fix !11313. - - - - - 278a53ee by Sergey Vinokurov at 2024-12-30T11:53:59-05:00 Update changelog for CLC proposal #107 (NonEmpty laziness) - - - - - f56558be by Matthew Pickering at 2025-01-07T13:53:03-05:00 warnings: Find out if a qualified name is in the interactive scope directly There were two ad-hoc mechanisms used to determine which modules were in the interactive scope. 1. Look at everything in the GRE, to see what is imported qualified. 2. Look at the last loaded module in the HPT. (1) Is very inefficient, GlobalRdrEnvs can be very big. (2) is incorrect, there is no reason to assume the "last" thing added to the HPT has any relevance to module loading order. Happily, the same checks can be implemented directly by looking at the interactive imports from the interactive context. This mirrors what happens for normal imports. Arguably, the error reporting code shouldn't be doing this kind of processing and it should be an option is set when rendering the error message. However, this just improves the situation and doesn't block progress on that front in future. See #14225 and #15611 Fixes #25600 - - - - - 84155cdb by Simon Peyton Jones at 2025-01-07T13:53:40-05:00 Tidy up kcConDecls Addresses #25630 In particular, * Introduce ConArgKind and use it. * Make kcConDecls and tcConDecls work the same way concerning the kind of argument types - - - - - 6c12b6cf by Bryan Richter at 2025-01-07T18:15:02-05:00 Remove tmp files after toolchain check Fixes #25620 - - - - - 42826a89 by Cheng Shao at 2025-01-07T18:15:39-05:00 xxhash: bump to v0.8.3 - - - - - 185f17e4 by sheaf at 2025-01-07T18:16:15-05:00 Fix typo in GHC.Tc.Solver.Solve.runTcPluginsWanted - - - - - 23099752 by Luite Stegeman at 2025-01-08T00:33:33+01:00 Add flags for switching off speculative evaluation. We found that speculative evaluation can increase the amount of allocations in some circumstances. This patch adds new flags for selectively disabling speculative evaluation, allowing us to test the effect of the optimization. The new flags are: -fspec-eval globally enable speculative evaluation -fspec-eval-dictfun enable speculative evaluation for dictionary functions (no effect if speculative evaluation is globally disabled) The new flags are on by default for all optimisation levels. See #25284 - - - - - 0161badc by Ben Gamari at 2025-01-09T17:30:05-05:00 rts/printClosure: Print IPE information for thunks and functions This makes it considerably easier to grok the structure of the heap when IPE information is available. - - - - - 023f36f5 by Rodrigo Mesquita at 2025-01-10T14:57:48-05:00 user_guide: Note -pgmP/-optP are for /Haskell/-CPP Fixes #25574 - - - - - e1c133f2 by Ben Gamari at 2025-01-10T14:58:25-05:00 dump-decls: Suppress unit-ids While the testsuite driver already normalizes these away, they are nevertheless a severe nuisance when diffing outside of the testsuite. Intriguingly, this doesn't completely eliminate the unit IDs; some wired-in names are still printed. However, this is a cheap and helpful improvement over the status quo so I am simply going to accept this. Fixes #25334. - - - - - 2e7bf446 by sheaf at 2025-01-13T10:55:26+01:00 Remove SDocs from ErrCtxt & ErrInfo This commit: - turns the SDoc used in ErrCtxt into a proper error datatype, ErrCtxtMsg, which contains all the different error contexts that can be added, - replaces ErrInfo with [ErrCtxt]. ErrInfo used to contain two SDocs; the first is replaced with [ErrCtxt], and the second is removed, with the relevant information being put in the appropriate error message constructors. Fixes #23436 - - - - - 2d62b970 by Mike Pilgrem at 2025-01-13T12:59:10-05:00 Re CLC #300 - Specify fmap for NonEmpty as map See: * https://github.com/haskell/core-libraries-committee/issues/300 Seeks to: * move existing instances for NonEmpty (except of Eq and Ord) out of GHC.Internal.Base into new GHC.Internal.Data.NonEmpty (to avoid otherwise unavoidable cycles in the module graph); * move map out of Data.List.NonEmpty (base package) into GHC.Internal.Data.NonEmpty; * define fmap as map for NonEmpty instance of Functor, avoiding code duplication; * re-export map from existing GHC.Internal.Data.List.NonEmpty; and * re-export map from Data.List.NonEmpty (base package); without breaking anything in the GHC repository. Various tests *.stdout and *.stderr files are amended also. - - - - - ab3ab3e3 by Luite Stegeman at 2025-01-13T12:59:58-05:00 compiler/coreprep: Turn off dictionary speculation by default Speculative evaluation can cause performance regressions, therefore we turn it off by default. It can be enabled again with the -fspec-eval-dictfun flag See #25284 - - - - - 3d9cacd5 by Patrick at 2025-01-14T02:34:46+08:00 Enhance kind inference for data family instances This commit improves kind inference for data family instances by kind-checking the constructors, for H98 and newtype declarations (ONLY), as well as kind-checking the result kind signature (when using GADT syntax). This fixes #25611. Typechecker changes: In `tcDataFamInstHeader`, we now kind-check the constructors using `kcConDecls`, for H98-style decls and newtype decls ONLY. See Note [Kind inference for data family instances]. Testsuite changes: - The T25611{a,b,c,d} tests test the new kind inference implementation. - a,b: infer result kind from constructors (H98 case) - c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail, which now passes - d: GADT case, checking that we don't infer overly rigid kinds when kind-checking the constructors in data family instances. - DataInstanceKindsDefaults tests defaulting data instance kinds without UnliftedNewtypes or UnliftedDatatypes, as outlined in Note [Defaulting result kind of newtype/data family instance]. Also a few notes are updated to reflect the changes. Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones at gmail.com> - - - - - f6493dbc by amesgen at 2025-01-15T18:47:23-05:00 wasm: prevent bundlers from resolving import("node:timers") This fixes the following esbuild error: ✘ [ERROR] Could not resolve "node:timers" www/ghc_wasm_jsffi.js:66:25: 66 │ return (await import("node:timers")).setImmediate; ╵ ~~~~~~~~~~~~~ The package "node:timers" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "--platform=node" to do that, which will remove this error. Previously (i.e. after !13503), one had to work around this by passing `--external:node:timers`. - - - - - 87e82e2e by sheaf at 2025-01-16T14:51:45+01:00 Use checkTyEqRhs to make types concrete This commit refactors makeTypeConcrete to call checkTyEqRhs with the appropriate parameters. This avoids duplicating subtle logic in two places in the compiler. Changes: 1. Refactor of 'TyEqFlags'. Now 'TyEqFlags' stores a 'TEFTask', which is a description of which of the following checks we want to perform in 'checkTyEqRhs': - occurs check - level check - concreteness check In the process, the 'AreUnifying' datatype has been removed, as it is no longer needed. 2. Refactor of 'checkTyVar': a. Make use of the new 'TEFTask' data type to decide which checks to perform. In particular, this ensures that we perform **both** a concreteness check and a level check when both are required; previously we only did a concreteness check (that was a bug!). b. Recursively call 'checkTyVar' on the kind of unfilled metavariables. This deals with a bug in which we failed to uphold the invariant that the kind of a concrete type must itself be concrete. See test cases T23051, T23176. 3. Re-write of 'makeTypeConcrete', which now simply calls 'checkTyEqRhs' with appropriate 'TyEqFlags'/'TEFTask'. This gets rid of code duplication and risk for the two code paths going out-of-sync. Fixes #25616. See also #23883. - - - - - 5a8f35bd by ARATA Mizuki at 2025-01-17T11:17:49-05:00 x86 NCG: Use correct format for MOVD in the implementation of unpackInt64X2# MOVD takes the input format. Fixes #25658 - - - - - 14f8a7ec by Mateusz Goślinowski at 2025-01-17T22:49:09+00:00 Allow multiline strings in JS FFI (#25633) - - - - - 854c2f75 by Simon Peyton Jones at 2025-01-18T02:54:08-05:00 Fix a buglet in tcSplitForAllTyVarsReqTVBindersN The problem was that an equation in `split` had two guards (one about visiblity and one about `n_req`). So it fell thorugh if /either/ was False. But the next equation then assumed an invisible binder. Simple bug, easily fixed. Fixes #25661. - - - - - 264a1186 by sheaf at 2025-01-18T10:05:56+00:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - bf4f5ad3 by Jade at 2025-01-18T10:05:56+00:00 Add structured errors to GHCi (#23338) This patch creates the 'GhciCommandErrorMessage' data type which implents the 'Diagnostic' class and also provides error code for these error conditions. - - - - - b6f54188 by Ben Gamari at 2025-01-18T12:38:46-05:00 Revert "Division by constants optimization" This appears to be responsible for the regression described in #25653. This reverts commit daff1e30219d136977c71f42e82ccc58c9013cfb. - - - - - 0fd90de8 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Introduce div2 test This is a useful test from !8392 which is worth keeping around. - - - - - 32680979 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Test shift correctness in mul2 test - - - - - 163aa50a by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Add regression test for #25653 - - - - - 44778963 by Matthew Pickering at 2025-01-20T11:23:08+00:00 driver: Store an ExternalModuleGraph in the EPS We now store an ExternalModuleGraph in the EPS. When an new interface is loaded, the module graph is extended with a node for the loaded interface. The result is a partial module graph. If you want to run a transitive closure query on the graph you must first force the transitive closure to be loaded by using `loadExternalGraphBelow`. The primary advantage (for now) is that the transitive dependency calculation does not have to be repeated in getLinkDeps. If your module had many dependencies and many splices, performing this calculation at every splice site took a significant amount of time. We might also want to use this module graph in future for considering questions such as reachability of rules or accessibilty of instance imported by levelled imported. This patch removes another place in the compiler where transitive dependency is calculated in an ad-hoc manner. In general, the transitive dependency calculation should be cached and computed using a ModuleGraph abstraction. The transitive dependency query required by getLinkDeps operates on a graph without hs-boot nodes. If a linkable from a module in a loop is needed, then all modules in the loop are necessary to be available to execute that module. Therefore there is a query in `ModuleGraph` and `ExternalModuleGraph` which allows a transitive closure query to be performed on a graph without loops. Fixes #25634 ------------------------- Metric Decrease: MultiLayerModulesTH_Make MultiLayerModulesTH_OneShot Metric Increase: mhu-perf ------------------------- Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - b3c0acfc by Cheng Shao at 2025-01-20T11:53:10-05:00 hie: fix hie.yaml to use default hie-bios script !13778 accidentally changed hie.yaml to use hie-bios.bat as the default hie-bios script, which completely breaks hie support on non-Windows platforms. This patch reverts that change. - - - - - 595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. - - - - - 09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00 Fix :info pretty-printing of UNPACKed fields This patch: * Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int` as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the `:info` command. * Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one unpacks a newtype) from being printed in `:info` output unless `-dppr-debug` is enabled. Fixes #25651. - - - - - 6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00 driver: Store the HomePackageTable in a mutable reference This commit refactors the HomePackageTable and HomeUnitGraph: (1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511) (2) And it reworks these structures into their own modules to simplify the driver. The refactor is driven by the introduction of IO in the HPT interface, but is a bit more aggressive in simplifying the interfaces to enforce correct usage (ie to avoid performance pitfalls). Specifically: - The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph` - The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable` - The HPT now stores an `IORef` with the table of loaded home package modules. - The interface to the HPT now requires IO - The interface now enforces that the HPT is a datastructure that only grows - This is not enforced in the interface, but, clients of the HPT should never care about there being more or less entries in the HPT when these additional entries are not relevant to their result. - The exception to the invariant that the HPT is monotonically increasing is `restrictHpt`, a function which is called at a "barrier point" (during which there are no other threads inspecting or inserting in the HPT). The invariant can be temporarily broken at this point (currently, after upsweep). This is safe because a single thread holds control over the structure (thus the invariant being broken is never observed). The hug_var and associated structures in the driver, which aimed to improve memory usage in the driver by updating in place a HUG during upsweep, are no longer required as the HPT entries in the HUG are now themselves mutable by construction. This was previously explained in Note [ModuleNameSet, efficiency and space leaks], which is no longer relevant and was deleted. Fixes #25511 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> ------------------------- Metric Decrease: MultiComponentModulesRecomp MultiLayerModulesRecomp ------------------------- - - - - - f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 Fix build with gcc-15 which defaults to C23 standard (-std=gnu23) Fixes #25662 ``` utils/hp2ps/Utilities.c:6:14: error: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c:5:1: error: note: ‘malloc’ is declared in header ‘<stdlib.h>’ 4 | #include "Error.h" +++ |+#include <stdlib.h> 5 | | 5 | | ^ utils/hp2ps/Utilities.c: In function ‘xmalloc’: utils/hp2ps/Utilities.c:80:17: error: error: too many arguments to function ‘malloc’; expected 0, have 1 80 | r = (void*) malloc(n); | ^~~~~~ ~ | 80 | r = (void*) malloc(n); | ^ utils/hp2ps/Utilities.c:6:14: error: note: declared here 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c: In function ‘xrealloc’: utils/hp2ps/Utilities.c:92:18: error: warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:92:18: error: note: ‘realloc’ is declared in header ‘<stdlib.h>’ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:94:9: error: error: too many arguments to function ‘realloc’; expected 0, have 2 94 | r = realloc(p, n); | ^~~~~~~ ~ | 94 | r = realloc(p, n); | ^ utils/hp2ps/Utilities.c:92:18: error: note: declared here 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ ``` - - - - - 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 67fa7bc6 by Simon Peyton Jones at 2025-02-04T13:59:48+00:00 Make newtype instances opaque I think this will help with #23109 Wibbles Allow SelCo for newtype classes Experimental change Wibble Furher wibbles Further improvments Further wibbles esp exprIsConLike Run classop rule first Newtype classops are small needs comments - - - - - 2c414878 by Simon Peyton Jones at 2025-02-04T13:59:48+00:00 Wibble imports - - - - - ff8f989d by Simon Peyton Jones at 2025-02-04T14:04:00+00:00 Wibbles Notably: define and use mkNewTypeDictApp - - - - - 01c756b9 by Simon Peyton Jones at 2025-02-04T14:08:33+00:00 Make newtype-class data constructors not inline This variant tries * Making the data constructor for a newtype class not inline * exprIsConApp_maybe treats it like a normal data constructor * CoreToStg discards it (perhaps CorePrep should do that instead) * Some as-it-turns-out unforced changes to corePrepPgm that makes it pass all TyCons, not just the data tycons * Significantly simpler story in mkNewTypeDictApp - - - - - c07c14c4 by Simon Peyton Jones at 2025-02-04T14:48:04+00:00 Wibble - - - - - 750544c3 by Simon Peyton Jones at 2025-02-04T14:48:04+00:00 Get rid of newtype classes in CorePrep not CoreToStg - - - - - 35c8924c by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 Comment out bits that I think are no longer necessary * Extra field in ClassOpId, and classOpDictApp_maybe in Simplify.Iteration * Newtype classes being injective * Don't preInlineUnconditionally Dfuns * mkNewTypeDictApp * Zonking of unfoldings (only necessary for those local dfuns) - - - - - 26492f7f by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 Wibble - - - - - c90da8e0 by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 Allow pushDataCon on ClassTyCon newtypes The fact that there is no *actual* data constructor in the end i kind-of-irrelevant, and we turn out to get quite a lot of class-op (d |> co) where co : C t1 ~R C t2 - - - - - 6cba5b7b by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 Wibbles to merge - - - - - 701a6afc by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 Make newtype classes pretend to be injective - - - - - a56f5b45 by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 Make class datacons be have-no-unfolding Fixes the problem reported in #20689 @Mikolaj - - - - - b0505ad0 by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 wibble - - - - - ab2ddddd by Simon Peyton Jones at 2025-02-04T14:49:29+00:00 Don't make a closure table for type data decls - - - - - 16ac7b5b by Simon Peyton Jones at 2025-02-04T16:52:50+00:00 Make UanaryClass a new AlgTyConRhs work in progress, won't compile - - - - - 80465871 by Simon Peyton Jones at 2025-02-04T17:04:08+00:00 More wibbles - - - - - 48f87180 by Simon Peyton Jones at 2025-02-04T17:07:55+00:00 More wibbbles - - - - - 7f376016 by Simon Peyton Jones at 2025-02-04T17:08:41+00:00 More wibbles - - - - - 86453725 by Simon Peyton Jones at 2025-02-04T17:08:41+00:00 Unused bindings - - - - - 25b01561 by Simon Peyton Jones at 2025-02-04T17:08:41+00:00 Unused import - - - - - 92fe2248 by Simon Peyton Jones at 2025-02-04T17:08:41+00:00 Wibbles - - - - - 72996953 by Simon Peyton Jones at 2025-02-04T17:08:41+00:00 Wibbles - - - - - d2ca68e3 by Simon Peyton Jones at 2025-02-04T17:08:42+00:00 Wibble - - - - - 5046916a by Simon Peyton Jones at 2025-02-04T17:12:38+00:00 Wibbles Remove tyConAlgDataCons_maybe, and tyConSingleAlgDataCon_maybe Rename dontUnbox to canUnboxType (flippping sign) - - - - - 6a519494 by Simon Peyton Jones at 2025-02-04T17:37:16+00:00 Rebase wibbles - - - - - 11 changed files: - .ghcid - .gitattributes - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/flake.lock - .gitlab/generate-ci/gen_ci.hs - .gitlab/hello.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52bbd785f71adc33d50906e5e77b7a7e93066880...6a51949469f0853fae909617986a405fd1a28b62 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52bbd785f71adc33d50906e5e77b7a7e93066880...6a51949469f0853fae909617986a405fd1a28b62 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 17:40:06 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 04 Feb 2025 12:40:06 -0500 Subject: [Git][ghc/ghc][wip/T25647] 2 commits: Wibbles Message-ID: <67a250f618a26_348bf1cd5eb45465b@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: cd48e19b by Simon Peyton Jones at 2025-02-04T16:27:20+00:00 Wibbles - - - - - 22849523 by Simon Peyton Jones at 2025-02-04T17:39:30+00:00 Default tyvars in data/newtype insnstances This is what fixes #25647 - - - - - 4 changed files: - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - testsuite/tests/typecheck/should_compile/T25647.hs Changes: ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -860,8 +860,7 @@ rnDataFamInstDecl :: AssocTyFamInfo -> RnM (DataFamInstDecl GhcRn, FreeVars) rnDataFamInstDecl atfi (DataFamInstDecl { dfid_eqn = eqn@(FamEqn { feqn_tycon = tycon })}) - = do { (eqn', fvs) <- - rnFamEqn (TyDataCtx tycon) atfi eqn rnDataDefn + = do { (eqn', fvs) <- rnFamEqn (TyDataCtx tycon) atfi eqn rnDataDefn ; return (DataFamInstDecl { dfid_eqn = eqn' }, fvs) } -- Renaming of the associated types in instances. ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -1863,8 +1863,8 @@ kcConDecl new_or_data tc_res_kind -- because that's done in tcConDecl } -kcConDecl new_or_data tc_res_kind - -- ToDo: fix this comment NB: _tc_res_kind is unused. See (KCD3) in +kcConDecl new_or_data _tc_res_kind + -- NB: _tc_res_kind is unused. See (KCD3) in -- Note [kcConDecls: kind-checking data type decls] (ConDeclGADT { con_names = names, con_bndrs = L _ outer_bndrs , con_mb_cxt = cxt, con_g_args = args, con_res_ty = res_ty }) @@ -1876,9 +1876,10 @@ kcConDecl new_or_data tc_res_kind -- Why "_Tv"? See Note [Using TyVarTvs for kind-checking GADTs] do { _ <- tcHsContext cxt ; traceTc "kcConDecl:GADT {" (ppr names $$ ppr res_ty) - ; _ <- tcCheckLHsTypeInContext res_ty (TheKind tc_res_kind) + ; con_res_kind <- newOpenTypeKind + ; _ <- tcCheckLHsTypeInContext res_ty (TheKind con_res_kind) - ; let arg_exp_kind = getArgExpKind new_or_data tc_res_kind + ; let arg_exp_kind = getArgExpKind new_or_data con_res_kind -- getArgExpKind: for newtypes, check that the argument kind -- is the same the kind of `res_ty`, the data con's return type -- See (KCD2) in Note [kcConDecls: kind-checking data type decls] @@ -3752,30 +3753,30 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs res_kind tag_map ; return (NE.singleton dc) } -tcConDecl new_or_data dd_info rep_tycon tc_bndrs tc_res_kind tag_map - -- TODO: fix this comment NB: don't use res_kind here, as it's ill-scoped. Instead, +tcConDecl new_or_data dd_info rep_tycon tc_bndrs _tc_res_kind tag_map + -- NB: don't use _tc_res_kind here, as it's ill-scoped. Instead, -- we get the res_kind by typechecking the result type. (ConDeclGADT { con_names = names , con_bndrs = L _ outer_hs_bndrs , con_mb_cxt = cxt, con_g_args = hs_args , con_res_ty = hs_res_ty }) = addErrCtxt (DataConDefCtxt names) $ - do { traceTc "tcConDecl 1 gadt" (ppr names $$ ppr tc_res_kind) + do { traceTc "tcConDecl 1 gadt" (ppr names $$ ppr _tc_res_kind) ; let L _ name :| _ = names ; skol_info <- mkSkolemInfo (DataConSkol name) - ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts))) + ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind))) <- pushLevelAndSolveEqualitiesX "tcConDecl:GADT" $ tcOuterTKBndrs skol_info outer_hs_bndrs $ - do { ctxt <- tcHsContext cxt + do { ctxt <- tcHsContext cxt + + ; (res_ty, res_kind) <- tcInferLHsTypeKind hs_res_ty + -- See Note [GADT return kinds] -- See Note [Datatype return kinds] - ; let exp_kind = getArgExpKind new_or_data tc_res_kind + ; let exp_kind = getArgExpKind new_or_data res_kind ; btys <- tcConGADTArgs exp_kind hs_args - - ; res_ty <- tcCheckLHsType hs_res_ty tc_res_kind - -- See Note [GADT return kinds] - ; traceTc "tcConDecl 1a gadt" (ppr res_ty) + ; traceTc "tcConDecl 1a gadt" (ppr res_ty <+> dcolon <+> ppr res_kind) -- For data instances (only), ensure that the return type, -- res_ty, is a substitution instance of the header. @@ -3792,7 +3793,7 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs tc_res_kind tag_map ; let (arg_tys, stricts) = unzip btys ; field_lbls <- lookupConstructorFields name - ; return (ctxt, arg_tys, res_ty, field_lbls, stricts) + ; return (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind) } ; outer_bndrs <- scopedSortOuter outer_bndrs @@ -3806,7 +3807,7 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs tc_res_kind tag_map ; traceTc "tcConDecl:GADT" (vcat [ text "names:" <+> ppr names , text "tkvs:" <+> ppr tkvs , text "res_ty:" <+> ppr res_ty - , text "tc_res_kind" <+> ppr tc_res_kind ]) + , text "res_kind:" <+> ppr res_kind ]) ; reportUnsolvedEqualities skol_info tkvs tclvl wanted ; let tvbndrs = mkTyVarBinders InferredSpec tkvs ++ outer_tv_bndrs @@ -3828,14 +3829,6 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs tc_res_kind tag_map arg_tys' = substScaledTys arg_subst arg_tys res_ty' = substTy arg_subst res_ty - eq_preds' = pprTrace "eq_preds" - (vcat [ ppr names - , text "res_tmpl:" <+> ppr res_tmpl - , text "res_ty:" <+> ppr res_ty - , text "tc_res_kind:" <+> ppr tc_res_kind - , text "eq_preds:" <+> ppr eq_preds ]) $ - eq_preds - -- Can't print univ_tvs, arg_tys etc, because we are inside the knot here ; traceTc "tcConDecl 2" (ppr names $$ ppr field_lbls) ; fam_envs <- tcGetFamInstEnvs @@ -3848,7 +3841,7 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs tc_res_kind tag_map ; let bang_opts = SrcBangOpts (initBangOpts dflags) ; buildDataCon fam_envs bang_opts name is_infix rep_nm stricts field_lbls - univ_tvs ex_tvs tvbndrs' eq_preds' + univ_tvs ex_tvs tvbndrs' eq_preds ctxt' arg_tys' res_ty' rep_tycon tag_map -- NB: we put data_tc, the type constructor gotten from the -- constructor type signature into the data constructor; ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -975,7 +975,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] ===================================== testsuite/tests/typecheck/should_compile/T25647.hs ===================================== @@ -18,25 +18,33 @@ newtype Fix1b f where -- A plain newtype, GADT syntax, with a return kind signature -- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r -newtype Fix2 f :: TYPE r where - In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff +-- Rejected because of deafulting; maybe that's OK +-- newtype Fix2 f :: TYPE r where +-- In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff -- Plain newtype, H98 syntax, standalone kind signature --- Should get In3 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f ---type Fix3 :: forall r k. (k -> TYPE r) -> k ---newtype Fix3 f = In3 (f (Fix3 f)) +-- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f +type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix3 f = In3 (f (Fix3 f)) + +-- This variant produces a /terrible/ message +-- type Fix3a :: forall r k. (TYPE r -> TYPE r) -> TYPE r +-- newtype Fix3a f = In3a (f (Fix3 f)) -{- -- Plain newtype, H98 syntax, standalone kind signature -- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f -type Fix4 :: forall r k. (k -> TYPE r) -> k +type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r newtype Fix4 f where - In4 :: forall rr kk (ff :: kk -> TYPE rr). - ff (Fix4 ff) -> Fix4 @rr @kk ff --} + In4 :: forall rr (ff :: TYPE rr -> TYPE rr). + ff (Fix4 ff) -> Fix4 @rr ff + +-- Rejected because of defulting; maybe that's OK +--type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r +--newtype Fix4a f where +-- In4a :: ff (Fix4a ff) -> Fix4a ff + -------------------- Data families with newtype instance ----------------- -{- -- data instance in GADT sytntax data family Dix1 :: (k -> Type) -> k data instance Dix1 f where @@ -47,17 +55,25 @@ data family Dix2 :: (k -> Type) -> k newtype instance Dix2 f where DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + -- newtype instance in H98 syntax data family Dix3 :: (k -> Type) -> k newtype instance Dix3 f = DIn3 (f (Dix3 f)) -- newtype instance in GADT syntax +-- Rejected because of defaulting data family Dix4 :: (k -> TYPE r) -> k newtype instance Dix4 f where DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff +--data family Dix4a :: (k -> TYPE r) -> k +--newtype instance forall r f. Dix4a f :: TYPE r where +-- DIn4a :: forall r (ff :: TYPE r -> TYPE r). ff (Dix4a ff) -> Dix4a ff + -- newtype instance in H98 syntax data family Dix5 :: (k -> TYPE r) -> k newtype instance Dix5 f = DIn5 (f (Dix5 f)) --} View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e605c5eed28d41163d210935dc36d9b75ff2f790...2284952331e54f87314c63cf449a80dc9f68db6c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e605c5eed28d41163d210935dc36d9b75ff2f790...2284952331e54f87314c63cf449a80dc9f68db6c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 17:44:36 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 04 Feb 2025 12:44:36 -0500 Subject: [Git][ghc/ghc][wip/T23109] More rebase wibbles Message-ID: <67a25204bd004_348bf21c963c548a0@gitlab.mail> Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: b2d27a75 by Simon Peyton Jones at 2025-02-04T17:44:16+00:00 More rebase wibbles - - - - - 3 changed files: - compiler/GHC/Core/Lint.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Tc/Instance/Class.hs Changes: ===================================== compiler/GHC/Core/Lint.hs ===================================== @@ -2599,8 +2599,7 @@ lintCoercion the_co@(SelCo cs co) -> failWithL $ hang (text "Bad SelCo:") 2 $ vcat [ text "the_co:" <+> ppr the_co , text "lhs type:" <+> ppr s - , text "rhs type:" <+> ppr t - , text "role:" <+> ppr co_role ] } + , text "rhs type:" <+> ppr t ] } lintCoercion the_co@(LRCo _lr co) = do { lintCoercion co ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -40,7 +40,7 @@ import GHC.Core.Coercion import GHC.Core.TyCon import GHC.Core.Class( classTyCon ) import GHC.Core.DataCon -import GHC.Core.TyCo.Rep( UnivCoProvenance(..), scaledThing ) +import GHC.Core.TyCo.Rep( scaledThing ) import GHC.Core.Opt.OccurAnal import GHC.Data.Maybe @@ -1349,9 +1349,9 @@ isUnaryClassApp v args where -- mk_co makes a coercion of kind (C ta tb tc ~ ty[t1/a,tb/b,tc/c]) mk_co tycon ty_args + | [meth_ty] <- dataConInstArgTys (tyConSingleDataCon tycon) ty_args = mkUnaryClassCo (mkTyConApp tycon ty_args) (scaledThing meth_ty) - where - [meth_ty] = dataConInstArgTys (tyConSingleDataCon tycon) ty_args + | otherwise = pprPanic "isUnaryClassApp" (ppr args $$ ppr tycon $$ ppr ty_args) getUnaryClassPayload :: TyCon -> [ArgInfo] -> Maybe (CoreExpr, [Type], [ArgInfo]) getUnaryClassPayload tc args ===================================== compiler/GHC/Tc/Instance/Class.hs ===================================== @@ -21,7 +21,7 @@ import GHC.Tc.Utils.TcMType import GHC.Tc.Types.Evidence import GHC.Tc.Types.CtLoc import GHC.Tc.Types.Origin ( InstanceWhat (..), SafeOverlapping, CtOrigin(GetFieldOrigin) ) -import GHC.Tc.Instance.Family( tcGetFamInstEnvs, tcInstNewTyCon_maybe, tcLookupDataFamInst, FamInstEnvs ) +import GHC.Tc.Instance.Family( tcGetFamInstEnvs, tcLookupDataFamInst, FamInstEnvs ) import GHC.Rename.Env( addUsedGRE, addUsedDataCons, DeprecationWarnings (..) ) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2d27a75e6f4d94e0ee2c6cd259efbc349e335ee -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2d27a75e6f4d94e0ee2c6cd259efbc349e335ee You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 19:14:53 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 04 Feb 2025 14:14:53 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: gitlab-ci: Don't use .full-ci to run test-primops Message-ID: <67a2672cea8e2_348bf34aeb1c65443@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - a68c1176 by Ben Gamari at 2025-02-04T14:14:40-05:00 CorePrep: Name `sat` binders more descriptively - - - - - c2b672bb by Ben Gamari at 2025-02-04T14:14:41-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 7db1988e by Cheng Shao at 2025-02-04T14:14:42-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - 11 changed files: - .gitlab-ci.yml - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/CoreToStg/Prep.hs - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -909,7 +909,10 @@ test-primops-label: extends: .test-primops-validate-template rules: - if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/' - - *full-ci + # We do not use *.full-ci here since that would imply running in nightly + # where we do not have the normal validate jobs. We have the -nightly job + # below to handle this case. + - if: '$CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/' test-primops-nightly: extends: .test-primops ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -168,15 +167,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -59,7 +59,8 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Id.Make ( realWorldPrimId ) import GHC.Types.Basic -import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName ) +import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName, OccName ) +import GHC.Types.Name.Occurrence (occNameString) import GHC.Types.SrcLoc ( SrcSpan(..), realSrcLocSpan, mkRealSrcLoc ) import GHC.Types.Literal import GHC.Types.Tickish @@ -70,6 +71,7 @@ import qualified Data.ByteString.Builder as BB import Data.ByteString.Builder.Prim import Control.Monad +import Data.List (intercalate) {- Note [CorePrep Overview] @@ -247,11 +249,11 @@ corePrepPgm logger cp_cfg pgm_cfg withTiming logger (text "CorePrep"<+>brackets (ppr this_mod)) (\a -> a `seqList` ()) $ do - us <- mkSplitUniqSupply 's' let initialCorePrepEnv = mkInitialCorePrepEnv cp_cfg - let - implicit_binds = mkDataConWorkers + us <- mkSplitUniqSupply 's' + + let implicit_binds = mkDataConWorkers (cpPgm_generateDebugInfo pgm_cfg) mod_loc data_tycons -- NB: we must feed mkImplicitBinds through corePrep too @@ -711,13 +713,13 @@ cpePair :: TopLevelFlag -> RecFlag -> Demand -> Levity -> UniqSM (Floats, CpeRhs) -- Used for all bindings -- The binder is already cloned, hence an OutId -cpePair top_lvl is_rec dmd lev env bndr rhs +cpePair top_lvl is_rec dmd lev env0 bndr rhs = assert (not (isJoinId bndr)) $ -- those should use cpeJoinPair do { (floats1, rhs1) <- cpeRhsE env rhs -- See if we are allowed to float this stuff out of the RHS ; let dec = want_float_from_rhs floats1 rhs1 - ; (floats2, rhs2) <- executeFloatDecision dec floats1 rhs1 + ; (floats2, rhs2) <- executeFloatDecision env dec floats1 rhs1 -- Make the arity match up ; (floats3, rhs3) @@ -725,7 +727,7 @@ cpePair top_lvl is_rec dmd lev env bndr rhs then return (floats2, cpeEtaExpand arity rhs2) else warnPprTrace True "CorePrep: silly extra arguments:" (ppr bndr) $ -- Note [Silly extra arguments] - (do { v <- newVar (idType bndr) + (do { v <- newVar env (idType bndr) ; let (float, v') = mkNonRecFloat env Lifted v rhs2 ; return ( snocFloat floats2 float , cpeEtaExpand arity (Var v')) }) @@ -735,6 +737,8 @@ cpePair top_lvl is_rec dmd lev env bndr rhs ; return (floats4, rhs4) } where + env = pushBinderContext bndr env0 + arity = idArity bndr -- We must match this arity want_float_from_rhs floats rhs @@ -967,36 +971,36 @@ cpeBodyNF env expr cpeBody :: CorePrepEnv -> CoreExpr -> UniqSM (Floats, CpeBody) cpeBody env expr = do { (floats1, rhs) <- cpeRhsE env expr - ; (floats2, body) <- rhsToBody rhs + ; (floats2, body) <- rhsToBody env rhs ; return (floats1 `appFloats` floats2, body) } -------- -rhsToBody :: CpeRhs -> UniqSM (Floats, CpeBody) +rhsToBody :: CorePrepEnv -> CpeRhs -> UniqSM (Floats, CpeBody) -- Remove top level lambdas by let-binding -rhsToBody (Tick t expr) +rhsToBody env (Tick t expr) | tickishScoped t == NoScope -- only float out of non-scoped annotations - = do { (floats, expr') <- rhsToBody expr + = do { (floats, expr') <- rhsToBody env expr ; return (floats, mkTick t expr') } -rhsToBody (Cast e co) +rhsToBody env (Cast e co) -- You can get things like -- case e of { p -> coerce t (\s -> ...) } - = do { (floats, e') <- rhsToBody e + = do { (floats, e') <- rhsToBody env e ; return (floats, Cast e' co) } -rhsToBody expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] +rhsToBody env expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] | all isTyVar bndrs -- Type lambdas are ok = return (emptyFloats, expr) | otherwise -- Some value lambdas = do { let rhs = cpeEtaExpand (exprArity expr) expr - ; fn <- newVar (exprType rhs) + ; fn <- newVar env (exprType rhs) ; let float = Float (NonRec fn rhs) LetBound TopLvlFloatable ; return (unitFloat float, Var fn) } where (bndrs,_) = collectBinders expr -rhsToBody expr = return (emptyFloats, expr) +rhsToBody _env expr = return (emptyFloats, expr) {- Note [No eta reduction needed in rhsToBody] @@ -1168,7 +1172,7 @@ cpeApp top_env expr -- allocating CaseBound Floats for token and thing as needed = do { (floats1, token) <- cpeArg env topDmd token ; (floats2, thing) <- cpeBody env thing - ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar ty + ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar env ty ; let tup = mkCoreUnboxedTuple [token, Var case_bndr] ; let float = mkCaseFloat case_bndr thing ; return (floats1 `appFloats` floats2 `snocFloat` float, tup) } @@ -1577,7 +1581,7 @@ cpeArg env dmd arg ; let arg_ty = exprType arg1 lev = typeLevity arg_ty dec = wantFloatLocal NonRecursive dmd lev floats1 arg1 - ; (floats2, arg2) <- executeFloatDecision dec floats1 arg1 + ; (floats2, arg2) <- executeFloatDecision env dec floats1 arg1 -- Else case: arg1 might have lambdas, and we can't -- put them inside a wrapBinds @@ -1586,7 +1590,7 @@ cpeArg env dmd arg -- see Note [ANF-ising literal string arguments] ; if exprIsTrivial arg2 then return (floats2, arg2) - else do { v <- (`setIdDemandInfo` dmd) <$> newVar arg_ty + else do { v <- (`setIdDemandInfo` dmd) <$> newVar env arg_ty -- See Note [Pin demand info on floats] ; let arity = cpeArgArity env dec floats1 arg2 arg3 = cpeEtaExpand arity arg2 @@ -2424,13 +2428,13 @@ instance Outputable FloatDecision where ppr FloatNone = text "none" ppr FloatAll = text "all" -executeFloatDecision :: FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) -executeFloatDecision dec floats rhs +executeFloatDecision :: CorePrepEnv -> FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) +executeFloatDecision env dec floats rhs = case dec of FloatAll -> return (floats, rhs) FloatNone | isEmptyFloats floats -> return (emptyFloats, rhs) - | otherwise -> do { (floats', body) <- rhsToBody rhs + | otherwise -> do { (floats', body) <- rhsToBody env rhs ; return (emptyFloats, wrapBinds floats $ wrapBinds floats' body) } -- FloatNone case: `rhs` might have lambdas, and we can't @@ -2569,6 +2573,8 @@ data CorePrepEnv , cpe_subst :: Subst -- ^ See Note [CorePrepEnv: cpe_subst] , cpe_rec_ids :: UnVarSet -- Faster OutIdSet; See Note [Speculative evaluation] + + , cpe_context :: [OccName] -- ^ See Note [Binder context] } mkInitialCorePrepEnv :: CorePrepConfig -> CorePrepEnv @@ -2576,6 +2582,7 @@ mkInitialCorePrepEnv cfg = CPE { cpe_config = cfg , cpe_subst = emptySubst , cpe_rec_ids = emptyUnVarSet + , cpe_context = [] } extendCorePrepEnv :: CorePrepEnv -> Id -> Id -> CorePrepEnv @@ -2616,6 +2623,14 @@ cpSubstCo :: CorePrepEnv -> Coercion -> Coercion cpSubstCo (CPE { cpe_subst = subst }) co = substCo subst co -- substCo has a short-cut if the TCvSubst is empty +-- | See Note [Binder context] +pushBinderContext :: Id -> CorePrepEnv -> CorePrepEnv +pushBinderContext ident env + | lengthAtLeast (cpe_context env) 2 + = env + | otherwise + = env { cpe_context = getOccName ident : cpe_context env} + ------------------------------------------------------------------------------ -- Cloning binders -- --------------------------------------------------------------------------- @@ -2704,10 +2719,20 @@ fiddleCCall id -- Generating new binders -- --------------------------------------------------------------------------- -newVar :: Type -> UniqSM Id -newVar ty - = seqType ty `seq` mkSysLocalOrCoVarM (fsLit "sat") ManyTy ty - +newVar :: CorePrepEnv -> Type -> UniqSM Id +newVar env ty + -- See Note [Binder context] + = seqType ty `seq` mkSysLocalOrCoVarM (fsLit occ) ManyTy ty + where occ = intercalate "_" (map occNameString $ cpe_context env) ++ "_sat" + +{- Note [Binder context] + ~~~~~~~~~~~~~~~~~~~~~ + To ensure that the compiled program (specifically symbol names) + remains understandable to the user we maintain a context + of binders that we are currently under. This allows us to give + identifiers conjured during CorePrep more contextually-meaningful + names. This is done in `newVar`. + -} ------------------------------------------------------------------------------ -- Floating ticks ===================================== testsuite/tests/core-to-stg/T14895.stderr ===================================== @@ -11,10 +11,10 @@ T14895.go GHC.Internal.Data.Either.Left e [Occ=Once1] -> wild; GHC.Internal.Data.Either.Right a1 [Occ=Once1] -> let { - sat [Occ=Once1] :: b + go_sat [Occ=Once1] :: b [LclId] = {a1, f} \u [] f a1; - } in GHC.Internal.Data.Either.Right [sat]; + } in GHC.Internal.Data.Either.Right [go_sat]; }; ===================================== testsuite/tests/core-to-stg/T24124.stderr ===================================== @@ -9,16 +9,16 @@ T24124.testFun1 T24124.StrictPair a b #) [GblId, Arity=3, Str=, Cpr=1, Unf=OtherCon []] = {} \r [x y void] - case x of sat { + case x of testFun1_sat { __DEFAULT -> case case y of y [OS=OneShot] { - __DEFAULT -> T24124.MkStrictPair [sat y]; + __DEFAULT -> T24124.MkStrictPair [testFun1_sat y]; } of - sat + testFun1_sat { - __DEFAULT -> GHC.Internal.Types.MkSolo# [sat]; + __DEFAULT -> GHC.Internal.Types.MkSolo# [testFun1_sat]; }; }; ===================================== testsuite/tests/ghci/should_run/T21052.stdout ===================================== @@ -4,9 +4,9 @@ BCO_toplevel :: GHC.Internal.Types.IO [GHC.Internal.Types.Any] [LclIdX] = {} \u [] let { - sat :: [GHC.Internal.Types.Any] + _sat :: [GHC.Internal.Types.Any] [LclId, Unf=OtherCon []] = :! [GHC.Internal.Tuple.() GHC.Internal.Types.[]]; - } in GHC.Internal.Base.returnIO sat; + } in GHC.Internal.Base.returnIO _sat; ===================================== testsuite/tests/simplCore/should_compile/T20040.stderr ===================================== @@ -16,7 +16,9 @@ ifoldl' = Cons ipv2 ipv3 -> case z of z1 { __DEFAULT -> - case f z1 ipv2 of sat { __DEFAULT -> ifoldl' f sat ipv3; }; + case f z1 ipv2 of ifoldl'_sat { + __DEFAULT -> ifoldl' f ifoldl'_sat ipv3; + }; }; }; end Rec } ===================================== testsuite/tests/simplCore/should_compile/T23083.stderr ===================================== @@ -13,10 +13,10 @@ T23083.g :: ((GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer T23083.g = \ (f [Occ=Once1!] :: (GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> GHC.Internal.Bignum.Integer.Integer) (h [Occ=OnceL1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> let { - sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer + g_sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer [LclId, Unf=OtherCon []] - sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in - f sat + g_sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in + f g_sat -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T23083.$trModule4 :: GHC.Prim.Addr# ===================================== testsuite/tests/simplStg/should_compile/T15226b.stderr ===================================== @@ -8,13 +8,13 @@ T15226b.bar1 T15226b.Str (GHC.Internal.Maybe.Maybe a) #) [GblId, Arity=2, Str=, Cpr=1(, 1), Unf=OtherCon []] = {} \r [x void] - case x of sat { + case x of bar1_sat { __DEFAULT -> let { - sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) + bar1_sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) [LclId, Unf=OtherCon []] = - T15226b.Str! [sat]; - } in GHC.Internal.Types.MkSolo# [sat]; + T15226b.Str! [bar1_sat]; + } in GHC.Internal.Types.MkSolo# [bar1_sat]; }; T15226b.bar ===================================== testsuite/tests/simplStg/should_compile/T19717.stderr ===================================== @@ -6,14 +6,14 @@ Foo.f :: forall {a}. a -> [GHC.Internal.Maybe.Maybe a] case x of x1 { __DEFAULT -> let { - sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a + f_sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a [LclId, Unf=OtherCon []] = GHC.Internal.Maybe.Just! [x1]; } in let { - sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] + f_sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] [LclId, Unf=OtherCon []] = - :! [sat GHC.Internal.Types.[]]; - } in : [sat sat]; + :! [f_sat GHC.Internal.Types.[]]; + } in : [f_sat f_sat]; }; ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f798e2cb027e73a318574899345fa6d8c59b13d...7db1988edb0a4de3b951ed76bdf255c6a97de91f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f798e2cb027e73a318574899345fa6d8c59b13d...7db1988edb0a4de3b951ed76bdf255c6a97de91f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 20:32:41 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Tue, 04 Feb 2025 15:32:41 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] 39 commits: compiler: Always load GHC.Data.FastString optimised into GHCi Message-ID: <67a27969c66e4_348bf3c0a3e874592@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 834be4fb by Alan Zimmerman at 2025-02-04T18:02:19+00:00 GHC-CPP: first rough proof of concept Processes #define FOO #ifdef FOO x = 1 #endif Into [ITcppIgnored [L loc ITcppDefine] ,ITcppIgnored [L loc ITcppIfdef] ,ITvarid "x" ,ITequal ,ITinteger (IL {il_text = SourceText "1", il_neg = False, il_value = 1}) ,ITcppIgnored [L loc ITcppEndif] ,ITeof] In time, ITcppIgnored will be pushed into a comment - - - - - 37d979cf by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Tidy up before re-visiting the continuation mechanic - - - - - 54d9f567 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Switch preprocessor to continuation passing style Proof of concept, needs tidying up - - - - - c9ae16e7 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Small cleanup - - - - - e3383562 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Get rid of some cruft - - - - - ad0b64f3 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Starting to integrate. Need to get the pragma recognised and set - - - - - dbef56e3 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Make cppTokens extend to end of line, and process CPP comments - - - - - aaaed484 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Remove unused ITcppDefined - - - - - a39b4968 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Allow spaces between # and keyword for preprocessor directive - - - - - 261b9356 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Process CPP continuation lines They are emited as separate ITcppContinue tokens. Perhaps the processing should be more like a comment, and keep on going to the end. BUT, the last line needs to be slurped as a whole. - - - - - 96347cd5 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Accumulate CPP continuations, process when ready Can be simplified further, we only need one CPP token - - - - - 31511b10 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Simplify Lexer interface. Only ITcpp We transfer directive lines through it, then parse them from scratch in the preprocessor. - - - - - b70d94ee by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Deal with directive on last line, with no trailing \n - - - - - b9d2983e by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Start parsing and processing the directives - - - - - e7cd410f by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Prepare for processing include files - - - - - c48dd8ca by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Move PpState into PreProcess And initParserState, initPragState too - - - - - 322d9fc8 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Process nested include files Also move PpState out of Lexer.x, so it is easy to evolve it in a ghci session, loading utils/check-cpp/Main.hs - - - - - 88718e97 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Split into separate files - - - - - 69ce6e37 by Alan Zimmerman at 2025-02-04T18:02:19+00:00 Starting on expression parser. But it hangs. Time for Text.Parsec.Expr - - - - - f9d4ab39 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Start integrating the ghc-cpp work >From https://github.com/alanz/ghc-cpp - - - - - 09ef6968 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 WIP - - - - - 2fe0f7d6 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Fixup after rebase - - - - - c5edd836 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 WIP - - - - - 4a41bf78 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Fixup after rebase, including all tests pass - - - - - b1609a07 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Change pragma usage to GHC_CPP from GhcCPP - - - - - f868d034 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Some comments - - - - - 309947ff by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Reformat - - - - - c37309f0 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Delete unused file - - - - - b1c6a4d1 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Rename module Parse to ParsePP - - - - - 8bd4c2e5 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Clarify naming in the parser - - - - - b143f90b by Alan Zimmerman at 2025-02-04T18:02:20+00:00 WIP. Switching to alex/happy to be able to work in-tree Since Parsec is not available - - - - - c4490836 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 Layering is now correct - GHC lexer, emits CPP tokens - accumulated in Preprocessor state - Lexed by CPP lexer, CPP command extracted, tokens concated with spaces (to get rid of token pasting via comments) - if directive lexed and parsed by CPP lexer/parser, and evaluated - - - - - 0056a0d8 by Alan Zimmerman at 2025-02-04T18:02:20+00:00 First example working Loading Example1.hs into ghci, getting the right results ``` {-# LANGUAGE GHC_CPP #-} module Example1 where y = 3 x = "hello" "bye now" foo = putStrLn x ``` - - - - - a7efc058 by Alan Zimmerman at 2025-02-04T20:32:03+00:00 Rebase, and all tests pass except whitespace for generated parser - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Parser/Monad.hs - compiler/GHC/Data/FastString.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Parser.hs-boot - compiler/GHC/Parser.y - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/HaddockLex.x - compiler/GHC/Parser/Header.hs - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - + compiler/GHC/Parser/PreProcess.hs - + compiler/GHC/Parser/PreProcess/Eval.hs - + compiler/GHC/Parser/PreProcess/Lexer.x - + compiler/GHC/Parser/PreProcess/Macro.hs - + compiler/GHC/Parser/PreProcess/ParsePP.hs - + compiler/GHC/Parser/PreProcess/Parser.y - + compiler/GHC/Parser/PreProcess/ParserM.hs - + compiler/GHC/Parser/PreProcess/Types.hs - compiler/GHC/Parser/Utils.hs - compiler/GHC/StgToByteCode.hs - compiler/ghc.cabal.in The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/237548092a8cedcc244412f1bf10a6a08f982de1...a7efc05837c7f679c0e67108d5dae368f7a81255 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/237548092a8cedcc244412f1bf10a6a08f982de1...a7efc05837c7f679c0e67108d5dae368f7a81255 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 22:50:29 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 04 Feb 2025 17:50:29 -0500 Subject: [Git][ghc/ghc][wip/T23109] Yet more rebase wibbles Message-ID: <67a299b562968_348bf59fb1f4783c8@gitlab.mail> Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: 2a5950e8 by Simon Peyton Jones at 2025-02-04T22:49:49+00:00 Yet more rebase wibbles - - - - - 3 changed files: - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Types/Evidence.hs Changes: ===================================== compiler/GHC/Tc/Solver/Default.hs ===================================== @@ -400,7 +400,7 @@ defaultExceptionContext ct = do { warnTcS $ TcRnDefaultedExceptionContext (ctLoc ct) ; empty_ec_id <- lookupId emptyExceptionContextName ; let ev = ctEvidence ct - ev_tm = mkEvCast (Var empty_ec_id) (wrapIP (ctEvPred ev)) + ev_tm = EvExpr (evWrapIP (ctEvPred ev) (Var empty_ec_id)) ; setEvBindIfWanted ev EvCanonical ev_tm -- EvCanonical: see Note [CallStack and ExecptionContext hack] -- in GHC.Tc.Solver.Dict ===================================== compiler/GHC/Tc/Solver/Dict.hs ===================================== @@ -2,7 +2,7 @@ -- | Solving Class constraints CDictCan module GHC.Tc.Solver.Dict ( - solveDict, solveDictNC, + solveDict, solveDictNC, solveCallStack, checkInstanceOK, matchLocalInst, chooseInstance, makeSuperClasses, mkStrictSuperClasses, @@ -41,8 +41,9 @@ import GHC.Types.Var import GHC.Types.Id( mkTemplateLocals ) import GHC.Types.Var.Set import GHC.Types.Var.Env +import GHC.Types.SrcLoc -import GHC.Builtin.Names( srcLocDataConName, pushCallStackName ) +import GHC.Builtin.Names( srcLocDataConName, pushCallStackName, emptyCallStackName ) import GHC.Utils.Monad ( concatMapM, foldlM ) import GHC.Utils.Outputable @@ -52,7 +53,6 @@ import GHC.Utils.Misc import GHC.Unit.Module import GHC.Data.Bag -import GHC.Data.FastString( FastString ) import GHC.Driver.DynFlags @@ -141,16 +141,32 @@ canDictCt ev cls tys -- doNotExpand: We have already expanded superclasses for /this/ dict -- so set the fuel to doNotExpand to avoid repeating expansion - | isWanted ev + | CtWanted { ctev_rewriters = rewriters } <- ev , Just ip_name <- isCallStackPred cls tys - , isPushCallStackOrigin (ctEvOrigin ev) + , isPushCallStackOrigin orig -- If we're given a CallStack constraint that arose from a function -- call, we need to push the current call-site onto the stack instead -- of solving it directly from a given. -- See Note [Overview of implicit CallStacks] in GHC.Tc.Types.Evidence -- and Note [Solving CallStack constraints] in GHC.Tc.Solver.Types = Stage $ - do { new_ev <- solveCallStack ip_name ev + do { -- First we emit a new constraint that will capture the + -- given CallStack. + + let new_loc = setCtLocOrigin loc (IPOccOrigin (HsIPName ip_name)) + -- We change the origin to IPOccOrigin so + -- this rule does not fire again. + -- See Note [Overview of implicit CallStacks] + -- in GHC.Tc.Types.Evidence + + ; new_ev <- newWantedEvVarNC new_loc rewriters pred + + -- Then we solve the wanted by pushing the call-site + -- onto the newly emitted CallStack + ; let ev_cs = EvCsPushCall (callStackOriginFS orig) + (ctLocSpan loc) (ctEvExpr new_ev) + ; solveCallStack ev ev_cs + ; continueWith (DictCt { di_ev = new_ev, di_cls = cls , di_tys = tys, di_pend_sc = doNotExpand }) } -- doNotExpand: No superclasses for class CallStack @@ -165,6 +181,10 @@ canDictCt ev cls tys ; continueWith (DictCt { di_ev = ev, di_cls = cls , di_tys = tys, di_pend_sc = fuel }) } + where + loc = ctEvLoc ev + orig = ctLocOrigin loc + pred = ctEvPred ev {- ********************************************************************* * * @@ -172,67 +192,49 @@ canDictCt ev cls tys * * ********************************************************************* -} -solveCallStack :: FastString -> CtEvidence -> TcS CtEvidence --- See Note [Overview of implicit CallStacks] in GHC.Tc.Types.Evidence -solveCallStack ip_name ev@(CtWanted { ctev_rewriters = rewriters }) - -- We're given ev_cs :: CallStack, but the evidence term should be a - -- dictionary, so we have to coerce ev_cs to a dictionary for - -- `IP ip CallStack`. See Note [Overview of implicit CallStacks] - = do { df <- getDynFlags - - ; -- First we emit a new constraint that will capture the - -- given CallStack. - let new_loc = setCtLocOrigin loc (IPOccOrigin (HsIPName ip_name)) - -- We change the origin to IPOccOrigin so - -- this rule does not fire again. - -- See Note [Overview of implicit CallStacks] - -- in GHC.Tc.Types.Evidence - - ; outer_ev <- newWantedEvVarNC new_loc rewriters pred - - -- Then we solve the wanted by pushing the call-site - -- onto the newly emitted CallStack - ; let fs = callStackOriginFS orig - span = ctLocSpan loc - platform = targetPlatform df - ; m <- getModule - ; srcLocDataCon <- lookupDataCon srcLocDataConName - ; push_cs_id <- lookupId pushCallStackName - ; name_expr <- mkStringExprFS fs - ; loc_expr <- mkCoreConApps srcLocDataCon <$> - sequence [ mkStringExprFS (unitFS $ moduleUnit m) - , mkStringExprFS (moduleNameFS $ moduleName m) - , mkStringExprFS (srcSpanFile span) - , return $ mkIntExprInt platform (srcSpanStartLine span) - , return $ mkIntExprInt platform (srcSpanStartCol span) - , return $ mkIntExprInt platform (srcSpanEndLine span) - , return $ mkIntExprInt platform (srcSpanEndCol span) ] - - -- At this point outer_ev :: IP sym CallStack - -- but we need the actual CallStack to pass to - -- pushCallStack :: (String,SrcLoc) -> CallStack -> CallStack - -- See Note [Overview of implicit CallStacks] - ; let outer_stk, inner_stk :: EvExpr -- Both of type CallStack - outer_stk = evUnwrapIP pred (ctEvExpr outer_ev) - inner_stk = mkCoreApps (Var push_cs_id) [mkCoreTup [name_expr, loc_expr], outer_stk] - - ; setEvBindIfWanted ev True (EvExpr (evWrapIP pred inner_stk)) - ; return outer_ev } - where - loc = ctEvLoc ev - orig = ctLocOrigin loc - pred = ctEvPred ev - solveCallStack :: CtEvidence -> EvCallStack -> TcS () -- Also called from GHC.Tc.Solver when defaulting call stacks solveCallStack ev ev_cs -- We're given ev_cs :: CallStack, but the evidence term should be a -- dictionary, so we have to coerce ev_cs to a dictionary for -- `IP ip CallStack`. See Note [Overview of implicit CallStacks] - = do { cs_tm <- evCallStack ev_cs - ; let ev_tm = mkEvCast cs_tm (wrapIP (ctEvPred ev)) + = do { inner_stk <- evCallStack pred ev_cs + ; let ev_tm = EvExpr (evWrapIP pred inner_stk) ; setEvBindIfWanted ev EvCanonical ev_tm } -- EvCanonical: see Note [CallStack and ExecptionContext hack] + where + pred = ctEvPred ev + +-- Dictionary for CallStack implicit parameters +evCallStack :: TcPredType -> EvCallStack -> TcS EvExpr +-- See Note [Overview of implicit CallStacks] in GHC.Tc.Types.Evidence +evCallStack _ EvCsEmpty + = Var <$> lookupId emptyCallStackName +evCallStack pred (EvCsPushCall fs loc tm) + = do { df <- getDynFlags + ; m <- getModule + ; srcLocDataCon <- lookupDataCon srcLocDataConName + ; let platform = targetPlatform df + mkSrcLoc l = mkCoreConWrapApps srcLocDataCon <$> + sequence [ mkStringExprFS (unitFS $ moduleUnit m) + , mkStringExprFS (moduleNameFS $ moduleName m) + , mkStringExprFS (srcSpanFile l) + , return $ mkIntExprInt platform (srcSpanStartLine l) + , return $ mkIntExprInt platform (srcSpanStartCol l) + , return $ mkIntExprInt platform (srcSpanEndLine l) + , return $ mkIntExprInt platform (srcSpanEndCol l) + ] + + ; push_cs_id <- lookupId pushCallStackName + ; name_expr <- mkStringExprFS fs + ; loc_expr <- mkSrcLoc loc + -- At this point tm :: IP sym CallStack + -- but we need the actual CallStack to pass to pushCS, + -- so we use evUwrapIP to strip the dictionary wrapper + -- See Note [Overview of implicit CallStacks] + ; let outer_stk = evUnwrapIP pred tm + ; return (mkCoreApps (Var push_cs_id) + [mkCoreTup [name_expr, loc_expr], outer_stk]) } {- Note [CallStack and ExecptionContext hack] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Types/Evidence.hs ===================================== @@ -510,9 +510,6 @@ data EvTerm type EvExpr = CoreExpr --- An EvTerm is (usually) constructed by any of the constructors here --- and those more complicated ones who were moved to module GHC.Tc.Types.EvTerm - -- | Any sort of evidence Id, including coercions evId :: EvId -> EvExpr evId = Var View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2a5950e85b96bf7bd2de87b3adae13753128cc31 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2a5950e85b96bf7bd2de87b3adae13753128cc31 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 23:35:46 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 04 Feb 2025 18:35:46 -0500 Subject: [Git][ghc/ghc][master] CorePrep: Name `sat` binders more descriptively Message-ID: <67a2a452c060_348bf62e6ac0885bd@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - 8 changed files: - compiler/GHC/CoreToStg/Prep.hs - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr Changes: ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -59,7 +59,8 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Id.Make ( realWorldPrimId ) import GHC.Types.Basic -import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName ) +import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName, OccName ) +import GHC.Types.Name.Occurrence (occNameString) import GHC.Types.SrcLoc ( SrcSpan(..), realSrcLocSpan, mkRealSrcLoc ) import GHC.Types.Literal import GHC.Types.Tickish @@ -70,6 +71,7 @@ import qualified Data.ByteString.Builder as BB import Data.ByteString.Builder.Prim import Control.Monad +import Data.List (intercalate) {- Note [CorePrep Overview] @@ -247,11 +249,11 @@ corePrepPgm logger cp_cfg pgm_cfg withTiming logger (text "CorePrep"<+>brackets (ppr this_mod)) (\a -> a `seqList` ()) $ do - us <- mkSplitUniqSupply 's' let initialCorePrepEnv = mkInitialCorePrepEnv cp_cfg - let - implicit_binds = mkDataConWorkers + us <- mkSplitUniqSupply 's' + + let implicit_binds = mkDataConWorkers (cpPgm_generateDebugInfo pgm_cfg) mod_loc data_tycons -- NB: we must feed mkImplicitBinds through corePrep too @@ -711,13 +713,13 @@ cpePair :: TopLevelFlag -> RecFlag -> Demand -> Levity -> UniqSM (Floats, CpeRhs) -- Used for all bindings -- The binder is already cloned, hence an OutId -cpePair top_lvl is_rec dmd lev env bndr rhs +cpePair top_lvl is_rec dmd lev env0 bndr rhs = assert (not (isJoinId bndr)) $ -- those should use cpeJoinPair do { (floats1, rhs1) <- cpeRhsE env rhs -- See if we are allowed to float this stuff out of the RHS ; let dec = want_float_from_rhs floats1 rhs1 - ; (floats2, rhs2) <- executeFloatDecision dec floats1 rhs1 + ; (floats2, rhs2) <- executeFloatDecision env dec floats1 rhs1 -- Make the arity match up ; (floats3, rhs3) @@ -725,7 +727,7 @@ cpePair top_lvl is_rec dmd lev env bndr rhs then return (floats2, cpeEtaExpand arity rhs2) else warnPprTrace True "CorePrep: silly extra arguments:" (ppr bndr) $ -- Note [Silly extra arguments] - (do { v <- newVar (idType bndr) + (do { v <- newVar env (idType bndr) ; let (float, v') = mkNonRecFloat env Lifted v rhs2 ; return ( snocFloat floats2 float , cpeEtaExpand arity (Var v')) }) @@ -735,6 +737,8 @@ cpePair top_lvl is_rec dmd lev env bndr rhs ; return (floats4, rhs4) } where + env = pushBinderContext bndr env0 + arity = idArity bndr -- We must match this arity want_float_from_rhs floats rhs @@ -967,36 +971,36 @@ cpeBodyNF env expr cpeBody :: CorePrepEnv -> CoreExpr -> UniqSM (Floats, CpeBody) cpeBody env expr = do { (floats1, rhs) <- cpeRhsE env expr - ; (floats2, body) <- rhsToBody rhs + ; (floats2, body) <- rhsToBody env rhs ; return (floats1 `appFloats` floats2, body) } -------- -rhsToBody :: CpeRhs -> UniqSM (Floats, CpeBody) +rhsToBody :: CorePrepEnv -> CpeRhs -> UniqSM (Floats, CpeBody) -- Remove top level lambdas by let-binding -rhsToBody (Tick t expr) +rhsToBody env (Tick t expr) | tickishScoped t == NoScope -- only float out of non-scoped annotations - = do { (floats, expr') <- rhsToBody expr + = do { (floats, expr') <- rhsToBody env expr ; return (floats, mkTick t expr') } -rhsToBody (Cast e co) +rhsToBody env (Cast e co) -- You can get things like -- case e of { p -> coerce t (\s -> ...) } - = do { (floats, e') <- rhsToBody e + = do { (floats, e') <- rhsToBody env e ; return (floats, Cast e' co) } -rhsToBody expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] +rhsToBody env expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] | all isTyVar bndrs -- Type lambdas are ok = return (emptyFloats, expr) | otherwise -- Some value lambdas = do { let rhs = cpeEtaExpand (exprArity expr) expr - ; fn <- newVar (exprType rhs) + ; fn <- newVar env (exprType rhs) ; let float = Float (NonRec fn rhs) LetBound TopLvlFloatable ; return (unitFloat float, Var fn) } where (bndrs,_) = collectBinders expr -rhsToBody expr = return (emptyFloats, expr) +rhsToBody _env expr = return (emptyFloats, expr) {- Note [No eta reduction needed in rhsToBody] @@ -1168,7 +1172,7 @@ cpeApp top_env expr -- allocating CaseBound Floats for token and thing as needed = do { (floats1, token) <- cpeArg env topDmd token ; (floats2, thing) <- cpeBody env thing - ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar ty + ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar env ty ; let tup = mkCoreUnboxedTuple [token, Var case_bndr] ; let float = mkCaseFloat case_bndr thing ; return (floats1 `appFloats` floats2 `snocFloat` float, tup) } @@ -1577,7 +1581,7 @@ cpeArg env dmd arg ; let arg_ty = exprType arg1 lev = typeLevity arg_ty dec = wantFloatLocal NonRecursive dmd lev floats1 arg1 - ; (floats2, arg2) <- executeFloatDecision dec floats1 arg1 + ; (floats2, arg2) <- executeFloatDecision env dec floats1 arg1 -- Else case: arg1 might have lambdas, and we can't -- put them inside a wrapBinds @@ -1586,7 +1590,7 @@ cpeArg env dmd arg -- see Note [ANF-ising literal string arguments] ; if exprIsTrivial arg2 then return (floats2, arg2) - else do { v <- (`setIdDemandInfo` dmd) <$> newVar arg_ty + else do { v <- (`setIdDemandInfo` dmd) <$> newVar env arg_ty -- See Note [Pin demand info on floats] ; let arity = cpeArgArity env dec floats1 arg2 arg3 = cpeEtaExpand arity arg2 @@ -2424,13 +2428,13 @@ instance Outputable FloatDecision where ppr FloatNone = text "none" ppr FloatAll = text "all" -executeFloatDecision :: FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) -executeFloatDecision dec floats rhs +executeFloatDecision :: CorePrepEnv -> FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) +executeFloatDecision env dec floats rhs = case dec of FloatAll -> return (floats, rhs) FloatNone | isEmptyFloats floats -> return (emptyFloats, rhs) - | otherwise -> do { (floats', body) <- rhsToBody rhs + | otherwise -> do { (floats', body) <- rhsToBody env rhs ; return (emptyFloats, wrapBinds floats $ wrapBinds floats' body) } -- FloatNone case: `rhs` might have lambdas, and we can't @@ -2569,6 +2573,8 @@ data CorePrepEnv , cpe_subst :: Subst -- ^ See Note [CorePrepEnv: cpe_subst] , cpe_rec_ids :: UnVarSet -- Faster OutIdSet; See Note [Speculative evaluation] + + , cpe_context :: [OccName] -- ^ See Note [Binder context] } mkInitialCorePrepEnv :: CorePrepConfig -> CorePrepEnv @@ -2576,6 +2582,7 @@ mkInitialCorePrepEnv cfg = CPE { cpe_config = cfg , cpe_subst = emptySubst , cpe_rec_ids = emptyUnVarSet + , cpe_context = [] } extendCorePrepEnv :: CorePrepEnv -> Id -> Id -> CorePrepEnv @@ -2616,6 +2623,14 @@ cpSubstCo :: CorePrepEnv -> Coercion -> Coercion cpSubstCo (CPE { cpe_subst = subst }) co = substCo subst co -- substCo has a short-cut if the TCvSubst is empty +-- | See Note [Binder context] +pushBinderContext :: Id -> CorePrepEnv -> CorePrepEnv +pushBinderContext ident env + | lengthAtLeast (cpe_context env) 2 + = env + | otherwise + = env { cpe_context = getOccName ident : cpe_context env} + ------------------------------------------------------------------------------ -- Cloning binders -- --------------------------------------------------------------------------- @@ -2704,10 +2719,20 @@ fiddleCCall id -- Generating new binders -- --------------------------------------------------------------------------- -newVar :: Type -> UniqSM Id -newVar ty - = seqType ty `seq` mkSysLocalOrCoVarM (fsLit "sat") ManyTy ty - +newVar :: CorePrepEnv -> Type -> UniqSM Id +newVar env ty + -- See Note [Binder context] + = seqType ty `seq` mkSysLocalOrCoVarM (fsLit occ) ManyTy ty + where occ = intercalate "_" (map occNameString $ cpe_context env) ++ "_sat" + +{- Note [Binder context] + ~~~~~~~~~~~~~~~~~~~~~ + To ensure that the compiled program (specifically symbol names) + remains understandable to the user we maintain a context + of binders that we are currently under. This allows us to give + identifiers conjured during CorePrep more contextually-meaningful + names. This is done in `newVar`. + -} ------------------------------------------------------------------------------ -- Floating ticks ===================================== testsuite/tests/core-to-stg/T14895.stderr ===================================== @@ -11,10 +11,10 @@ T14895.go GHC.Internal.Data.Either.Left e [Occ=Once1] -> wild; GHC.Internal.Data.Either.Right a1 [Occ=Once1] -> let { - sat [Occ=Once1] :: b + go_sat [Occ=Once1] :: b [LclId] = {a1, f} \u [] f a1; - } in GHC.Internal.Data.Either.Right [sat]; + } in GHC.Internal.Data.Either.Right [go_sat]; }; ===================================== testsuite/tests/core-to-stg/T24124.stderr ===================================== @@ -9,16 +9,16 @@ T24124.testFun1 T24124.StrictPair a b #) [GblId, Arity=3, Str=, Cpr=1, Unf=OtherCon []] = {} \r [x y void] - case x of sat { + case x of testFun1_sat { __DEFAULT -> case case y of y [OS=OneShot] { - __DEFAULT -> T24124.MkStrictPair [sat y]; + __DEFAULT -> T24124.MkStrictPair [testFun1_sat y]; } of - sat + testFun1_sat { - __DEFAULT -> GHC.Internal.Types.MkSolo# [sat]; + __DEFAULT -> GHC.Internal.Types.MkSolo# [testFun1_sat]; }; }; ===================================== testsuite/tests/ghci/should_run/T21052.stdout ===================================== @@ -4,9 +4,9 @@ BCO_toplevel :: GHC.Internal.Types.IO [GHC.Internal.Types.Any] [LclIdX] = {} \u [] let { - sat :: [GHC.Internal.Types.Any] + _sat :: [GHC.Internal.Types.Any] [LclId, Unf=OtherCon []] = :! [GHC.Internal.Tuple.() GHC.Internal.Types.[]]; - } in GHC.Internal.Base.returnIO sat; + } in GHC.Internal.Base.returnIO _sat; ===================================== testsuite/tests/simplCore/should_compile/T20040.stderr ===================================== @@ -16,7 +16,9 @@ ifoldl' = Cons ipv2 ipv3 -> case z of z1 { __DEFAULT -> - case f z1 ipv2 of sat { __DEFAULT -> ifoldl' f sat ipv3; }; + case f z1 ipv2 of ifoldl'_sat { + __DEFAULT -> ifoldl' f ifoldl'_sat ipv3; + }; }; }; end Rec } ===================================== testsuite/tests/simplCore/should_compile/T23083.stderr ===================================== @@ -13,10 +13,10 @@ T23083.g :: ((GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer T23083.g = \ (f [Occ=Once1!] :: (GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> GHC.Internal.Bignum.Integer.Integer) (h [Occ=OnceL1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> let { - sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer + g_sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer [LclId, Unf=OtherCon []] - sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in - f sat + g_sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in + f g_sat -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T23083.$trModule4 :: GHC.Prim.Addr# ===================================== testsuite/tests/simplStg/should_compile/T15226b.stderr ===================================== @@ -8,13 +8,13 @@ T15226b.bar1 T15226b.Str (GHC.Internal.Maybe.Maybe a) #) [GblId, Arity=2, Str=, Cpr=1(, 1), Unf=OtherCon []] = {} \r [x void] - case x of sat { + case x of bar1_sat { __DEFAULT -> let { - sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) + bar1_sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) [LclId, Unf=OtherCon []] = - T15226b.Str! [sat]; - } in GHC.Internal.Types.MkSolo# [sat]; + T15226b.Str! [bar1_sat]; + } in GHC.Internal.Types.MkSolo# [bar1_sat]; }; T15226b.bar ===================================== testsuite/tests/simplStg/should_compile/T19717.stderr ===================================== @@ -6,14 +6,14 @@ Foo.f :: forall {a}. a -> [GHC.Internal.Maybe.Maybe a] case x of x1 { __DEFAULT -> let { - sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a + f_sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a [LclId, Unf=OtherCon []] = GHC.Internal.Maybe.Just! [x1]; } in let { - sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] + f_sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] [LclId, Unf=OtherCon []] = - :! [sat GHC.Internal.Types.[]]; - } in : [sat sat]; + :! [f_sat GHC.Internal.Types.[]]; + } in : [f_sat f_sat]; }; View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7cc0855009070a4ca50504d2bdda7566417e2900 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7cc0855009070a4ca50504d2bdda7566417e2900 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 23:36:01 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 04 Feb 2025 18:36:01 -0500 Subject: [Git][ghc/ghc][master] ghc-toolchain: Parse i686 triples Message-ID: <67a2a461b851d_348bf61453ec899e2@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 1 changed file: - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fb40981decc6b1c03fe6ee671449844aecb63ebf -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fb40981decc6b1c03fe6ee671449844aecb63ebf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 23:36:42 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 04 Feb 2025 18:36:42 -0500 Subject: [Git][ghc/ghc][master] compiler: remove unused assembleOneBCO function Message-ID: <67a2a48a9cb56_348bf612a6f092924@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - 1 changed file: - compiler/GHC/ByteCode/Asm.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -168,15 +167,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/02794411602e35b671b5b954457a124f37a5d44a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/02794411602e35b671b5b954457a124f37a5d44a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 23:46:30 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Tue, 04 Feb 2025 18:46:30 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] More plumbing. Ready for testing tomorrow. Message-ID: <67a2a6d5d0ae1_348bf6860f28932a0@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: 76d8e943 by Alan Zimmerman at 2025-02-04T23:46:06+00:00 More plumbing. Ready for testing tomorrow. - - - - - 7 changed files: - compiler/GHC/Parser/PreProcess.hs - compiler/GHC/Parser/PreProcess/Macro.hs - compiler/GHC/Parser/PreProcess/ParsePP.hs - compiler/GHC/Parser/PreProcess/Types.hs - utils/check-cpp/ParsePP.hs - − utils/check-cpp/Parser.hs - utils/check-cpp/PreProcess.hs Changes: ===================================== compiler/GHC/Parser/PreProcess.hs ===================================== @@ -14,7 +14,6 @@ module GHC.Parser.PreProcess ( PpState, ) where -import Data.Char import Data.Map qualified as Map import Debug.Trace (trace) import GHC.Data.FastString @@ -41,14 +40,12 @@ initParserState = Lexer.initParserState initPpState -- --------------------------------------------------------------------- -data CppState - = CppIgnoring - | CppNormal - deriving (Show) - --- --------------------------------------------------------------------- - +-- | Continuation based lexer, provides input to GHC.Parser +lexer :: Bool -> (Located Token -> PP a) -> PP a lexer = ppLexer + +-- | Debug version of @lexer@ +lexerDbg :: Bool -> (Located Token -> PP a) -> PP a lexerDbg = ppLexerDbg ppLexer, ppLexerDbg :: Bool -> (Located Token -> PP a) -> PP a @@ -70,7 +67,7 @@ ppLexer queueComments cont = ppLexer queueComments cont in case tk of - -- case (trace ("M.ppLexer:tk=" ++ show (unLoc tk)) tk) of + -- case (trace ("M.ppLexer:tk=" ++ show (unLoc tk)) tk) of L _ ITeof -> do mInp <- popIncludeLoc case mInp of @@ -93,8 +90,6 @@ ppLexer queueComments cont = -- --------------------------------------------------------------------- -type PP = P PpState - preprocessElse :: PP () preprocessElse = do accepting <- getAccepting @@ -117,23 +112,21 @@ processCppToks fs = do processCpp :: [FastString] -> PP () processCpp fs = do - -- traceM $ "processCpp: fs=" ++ show fs - -- let s = cppInitial fs - let s = cppInitial fs + let s = concatMap unpackFS fs case parseDirective s of Left err -> error $ show (err, s) Right (CppInclude filename) -> do ppInclude filename Right (CppDefine name def) -> do - ppDefine name def + ppDefine (MacroName name Nothing) def Right (CppIf cond) -> do - _ <- ppIf cond + ppIf cond return () Right (CppIfdef name) -> do - defined <- ppIsDefined name + defined <- ppIsDefined (MacroName name Nothing) setAccepting defined Right (CppIfndef name) -> do - defined <- ppIsDefined name + defined <- ppIsDefined (MacroName name Nothing) setAccepting (not defined) Right CppElse -> do accepting <- getAccepting @@ -144,64 +137,8 @@ processCpp fs = do setAccepting True return () - -- return (trace ("processCpp:s=" ++ show s) ()) return () --- --------------------------------------------------------------------- --- Preprocessor state functions - -getCppState :: PP CppState -getCppState = do - accepting <- getAccepting - if accepting - then return CppNormal - else return CppIgnoring - --- pp_context stack start ----------------- - -pushContext :: Token -> PP () -pushContext new = - P $ \s -> POk s{pp = (pp s){pp_context = new : pp_context (pp s)}} () - -popContext :: PP () -popContext = - P $ \s -> - let - new_context = case pp_context (pp s) of - [] -> [] - (_ : t) -> t - in - POk s{pp = (pp s){pp_context = new_context}} () - -peekContext :: PP Token -peekContext = - P $ \s -> - let - r = case pp_context (pp s) of - [] -> ITeof -- Anthing really, for now, except a CPP one - (h : _) -> h - in - POk s r - -setAccepting :: Bool -> PP () -setAccepting on = - P $ \s -> POk s{pp = (pp s){pp_accepting = on}} () - -getAccepting :: PP Bool -getAccepting = P $ \s -> POk s (pp_accepting (pp s)) - --- ------------------------------------- - -pushContinuation :: Located Token -> PP () -pushContinuation new = - P $ \s -> POk s{pp = (pp s){pp_continuation = new : pp_continuation (pp s)}} () - -popContinuation :: PP [Located Token] -popContinuation = - P $ \s -> POk s{pp = (pp s){pp_continuation = []}} (pp_continuation (pp s)) - --- pp_context stack end ------------------- - -- pp_include start ----------------------- getInclude :: String -> PP (Maybe StringBuffer) @@ -235,51 +172,19 @@ ppInclude filename = do pushIncludeLoc origInput let loc = PsLoc (mkRealSrcLoc (mkFastString filename) 1 1) (BufPos 0) Lexer.setInput (Lexer.AI loc src) - -- return $ trace ("ppInclude:mSrc=[" ++ show mSrc ++ "]") () - --- return $ trace ("ppInclude:filename=[" ++ filename ++ "]") () - -ppDefine :: String -> String -> PP () -ppDefine name val = P $ \s -> - -- POk s{pp = (pp s){pp_defines = Map.insert (trace ("ppDefine:def=[" ++ name ++ "]") (MacroName name Nothing)) val (pp_defines (pp s))}} () - POk s{pp = (pp s){pp_defines = Map.insert (MacroName name Nothing) val (pp_defines (pp s))}} () -ppIsDefined :: String -> PP Bool -ppIsDefined def = P $ \s -> - POk s (Map.member (MacroName def Nothing) (pp_defines (pp s))) - -- POk s (Map.member (trace ("ppIsDefined:def=[" ++ def ++ "]") (MacroName def Nothing)) (pp_defines (pp s))) - -ppIf :: String -> PP Bool +ppIf :: String -> PP () ppIf str = P $ \s -> - -- -- POk s (Map.member def (pp_defines (pp s))) - -- POk s (Map.member (trace ("ppIsDefined:def=[" ++ def ++ "]") def) (pp_defines (pp s))) let s' = cppIf (pp s) str in - POk s{pp = s'} (pp_accepting s') - --- | Take a @FastString@ of the form "#define FOO\n" and strip off all but "FOO" -cleanTokenString :: FastString -> String -cleanTokenString fs = r - where - ss = dropWhile (\c -> not $ isSpace c) (unpackFS fs) - r = init ss - --- parseDefine :: FastString -> Maybe (String, [String]) --- parseDefine fs = r --- where --- -- r = Just (cleanTokenString s, "") --- r = case parseCppParser cppDefinition (unpackFS fs) of --- Left _ -> Nothing --- Right v -> Just v + POk s{pp = s'} () -- ===================================================================== {- | Do cpp initial processing, as per https://gcc.gnu.org/onlinedocs/cpp/Initial-processing.html See Note [GhcCPP Initial Processing] -} -cppInitial :: [FastString] -> String -cppInitial fs = concatMap unpackFS fs {- Note [GhcCPP Initial Processing] @@ -296,4 +201,61 @@ directive. and is handled in the Lexer. 4. All comments are replaced with a single space +Note [GhcCPP Processing Overview] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +GHC.Parser calls `GHC.PreProcess.lexer` to provide it with the next +token to parse, until it gets the EOF token. + +Without GHC_CPP, this simply calls `GHC.Parser.Lexer.lexer` to get the +next token. But `GHC.PreProcess.lexer` runs its own loop between the +two. + +- It calls `GHC.Parser.Lexer.lexer` + +- If the GhcCpp option is not set, it returns a normal token, which is + passed to the parser. + +- If the GhcCpp option is set, it may in addition return an `ITcpp` + token. + + This is either one containing a whole line starting with a + preprocessor directive, or a continuation of the prior line if it + was a directive ending with a backlash + +- The lexing loop in this file accumulates these continuation tokens + until it has a full preprocessor line. + +- It does basic token-based analysis of this, to determine the + specific PP directive it refers to + +- The preprocessor can be in one of two states: `CppNormal` or + `CppIgnoring`. + + When it is in `CppNormal` it passes non-PP tokens to the parser as + normal. + + When it is in `CppIgnoring` it does not pass the non-PP tokens to + the parser, but inserts them into the parser queued comments store, + as if each was a comment. + +- When it has a full preprocessor directive, this is processed as expected. + `#define` : records a macro definition in the PP state + `#include` : not currently processed + + `#ifdef` / `#ifndef` : If the following token is the name of a macro, switch to + `CppNormal` or `CppIgnoring` as appropriate + + `#if` : perform macro expansion on the text, until it reaches a + fixpoint. Then parse it with `GHC.Parser.PreProcess.Parser/Lexer` as + an expression, and evaluate it. Set the state according to the outcome. + +- The `#if` / `#ifdef` / `#ifndef` directives also open a new macro + scope. Any macros defined will be stored in this scope. + +- `#else` : flip the state between `CppIgnoring` and `CppNormal`, and + pop the scope. Start a new scope. + +- `#endif` : pop the scope, set the state according to the surrounding + scope. + -} ===================================== compiler/GHC/Parser/PreProcess/Macro.hs ===================================== @@ -22,7 +22,6 @@ details -- TODO: Parse tokens with original locations in them. -import Data.Map qualified as Map import Data.Maybe import GHC.Parser.PreProcess.Eval @@ -46,37 +45,31 @@ process s str = (s0, o) CppIfdef name -> ifdef s name CppIf ifstr -> cppIf s ifstr CppIfndef name -> ifndef s name - CppElse -> undefined - CppEndif -> undefined + CppElse -> cppElse s + CppEndif -> popScope' s -- --------------------------------------------------------------------- define :: PpState -> String -> MacroDef -> PpState -define s name toks = s{pp_defines = Map.insert (MacroName name Nothing) toks (pp_defines s)} +define s name toks = addDefine' s (MacroName name Nothing) toks ifdef :: PpState -> String -> PpState -ifdef s name = - case Map.lookup (MacroName name Nothing) (pp_defines s) of - Just _ -> s{pp_accepting = True} - _ -> s{pp_accepting = False} +ifdef s name = pushAccepting' s (ppIsDefined' s (MacroName name Nothing)) ifndef :: PpState -> String -> PpState -ifndef s name = - case Map.lookup (MacroName name Nothing) (pp_defines s) of - Just _ -> s{pp_accepting = False} - _ -> s{pp_accepting = True} +ifndef s name = pushAccepting' s (not $ ppIsDefined' s (MacroName name Nothing)) +-- We evaluate to an Int, which we convert to a bool cppIf :: PpState -> String -> PpState -cppIf s str = r +cppIf s str = pushAccepting' s (toBool v) where expanded = expand s str - -- toks0 = cppLex expanded - -- r = error (show toks0) v = case Parser.parseExpr expanded of Left err -> error $ show err Right tree -> eval tree - -- We evaluate to an Int, which we convert to a bool - r = s{pp_accepting = toBool v} + +cppElse :: PpState -> PpState +cppElse s = setAccepting' s (not $ getAccepting' s) -- --------------------------------------------------------------------- @@ -96,7 +89,7 @@ expandOne s tok = r r = fromMaybe (t_str tok) - (Map.lookup (MacroName (t_str tok) Nothing) (pp_defines s)) + (ppDefinition' s (MacroName (t_str tok) Nothing)) -- --------------------------------------------------------------------- ===================================== compiler/GHC/Parser/PreProcess/ParsePP.hs ===================================== @@ -1,11 +1,10 @@ module GHC.Parser.PreProcess.ParsePP ( - cppLex, parseDirective, + cppLex, ) where -import Data.List +import Data.List (intercalate) import GHC.Parser.Errors.Ppr () - import GHC.Parser.PreProcess.Lexer import GHC.Parser.PreProcess.ParserM (Token (..), init_state) import GHC.Parser.PreProcess.Types @@ -15,7 +14,7 @@ import GHC.Prelude -- First parse to CPP tokens, using a C++-like language spec -- https://gcc.gnu.org/onlinedocs/cpp/Tokenization.html --- Parse a CPP directive, using tokens from the CPP lexer +-- | Parse a CPP directive, using tokens from the CPP lexer parseDirective :: String -> Either String CppDirective parseDirective s = case cppLex s of @@ -29,23 +28,30 @@ parseDirective s = ("#" : "ifdef" : ts) -> Right $ cppIfdef ts ("#" : "else" : ts) -> Right $ cppElse ts ("#" : "endif" : ts) -> Right $ cppEndif ts - other -> Left ("unexpected directive: " ++ (intercalate " " other)) + other -> Left ("unexpected directive: " ++ (combineToks other)) + +{- | Comply with the CPP requirement to not combine adjacent tokens. +This will automatically insert a space in place of a comment, as +comments cannot occur within a token. +-} +combineToks :: [String] -> String +combineToks ss = intercalate " " ss cppDefine :: [String] -> Either String CppDirective cppDefine [] = Left "error:empty #define directive" -cppDefine (n : ts) = Right $ CppDefine n (intercalate " " ts) +cppDefine (n : ts) = Right $ CppDefine n (combineToks ts) cppInclude :: [String] -> CppDirective -cppInclude ts = CppInclude (intercalate " " ts) +cppInclude ts = CppInclude (combineToks ts) cppIf :: [String] -> CppDirective -cppIf ts = CppIf (intercalate " " ts) +cppIf ts = CppIf (combineToks ts) cppIfdef :: [String] -> CppDirective -cppIfdef ts = CppIfdef (intercalate " " ts) +cppIfdef ts = CppIfdef (combineToks ts) cppIfndef :: [String] -> CppDirective -cppIfndef ts = CppIfndef (intercalate " " ts) +cppIfndef ts = CppIfndef (combineToks ts) cppElse :: [String] -> CppDirective cppElse _ts = CppElse ===================================== compiler/GHC/Parser/PreProcess/Types.hs ===================================== @@ -1,34 +1,45 @@ module GHC.Parser.PreProcess.Types where +import Data.List.NonEmpty (NonEmpty (..), (<|)) +import Data.List.NonEmpty qualified as NonEmpty +import Data.Map (Map) +import Data.Map qualified as Map import GHC.Data.StringBuffer -import GHC.Parser.Lexer (Token (..)) -import qualified GHC.Parser.Lexer as Lexer +import GHC.Parser.Lexer (P (..), PState (..), ParseResult (..), Token (..)) +import GHC.Parser.Lexer qualified as Lexer +import GHC.Prelude import GHC.Types.SrcLoc -import Data.Map (Map) -import qualified Data.Map as Map -import GHC.Prelude +-- --------------------------------------------------------------------- + +type PP = P PpState + +data CppState + = CppIgnoring + | CppNormal + deriving (Show) -- --------------------------------------------------------------------- initPpState :: PpState initPpState = PpState - { pp_defines = Map.empty - , pp_includes = Map.empty + { pp_includes = Map.empty , pp_include_stack = [] , pp_continuation = [] - , pp_context = [] - , pp_accepting = True + , pp_scope = (PpScope Map.empty True) :| [] } data PpState = PpState - { pp_defines :: !(Map MacroName MacroDef) - , pp_includes :: !(Map String StringBuffer) + { pp_includes :: !(Map String StringBuffer) , pp_include_stack :: ![Lexer.AlexInput] , pp_continuation :: ![Located Token] - , pp_context :: ![Token] - -- ^ What preprocessor directive we are currently processing + , pp_scope :: !(NonEmpty PpScope) + } + deriving (Show) + +data PpScope = PpScope + { pp_defines :: !(Map MacroName MacroDef) , pp_accepting :: !Bool } deriving (Show) @@ -83,3 +94,144 @@ data CompOp deriving (Show, Eq) -- --------------------------------------------------------------------- +-- Preprocessor state functions + +getCppState :: PP CppState +getCppState = do + accepting <- getAccepting + if accepting + then return CppNormal + else return CppIgnoring + +-- pp_scope stack start ----------------- + +pushScope :: PpScope -> PP () +pushScope new = + P $ \s -> POk s{pp = (pp s){pp_scope = new <| (pp_scope (pp s))}} () + +pushScope' :: PpState -> PpScope -> PpState +pushScope' s new = s{pp_scope = new <| (pp_scope s)} + +popScope :: PP () +popScope = + P $ \s -> + let + new_scope = case pp_scope (pp s) of + c :| [] -> c :| [] + _ :| (h : t) -> h :| t + in + POk s{pp = (pp s){pp_scope = new_scope}} () + +popScope' :: PpState -> PpState +popScope' s = + let + new_scope = case pp_scope s of + c :| [] -> c :| [] + _ :| (h : t) -> h :| t + in + s{pp_scope = new_scope} + +getScope :: PP PpScope +getScope = + P $ \s -> POk s (getScope' (pp s)) + +getScope' :: PpState -> PpScope +getScope' s = NonEmpty.head $ pp_scope s + +setScope :: PpScope -> PP () +setScope scope = + P $ \s -> + let + new_scope = case pp_scope (pp s) of + _ :| rest -> scope :| rest + in + POk s{pp = (pp s){pp_scope = new_scope}} () + +setScope' :: PpState -> PpScope -> PpState +setScope' s scope = + let + new_scope = case pp_scope s of + _ :| rest -> scope :| rest + in + s{pp_scope = new_scope} + +setAccepting :: Bool -> PP () +setAccepting on = do + scope <- getScope + setScope (scope{pp_accepting = on}) + +pushAccepting' :: PpState -> Bool -> PpState +pushAccepting' s on = pushScope' s (PpScope Map.empty on) + +setAccepting' :: PpState -> Bool -> PpState +setAccepting' s on = setScope' s (scope{pp_accepting = on}) + where + scope = getScope' s + +getAccepting :: PP Bool +getAccepting = P $ \s -> POk s (pp_accepting (NonEmpty.head $ pp_scope (pp s))) + +getAccepting' :: PpState -> Bool +getAccepting' s = pp_accepting (NonEmpty.head $ pp_scope s) + +addDefine :: MacroName -> MacroDef -> PP () +addDefine name def = do + scope <- getScope + setScope (scope{pp_defines = Map.insert name def (pp_defines scope)}) + +addDefine' :: PpState -> MacroName -> MacroDef -> PpState +addDefine' s name def = r + where + scope = getScope' s + r = setScope' s (scope{pp_defines = Map.insert name def (pp_defines scope)}) + +ppDefine :: MacroName -> MacroDef -> PP () +ppDefine name val = addDefine name val + +ppIsDefined :: MacroName -> PP Bool +ppIsDefined name = do + -- Look up the chain of scopes, until we find one that works, or end + let + lookup [] = False + lookup (h : t) = + if Map.member name (pp_defines h) + then True + else lookup t + pp <- getPpState + let scopes = NonEmpty.toList (pp_scope pp) + return $ lookup scopes + +ppIsDefined' :: PpState -> MacroName -> Bool +ppIsDefined' s name = lookup scopes + where + -- Look up the chain of scopes, until we find one that works, or end + lookup [] = False + lookup (h : t) = + if Map.member name (pp_defines h) + then True + else lookup t + scopes = NonEmpty.toList (pp_scope s) + +ppDefinition' :: PpState -> MacroName -> Maybe MacroDef +ppDefinition' s name = lookup scopes + where + -- Look up the chain of scopes, until we find one that works, or end + lookup [] = Nothing + lookup (h : t) = + if Map.member name (pp_defines h) + then Map.lookup name (pp_defines h) + else lookup t + scopes = NonEmpty.toList (pp_scope s) + +getPpState :: PP PpState +getPpState = P $ \s -> POk s (pp s) + +-- ------------------------------------- + +pushContinuation :: Located Token -> PP () +pushContinuation new = + P $ \s -> POk s{pp = (pp s){pp_continuation = new : pp_continuation (pp s)}} () + +popContinuation :: PP [Located Token] +popContinuation = + P $ \s -> POk s{pp = (pp s){pp_continuation = []}} (pp_continuation (pp s)) ===================================== utils/check-cpp/ParsePP.hs ===================================== @@ -23,30 +23,40 @@ import Lexer -- Parse a CPP directive, using tokens from the CPP lexer parseDirective :: String -> Either String CppDirective parseDirective s = - case cppLex s of - Left e -> Left e - Right toks -> - case map t_str toks of - ("#":"define":ts) -> cppDefine ts - ("#":"include":ts) -> Right $ cppInclude ts - ("#":"if":ts) -> Right $ cppIf ts - ("#":"ifndef":ts) -> Right $ cppIfndef ts - ("#":"ifdef":ts) -> Right $ cppIfdef ts - ("#":"else":ts) -> Right $ cppElse ts - ("#":"endif":ts) -> Right $ cppEndif ts - other -> Left ("unexpected directive: " ++ (intercalate " " other)) - - + case cppLex s of + Left e -> Left e + Right toks -> + case map t_str toks of + ("#" : "define" : ts) -> cppDefine ts + ("#" : "include" : ts) -> Right $ cppInclude ts + ("#" : "if" : ts) -> Right $ cppIf ts + ("#" : "ifndef" : ts) -> Right $ cppIfndef ts + ("#" : "ifdef" : ts) -> Right $ cppIfdef ts + ("#" : "else" : ts) -> Right $ cppElse ts + ("#" : "endif" : ts) -> Right $ cppEndif ts + other -> Left ("unexpected directive: " ++ (intercalate " " other)) + +cppDefine :: [String] -> Either String CppDirective cppDefine [] = Left "error:empty #define directive" -cppDefine (n:ts) = Right $ CppDefine n (intercalate " " ts) +cppDefine (n : ts) = Right $ CppDefine n (intercalate " " ts) +cppInclude :: [String] -> CppDirective cppInclude ts = CppInclude (intercalate " " ts) + +cppIf :: [String] -> CppDirective cppIf ts = CppIf (intercalate " " ts) + +cppIfdef :: [String] -> CppDirective cppIfdef ts = CppIfdef (intercalate " " ts) + +cppIfndef :: [String] -> CppDirective cppIfndef ts = CppIfndef (intercalate " " ts) + +cppElse :: [String] -> CppDirective cppElse _ts = CppElse -cppEndif _ts = CppEndif +cppEndif :: [String] -> CppDirective +cppEndif _ts = CppEndif -- --------------------------------------------------------------------- @@ -59,6 +69,7 @@ cppLex s = case lexCppTokenStream s init_state of doATest :: String -> Either String CppDirective doATest str = parseDirective str + -- doATest str = parseDirectiveOld str t0 :: Either String CppDirective ===================================== utils/check-cpp/Parser.hs deleted ===================================== @@ -1,881 +0,0 @@ -{-# OPTIONS_GHC -w #-} -{-# LANGUAGE CPP #-} -{-# LANGUAGE MagicHash #-} -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE TypeSynonymInstances #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE PatternGuards #-} -{-# LANGUAGE NoStrictData #-} -{-# LANGUAGE UnboxedTuples #-} -{-# LANGUAGE PartialTypeSignatures #-} -#if __GLASGOW_HASKELL__ >= 710 -{-# LANGUAGE PartialTypeSignatures #-} -#endif -module Parser (parseExpr) where - -import Lexer (lex_tok) -import ParserM (Token(..), ParserM, run_parser, get_pos, show_pos, - happyError) -import Types --- Needed when invoking happy -ad -import qualified GHC.Internal.Data.Tuple as Happy_Prelude -import qualified Data.Function as Happy_Prelude -import qualified Data.Bool as Happy_Prelude -import qualified Data.Function as Happy_Prelude -import qualified Data.Maybe as Happy_Prelude -import qualified Data.Int as Happy_Prelude -import qualified Data.String as Happy_Prelude -import qualified Data.List as Happy_Prelude -import qualified Control.Monad as Happy_Prelude -import qualified Text.Show as Happy_Prelude -import qualified GHC.Num as Happy_Prelude -import qualified GHC.Err as Happy_Prelude -import qualified Data.Array as Happy_Data_Array -import qualified Data.Bits as Bits -import qualified GHC.Exts as Happy_GHC_Exts -import qualified System.IO as Happy_System_IO -import qualified System.IO.Unsafe as Happy_System_IO_Unsafe -import qualified Debug.Trace as Happy_Debug_Trace -import Control.Applicative(Applicative(..)) -import Control.Monad (ap) - --- parser produced by Happy Version 2.1.4 - -data HappyAbsSyn t7 - = HappyTerminal (Token) - | HappyErrorToken Happy_Prelude.Int - | HappyAbsSyn5 (Expr) - | HappyAbsSyn7 t7 - -{-# NOINLINE happyTokenStrings #-} -happyTokenStrings = ["'{'","'}'","'['","']'","'#'","'##'","'('","')'","'<:'","':>'","'<%'","'%>'","'%:'","'%:%:'","';'","':'","'...'","'new'","'delete'","'?'","'::'","'.'","'.*'","'+'","'-'","'*'","'/'","'%'","'^'","'&'","'|'","'~'","'!'","'='","'<'","'>'","'+='","'-='","'*='","'/='","'%='","'^='","'&='","'|='","'<<'","'>>'","'>>='","'<<='","'=='","'!='","'<='","'>='","'&&'","'||'","'++'","'--'","','","'->*'","'->'","'and'","'and_eq'","'bitand'","'bitor'","'compl'","'not'","'not_eq'","'or'","'or_eq'","'xor'","'xor_eq'","lower_name","upper_name","integer","string","other","%eof"] - -happyActOffsets :: HappyAddr -happyActOffsets = HappyA# "\xf9\xff\xff\xff\xe2\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xff\xff\xff\xf9\xff\xff\xff\x00\x00\x00\x00\xfa\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xf9\xff\xff\xff\xe6\xff\xff\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# - -happyGotoOffsets :: HappyAddr -happyGotoOffsets = HappyA# "\x06\x00\x00\x00\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\x27\x00\x00\x00\x37\x00\x00\x00\x3a\x00\x00\x00\x3d\x00\x00\x00\x44\x00\x00\x00\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# - -happyDefActions :: HappyAddr -happyDefActions = HappyA# "\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff\xf4\xff\xff\xff\xf3\xff\xff\xff\xf2\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfd\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfb\xff\xff\xff\xfa\xff\xff\xff\xf7\xff\xff\xff\xf5\xff\xff\xff\xf9\xff\xff\xff\xf8\xff\xff\xff\xf6\xff\xff\xff\xfc\xff\xff\xff"# - -happyCheck :: HappyAddr -happyCheck = HappyA# "\xff\xff\xff\xff\x08\x00\x00\x00\xff\xff\xff\xff\x09\x00\x00\x00\x24\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\x24\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\x24\x00\x00\x00\x25\x00\x00\x00\x32\x00\x00\x00\xff\xff\xff\xff\x34\x00\x00\x00\x35\x00\x00\x00\x36\x00\x00\x00\x37\x00\x00\x00\x32\x00\x00\x00\xff\xff\xff\xff\x34\x00\x00\x00\x35\x00\x00\x00\x36\x00\x00\x00\xff\xff\xff\xff\x24\x00\x00\x00\x25\x00\x00\x00\x34\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x24\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x48\x00\x00\x00\x49\x00\x00\x00\x32\x00\x00\x00\x4d\x00\x00\x00\x34\x00\x00\x00\x35\x00\x00\x00\x36\x00\x00\x00\x37\x00\x00\x00\xff\xff\xff\xff\x32\x00\x00\x00\xff\xff\xff\xff\x34\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\x48\x00\x00\x00\x49\x00\x00\x00\x4a\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# - -happyTable :: HappyAddr -happyTable = HappyA# "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x09\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x10\x00\x00\x00\x11\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x17\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x0b\x00\x00\x00\x0c\x00\x00\x00\x16\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x0d\x00\x00\x00\xff\xff\xff\xff\x0e\x00\x00\x00\x0f\x00\x00\x00\x10\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x0f\x00\x00\x00\x15\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x14\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x13\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x09\x00\x00\x00\x12\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# - -happyReduceArr = Happy_Data_Array.array (1, 13) [ - (1 , happyReduce_1), - (2 , happyReduce_2), - (3 , happyReduce_3), - (4 , happyReduce_4), - (5 , happyReduce_5), - (6 , happyReduce_6), - (7 , happyReduce_7), - (8 , happyReduce_8), - (9 , happyReduce_9), - (10 , happyReduce_10), - (11 , happyReduce_11), - (12 , happyReduce_12), - (13 , happyReduce_13) - ] - -happyRuleArr :: HappyAddr -happyRuleArr = HappyA# "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00"# - -happyCatchStates :: [Happy_Prelude.Int] -happyCatchStates = [] - -happy_n_terms = 78 :: Happy_Prelude.Int -happy_n_nonterms = 3 :: Happy_Prelude.Int - -happy_n_starts = 1 :: Happy_Prelude.Int - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_1 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_1 = happySpecReduce_1 0# happyReduction_1 -happyReduction_1 (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (happy_var_1 - ) -happyReduction_1 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_2 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_2 = happySpecReduce_1 0# happyReduction_2 -happyReduction_2 (HappyTerminal happy_var_1) - = HappyAbsSyn5 - (IntVal (read $ t_str happy_var_1) - ) -happyReduction_2 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_3 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_3 = happySpecReduce_3 0# happyReduction_3 -happyReduction_3 _ - (HappyAbsSyn5 happy_var_2) - _ - = HappyAbsSyn5 - (happy_var_2 - ) -happyReduction_3 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_4 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_4 = happySpecReduce_3 0# happyReduction_4 -happyReduction_4 (HappyAbsSyn5 happy_var_3) - _ - (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (Logic LogicalOr happy_var_1 happy_var_3 - ) -happyReduction_4 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_5 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_5 = happySpecReduce_3 0# happyReduction_5 -happyReduction_5 (HappyAbsSyn5 happy_var_3) - _ - (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (Logic LogicalAnd happy_var_1 happy_var_3 - ) -happyReduction_5 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_6 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_6 = happySpecReduce_3 0# happyReduction_6 -happyReduction_6 (HappyAbsSyn5 happy_var_3) - _ - (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (Comp CmpEqual happy_var_1 happy_var_3 - ) -happyReduction_6 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_7 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_7 = happySpecReduce_3 0# happyReduction_7 -happyReduction_7 (HappyAbsSyn5 happy_var_3) - _ - (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (Comp CmpGt happy_var_1 happy_var_3 - ) -happyReduction_7 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_8 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_8 = happySpecReduce_3 0# happyReduction_8 -happyReduction_8 (HappyAbsSyn5 happy_var_3) - _ - (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (Comp CmpGtE happy_var_1 happy_var_3 - ) -happyReduction_8 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_9 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_9 = happySpecReduce_3 0# happyReduction_9 -happyReduction_9 (HappyAbsSyn5 happy_var_3) - _ - (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (Comp CmpLt happy_var_1 happy_var_3 - ) -happyReduction_9 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_10 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_10 = happySpecReduce_3 0# happyReduction_10 -happyReduction_10 (HappyAbsSyn5 happy_var_3) - _ - (HappyAbsSyn5 happy_var_1) - = HappyAbsSyn5 - (Comp CmpLtE happy_var_1 happy_var_3 - ) -happyReduction_10 _ _ _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_11 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_11 = happySpecReduce_1 1# happyReduction_11 -happyReduction_11 (HappyAbsSyn7 happy_var_1) - = HappyAbsSyn5 - (Var happy_var_1 - ) -happyReduction_11 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_12 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_12 = happySpecReduce_1 2# happyReduction_12 -happyReduction_12 (HappyTerminal happy_var_1) - = HappyAbsSyn7 - (t_str happy_var_1 - ) -happyReduction_12 _ = notHappyAtAll - -#if __GLASGOW_HASKELL__ >= 710 -happyReduce_13 :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> ParserM (HappyAbsSyn _) -#endif -happyReduce_13 = happySpecReduce_1 2# happyReduction_13 -happyReduction_13 (HappyTerminal happy_var_1) - = HappyAbsSyn7 - (t_str happy_var_1 - ) -happyReduction_13 _ = notHappyAtAll - -happyTerminalToTok term = case term of { - TEOF "" -> 77#; - TOpenBrace {} -> 2#; - TCloseBrace {} -> 3#; - TOpenBracket {} -> 4#; - TCloseBracket {} -> 5#; - THash {} -> 6#; - THashHash {} -> 7#; - TOpenParen {} -> 8#; - TCloseParen {} -> 9#; - TLtColon {} -> 10#; - TColonGt{} -> 11#; - TLtPercent {} -> 12#; - TPercentGt {} -> 13#; - TPercentColon {} -> 14#; - TPercentColonTwice {} -> 15#; - TSemi {} -> 16#; - TColon {} -> 17#; - TDotDotDot {} -> 18#; - TNew {} -> 19#; - TDelete {} -> 20#; - TQuestion {} -> 21#; - TColonColon{} -> 22#; - TDot {} -> 23#; - TDotStar {} -> 24#; - TPlus {} -> 25#; - TMinus {} -> 26#; - TStar {} -> 27#; - TSlash {} -> 28#; - TPercent {} -> 29#; - TUpArrow {} -> 30#; - TAmpersand {} -> 31#; - TPipe {} -> 32#; - TTilde {} -> 33#; - TExclamation {} -> 34#; - TEqual {} -> 35#; - TOpenAngle {} -> 36#; - TCloseAngle {} -> 37#; - TPlusEqual {} -> 38#; - TMinusEqual {} -> 39#; - TStarEqual {} -> 40#; - TSlashEqual {} -> 41#; - TPercentEqual {} -> 42#; - TUpEqual {} -> 43#; - TAmpersandEqual {} -> 44#; - TPipeEqual {} -> 45#; - TLtLt {} -> 46#; - TGtGt {} -> 47#; - TGtGtEqual {} -> 48#; - TLtLtEqual {} -> 49#; - TEqualEqual {} -> 50#; - TExclaimEqual {} -> 51#; - TLtEqual {} -> 52#; - TGtEqual {} -> 53#; - TAmpersandTwice {} -> 54#; - TPipePipe {} -> 55#; - TPlusPlus {} -> 56#; - TMinusMinus {} -> 57#; - TComma {} -> 58#; - TMinusGtStar {} -> 59#; - TMinusGt {} -> 60#; - TAnd {} -> 61#; - TAndEq {} -> 62#; - TBitand {} -> 63#; - TBitor {} -> 64#; - TCompl {} -> 65#; - TNot {} -> 66#; - TNotEq {} -> 67#; - TOr {} -> 68#; - TOrEq {} -> 69#; - TXor {} -> 70#; - TXorEq {} -> 71#; - TLowerName {} -> 72#; - TUpperName {} -> 73#; - TInteger {} -> 74#; - TString {} -> 75#; - TOther {} -> 76#; - _ -> -1#; - } -{-# NOINLINE happyTerminalToTok #-} - -happyLex kend kmore = lex_tok (\tk -> case tk of { - TEOF "" -> kend tk; - _ -> kmore (happyTerminalToTok tk) tk }) -{-# INLINE happyLex #-} - -happyNewToken action sts stk = happyLex (\tk -> happyDoAction 77# tk action sts stk) (\i tk -> happyDoAction i tk action sts stk) - -happyReport 77# = happyReport' -happyReport _ = happyReport' - - -happyThen :: () => (ParserM a) -> (a -> (ParserM b)) -> (ParserM b) -happyThen = (Happy_Prelude.>>=) -happyReturn :: () => a -> (ParserM a) -happyReturn = (Happy_Prelude.return) -#if __GLASGOW_HASKELL__ >= 710 -happyParse :: () => Happy_GHC_Exts.Int# -> ParserM (HappyAbsSyn _) - -happyNewToken :: () => Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> (ParserM (HappyAbsSyn _)) - -happyDoAction :: () => Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> (ParserM (HappyAbsSyn _)) - -happyReduceArr :: () => Happy_Data_Array.Array Happy_Prelude.Int (Happy_GHC_Exts.Int# -> Token -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn _) -> (ParserM (HappyAbsSyn _))) - -#endif -happyThen1 :: () => ParserM a -> (a -> ParserM b) -> ParserM b -happyThen1 = happyThen -happyFmap1 f m = happyThen m (\a -> happyReturn (f a)) -happyReturn1 :: () => a -> (ParserM a) -happyReturn1 = happyReturn -happyReport' :: () => (Token) -> [Happy_Prelude.String] -> (ParserM a) -> (ParserM a) -happyReport' = (\tokens expected resume -> happyError) - -happyAbort :: () => (ParserM a) -happyAbort = Happy_Prelude.error "Called abort handler in non-resumptive parser" - -expr = happySomeParser where - happySomeParser = happyThen (happyParse 0#) (\x -> case x of {HappyAbsSyn5 z -> happyReturn z; _other -> notHappyAtAll }) - -happySeq = happyDontSeq - - --- parseExpr :: String -> Either String Expr -parseExpr = run_parser expr -#define HAPPY_DEBUG 1 --- $Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp $ - -#if !defined(__GLASGOW_HASKELL__) -# error This code isn't being built with GHC. -#endif - --- Get WORDS_BIGENDIAN (if defined) -#include "MachDeps.h" - --- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. -#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Happy_Prelude.Bool) -#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Happy_Prelude.Bool) -#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Happy_Prelude.Bool) -#define PLUS(n,m) (n Happy_GHC_Exts.+# m) -#define MINUS(n,m) (n Happy_GHC_Exts.-# m) -#define TIMES(n,m) (n Happy_GHC_Exts.*# m) -#define NEGATE(n) (Happy_GHC_Exts.negateInt# (n)) - -type Happy_Int = Happy_GHC_Exts.Int# -data Happy_IntList = HappyCons Happy_Int Happy_IntList - -#define INVALID_TOK -1# -#define ERROR_TOK 0# -#define CATCH_TOK 1# - -#if defined(HAPPY_COERCE) -# define GET_ERROR_TOKEN(x) (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# i) -> i }) -# define MK_ERROR_TOKEN(i) (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# i)) -# define MK_TOKEN(x) (happyInTok (x)) -#else -# define GET_ERROR_TOKEN(x) (case x of { HappyErrorToken (Happy_GHC_Exts.I# i) -> i }) -# define MK_ERROR_TOKEN(i) (HappyErrorToken (Happy_GHC_Exts.I# i)) -# define MK_TOKEN(x) (HappyTerminal (x)) -#endif - -#if defined(HAPPY_DEBUG) -# define DEBUG_TRACE(s) (happyTrace (s)) Happy_Prelude.$ -happyTrace string expr = Happy_System_IO_Unsafe.unsafePerformIO Happy_Prelude.$ do - Happy_System_IO.hPutStr Happy_System_IO.stderr string - Happy_Prelude.return expr -#else -# define DEBUG_TRACE(s) {- nothing -} -#endif - -infixr 9 `HappyStk` -data HappyStk a = HappyStk a (HappyStk a) - ------------------------------------------------------------------------------ --- starting the parse - -happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll - ------------------------------------------------------------------------------ --- Accepting the parse - --- If the current token is ERROR_TOK, it means we've just accepted a partial --- parse (a %partial parser). We must ignore the saved token on the top of --- the stack in this case. -happyAccept ERROR_TOK tk st sts (_ `HappyStk` ans `HappyStk` _) = - happyReturn1 ans -happyAccept j tk st sts (HappyStk ans _) = - (happyTcHack j (happyTcHack st)) (happyReturn1 ans) - ------------------------------------------------------------------------------ --- Arrays only: do the next action - -happyDoAction i tk st = - DEBUG_TRACE("state: " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# st) Happy_Prelude.++ - ",\ttoken: " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# i) Happy_Prelude.++ - ",\taction: ") - case happyDecodeAction (happyNextAction i st) of - HappyFail -> DEBUG_TRACE("failing.\n") - happyFail i tk st - HappyAccept -> DEBUG_TRACE("accept.\n") - happyAccept i tk st - HappyReduce rule -> DEBUG_TRACE("reduce (rule " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# rule) Happy_Prelude.++ ")") - (happyReduceArr Happy_Data_Array.! (Happy_GHC_Exts.I# rule)) i tk st - HappyShift new_state -> DEBUG_TRACE("shift, enter state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# new_state) Happy_Prelude.++ "\n") - happyShift new_state i tk st - -{-# INLINE happyNextAction #-} -happyNextAction i st = case happyIndexActionTable i st of - Happy_Prelude.Just (Happy_GHC_Exts.I# act) -> act - Happy_Prelude.Nothing -> happyIndexOffAddr happyDefActions st - -{-# INLINE happyIndexActionTable #-} -happyIndexActionTable i st - | GTE(i, 0#), GTE(off, 0#), EQ(happyIndexOffAddr happyCheck off, i) - -- i >= 0: Guard against INVALID_TOK (do the default action, which ultimately errors) - -- off >= 0: Otherwise it's a default action - -- equality check: Ensure that the entry in the compressed array is owned by st - = Happy_Prelude.Just (Happy_GHC_Exts.I# (happyIndexOffAddr happyTable off)) - | Happy_Prelude.otherwise - = Happy_Prelude.Nothing - where - off = PLUS(happyIndexOffAddr happyActOffsets st, i) - -data HappyAction - = HappyFail - | HappyAccept - | HappyReduce Happy_Int -- rule number - | HappyShift Happy_Int -- new state - deriving Happy_Prelude.Show - -{-# INLINE happyDecodeAction #-} -happyDecodeAction :: Happy_Int -> HappyAction -happyDecodeAction 0# = HappyFail -happyDecodeAction -1# = HappyAccept -happyDecodeAction action | LT(action, 0#) = HappyReduce NEGATE(PLUS(action, 1#)) - | Happy_Prelude.otherwise = HappyShift MINUS(action, 1#) - -{-# INLINE happyIndexGotoTable #-} -happyIndexGotoTable nt st = happyIndexOffAddr happyTable off - where - off = PLUS(happyIndexOffAddr happyGotoOffsets st, nt) - -{-# INLINE happyIndexOffAddr #-} -happyIndexOffAddr :: HappyAddr -> Happy_Int -> Happy_Int -happyIndexOffAddr (HappyA# arr) off = -#if __GLASGOW_HASKELL__ >= 901 - Happy_GHC_Exts.int32ToInt# -- qualified import because it doesn't exist on older GHC's -#endif -#ifdef WORDS_BIGENDIAN - -- The CI of `alex` tests this code path - (Happy_GHC_Exts.word32ToInt32# (Happy_GHC_Exts.wordToWord32# (Happy_GHC_Exts.byteSwap32# (Happy_GHC_Exts.word32ToWord# (Happy_GHC_Exts.int32ToWord32# -#endif - (Happy_GHC_Exts.indexInt32OffAddr# arr off) -#ifdef WORDS_BIGENDIAN - ))))) -#endif - -happyIndexRuleArr :: Happy_Int -> (# Happy_Int, Happy_Int #) -happyIndexRuleArr r = (# nt, len #) - where - !(Happy_GHC_Exts.I# n_starts) = happy_n_starts - offs = TIMES(MINUS(r,n_starts),2#) - nt = happyIndexOffAddr happyRuleArr offs - len = happyIndexOffAddr happyRuleArr PLUS(offs,1#) - -data HappyAddr = HappyA# Happy_GHC_Exts.Addr# - ------------------------------------------------------------------------------ --- Shifting a token - -happyShift new_state ERROR_TOK tk st sts stk@(x `HappyStk` _) = - -- See "Error Fixup" below - let i = GET_ERROR_TOKEN(x) in - DEBUG_TRACE("shifting the error token") - happyDoAction i tk new_state (HappyCons st sts) stk - -happyShift new_state i tk st sts stk = - happyNewToken new_state (HappyCons st sts) (MK_TOKEN(tk) `HappyStk` stk) - --- happyReduce is specialised for the common cases. - -happySpecReduce_0 nt fn j tk st sts stk - = happySeq fn (happyGoto nt j tk st (HappyCons st sts) (fn `HappyStk` stk)) - -happySpecReduce_1 nt fn j tk old_st sts@(HappyCons st _) (v1 `HappyStk` stk') - = let r = fn v1 in - happyTcHack old_st (happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))) - -happySpecReduce_2 nt fn j tk old_st - (HappyCons _ sts@(HappyCons st _)) - (v1 `HappyStk` v2 `HappyStk` stk') - = let r = fn v1 v2 in - happyTcHack old_st (happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))) - -happySpecReduce_3 nt fn j tk old_st - (HappyCons _ (HappyCons _ sts@(HappyCons st _))) - (v1 `HappyStk` v2 `HappyStk` v3 `HappyStk` stk') - = let r = fn v1 v2 v3 in - happyTcHack old_st (happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))) - -happyReduce k nt fn j tk st sts stk - = case happyDrop MINUS(k,(1# :: Happy_Int)) sts of - sts1@(HappyCons st1 _) -> - let r = fn stk in -- it doesn't hurt to always seq here... - st `happyTcHack` happyDoSeq r (happyGoto nt j tk st1 sts1 r) - -happyMonadReduce k nt fn j tk st sts stk = - case happyDrop k (HappyCons st sts) of - sts1@(HappyCons st1 _) -> - let drop_stk = happyDropStk k stk in - j `happyTcHack` happyThen1 (fn stk tk) - (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk)) - -happyMonad2Reduce k nt fn j tk st sts stk = - case happyDrop k (HappyCons st sts) of - sts1@(HappyCons st1 _) -> - let drop_stk = happyDropStk k stk - off = happyIndexOffAddr happyGotoOffsets st1 - off_i = PLUS(off, nt) - new_state = happyIndexOffAddr happyTable off_i - in - j `happyTcHack` happyThen1 (fn stk tk) - (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk)) - -happyDrop 0# l = l -happyDrop n (HappyCons _ t) = happyDrop MINUS(n,(1# :: Happy_Int)) t - -happyDropStk 0# l = l -happyDropStk n (x `HappyStk` xs) = happyDropStk MINUS(n,(1#::Happy_Int)) xs - ------------------------------------------------------------------------------ --- Moving to a new state after a reduction - -happyGoto nt j tk st = - DEBUG_TRACE(", goto state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# new_state) Happy_Prelude.++ "\n") - happyDoAction j tk new_state - where new_state = happyIndexGotoTable nt st - -{- Note [Error recovery] -~~~~~~~~~~~~~~~~~~~~~~~~ -When there is no applicable action for the current lookahead token `tk`, -happy enters error recovery mode. Depending on whether the grammar file -declares the two action form `%error { abort } { report }` for - Resumptive Error Handling, -it works in one (not resumptive) or two phases (resumptive): - - 1. Fixup mode: - Try to see if there is an action for the error token ERROR_TOK. If there - is, do *not* emit an error and pretend instead that an `error` token was - inserted. - When there is no ERROR_TOK action, report an error. - - In non-resumptive error handling, calling the single error handler - (e.g. `happyError`) will throw an exception and abort the parser. - However, in resumptive error handling we enter *error resumption mode*. - - 2. Error resumption mode: - After reporting the error (with `report`), happy will attempt to find - a good state stack to resume parsing in. - For each candidate stack, it discards input until one of the candidates - resumes (i.e. shifts the current input). - If no candidate resumes before the end of input, resumption failed and - calls the `abort` function, to much the same effect as in non-resumptive - error handling. - - Candidate stacks are declared by the grammar author using the special - `catch` terminal and called "catch frames". - This mechanism is described in detail in Note [happyResume]. - -The `catch` resumption mechanism (2) is what usually is associated with -`error` in `bison` or `menhir`. Since `error` is used for the Fixup mechanism -(1) above, we call the corresponding token `catch`. -Furthermore, in constrast to `bison`, our implementation of `catch` -non-deterministically considers multiple catch frames on the stack for -resumption (See Note [Multiple catch frames]). - -Note [happyResume] -~~~~~~~~~~~~~~~~~~ -`happyResume` implements the resumption mechanism from Note [Error recovery]. -It is best understood by example. Consider - -Exp :: { String } -Exp : '1' { "1" } - | catch { "catch" } - | Exp '+' Exp %shift { $1 Happy_Prelude.++ " + " Happy_Prelude.++ $3 } -- %shift: associate 1 + 1 + 1 to the right - | '(' Exp ')' { "(" Happy_Prelude.++ $2 Happy_Prelude.++ ")" } - -The idea of the use of `catch` here is that upon encountering a parse error -during expression parsing, we can gracefully degrade using the `catch` rule, -still producing a partial syntax tree and keep on parsing to find further -syntax errors. - -Let's trace the parser state for input 11+1, which will error out after shifting 1. -After shifting, we have the following item stack (growing downwards and omitting -transitive closure items): - - State 0: %start_parseExp -> . Exp - State 5: Exp -> '1' . - -(Stack as a list of state numbers: [5,0].) -As Note [Error recovery] describes, we will first try Fixup mode. -That fails because no production can shift the `error` token. -Next we try Error resumption mode. This works as follows: - - 1. Pop off the item stack until we find an item that can shift the `catch` - token. (Implemented in `pop_items`.) - * State 5 cannot shift catch. Pop. - * State 0 can shift catch, which would transition into - State 4: Exp -> catch . - So record the *stack* `[4,0]` after doing the shift transition. - We call this a *catch frame*, where the top is a *catch state*, - corresponding to an item in which we just shifted a `catch` token. - There can be multiple such catch stacks, see Note [Multiple catch frames]. - - 2. Discard tokens from the input until the lookahead can be shifted in one - of the catch stacks. (Implemented in `discard_input_until_exp` and - `some_catch_state_shifts`.) - * We cannot shift the current lookahead '1' in state 4, so we discard - * We *can* shift the next lookahead '+' in state 4, but only after - reducing, which pops State 4 and goes to State 3: - State 3: %start_parseExp -> Exp . - Exp -> Exp . '+' Exp - Here we can shift '+'. - As you can see, to implement this machinery we need to simulate - the operation of the LALR automaton, especially reduction - (`happySimulateReduce`). - -Note [Multiple catch frames] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -For fewer spurious error messages, it can be beneficial to trace multiple catch -items. Consider - -Exp : '1' - | catch - | Exp '+' Exp %shift - | '(' Exp ')' - -Let's trace the parser state for input (;+1, which will error out after shifting (. -After shifting, we have the following item stack (growing downwards): - - State 0: %start_parseExp -> . Exp - State 6: Exp -> '(' . Exp ')' - -Upon error, we want to find items in the stack which can shift a catch token. -Note that both State 0 and State 6 can shift a catch token, transitioning into - State 4: Exp -> catch . -Hence we record the catch frames `[4,6,0]` and `[4,0]` for possible resumption. - -Which catch frame do we pick for resumption? -Note that resuming catch frame `[4,0]` will parse as "catch+1", whereas -resuming the innermost frame `[4,6,0]` corresponds to parsing "(catch+1". -The latter would keep discarding input until the closing ')' is found. -So we will discard + and 1, leading to a spurious syntax error at the end of -input, aborting the parse and never producing a partial syntax tree. Bad! - -It is far preferable to resume with catch frame `[4,0]`, where we can resume -successfully on input +, so that is what we do. - -In general, we pick the catch frame for resumption that discards the least -amount of input for a successful shift, preferring the topmost such catch frame. --} - --- happyFail :: Happy_Int -> Token -> Happy_Int -> _ --- This function triggers Note [Error recovery]. --- If the current token is ERROR_TOK, phase (1) has failed and we might try --- phase (2). -happyFail ERROR_TOK = happyFixupFailed -happyFail i = happyTryFixup i - --- Enter Error Fixup (see Note [Error recovery]): --- generate an error token, save the old token and carry on. --- When a `happyShift` accepts the error token, we will pop off the error token --- to resume parsing with the current lookahead `i`. -happyTryFixup i tk action sts stk = - DEBUG_TRACE("entering `error` fixup.\n") - happyDoAction ERROR_TOK tk action sts (MK_ERROR_TOKEN(i) `HappyStk` stk) - -- NB: `happyShift` will simply pop the error token and carry on with - -- `tk`. Hence we don't change `tk` in the call here - --- See Note [Error recovery], phase (2). --- Enter resumption mode after reporting the error by calling `happyResume`. -happyFixupFailed tk st sts (x `HappyStk` stk) = - let i = GET_ERROR_TOKEN(x) in - DEBUG_TRACE("`error` fixup failed.\n") - let resume = happyResume i tk st sts stk - expected = happyExpectedTokens st sts in - happyReport i tk expected resume - --- happyResume :: Happy_Int -> Token -> Happy_Int -> _ --- See Note [happyResume] -happyResume i tk st sts stk = pop_items [] st sts stk - where - !(Happy_GHC_Exts.I# n_starts) = happy_n_starts -- this is to test whether we have a start token - !(Happy_GHC_Exts.I# eof_i) = happy_n_terms Happy_Prelude.- 1 -- this is the token number of the EOF token - happy_list_to_list :: Happy_IntList -> [Happy_Prelude.Int] - happy_list_to_list (HappyCons st sts) - | LT(st, n_starts) - = [(Happy_GHC_Exts.I# st)] - | Happy_Prelude.otherwise - = (Happy_GHC_Exts.I# st) : happy_list_to_list sts - - -- See (1) of Note [happyResume] - pop_items catch_frames st sts stk - | LT(st, n_starts) - = DEBUG_TRACE("reached start state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# st) Happy_Prelude.++ ", ") - if Happy_Prelude.null catch_frames_new - then DEBUG_TRACE("no resumption.\n") - happyAbort - else DEBUG_TRACE("now discard input, trying to anchor in states " Happy_Prelude.++ Happy_Prelude.show (Happy_Prelude.map (happy_list_to_list . Happy_Prelude.fst) (Happy_Prelude.reverse catch_frames_new)) Happy_Prelude.++ ".\n") - discard_input_until_exp i tk (Happy_Prelude.reverse catch_frames_new) - | (HappyCons st1 sts1) <- sts, _ `HappyStk` stk1 <- stk - = pop_items catch_frames_new st1 sts1 stk1 - where - !catch_frames_new - | HappyShift new_state <- happyDecodeAction (happyNextAction CATCH_TOK st) - , DEBUG_TRACE("can shift catch token in state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# st) Happy_Prelude.++ ", into state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# new_state) Happy_Prelude.++ "\n") - Happy_Prelude.null (Happy_Prelude.filter (\(HappyCons _ (HappyCons h _),_) -> EQ(st,h)) catch_frames) - = (HappyCons new_state (HappyCons st sts), MK_ERROR_TOKEN(i) `HappyStk` stk):catch_frames -- MK_ERROR_TOKEN(i) is just some dummy that should not be accessed by user code - | Happy_Prelude.otherwise - = DEBUG_TRACE("already shifted or can't shift catch in " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# st) Happy_Prelude.++ "\n") - catch_frames - - -- See (2) of Note [happyResume] - discard_input_until_exp i tk catch_frames - | Happy_Prelude.Just (HappyCons st (HappyCons catch_st sts), catch_frame) <- some_catch_state_shifts i catch_frames - = DEBUG_TRACE("found expected token in state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# st) Happy_Prelude.++ " after shifting from " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# catch_st) Happy_Prelude.++ ": " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# i) Happy_Prelude.++ "\n") - happyDoAction i tk st (HappyCons catch_st sts) catch_frame - | EQ(i,eof_i) -- is i EOF? - = DEBUG_TRACE("reached EOF, cannot resume. abort parse :(\n") - happyAbort - | Happy_Prelude.otherwise - = DEBUG_TRACE("discard token " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# i) Happy_Prelude.++ "\n") - happyLex (\eof_tk -> discard_input_until_exp eof_i eof_tk catch_frames) -- eof - (\i tk -> discard_input_until_exp i tk catch_frames) -- not eof - - some_catch_state_shifts _ [] = DEBUG_TRACE("no catch state could shift.\n") Happy_Prelude.Nothing - some_catch_state_shifts i catch_frames@(((HappyCons st sts),_):_) = try_head i st sts catch_frames - where - try_head i st sts catch_frames = -- PRECONDITION: head catch_frames = (HappyCons st sts) - DEBUG_TRACE("trying token " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# i) Happy_Prelude.++ " in state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# st) Happy_Prelude.++ ": ") - case happyDecodeAction (happyNextAction i st) of - HappyFail -> DEBUG_TRACE("fail.\n") some_catch_state_shifts i (Happy_Prelude.tail catch_frames) - HappyAccept -> DEBUG_TRACE("accept.\n") Happy_Prelude.Just (Happy_Prelude.head catch_frames) - HappyShift _ -> DEBUG_TRACE("shift.\n") Happy_Prelude.Just (Happy_Prelude.head catch_frames) - HappyReduce r -> case happySimulateReduce r st sts of - (HappyCons st1 sts1) -> try_head i st1 sts1 catch_frames - -happySimulateReduce r st sts = - DEBUG_TRACE("simulate reduction of rule " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# r) Happy_Prelude.++ ", ") - let (# nt, len #) = happyIndexRuleArr r in - DEBUG_TRACE("nt " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# nt) Happy_Prelude.++ ", len: " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# len) Happy_Prelude.++ ", new_st ") - let !(sts1@(HappyCons st1 _)) = happyDrop len (HappyCons st sts) - new_st = happyIndexGotoTable nt st1 in - DEBUG_TRACE(Happy_Prelude.show (Happy_GHC_Exts.I# new_st) Happy_Prelude.++ ".\n") - (HappyCons new_st sts1) - -happyTokenToString :: Happy_Prelude.Int -> Happy_Prelude.String -happyTokenToString i = happyTokenStrings Happy_Prelude.!! (i Happy_Prelude.- 2) -- 2: errorTok, catchTok - -happyExpectedTokens :: Happy_Int -> Happy_IntList -> [Happy_Prelude.String] --- Upon a parse error, we want to suggest tokens that are expected in that --- situation. This function computes such tokens. --- It works by examining the top of the state stack. --- For every token number that does a shift transition, record that token number. --- For every token number that does a reduce transition, simulate that reduction --- on the state state stack and repeat. --- The recorded token numbers are then formatted with 'happyTokenToString' and --- returned. -happyExpectedTokens st sts = - DEBUG_TRACE("constructing expected tokens.\n") - Happy_Prelude.map happyTokenToString (search_shifts st sts []) - where - search_shifts st sts shifts = Happy_Prelude.foldr (add_action st sts) shifts (distinct_actions st) - add_action st sts (Happy_GHC_Exts.I# i, Happy_GHC_Exts.I# act) shifts = - DEBUG_TRACE("found action in state " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# st) Happy_Prelude.++ ", input " Happy_Prelude.++ Happy_Prelude.show (Happy_GHC_Exts.I# i) Happy_Prelude.++ ", " Happy_Prelude.++ Happy_Prelude.show (happyDecodeAction act) Happy_Prelude.++ "\n") - case happyDecodeAction act of - HappyFail -> shifts - HappyAccept -> shifts -- This would always be %eof or error... Not helpful - HappyShift _ -> Happy_Prelude.insert (Happy_GHC_Exts.I# i) shifts - HappyReduce r -> case happySimulateReduce r st sts of - (HappyCons st1 sts1) -> search_shifts st1 sts1 shifts - distinct_actions st - -- The (token number, action) pairs of all actions in the given state - = ((-1), (Happy_GHC_Exts.I# (happyIndexOffAddr happyDefActions st))) - : [ (i, act) | i <- [begin_i..happy_n_terms], act <- get_act row_off i ] - where - row_off = happyIndexOffAddr happyActOffsets st - begin_i = 2 -- +2: errorTok,catchTok - get_act off (Happy_GHC_Exts.I# i) -- happyIndexActionTable with cached row offset - | let off_i = PLUS(off,i) - , GTE(off_i,0#) - , EQ(happyIndexOffAddr happyCheck off_i,i) - = [(Happy_GHC_Exts.I# (happyIndexOffAddr happyTable off_i))] - | Happy_Prelude.otherwise - = [] - --- Internal happy errors: - -notHappyAtAll :: a -notHappyAtAll = Happy_Prelude.error "Internal Happy parser panic. This is not supposed to happen! Please open a bug report at https://github.com/haskell/happy/issues.\n" - ------------------------------------------------------------------------------ --- Hack to get the typechecker to accept our action functions - -happyTcHack :: Happy_Int -> a -> a -happyTcHack x y = y -{-# INLINE happyTcHack #-} - ------------------------------------------------------------------------------ --- Seq-ing. If the --strict flag is given, then Happy emits --- happySeq = happyDoSeq --- otherwise it emits --- happySeq = happyDontSeq - -happyDoSeq, happyDontSeq :: a -> b -> b -happyDoSeq a b = a `Happy_GHC_Exts.seq` b -happyDontSeq a b = b - ------------------------------------------------------------------------------ --- Don't inline any functions from the template. GHC has a nasty habit --- of deciding to inline happyGoto everywhere, which increases the size of --- the generated parser quite a bit. - -{-# NOINLINE happyDoAction #-} -{-# NOINLINE happyTable #-} -{-# NOINLINE happyCheck #-} -{-# NOINLINE happyActOffsets #-} -{-# NOINLINE happyGotoOffsets #-} -{-# NOINLINE happyDefActions #-} - -{-# NOINLINE happyShift #-} -{-# NOINLINE happySpecReduce_0 #-} -{-# NOINLINE happySpecReduce_1 #-} -{-# NOINLINE happySpecReduce_2 #-} -{-# NOINLINE happySpecReduce_3 #-} -{-# NOINLINE happyReduce #-} -{-# NOINLINE happyMonadReduce #-} -{-# NOINLINE happyGoto #-} -{-# NOINLINE happyFail #-} - --- end of Happy Template. ===================================== utils/check-cpp/PreProcess.hs ===================================== @@ -21,29 +21,14 @@ import Types -- --------------------------------------------------------------------- +-- | Set parser options for parsing OPTIONS pragmas +initPragState :: Lexer.ParserOpts -> StringBuffer -> RealSrcLoc -> PState PpState +initPragState = Lexer.initPragState initPpState + +-- | Creates a parse state from a 'ParserOpts' value +initParserState :: Lexer.ParserOpts -> StringBuffer -> RealSrcLoc -> PState PpState +initParserState = Lexer.initParserState initPpState --- initPpState :: PpState --- initPpState = --- PpState --- { pp_defines = Map.empty --- , pp_includes = Map.empty --- , pp_include_stack = [] --- , pp_continuation = [] --- , pp_context = [] --- , pp_accepting = True --- } - --- data PpState = PpState --- { pp_defines :: !(Map String [String]) --- , pp_includes :: !(Map String StringBuffer) --- , pp_include_stack :: ![Lexer.AlexInput] --- , pp_continuation :: ![Located Token] --- , pp_context :: ![Token] -- What preprocessor directive we are currently processing --- , pp_accepting :: !Bool --- } --- deriving (Show) - --- deriving instance Show Lexer.AlexInput -- --------------------------------------------------------------------- data CppState @@ -53,6 +38,9 @@ data CppState -- --------------------------------------------------------------------- +lexer = ppLexer +lexerDbg = ppLexerDbg + ppLexer, ppLexerDbg :: Bool -> (Located Token -> PP a) -> PP a -- Use this instead of 'lexer' in GHC.Parser to dump the tokens for debugging. ppLexerDbg queueComments cont = ppLexer queueComments contDbg @@ -119,11 +107,9 @@ processCppToks fs = do processCpp :: [FastString] -> PP () processCpp fs = do - -- traceM $ "processCpp: fs=" ++ show fs - -- let s = cppInitial fs let s = cppInitial fs case parseDirective s of - Left err -> error $ show (err,s) + Left err -> error $ show (err, s) Right (CppInclude filename) -> do ppInclude filename Right (CppDefine name def) -> do @@ -146,7 +132,6 @@ processCpp fs = do setAccepting True return () - -- return (trace ("processCpp:s=" ++ show s) ()) return () -- --------------------------------------------------------------------- @@ -237,44 +222,22 @@ ppInclude filename = do pushIncludeLoc origInput let loc = PsLoc (mkRealSrcLoc (mkFastString filename) 1 1) (BufPos 0) Lexer.setInput (Lexer.AI loc src) - return $ trace ("ppInclude:mSrc=[" ++ show mSrc ++ "]") () - --- return $ trace ("ppInclude:filename=[" ++ filename ++ "]") () ppDefine :: String -> String -> PP () ppDefine name val = P $ \s -> - -- POk s{pp = (pp s){pp_defines = Set.insert (cleanTokenString def) (pp_defines (pp s))}} () - POk s{pp = (pp s){pp_defines = Map.insert (trace ("ppDefine:def=[" ++ name ++ "]") (MacroName name Nothing)) val (pp_defines (pp s))}} () + POk s{pp = (pp s){pp_defines = Map.insert (MacroName name Nothing) val (pp_defines (pp s))}} () ppIsDefined :: String -> PP Bool ppIsDefined def = P $ \s -> - -- POk s (Map.member def (pp_defines (pp s))) - POk s (Map.member (trace ("ppIsDefined:def=[" ++ def ++ "]") (MacroName def Nothing)) (pp_defines (pp s))) + POk s (Map.member (MacroName def Nothing) (pp_defines (pp s))) ppIf :: String -> PP Bool ppIf str = P $ \s -> - -- -- POk s (Map.member def (pp_defines (pp s))) - -- POk s (Map.member (trace ("ppIsDefined:def=[" ++ def ++ "]") def) (pp_defines (pp s))) let s' = cppIf (pp s) str in POk s{pp = s'} (pp_accepting s') --- | Take a @FastString@ of the form "#define FOO\n" and strip off all but "FOO" -cleanTokenString :: FastString -> String -cleanTokenString fs = r - where - ss = dropWhile (\c -> not $ isSpace c) (unpackFS fs) - r = init ss - --- parseDefine :: FastString -> Maybe (String, [String]) --- parseDefine fs = r --- where --- -- r = Just (cleanTokenString s, "") --- r = case parseCppParser cppDefinition (unpackFS fs) of --- Left _ -> Nothing --- Right v -> Just v - -- ===================================================================== {- | Do cpp initial processing, as per https://gcc.gnu.org/onlinedocs/cpp/Initial-processing.html View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/76d8e94361190d4b9dade8a70a9eff50205bb493 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/76d8e94361190d4b9dade8a70a9eff50205bb493 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 23:48:39 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 04 Feb 2025 18:48:39 -0500 Subject: [Git][ghc/ghc][wip/T25647] wibbles Message-ID: <67a2a757dcaaf_348bf6826d009347c@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 81e27683 by Simon Peyton Jones at 2025-02-04T23:48:10+00:00 wibbles Including fix for #25725 - - - - - 6 changed files: - compiler/GHC/Rename/Module.hs - compiler/Language/Haskell/Syntax/Decls.hs - testsuite/tests/typecheck/should_compile/T25647.hs - + testsuite/tests/typecheck/should_compile/T25647_fail.hs - + testsuite/tests/typecheck/should_compile/T25725.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -659,6 +659,7 @@ rnClsInstDecl (ClsInstDecl { cid_ext = (inst_warn_ps, _, _) rnFamEqn :: HsDocContext -> AssocTyFamInfo -> FamEqn GhcPs rhs + -> FreeKiTyVars -- Implicit binders of the rhs payload -> (HsDocContext -> rhs -> RnM (rhs', FreeVars)) -> RnM (FamEqn GhcRn rhs', FreeVars) rnFamEqn doc atfi @@ -666,7 +667,7 @@ rnFamEqn doc atfi , feqn_bndrs = outer_bndrs , feqn_pats = pats , feqn_fixity = fixity - , feqn_rhs = payload }) rn_payload + , feqn_rhs = payload }) payload_kvs rn_payload = do { tycon' <- lookupFamInstName mb_cls tycon -- all_imp_vars represent the implicitly bound type variables. This is @@ -697,7 +698,7 @@ rnFamEqn doc atfi -- -- For associated type family instances, exclude the type variables -- bound by the instance head with filterInScopeM (#19649). - ; all_imp_vars <- filterInScopeM $ pat_kity_vars + ; all_imp_vars <- filterInScopeM $ (pat_kity_vars ++ payload_kvs) ; bindHsOuterTyVarBndrs doc mb_cls all_imp_vars outer_bndrs $ \rn_outer_bndrs -> do { (pats', pat_fvs) <- rnLHsTypeArgs (FamPatCtx tycon) pats @@ -847,8 +848,9 @@ rnTyFamInstEqn :: AssocTyFamInfo -> TyFamInstEqn GhcPs -> RnM (TyFamInstEqn GhcRn, FreeVars) rnTyFamInstEqn atfi eqn@(FamEqn { feqn_tycon = tycon }) - = rnFamEqn (TySynCtx tycon) atfi eqn rnTySyn - + = rnFamEqn (TySynCtx tycon) atfi eqn + [{- No implicit vars on RHS of a type instance -}] + rnTySyn rnTyFamDefltDecl :: Name -> TyFamDefltDecl GhcPs @@ -859,8 +861,9 @@ rnDataFamInstDecl :: AssocTyFamInfo -> DataFamInstDecl GhcPs -> RnM (DataFamInstDecl GhcRn, FreeVars) rnDataFamInstDecl atfi (DataFamInstDecl { dfid_eqn = - eqn@(FamEqn { feqn_tycon = tycon })}) - = do { (eqn', fvs) <- rnFamEqn (TyDataCtx tycon) atfi eqn rnDataDefn + eqn@(FamEqn { feqn_tycon = tycon, feqn_rhs = defn })}) + = do { let implicit_kvs = extractDataDefnKindVars defn + ; (eqn', fvs) <- rnFamEqn (TyDataCtx tycon) atfi eqn implicit_kvs rnDataDefn ; return (DataFamInstDecl { dfid_eqn = eqn' }, fvs) } -- Renaming of the associated types in instances. ===================================== compiler/Language/Haskell/Syntax/Decls.hs ===================================== @@ -809,9 +809,11 @@ data HsDataDefn pass -- The payload of a data type defn -- *and* for data family instances = -- | Declares a data type or newtype, giving its constructors -- @ - -- data/newtype T a = - -- data/newtype instance T [a] = + -- data/newtype T a :: ksig = + -- data/newtype instance T [a] :: ksig = -- @ + -- The HsDataDefn describes the (optional) kind signature and the + -- but not the `data T a` or `newtype T [a]` headers HsDataDefn { dd_ext :: XCHsDataDefn pass, dd_ctxt :: Maybe (LHsContext pass), -- ^ Context dd_cType :: Maybe (XRec pass CType), ===================================== testsuite/tests/typecheck/should_compile/T25647.hs ===================================== @@ -16,21 +16,17 @@ newtype Fix1a f = In1a (f (Fix1a f)) newtype Fix1b f where In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff --- A plain newtype, GADT syntax, with a return kind signature +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor -- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r --- Rejected because of deafulting; maybe that's OK --- newtype Fix2 f :: TYPE r where --- In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff +newtype Fix2 f :: TYPE r where + In2 :: forall r (ff :: TYPE r -> TYPE r). ff (Fix2 ff) -> Fix2 ff -- Plain newtype, H98 syntax, standalone kind signature -- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r newtype Fix3 f = In3 (f (Fix3 f)) --- This variant produces a /terrible/ message --- type Fix3a :: forall r k. (TYPE r -> TYPE r) -> TYPE r --- newtype Fix3a f = In3a (f (Fix3 f)) - -- Plain newtype, H98 syntax, standalone kind signature -- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r @@ -38,11 +34,6 @@ newtype Fix4 f where In4 :: forall rr (ff :: TYPE rr -> TYPE rr). ff (Fix4 ff) -> Fix4 @rr ff --- Rejected because of defulting; maybe that's OK ---type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r ---newtype Fix4a f where --- In4a :: ff (Fix4a ff) -> Fix4a ff - -------------------- Data families with newtype instance ----------------- -- data instance in GADT sytntax @@ -64,15 +55,11 @@ data family Dix3 :: (k -> Type) -> k newtype instance Dix3 f = DIn3 (f (Dix3 f)) -- newtype instance in GADT syntax --- Rejected because of defaulting +-- The newtype instance defaults to LiftedRep data family Dix4 :: (k -> TYPE r) -> k newtype instance Dix4 f where DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff ---data family Dix4a :: (k -> TYPE r) -> k ---newtype instance forall r f. Dix4a f :: TYPE r where --- DIn4a :: forall r (ff :: TYPE r -> TYPE r). ff (Dix4a ff) -> Dix4a ff - -- newtype instance in H98 syntax data family Dix5 :: (k -> TYPE r) -> k newtype instance Dix5 f = DIn5 (f (Dix5 f)) ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.hs ===================================== @@ -0,0 +1,58 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647 where + +import GHC.Exts +import Data.Kind + +-------------------- Plain newtypes ----------------- + +-- Rejected because in the type signature for In2 we default +-- the runtime-rep variable to LiftedRep, and that makes In2 +-- into a GADT +newtype Fix2 f :: TYPE r where + In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff + +-- Rejected because of defulting; maybe that's OK +type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4a f where + In4a :: ff (Fix4a ff) -> Fix4a ff + +-- This variant produces a /terrible/ message +-- type Fix3a :: forall r k. (TYPE r -> TYPE r) -> TYPE r +-- newtype Fix3a f = In3a (f (Fix3 f)) + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in GADT syntax +-- Rejected because of defaulting +data family Dix4 :: (k -> TYPE r) -> k +newtype instance Dix4 f where + DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff + +data family Dix4a :: (k -> TYPE r) -> k +newtype instance forall r f. Dix4a f :: TYPE r where + DIn4a :: forall r (ff :: TYPE r -> TYPE r). ff (Dix4a ff) -> Dix4a ff + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + ===================================== testsuite/tests/typecheck/should_compile/T25725.hs ===================================== @@ -0,0 +1,17 @@ +{-# LANGUAGE TypeFamilies, PolyKinds #-} + +module T25725 where + +import Data.Kind +import GHC.Exts + +--This one was OK +data D :: TYPE r -> Type where + MkD :: p -> D p + +-- But this was rejected +data family Dix4 :: Type -> k +data instance Dix4 Int :: TYPE r -> Type where + DIn4 :: p -> Dix4 Int p + + ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -933,3 +933,4 @@ test('T25266', normal, compile, ['']) test('T25266a', normal, compile_fail, ['']) test('T25266b', normal, compile, ['']) test('T25597', normal, compile, ['']) +test('T25725', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/81e27683750b15bb2f869109a355247fb7bf7dee -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/81e27683750b15bb2f869109a355247fb7bf7dee You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 4 23:52:28 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 04 Feb 2025 18:52:28 -0500 Subject: [Git][ghc/ghc][wip/T23109] Wibble imports Message-ID: <67a2a83c6c6f0_348bf62e6ac09367d@gitlab.mail> Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: f37dfcbc by Simon Peyton Jones at 2025-02-04T23:51:41+00:00 Wibble imports - - - - - 1 changed file: - compiler/GHC/Types/Id.hs Changes: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -165,13 +165,9 @@ import GHC.Stg.EnforceEpt.TagSig import GHC.Unit.Module import {-# SOURCE #-} GHC.Builtin.PrimOps (PrimOp) import GHC.Builtin.Uniques (mkBuiltinUnique) -import GHC.Builtin.Uniques (mkBuiltinUnique) import GHC.Data.Maybe import GHC.Data.FastString -import GHC.Data.Maybe - -import GHC.Unit.Module import GHC.Utils.Misc import GHC.Utils.Outputable View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f37dfcbcabd0705b6f8a925f2ed16c61ad057e5c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f37dfcbcabd0705b6f8a925f2ed16c61ad057e5c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 07:58:33 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Wed, 05 Feb 2025 02:58:33 -0500 Subject: [Git][ghc/ghc][wip/T23109] Import wibble Message-ID: <67a31a29ac343_1879b912cf84827692@gitlab.mail> Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: ff1f263c by Simon Peyton Jones at 2025-02-05T07:58:16+00:00 Import wibble - - - - - 1 changed file: - compiler/GHC/Tc/Instance/Class.hs Changes: ===================================== compiler/GHC/Tc/Instance/Class.hs ===================================== @@ -57,7 +57,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Utils.Misc( splitAtList, fstOf3 ) import GHC.Data.FastString -import GHC.Data.Maybe ( expectJust ) import GHC.Unit.Module.Warnings View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff1f263c3a453f84d69aef83b1e115e6b9c089bc -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff1f263c3a453f84d69aef83b1e115e6b9c089bc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 09:46:05 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Wed, 05 Feb 2025 04:46:05 -0500 Subject: [Git][ghc/ghc][wip/T25647] Wibble Message-ID: <67a3335d41b1a_1e09a818062842918@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 5b1c26f7 by Simon Peyton Jones at 2025-02-05T09:45:50+00:00 Wibble - - - - - 5 changed files: - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - testsuite/tests/typecheck/should_compile/T25647_fail.hs - + testsuite/tests/typecheck/should_compile/T25647_fail.stderr - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -3360,24 +3360,52 @@ So, we use bindOuterFamEqnTKBndrs (which does not create an implication for the telescope), and generalise over /all/ the variables in the LHS, without treating the explicitly-quantified ones specially. Wrinkles: - - When generalising, include the explicit user-specified forall'd +(GT1) When generalising, include the explicit user-specified forall'd variables, so that we get an error from Validity.checkFamPatBinders if a forall'd variable is not bound on the LHS - - We still want to complain about a bad telescope among the user-specified +(GT2) We still want to complain about a bad telescope among the user-specified variables. So in checkFamTelescope we emit an implication constraint quantifying only over them, purely so that we get a good telescope error. - - Note that, unlike a type signature like +(GT3) Note that, unlike a type signature like f :: forall (a::k). blah we do /not/ care about the Inferred/Specified designation or order for the final quantified tyvars. Type-family instances are not invoked directly in Haskell source code, so visible type application etc plays no role. -See also Note [Re-quantify type variables in rules] in -GHC.Tc.Gen.Rule, which explains a /very/ similar design when -generalising over the type of a rewrite rule. +(GT4) Consider #25647 (with UnliftedNewtypes) + type N :: forall r. (TYPE r -> TYPE r) -> TYPE r + newtype N f where { MkN :: ff (N ff) -> N ff } + When kind-checking the type signature for MkN we'll start wtih + ff :: TYPE kappa -> TYPE kappa + MkN :: ff (N @kappa) ff -> N @kappa ff + Then we generalise /and default the RuntimeRep variable kappa/ + (via `kindGeneralizeAll` in `tcConDecl`), thus kappa := LiftedRep + + But now the newtype looks like a GADT and we get an error + A newtype must not be a GADT + + This seems OK. We are just following the rules. + + But this variant (the original report in #25647) + data family Fix2 :: (k -> Type) -> k + newtype instance Fix2 f where { In2 :: f (Fix2 f) -> Fix2 f } + At the `newtype instance`, we first + 1. Find the kind of the newtype instance in `tcDataFamInstHeader` + 2. Typecheck the newtype definitition itself in `tcConDecl` + In step 1 we do /not/ want to get + newtype instance forall r . Fix2 (f :: TYPE r -> TYPE r) :: TYPE r where + If we do, we'll get that same "newtype must not be GADT" error as for N above. + Rather, we want to default the RuntimeRep variable r := LiftedRep. Hence + the use of `DefaultNonStandardTyVars` in `tcDataFamInstHeader`. The key thing + is that we must make the /same/ choice here as we do in kind-checking the data + constructor's type. + +See also Note [Re-quantify type variables in rules] in GHC.Tc.Gen.Rule, which +explains a /very/ similar design when generalising over the type of a rewrite +rule. -} ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -976,6 +976,9 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs + -- DefaultNonStandardTyVars: see (GT4) in + -- GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] + ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.hs ===================================== @@ -5,54 +5,13 @@ module T25647 where import GHC.Exts import Data.Kind --------------------- Plain newtypes ----------------- - -- Rejected because in the type signature for In2 we default -- the runtime-rep variable to LiftedRep, and that makes In2 -- into a GADT newtype Fix2 f :: TYPE r where In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff --- Rejected because of defulting; maybe that's OK +-- Rejected for the same reason type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r newtype Fix4a f where In4a :: ff (Fix4a ff) -> Fix4a ff - --- This variant produces a /terrible/ message --- type Fix3a :: forall r k. (TYPE r -> TYPE r) -> TYPE r --- newtype Fix3a f = In3a (f (Fix3 f)) - --------------------- Data families with newtype instance ----------------- - --- data instance in GADT sytntax -data family Dix1 :: (k -> Type) -> k -data instance Dix1 f where - DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff - --- newtype instance in GADT syntax -data family Dix2 :: (k -> Type) -> k -newtype instance Dix2 f where - DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff - -data family Dix2a :: (k -> Type) -> k -newtype instance Dix2a f :: Type where - DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff - --- newtype instance in H98 syntax -data family Dix3 :: (k -> Type) -> k -newtype instance Dix3 f = DIn3 (f (Dix3 f)) - --- newtype instance in GADT syntax --- Rejected because of defaulting -data family Dix4 :: (k -> TYPE r) -> k -newtype instance Dix4 f where - DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff - -data family Dix4a :: (k -> TYPE r) -> k -newtype instance forall r f. Dix4a f :: TYPE r where - DIn4a :: forall r (ff :: TYPE r -> TYPE r). ff (Dix4a ff) -> Dix4a ff - --- newtype instance in H98 syntax -data family Dix5 :: (k -> TYPE r) -> k -newtype instance Dix5 f = DIn5 (f (Dix5 f)) - ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.stderr ===================================== @@ -0,0 +1 @@ + \ No newline at end of file ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -933,4 +933,5 @@ test('T25266', normal, compile, ['']) test('T25266a', normal, compile_fail, ['']) test('T25266b', normal, compile, ['']) test('T25597', normal, compile, ['']) -test('T25725', normal, compile, ['']) +test('T25647', normal, compile, ['']) +test('T25647_fail', normal, compile_fail, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b1c26f70045663c0c68bbacfb4f48259975dd1b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b1c26f70045663c0c68bbacfb4f48259975dd1b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 11:15:20 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 05 Feb 2025 06:15:20 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] uncondInline join points for trivial applications without free vars Message-ID: <67a34848a469a_200a51610c389015c@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: 980225e3 by Rodrigo Mesquita at 2025-02-05T11:14:20+00:00 uncondInline join points for trivial applications without free vars - - - - - 1 changed file: - compiler/GHC/Core/Unfold.hs Changes: ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,7 +434,7 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body | exprIsTrivial body = True -- Nullary constructors, literals @@ -443,9 +443,38 @@ uncondInlineJoin _bndrs body , isJoinId v -- Indirection to another join point; always inline = True + | trivialAppWithoutFreeArgs + -- See Note [...] + = True + | otherwise = False + where + -- Arguments cannot be free Vars!! See Note ... + trivialAppWithoutFreeArgs = go body + go (App f a) + + -- Go over types + | Type _ <- a = go f + + -- 1. If arg is a Var, it must be bound by bndrs + | Var v <- a + , v `elem` bndrs {- not free -} + = go f + + -- 2. If arg is otherwise trivial, continue + | exprIsTrivial a = go f + + -- Go over casts (and ticks?) + go (Cast e _) = go e + go (Tick _ e) = go e + + go (Var _) = True -- reached base case (function being applied, may be free var) + + go e = False -- any other case is not trivial app without free args + + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/980225e3dae2f5949ce53fb915b2bd88570309c3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/980225e3dae2f5949ce53fb915b2bd88570309c3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 11:20:29 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 05 Feb 2025 06:20:29 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] uncondInline join points for trivial applications without free vars Message-ID: <67a3497dd82e8_200a51624abc93828@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: cffdfc86 by Rodrigo Mesquita at 2025-02-05T11:20:14+00:00 uncondInline join points for trivial applications without free vars - - - - - 1 changed file: - compiler/GHC/Core/Unfold.hs Changes: ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,7 +434,7 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body | exprIsTrivial body = True -- Nullary constructors, literals @@ -443,9 +443,39 @@ uncondInlineJoin _bndrs body , isJoinId v -- Indirection to another join point; always inline = True + | trivialAppWithoutFreeArgs + -- See Note [...] + = True + | otherwise = False + where + -- Arguments cannot be free Vars!! See Note ... + trivialAppWithoutFreeArgs = go body + go (App f a) + + -- Go over types + | Type _ <- a = go f + + -- 1. If arg is a Var, it must be bound by bndrs + | Var v <- a + = if v `elem` bndrs {- not free -} + then go f + else False + + -- 2. If arg is otherwise trivial, continue + | exprIsTrivial a = go f + + -- Go over casts (and ticks?) + go (Cast e _) = go e + go (Tick _ e) = go e + + go (Var _) = True -- reached base case (function being applied, may be free var) + + go e = False -- any other case is not trivial app without free args + + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cffdfc864212e5ae6d91018cc55347565ec3b166 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cffdfc864212e5ae6d91018cc55347565ec3b166 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 11:55:08 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 05 Feb 2025 06:55:08 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] uncondInline join points for trivial applications without free vars Message-ID: <67a3519c4d767_200a51d19a5c102467@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: bc892215 by Rodrigo Mesquita at 2025-02-05T11:54:43+00:00 uncondInline join points for trivial applications without free vars TODO: Commit Message TODO: Write Note TODO: Update [Duplicating join points] - - - - - 2 changed files: - compiler/GHC/Core/Unfold.hs - testsuite/tests/perf/compiler/all.T Changes: ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,7 +434,7 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body | exprIsTrivial body = True -- Nullary constructors, literals @@ -443,9 +443,39 @@ uncondInlineJoin _bndrs body , isJoinId v -- Indirection to another join point; always inline = True + | trivialAppWithoutFreeArgs + -- See Note [...] + = True + | otherwise = False + where + -- Arguments cannot be free Vars!! See Note ... + trivialAppWithoutFreeArgs = go body + go (App f a) + + -- Go over types + | Type _ <- a = go f + + -- 1. If arg is a Var, it must be bound by bndrs + | Var v <- a + = if v `elem` bndrs {- not free -} + then go f + else False + + -- 2. If arg is otherwise trivial, continue + | exprIsTrivial a = go f + + -- Go over casts (and ticks?) + go (Cast e _) = go e + go (Tick _ e) = go e + + go (Var _) = True -- reached base case (function being applied, may be free var) + + go _ = False -- any other case is not trivial app without free args + + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -612,6 +612,17 @@ test ('T16473', compile_and_run, ['-O2 -flate-specialise']) +# Run this program. If inlining the join point fails, it'll start to allocate much more. +# The join point is only created when -fno-local-float-out +test ('T16473b', + [ collect_stats('bytes allocated',5) + , only_ways(['normal']) + , js_broken(22261) + ], + compile_and_run, + ['-O2 -fno-local-float-out']) + + test('T17516', [ collect_compiler_runtime(5), ], View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bc8922158b432ff5beda412f68c5a593c2c2bf9e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bc8922158b432ff5beda412f68c5a593c2c2bf9e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 12:26:48 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Wed, 05 Feb 2025 07:26:48 -0500 Subject: [Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] add test T25647 Message-ID: <67a35908aeb23_200a5113236c81067c@gitlab.mail> Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC Commits: 8ab05963 by Patrick at 2025-02-05T20:26:34+08:00 add test T25647 - - - - - 2 changed files: - + testsuite/tests/indexed-types/should_compile/T25647.hs - testsuite/tests/indexed-types/should_compile/all.T Changes: ===================================== testsuite/tests/indexed-types/should_compile/T25647.hs ===================================== @@ -0,0 +1,73 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647 where + +import GHC.Exts +import Data.Kind + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r +newtype Fix2 f :: TYPE r where + In2 :: forall r (ff :: TYPE r -> TYPE r). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f +type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f +type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4 f where + In4 :: forall rr (ff :: TYPE rr -> TYPE rr). + ff (Fix4 ff) -> Fix4 @rr ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in GADT syntax +-- The newtype instance defaults to LiftedRep +-- fail with additional equality constraints: + -- • A newtype must not be a GADT: [(t, LiftedRep), (r, LiftedRep), + -- (f, ff)] + +-- data family Dix4 :: (k -> TYPE r) -> k +-- newtype instance Dix4 f where +-- DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +data family Dix6 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix6 f where + DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/indexed-types/should_compile/all.T ===================================== @@ -315,3 +315,4 @@ test('T25611a', normal, compile, ['']) test('T25611b', normal, compile, ['']) test('T25611c', normal, compile, ['']) test('T25611d', normal, compile, ['']) +test('T25647', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8ab0596313559d7ca8eb2a15382a726aebae20c8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8ab0596313559d7ca8eb2a15382a726aebae20c8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 12:39:23 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Wed, 05 Feb 2025 07:39:23 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] 37 commits: Fixes for built-in names (#25182, #25174) Message-ID: <67a35bfb419e_200a511780c981103f4@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: cc4470be by Vladislav Zavialov at 2025-01-28T18:32:38+03:00 Fixes for built-in names (#25182, #25174) * In isBuiltInOcc_maybe, do not match on "FUN" (#25174) * Classify MkSolo as UserSyntax (#25182) Extracted from 51e3ec839c378f0da7052278a56482f0349e9bc7 - - - - - 1e9f966b by Andreas Klebinger at 2025-02-05T13:16:42+01:00 9.10.2 backport batch 5 - patch notes. - - - - - f959fbbf by Andreas Klebinger at 2025-02-05T13:16:44+01:00 9.10.2: Bump base to version 4.20.1 - - - - - 1fd4f8d4 by Andreas Klebinger at 2025-02-05T13:16:44+01:00 Allow unknown fd device types for setNonBlockingMode. This allows fds with a unknown device type to have blocking mode set. This happens for example for fds from the inotify subsystem. Fixes #25199. (cherry picked from commit 620becd72ec18ca08c1ed86759d65a0e614fe43c) - - - - - a610550e by Sylvain Henry at 2025-02-05T13:16:44+01:00 Fix interaction between fork and kqueue (#24672) A kqueue file descriptor isn't inherited by a child created with fork. As such we mustn't try to close this file descriptor as we would close a random one, e.g. the one used by timerfd. Fix #24672 (cherry picked from commit e7a26d7a6faf1ea534e036c5085a0a027dbb6f5f) - - - - - 877ce54e by Sylvain Henry at 2025-02-05T13:16:44+01:00 JS: fix h$withCStringOnHeap helper (#25288) strlen returns the length of the string without the \0 terminating byte, hence CString weren't properly allocated on the heap (ending \0 byte was missing). - - - - - 2694559a by Ben Gamari at 2025-02-05T13:16:44+01:00 base: Propagate `error` CallStack to thrown exception Previously `errorCallWithCallStackException` failed to propagate its `CallStack` argument, which represents the call-chain of the preceding `error` call, to the exception that it returned. Consequently, the call-stack of `error` calls were quite useless. Unfortunately, this is the second time that I have fixed this but it seems the first must have been lost in rebasing. Fixes a bug in the implementation of CLC proposal 164 <https://github.com/haskell/core-libraries-committee/issues/164> Fixes #24807. (cherry picked from commit 5f7c20bc6b9deacabb1fb099781f00371cdb4369) - - - - - 295066e0 by Matthew Pickering at 2025-02-05T13:16:44+01:00 driver: Fix -working-dir for foreign files -working-dir definitely needs more serious testing, there are some easy ways to test this. * Modify Cabal to call ghc using -working-dir rather than changing directory. * Modify the testsuite to run ghc using `-working-dir` rather than running GHC with cwd = temporary directory. However this will have to wait until after 9.12. Fixes #25150 (cherry picked from commit c20d51867c824e32c61bd1e002680bef268e4f51) - - - - - 66bc119e by Matthew Pickering at 2025-02-05T13:16:44+01:00 ci: Fix variable inheritence for ghcup-metadata testing job Downstream in ghcup-ci we use the CONFIGURE_ARGS variable to determine how to setup all the different jobs. On the downstream trigger this was being inherited from the default setting in .gitlab.yml file. Therefore this led to job failures as the necessary CONFIGURE_ARGS were not being passed to the configure script when installing the bindist. See docs: * https://docs.gitlab.com/ee/ci/yaml/#inherit * https://docs.gitlab.com/ee/ci/yaml/#triggerforward 1. inherit:variables:fals - This stops the global variables being inherited into the job and hence forwarded onto the downstream job. 2. trigger:forward:* - yaml_variables: true (default) pass yaml variables to downstream, this is important to pass the upstream pipeline id to downstream. - pipeline_variables: false (default) but don't pass pipeline variables (normal environment variables). Fixes #25294 (cherry picked from commit 7cb7172eff9e18ed1c98f65a98018f76c4fcc9f6) - - - - - 8115f185 by Andreas Klebinger at 2025-02-05T13:16:44+01:00 ghc-experimental: Expose primops and ghc extensions via GHC.PrimOps This will be the new place for functions that would have gone into GHC.Exts in the past but are not stable enough to do so now. Addresses #25242 (cherry picked from commit 39497eeda74fc7f1e7ea89292de395b16f69cee2) - - - - - 3d359ceb by Sven Tennie at 2025-02-05T13:16:44+01:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. (cherry picked from commit eb612fbc8e94d50c9895c02f3d6ee076f61b7773) - - - - - 9b4326cf by Sven Tennie at 2025-02-05T13:16:45+01:00 AArch64: Implement switch/jump tables (#19912) This improves the performance of Cmm switch statements (compared to a chain of if statements.) (cherry picked from commit 1d22611665117131d1c7c3c0287696e8efcc88f2) - - - - - c84829f6 by Andrzej Rybczak at 2025-02-05T13:16:45+01:00 Fix typo in the @since annotation of annotateIO (cherry picked from commit 55609880c3eeda2c13859c10c157d7df05496288) - - - - - 49c55699 by Cristiano Moraes at 2025-02-05T13:16:45+01:00 configure: Find C++ probing when GCC version is the latest but G++ is old #23118 (cherry picked from commit 78ad81ecef846f73fee0f6c1a86cd6f19aa29b21) - - - - - cfc314a3 by sheaf at 2025-02-05T13:16:45+01:00 LLVM: use sse4.2 instead of sse42 LLVM expects the former instead of the latter since version 3.4. Fixes #25019 (cherry picked from commit 694489edf35c35b29fbdf09a8e3fdc404469858f) - - - - - c9285fd3 by sheaf at 2025-02-05T13:16:45+01:00 LLVM: make SSE4.2 imply +popcnt For consistency with the NCG as well as with Clang and GCC, we make the SSE4.2 feature flag imply +popcnt when using the LLVM backend. Fixes #25353 (cherry picked from commit 06ae85071b95376bd1eb354f7cc7901aed45b625) - - - - - 494646ba by Ben Gamari at 2025-02-05T13:16:45+01:00 testsuite: Normalise trailing digits from hole fits output The type variables in the holes fit output from `abstract_refinement_hole_fits` is quite sensitive to compiler configuration. Specifically, a slight change in the inlining behavior of `throw` changes type variable naming in `(>>=)` and a few others. Ideally we would make hole fits output more deterministic but in the meantime we simply normalise this difference away as it not relevant to the test's goal. (cherry picked from commit d029f1700effa626ff622700b198ed49ee8b6c19) - - - - - c193dfb6 by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Add test for #25066 (cherry picked from commit da5d7d0d8bde06a1c29612fd17b6a579fc523036) - - - - - aae9f5eb by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Fix #25066 As noted in #25066, the exception backtrace proposal introduced a rather subtle performance regression due to simplification producing Core which the demand analyser concludes may diverge with a precise exception. The nature of the problem is more completely described in the new Note [Hiding precise exception signature in throw]. The (rather hacky) solution we use here hides the problematic optimisation through judicious use of `noinline`. Ultimately however we will want a more principled solution (e.g. #23847). Fixes #255066 CLC proposal: https://github.com/haskell/core-libraries-committee/issues/290 Metric Decrease: T9872d (cherry picked from commit eb7ddae1a2b3fb1be1cd635849516a6398327b29) - - - - - 69c96a5e by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Improve documentation of Control.Exception.Backtrace (cherry picked from commit 0060ece762d7a936daf28195676b6162c30dc845) - - - - - f7654701 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 9.10.2 - more changelogs - - - - - 095575a4 by Cheng Shao at 2025-02-05T13:16:45+01:00 Revert "compiler: start deprecating cmmToRawCmmHook" This reverts commit 1c064ef1f3e1aa2afc996e962ad53effa99ec5f4. Turns out the GHC-WPC project does use it to observe Cmm in the pipeline, see #25363. (cherry picked from commit 525d451e175c7d6acfa968ce99d8d3fc7a8af0c7) - - - - - c6574dc0 by Cheng Shao at 2025-02-05T13:16:45+01:00 rts: fix pointer overflow undefined behavior in bytecode interpreter This patch fixes an unnoticed undefined behavior in the bytecode interpreter. It can be caught by building `rts/Interpreter.c` with `-fsanitize=pointer-overflow`, the warning message is something like: ``` rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13 rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13 rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13 ``` Whenever we do something like `SpW(-1)`, the negative argument is implicitly converted to an unsigned integer type and causes pointer arithmetic overflow. It happens to be harmless for most targets since overflowing would wrap the result to desired value, but it's still coincidental and undefined behavior. Furthermore, it causes real damage to the wasm backend, given clang-20 will emit invalid wasm code that crashes at run-time for this kind of C code! (see https://github.com/llvm/llvm-project/issues/108770) The fix here is adding some explicit casts to ensure we always use the signed `ptrdiff_t` type as right hand operand of pointer arithmetic. (cherry picked from commit 5bcfefd5bb73c18a9bad63d1813968832b696f9a) - - - - - 6f063d52 by Zubin Duggal at 2025-02-05T13:16:45+01:00 rel-eng: ghcup metadata generation: generated yaml anchors with meaningful names (cherry picked from commit d83f5bd730a8aef37d8a38b3560590d9798f8e45) (cherry picked from commit 280b627869da55a22b4b9a3458e6115b06b5fff4) - - - - - cf621c89 by Zubin Duggal at 2025-02-05T13:16:45+01:00 release: copy zip files into the correct directory Fixes #25446 (cherry picked from commit 346e4cd1903b2cbcc9bb7c39652666c513eb2a59) - - - - - 92d3d9a0 by Zubin Duggal at 2025-02-05T13:16:45+01:00 release: Sign .gz bindists too Fixes #25447 (cherry picked from commit bbdbe2254df1bfc9157cfb409afc93f8157712cd) - - - - - 4381b865 by Sebastian Graf at 2025-02-05T13:16:45+01:00 DmdAnal: Make `prompt#` lazy (#25439) This applies the same treatment to `prompt#` as for `catch#`. See `Note [Strictness for mask/unmask/catch/prompt]`. Fixes #25439. (cherry picked from commit 00d58ae18a7ce8db6b2d57261a08ba8c1c2549b5) - - - - - 25797520 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Compacting GC: Handle black holes in large objects. As #14497 showed black holes can appear inside large objects when we capture a computation and later blackhole it like we do for AP_STACK closures. Fixes #24791 (cherry picked from commit 7f90f319531c312a074d21688b05f664f0d173fc) - - - - - db9e443a by Ben Gamari at 2025-02-05T13:16:45+01:00 rts: Allow ExecPage to allocate anywhere in address space Currently the ExecPage facility has two users: * GHCi, for constructing info tables, and * the adjustor allocation path Despite neither of these have any spatial locality constraints ExecPage was using the linker's `mmapAnonForLinker`, which tries hard to ensure that mappings end up nearby the executable image. This makes adjustor allocation needlessly subject to fragmentation concerns. We now instead return less constrained mappings, improving the robustness of the mechanism. Addresses #25503. (cherry picked from commit a104508d2ea5bbc61c4a756dca42fc043b329709) - - - - - cc5bebf9 by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Fix incorrect mentions of GHC.Internal.Numeric These were incorrectly changed by the automated refactoring of the `ghc-internal` migration. Fixes #25521. (cherry picked from commit c3fc9b861fd00a85a4fcbd9960b8242d9fabe04b) - - - - - a0cc8121 by Arnaud Spiwack at 2025-02-05T13:16:45+01:00 Add test for #25428 (cherry picked from commit e6c957e49260230c4cb297aeec16be3293381fb7) - - - - - 655482c7 by Rodrigo Mesquita at 2025-02-05T13:16:45+01:00 ghc-internal: Derive version from ghc's version Fixes #25005 This also introduces ghc-experimental.cabal.in (cherry picked from commit 05116c83ec0d74bc66fa50181df8f577a09f24a6) - - - - - 59b542fe by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Change versionig of ghc-experimental to follow ghc versions. Just like ghc-internal it will now use the @ProjectVersionForLib@ macro for versioning. This means for ghc=9.10.1, ghc-experimental's version will be 9.1001.0 and so on. This fixes #25289 (cherry picked from commit 2293c0b7d709df7be04f596e72c97fd2435c4134) - - - - - bc0dcc49 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Update ghc-experimental-exports. We moved primops into ghc-experimental in a patch we backported. However some of the definitions moved don't exist on the 9.10 branch so we have to update the exports. - - - - - 91a2d560 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Bump hackage state. This avoids some bound issues when using ghc-9.10.1 as boot compiler. - - - - - b1491a90 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 CI fixes for 9.10 backports: export tests and perf window. * Accept windows export changes. (No simd on 9.10) * Accept some slightly metric decreases. ------------------------- Metric Decrease: T15703 T9872d ------------------------- - - - - - edd3c128 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 9.10 record more changes in changelog - - - - - 30 changed files: - .gitignore - .gitlab-ci.yml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Driver/Hooks.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Types/Name/Ppr.hs - docs/users_guide/9.10.2-notes.rst - hadrian/cabal.project - hadrian/cfg/system.config.in - hadrian/src/Oracles/Setting.hs - hadrian/src/Rules/Generate.hs - libraries/base/base.cabal → libraries/base/base.cabal.in - libraries/base/changelog.md - libraries/base/src/Control/Exception/Backtrace.hs - libraries/base/src/Data/Char.hs - libraries/base/src/Data/Semigroup.hs - libraries/base/src/GHC/Exts.hs - libraries/base/src/Prelude.hs - libraries/base/tests/T19288.stderr - + libraries/base/tests/T24807.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e62bd152cc20492059b3229d01132dc5acebaee...edd3c1281ffc6f7dcf4d40d40656fed0553db641 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e62bd152cc20492059b3229d01132dc5acebaee...edd3c1281ffc6f7dcf4d40d40656fed0553db641 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 13:08:45 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Wed, 05 Feb 2025 08:08:45 -0500 Subject: [Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] pick up tests from !13908 Message-ID: <67a362dda6c70_23a6f01ebf189867f@gitlab.mail> Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC Commits: f6c716f1 by Patrick at 2025-02-05T21:08:36+08:00 pick up tests from !13908 - - - - - 3 changed files: - testsuite/tests/indexed-types/should_compile/T25647.hs → testsuite/tests/indexed-types/should_compile/T25647a.hs - + testsuite/tests/indexed-types/should_compile/T25647b.hs - testsuite/tests/indexed-types/should_compile/all.T Changes: ===================================== testsuite/tests/indexed-types/should_compile/T25647.hs → testsuite/tests/indexed-types/should_compile/T25647a.hs ===================================== @@ -1,6 +1,6 @@ {-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} -module T25647 where +module T25647a where import GHC.Exts import Data.Kind ===================================== testsuite/tests/indexed-types/should_compile/T25647b.hs ===================================== @@ -0,0 +1,68 @@ +{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647a where + +import GHC.Exts +import Data.Kind + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r +-- newtype Fix2 f :: TYPE r where +-- In2 :: forall r (ff :: TYPE r -> TYPE r). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f +-- type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r +-- newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f +-- type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r +-- newtype Fix4 f where +-- In4 :: forall rr (ff :: TYPE rr -> TYPE rr). +-- ff (Fix4 ff) -> Fix4 @rr ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + + +-- data family Dix4 :: (k -> TYPE r) -> k +-- newtype instance Dix4 f where +-- DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/indexed-types/should_compile/all.T ===================================== @@ -315,4 +315,5 @@ test('T25611a', normal, compile, ['']) test('T25611b', normal, compile, ['']) test('T25611c', normal, compile, ['']) test('T25611d', normal, compile, ['']) -test('T25647', normal, compile, ['']) +test('T25647a', normal, compile, ['']) +test('T25647b', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f6c716f1c9bde25b1368adde69e86475cdeec671 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f6c716f1c9bde25b1368adde69e86475cdeec671 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 13:21:23 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Wed, 05 Feb 2025 08:21:23 -0500 Subject: [Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] update T25647b Message-ID: <67a365d39085c_23a6f045379c10018d@gitlab.mail> Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC Commits: 0aa0f50c by Patrick at 2025-02-05T21:21:14+08:00 update T25647b - - - - - 1 changed file: - testsuite/tests/indexed-types/should_compile/T25647b.hs Changes: ===================================== testsuite/tests/indexed-types/should_compile/T25647b.hs ===================================== @@ -1,10 +1,14 @@ {-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, MagicHash #-} -module T25647a where +module T25647b where import GHC.Exts import Data.Kind +--------------------------- +-- without UnliftedNewtypes +--------------------------- + -------------------- Plain newtypes ----------------- -- A plain newtype, H98 @@ -16,23 +20,6 @@ newtype Fix1a f = In1a (f (Fix1a f)) newtype Fix1b f where In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff --- A plain newtype, GADT syntax, with a return kind signature, --- and runtime-rep quantification in the data constructor --- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r --- newtype Fix2 f :: TYPE r where --- In2 :: forall r (ff :: TYPE r -> TYPE r). ff (Fix2 ff) -> Fix2 ff - --- Plain newtype, H98 syntax, standalone kind signature --- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f --- type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r --- newtype Fix3 f = In3 (f (Fix3 f)) - --- Plain newtype, H98 syntax, standalone kind signature --- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f --- type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r --- newtype Fix4 f where --- In4 :: forall rr (ff :: TYPE rr -> TYPE rr). --- ff (Fix4 ff) -> Fix4 @rr ff -------------------- Data families with newtype instance ----------------- @@ -54,11 +41,6 @@ newtype instance Dix2a f :: Type where data family Dix3 :: (k -> Type) -> k newtype instance Dix3 f = DIn3 (f (Dix3 f)) - --- data family Dix4 :: (k -> TYPE r) -> k --- newtype instance Dix4 f where --- DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff - -- newtype instance in H98 syntax data family Dix5 :: (k -> TYPE r) -> k newtype instance Dix5 f = DIn5 (f (Dix5 f)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0aa0f50ca0a5fba6191281b3cb186a4ac68b1e63 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0aa0f50ca0a5fba6191281b3cb186a4ac68b1e63 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 13:30:39 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Wed, 05 Feb 2025 08:30:39 -0500 Subject: [Git][ghc/ghc][wip/T25647] add more tests Message-ID: <67a367ff82a46_23a6f04d59a41004f1@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 5dbae152 by Patrick at 2025-02-05T21:30:29+08:00 add more tests - - - - - 3 changed files: - testsuite/tests/typecheck/should_compile/T25647.hs → testsuite/tests/typecheck/should_compile/T25647a.hs - + testsuite/tests/typecheck/should_compile/T25647b.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647.hs → testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -1,6 +1,6 @@ {-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} -module T25647 where +module T25647a where import GHC.Exts import Data.Kind @@ -64,3 +64,9 @@ newtype instance Dix4 f where data family Dix5 :: (k -> TYPE r) -> k newtype instance Dix5 f = DIn5 (f (Dix5 f)) +-- -- newtype instance that is not TYPE 'LiftedRep +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff + + ===================================== testsuite/tests/typecheck/should_compile/T25647b.hs ===================================== @@ -0,0 +1,47 @@ +{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647b where + +import GHC.Exts +import Data.Kind + +--------------------------- +-- without UnliftedNewtypes +--------------------------- + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -933,5 +933,6 @@ test('T25266', normal, compile, ['']) test('T25266a', normal, compile_fail, ['']) test('T25266b', normal, compile, ['']) test('T25597', normal, compile, ['']) -test('T25647', normal, compile, ['']) +test('T25647a', normal, compile, ['']) +test('T25647b', normal, compile, ['']) test('T25647_fail', normal, compile_fail, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5dbae152e0405b0ab8c195afa0ced469a0f01bf6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5dbae152e0405b0ab8c195afa0ced469a0f01bf6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 13:33:19 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 05 Feb 2025 08:33:19 -0500 Subject: [Git][ghc/ghc][wip/specialise-assembler] 10 commits: compiler: Always load GHC.Data.FastString optimised into GHCi Message-ID: <67a3689ef3067_23a6f07d8430108450@gitlab.mail> Matthew Pickering pushed to branch wip/specialise-assembler at Glasgow Haskell Compiler / GHC Commits: 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - b4d9bcd8 by Matthew Pickering at 2025-02-05T13:27:19+00:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 890bec99 by Matthew Pickering at 2025-02-05T13:32:48+00:00 perf: Speed up the bytecode assembler This commit contains a number of optimisations to the bytecode assembler. In programs which generate a large amount of bytecode, the assembler is called a lot of times on many instructions. 1. Specialise the assembleI function for the two intepreters to avoid having to materialise the intermediate free-monad like structure. 2. Directly compute the UArray and SmallArray needed rather than going via the intermediate SizedSeq 3. Use optimised monads 4. Define unrolled "any" and "mapM6" functions which can be inlined and avoid calling recursive functions. The resulting generated code is much more direct. - - - - - 23 changed files: - .gitlab-ci.yml - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Data/FastString.hs - compiler/GHC/Data/FlatBag.hs - compiler/GHC/Data/SmallArray.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/StgToByteCode.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - rts/StgCRunAsm.S - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/ghci/should_run/T21052.stdout - + testsuite/tests/perf/should_run/ByteCodeAsm.hs - testsuite/tests/perf/should_run/all.T - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -909,7 +909,10 @@ test-primops-label: extends: .test-primops-validate-template rules: - if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/' - - *full-ci + # We do not use *.full-ci here since that would imply running in nightly + # where we do not have the normal validate jobs. We have the -nightly job + # below to handle this case. + - if: '$CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/' test-primops-nightly: extends: .test-primops ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -94,9 +94,23 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') def prep_ghc_boot_th(): - # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + # Drop references to `ghc-internal` from `hs-source-dirs` as Hackage rejects + # out-of-sdist references and this packages is only uploaded for documentation + # purposes. modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', - lambda s: s.replace('../ghc-internal/src', '')) + lambda s: s.replace('../ghc-internal/src', '') + .replace('GHC.Internal.TH.Lib.Map', '') + .replace('GHC.Internal.TH.PprLib', '') + .replace('GHC.Internal.TH.Ppr', '') + .replace('GHC.Internal.TH.Lib,', '') + .replace('GHC.Internal.TH.Lib', '') + .replace('GHC.Internal.TH.Lift,', '') + .replace('GHC.Internal.TH.Quote,', '') + .replace('GHC.Internal.TH.Syntax', '') + .replace('GHC.Internal.ForeignSrcLang', '') + .replace('GHC.Internal.LanguageExtensions', '') + .replace('GHC.Internal.Lexeme', '') + ) PACKAGES = { pkg.name: pkg ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -1,21 +1,29 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +{-# LANGUAGE PatternSynonyms #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- +-- -- (c) The University of Glasgow 2002-2006 -- -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, - mkNativeCallInfoLit + mkNativeCallInfoLit, + + -- * For testing + assembleBCO ) where -import GHC.Prelude +import GHC.Prelude hiding ( any ) + import GHC.ByteCode.Instr import GHC.ByteCode.InfoTable @@ -29,13 +37,14 @@ import GHC.Types.Name.Set import GHC.Types.Literal import GHC.Types.Unique.DSet import GHC.Types.SptEntry +import GHC.Types.Unique.FM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq +import GHC.Data.SmallArray import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.Cmm.Expr @@ -45,20 +54,21 @@ import GHC.Platform import GHC.Platform.Profile import Control.Monad -import Control.Monad.Trans.Class -import Control.Monad.Trans.State.Strict +import qualified Control.Monad.Trans.State.Strict as MTL import qualified Data.Array.Unboxed as Array -import Data.Array.Base ( UArray(..) ) +import qualified Data.Array.IO as Array +import Data.Array.Base ( UArray(..), unsafeWrite, numElements, unsafeFreeze ) import Foreign hiding (shiftL, shiftR) -import Data.Char ( ord ) -import Data.List ( genericLength ) -import Data.Map.Strict (Map) +import Data.Char (ord) import Data.Maybe (fromMaybe) -import qualified Data.Map.Strict as Map import GHC.Float (castFloatToWord32, castDoubleToWord64) +import qualified Data.List as List ( any ) +import GHC.Exts + + -- ----------------------------------------------------------------------------- -- Unlinked BCOs @@ -135,9 +145,9 @@ assembleBCOs interp profile proto_bcos tycons top_strs modbreaks spt_entries = d -- mallocStrings :: Interp -> FlatBag UnlinkedBCO -> IO (FlatBag UnlinkedBCO) mallocStrings interp ulbcos = do - let bytestrings = reverse (execState (mapM_ collect ulbcos) []) + let bytestrings = reverse (MTL.execState (mapM_ collect ulbcos) []) ptrs <- interpCmd interp (MallocStrings bytestrings) - return (evalState (mapM splice ulbcos) ptrs) + return (MTL.evalState (mapM splice ulbcos) ptrs) where splice bco at UnlinkedBCO{..} = do lits <- mapM spliceLit unlinkedBCOLits @@ -145,10 +155,10 @@ mallocStrings interp ulbcos = do return bco { unlinkedBCOLits = lits, unlinkedBCOPtrs = ptrs } spliceLit (BCONPtrStr _) = do - rptrs <- get + rptrs <- MTL.get case rptrs of (RemotePtr p : rest) -> do - put rest + MTL.put rest return (BCONPtrWord (fromIntegral p)) _ -> panic "mallocStrings:spliceLit" spliceLit other = return other @@ -161,21 +171,60 @@ mallocStrings interp ulbcos = do mapM_ collectPtr unlinkedBCOPtrs collectLit (BCONPtrStr bs) = do - strs <- get - put (bs:strs) + strs <- MTL.get + MTL.put (bs:strs) collectLit _ = return () collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () +data RunAsmReader = RunAsmReader { isn_array :: {-# UNPACK #-} !(Array.IOUArray Int Word16) + , ptr_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCOPtr) + , lit_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCONPtr ) + } + +data RunAsmResult = RunAsmResult { final_isn_array :: !(Array.UArray Int Word16) + , final_ptr_array :: !(SmallArray BCOPtr) + , final_lit_array :: !(SmallArray BCONPtr) } + +-- How many words we have written so far. +data AsmState = AsmState { nisn :: !Int, nptr :: !Int, nlit :: !Int } + + +{-# NOINLINE inspectInstrs #-} +-- | Perform analysis of the bytecode to determine +-- 1. How many instructions we will produce +-- 2. If we are going to need long jumps. +-- 3. The offsets that labels refer to +inspectInstrs :: Platform -> Bool -> Word -> [BCInstr] -> InspectState +inspectInstrs platform long_jump e instrs = + inspectAsm long_jump e (mapM_ (assembleInspectAsm platform) instrs) + +{-# NOINLINE runInstrs #-} +-- | Assemble the bytecode from the instructions. +runInstrs :: Platform -> Bool -> InspectState -> [BCInstr] -> IO RunAsmResult +runInstrs platform long_jumps is_state instrs = do + -- Produce arrays of exactly the right size, corresponding to the result of inspectInstrs. + isn_array <- Array.newArray_ (0, (fromIntegral $ instrCount is_state) - 1) + ptr_array <- newSmallArrayIO (fromIntegral $ ptrCount is_state) undefined + lit_array <- newSmallArrayIO (fromIntegral $ litCount is_state) undefined + let env :: LocalLabel -> Word + env lbl = fromMaybe + (pprPanic "assembleBCO.findLabel" (ppr lbl)) + (lookupUFM (lblEnv is_state) lbl) + let initial_state = AsmState 0 0 0 + let initial_reader = RunAsmReader{..} + runAsm long_jumps env initial_reader initial_state (mapM_ (\i -> assembleRunAsm platform i) instrs) + final_isn_array <- unsafeFreeze isn_array + final_ptr_array <- unsafeFreezeSmallArrayIO ptr_array + final_lit_array <- unsafeFreezeSmallArrayIO lit_array + return $ RunAsmResult {..} + +assembleRunAsm :: Platform -> BCInstr -> RunAsm () +assembleRunAsm p i = assembleI @RunAsm p i -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' +assembleInspectAsm :: Platform -> BCInstr -> InspectAsm () +assembleInspectAsm p i = assembleI @InspectAsm p i assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform @@ -185,9 +234,7 @@ assembleBCO platform , protoBCOBitmapSize = bsize , protoBCOArity = arity }) = do -- pass 1: collect up the offsets of the local labels. - let asm = mapM_ (assembleI platform) instrs - - initial_offset = 0 + let initial_offset = 0 -- Jump instructions are variable-sized, there are long and short variants -- depending on the magnitude of the offset. However, we can't tell what @@ -197,30 +244,25 @@ assembleBCO platform -- and if the final size is indeed small enough for short jumps, we are -- done. Otherwise, we repeat the calculation, and we force all jumps in -- this BCO to be long. - (n_insns0, lbl_map0) = inspectAsm platform False initial_offset asm - ((n_insns, lbl_map), long_jumps) - | isLargeW (fromIntegral $ Map.size lbl_map0) - || isLargeW n_insns0 - = (inspectAsm platform True initial_offset asm, True) - | otherwise = ((n_insns0, lbl_map0), False) - - env :: LocalLabel -> Word - env lbl = fromMaybe - (pprPanic "assembleBCO.findLabel" (ppr lbl)) - (Map.lookup lbl lbl_map) + is0 = inspectInstrs platform False initial_offset instrs + (is1, long_jumps) + | isLargeInspectState is0 + = (inspectInstrs platform True initial_offset instrs, True) + | otherwise = (is0, False) + -- pass 2: run assembler and generate instructions, literals and pointers - let initial_state = (emptySS, emptySS, emptySS) - (final_insns, final_lits, final_ptrs) <- flip execStateT initial_state $ runAsm platform long_jumps env asm + RunAsmResult{..} <- runInstrs platform long_jumps is1 instrs -- precomputed size should be equal to final size - massertPpr (n_insns == sizeSS final_insns) + massertPpr (fromIntegral (instrCount is1) == numElements final_isn_array + && fromIntegral (ptrCount is1) == sizeofSmallArray final_ptr_array + && fromIntegral (litCount is1) == sizeofSmallArray final_lit_array) (text "bytecode instruction count mismatch") - let asm_insns = ssElts final_insns - !insns_arr = mkBCOByteArray $ Array.listArray (0 :: Int, fromIntegral n_insns - 1) asm_insns + let !insns_arr = mkBCOByteArray $ final_isn_array !bitmap_arr = mkBCOByteArray $ mkBitmapArray bsize bitmap - ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSizedSeq final_lits) (fromSizedSeq final_ptrs) + ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSmallArray final_lit_array) (fromSmallArray final_ptr_array) -- 8 Aug 01: Finalisers aren't safe when attached to non-primitive -- objects, since they might get run too early. Disable this until @@ -237,10 +279,6 @@ mkBitmapArray bsize bitmap = Array.listArray (0, length bitmap) $ fromIntegral bsize : map (fromInteger . fromStgWord) bitmap --- instrs nonptrs ptrs -type AsmState = (SizedSeq Word16, - SizedSeq BCONPtr, - SizedSeq BCOPtr) data Operand = Op Word @@ -260,39 +298,9 @@ truncHalfWord platform w = case platformWordSize platform of PW8 | w <= 4294967295 -> Op (fromIntegral w) _ -> pprPanic "GHC.ByteCode.Asm.truncHalfWord" (ppr w) -data Assembler a - = AllocPtr (IO BCOPtr) (Word -> Assembler a) - | AllocLit [BCONPtr] (Word -> Assembler a) - | AllocLabel LocalLabel (Assembler a) - | Emit Word16 [Operand] (Assembler a) - | NullAsm a - deriving (Functor) - -instance Applicative Assembler where - pure = NullAsm - (<*>) = ap - -instance Monad Assembler where - NullAsm x >>= f = f x - AllocPtr p k >>= f = AllocPtr p (k >=> f) - AllocLit l k >>= f = AllocLit l (k >=> f) - AllocLabel lbl k >>= f = AllocLabel lbl (k >>= f) - Emit w ops k >>= f = Emit w ops (k >>= f) - -ioptr :: IO BCOPtr -> Assembler Word -ioptr p = AllocPtr p return - -ptr :: BCOPtr -> Assembler Word -ptr = ioptr . return - -lit :: [BCONPtr] -> Assembler Word -lit l = AllocLit l return -label :: LocalLabel -> Assembler () -label w = AllocLabel w (return ()) - -emit :: Word16 -> [Operand] -> Assembler () -emit w ops = Emit w ops (return ()) +ptr :: MonadAssembler m => BCOPtr -> m Word +ptr = ioptr . return type LabelEnv = LocalLabel -> Word @@ -303,38 +311,142 @@ largeOp long_jumps op = case op of IOp i -> isLargeI i LabelOp _ -> long_jumps -runAsm :: Platform -> Bool -> LabelEnv -> Assembler a -> StateT AsmState IO a -runAsm platform long_jumps e = go +newtype RunAsm a = RunAsm' { runRunAsm :: Bool + -> LabelEnv + -> RunAsmReader + -> AsmState + -> IO (AsmState, a) } + +pattern RunAsm :: (Bool -> LabelEnv -> RunAsmReader -> AsmState -> IO (AsmState, a)) + -> RunAsm a +pattern RunAsm m <- RunAsm' m where - go (NullAsm x) = return x - go (AllocPtr p_io k) = do - p <- lift p_io - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_p1 = addToSS st_p0 p - in (sizeSS st_p0, (st_i0,st_l0,st_p1)) - go $ k w - go (AllocLit lits k) = do - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_l1 = addListToSS st_l0 lits - in (sizeSS st_l0, (st_i0,st_l1,st_p0)) - go $ k w - go (AllocLabel _ k) = go k - go (Emit w ops k) = do - let largeArgs = any (largeOp long_jumps) ops - opcode - | largeArgs = largeArgInstr w - | otherwise = w - words = concatMap expand ops - expand (SmallOp w) = [w] - expand (LabelOp w) = expand (Op (e w)) - expand (Op w) = if largeArgs then largeArg platform (fromIntegral w) else [fromIntegral w] - expand (IOp i) = if largeArgs then largeArg platform (fromIntegral i) else [fromIntegral i] - state $ \(st_i0,st_l0,st_p0) -> - let st_i1 = addListToSS st_i0 (opcode : words) - in ((), (st_i1,st_l0,st_p0)) - go k - -type LabelEnvMap = Map LocalLabel Word + RunAsm m = RunAsm' (oneShot $ \a -> oneShot $ \b -> oneShot $ \c -> oneShot $ \d -> m a b c d) +{-# COMPLETE RunAsm #-} + +instance Functor RunAsm where + fmap f (RunAsm x) = RunAsm (\a b c !s -> fmap (fmap f) (x a b c s)) + +instance Applicative RunAsm where + pure x = RunAsm $ \_ _ _ !s -> pure (s, x) + (RunAsm f) <*> (RunAsm x) = RunAsm $ \a b c !s -> do + (!s', f') <- f a b c s + (!s'', x') <- x a b c s' + return (s'', f' x') + {-# INLINE (<*>) #-} + + +instance Monad RunAsm where + return = pure + (RunAsm m) >>= f = RunAsm $ \a b c !s -> m a b c s >>= \(s', r) -> runRunAsm (f r) a b c s' + {-# INLINE (>>=) #-} + +runAsm :: Bool -> LabelEnv -> RunAsmReader -> AsmState -> RunAsm a -> IO a +runAsm long_jumps e r s (RunAsm'{runRunAsm}) = fmap snd $ runRunAsm long_jumps e r s + +expand :: PlatformWordSize -> Bool -> Operand -> RunAsm () +expand word_size largeArgs o = do + e <- askEnv + case o of + (SmallOp w) -> writeIsn w + (LabelOp w) -> let !r = e w in handleLargeArg r + (Op w) -> handleLargeArg w + (IOp i) -> handleLargeArg i + + where + handleLargeArg :: Integral a => a -> RunAsm () + handleLargeArg w = + if largeArgs + then largeArg word_size (fromIntegral w) + else writeIsn (fromIntegral w) + +lift :: IO a -> RunAsm a +lift io = RunAsm $ \_ _ _ s -> io >>= \a -> pure (s, a) + +askLongJumps :: RunAsm Bool +askLongJumps = RunAsm $ \a _ _ s -> pure (s, a) + +askEnv :: RunAsm LabelEnv +askEnv = RunAsm $ \_ b _ s -> pure (s, b) + +writePtr :: BCOPtr -> RunAsm Word +writePtr w + = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO ptr_array (nptr asm) w + let !n' = nptr asm + 1 + let !asm' = asm { nptr = n' } + return (asm', fromIntegral (nptr asm)) + +writeLit :: BCONPtr -> RunAsm Word +writeLit w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO lit_array (nlit asm) w + let !n' = nlit asm + 1 + let !asm' = asm { nlit = n' } + return (asm', fromIntegral (nlit asm)) + +writeLits :: OneOrTwo BCONPtr -> RunAsm Word +writeLits (OnlyOne l) = writeLit l +writeLits (OnlyTwo l1 l2) = writeLit l1 <* writeLit l2 + +writeIsn :: Word16 -> RunAsm () +writeIsn w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do +#if defined(DEBUG) + Array.writeArray isn_array (nisn asm) w +#else + unsafeWrite isn_array (nisn asm) w +#endif + let !n' = nisn asm + 1 + let !asm' = asm { nisn = n' } + return (asm', ()) + +{-# INLINE any #-} +-- Any is unrolled manually so that the call in `emit` can be eliminated without +-- relying on SpecConstr (which does not work across modules). +any :: (a -> Bool) -> [a] -> Bool +any _ [] = False +any f [x] = f x +any f [x,y] = f x || f y +any f [x,y,z] = f x || f y || f z +any f [x1,x2,x3,x4] = f x1 || f x2 || f x3 || f x4 +any f [x1,x2,x3,x4, x5] = f x1 || f x2 || f x3 || f x4 || f x5 +any f [x1,x2,x3,x4,x5,x6] = f x1 || f x2 || f x3 || f x4 || f x5 || f x6 +any f xs = List.any f xs + +{-# INLINE mapM6_ #-} +mapM6_ :: Monad m => (a -> m b) -> [a] -> m () +mapM6_ _ [] = return () +mapM6_ f [x] = () <$ f x +mapM6_ f [x,y] = () <$ f x <* f y +mapM6_ f [x,y,z] = () <$ f x <* f y <* f z +mapM6_ f [a1,a2,a3,a4] = () <$ f a1 <* f a2 <* f a3 <* f a4 +mapM6_ f [a1,a2,a3,a4,a5] = () <$ f a1 <* f a2 <* f a3 <* f a4 <* f a5 +mapM6_ f [a1,a2,a3,a4,a5,a6] = () <$ f a1 <* f a2 <* f a3 <* f a4 <* f a5 <* f a6 +mapM6_ f xs = mapM_ f xs + +instance MonadAssembler RunAsm where + ioptr p_io = do + p <- lift p_io + writePtr p + lit lits = writeLits lits + + label _ = return () + + emit pwordsize w ops = do + long_jumps <- askLongJumps + -- See the definition of `any` above + let largeArgs = any (largeOp long_jumps) ops + let opcode + | largeArgs = largeArgInstr w + | otherwise = w + writeIsn opcode + mapM6_ (expand pwordsize largeArgs) ops + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + +type LabelEnvMap = UniqFM LocalLabel Word data InspectState = InspectState { instrCount :: !Word @@ -343,26 +455,105 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } -inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) -inspectAsm platform long_jumps initial_offset - = go (InspectState initial_offset 0 0 Map.empty) +instance Outputable InspectState where + ppr (InspectState i p l m) = text "InspectState" <+> ppr [ppr i, ppr p, ppr l, ppr (sizeUFM m)] + +isLargeInspectState :: InspectState -> Bool +isLargeInspectState InspectState{..} = + isLargeW (fromIntegral $ sizeUFM lblEnv) + || isLargeW instrCount + +newtype InspectEnv = InspectEnv { _inspectLongJumps :: Bool + } + +newtype InspectAsm a = InspectAsm' { runInspectAsm :: InspectEnv -> InspectState -> (# InspectState, a #) } + +pattern InspectAsm :: (InspectEnv -> InspectState -> (# InspectState, a #)) + -> InspectAsm a +pattern InspectAsm m <- InspectAsm' m where - go s (NullAsm _) = (instrCount s, lblEnv s) - go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) - where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + genericLength ls }) (k n) - where n = litCount s - go s (AllocLabel lbl k) = go s' k - where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } - go s (Emit _ ops k) = go s' k - where - s' = s { instrCount = instrCount s + size } - size = sum (map count ops) + 1 + InspectAsm m = InspectAsm' (oneShot $ \a -> oneShot $ \b -> m a b) +{-# COMPLETE InspectAsm #-} + +instance Functor InspectAsm where + fmap f (InspectAsm k) = InspectAsm $ \a b -> case k a b of + (# b', c #) -> (# b', f c #) + +instance Applicative InspectAsm where + pure x = InspectAsm $ \_ s -> (# s, x #) + (InspectAsm f) <*> (InspectAsm x) = InspectAsm $ \a b -> case f a b of + (# s', f' #) -> + case x a s' of + (# s'', x' #) -> (# s'', f' x' #) + +instance Monad InspectAsm where + return = pure + (InspectAsm m) >>= f = InspectAsm $ \ a b -> case m a b of + (# s', a' #) -> runInspectAsm (f a') a s' + +get_ :: InspectAsm InspectState +get_ = InspectAsm $ \_ b -> (# b, b #) + +put_ :: InspectState -> InspectAsm () +put_ !s = InspectAsm $ \_ _ -> (# s, () #) + +modify_ :: (InspectState -> InspectState) -> InspectAsm () +modify_ f = InspectAsm $ \_ s -> let !s' = f s in (# s', () #) + +ask_ :: InspectAsm InspectEnv +ask_ = InspectAsm $ \a b -> (# b, a #) + +inspectAsm :: Bool -> Word -> InspectAsm () -> InspectState +inspectAsm long_jumps initial_offset (InspectAsm s) = + case s (InspectEnv long_jumps) (InspectState initial_offset 0 0 emptyUFM) of + (# res, () #) -> res +{-# INLINE inspectAsm #-} + + + +instance MonadAssembler InspectAsm where + ioptr _ = do + s <- get_ + let n = ptrCount s + put_ (s { ptrCount = n + 1 }) + return n + + lit ls = do + s <- get_ + let n = litCount s + put_ (s { litCount = n + oneTwoLength ls }) + return n + + label lbl = modify_ (\s -> let !count = instrCount s in let !env' = addToUFM (lblEnv s) lbl count in s { lblEnv = env' }) + + emit pwordsize _ ops = do + InspectEnv long_jumps <- ask_ + -- Size is written in this way as `mapM6_` is also used by RunAsm, and guaranteed + -- to unroll for arguments up to size 6. + let size = (MTL.execState (mapM6_ (\x -> MTL.modify (count' x +)) ops) 0) + 1 largeOps = any (largeOp long_jumps) ops - count (SmallOp _) = 1 - count (LabelOp _) = count (Op 0) - count (Op _) = if largeOps then largeArg16s platform else 1 - count (IOp _) = if largeOps then largeArg16s platform else 1 + bigSize = largeArg16s pwordsize + count' = if largeOps then countLarge bigSize else countSmall bigSize + + s <- get_ + put_ (s { instrCount = instrCount s + size }) + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + +count :: Word -> Bool -> Operand -> Word +count _ _ (SmallOp _) = 1 +count big largeOps (LabelOp _) = if largeOps then big else 1 +count big largeOps (Op _) = if largeOps then big else 1 +count big largeOps (IOp _) = if largeOps then big else 1 +{-# INLINE count #-} + +countSmall, countLarge :: Word -> Operand -> Word +countLarge big x = count big True x +countSmall big x = count big False x + -- Bring in all the bci_ bytecode constants. #include "Bytecodes.h" @@ -370,47 +561,67 @@ inspectAsm platform long_jumps initial_offset largeArgInstr :: Word16 -> Word16 largeArgInstr bci = bci_FLAG_LARGE_ARGS .|. bci -largeArg :: Platform -> Word64 -> [Word16] -largeArg platform w = case platformWordSize platform of - PW8 -> [fromIntegral (w `shiftR` 48), - fromIntegral (w `shiftR` 32), - fromIntegral (w `shiftR` 16), - fromIntegral w] +{-# INLINE largeArg #-} +largeArg :: PlatformWordSize -> Word64 -> RunAsm () +largeArg wsize w = case wsize of + PW8 -> do writeIsn (fromIntegral (w `shiftR` 48)) + writeIsn (fromIntegral (w `shiftR` 32)) + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) PW4 -> assertPpr (w < fromIntegral (maxBound :: Word32)) - (text "largeArg too big:" <+> ppr w) $ - [fromIntegral (w `shiftR` 16), - fromIntegral w] + (text "largeArg too big:" <+> ppr w) $ do + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) -largeArg16s :: Platform -> Word -largeArg16s platform = case platformWordSize platform of +largeArg16s :: PlatformWordSize -> Word +largeArg16s pwordsize = case pwordsize of PW8 -> 4 PW4 -> 2 -assembleI :: Platform +data OneOrTwo a = OnlyOne a | OnlyTwo a a deriving (Functor) + +oneTwoLength :: OneOrTwo a -> Word +oneTwoLength (OnlyOne {}) = 1 +oneTwoLength (OnlyTwo {}) = 2 + +class Monad m => MonadAssembler m where + ioptr :: IO BCOPtr -> m Word + lit :: OneOrTwo BCONPtr -> m Word + label :: LocalLabel -> m () + emit :: PlatformWordSize -> Word16 -> [Operand] -> m () + +lit1 :: MonadAssembler m => BCONPtr -> m Word +lit1 p = lit (OnlyOne p) + +{-# SPECIALISE assembleI :: Platform -> BCInstr -> InspectAsm () #-} +{-# SPECIALISE assembleI :: Platform -> BCInstr -> RunAsm () #-} + +assembleI :: forall m . MonadAssembler m + => Platform -> BCInstr - -> Assembler () + -> m () assembleI platform i = case i of - STKCHECK n -> emit bci_STKCHECK [Op n] - PUSH_L o1 -> emit bci_PUSH_L [wOp o1] - PUSH_LL o1 o2 -> emit bci_PUSH_LL [wOp o1, wOp o2] - PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] - PUSH8 o1 -> emit bci_PUSH8 [bOp o1] - PUSH16 o1 -> emit bci_PUSH16 [bOp o1] - PUSH32 o1 -> emit bci_PUSH32 [bOp o1] - PUSH8_W o1 -> emit bci_PUSH8_W [bOp o1] - PUSH16_W o1 -> emit bci_PUSH16_W [bOp o1] - PUSH32_W o1 -> emit bci_PUSH32_W [bOp o1] + STKCHECK n -> emit_ bci_STKCHECK [Op n] + PUSH_L o1 -> emit_ bci_PUSH_L [wOp o1] + PUSH_LL o1 o2 -> emit_ bci_PUSH_LL [wOp o1, wOp o2] + PUSH_LLL o1 o2 o3 -> emit_ bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] + PUSH8 o1 -> emit_ bci_PUSH8 [bOp o1] + PUSH16 o1 -> emit_ bci_PUSH16 [bOp o1] + PUSH32 o1 -> emit_ bci_PUSH32 [bOp o1] + PUSH8_W o1 -> emit_ bci_PUSH8_W [bOp o1] + PUSH16_W o1 -> emit_ bci_PUSH16_W [bOp o1] + PUSH32_W o1 -> emit_ bci_PUSH32_W [bOp o1] PUSH_G nm -> do p <- ptr (BCOPtrName nm) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_BCO proto -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_ALTS proto pk -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit (push_alts pk) [Op p] + emit_ (push_alts pk) [Op p] PUSH_ALTS_TUPLE proto call_info tuple_proto -> do let ul_bco = assembleBCO platform proto ul_tuple_bco = assembleBCO platform @@ -419,127 +630,131 @@ assembleI platform i = case i of p_tup <- ioptr (liftM BCOPtrBCO ul_tuple_bco) info <- word (fromIntegral $ mkNativeCallInfoSig platform call_info) - emit bci_PUSH_ALTS_T + emit_ bci_PUSH_ALTS_T [Op p, Op info, Op p_tup] - PUSH_PAD8 -> emit bci_PUSH_PAD8 [] - PUSH_PAD16 -> emit bci_PUSH_PAD16 [] - PUSH_PAD32 -> emit bci_PUSH_PAD32 [] + PUSH_PAD8 -> emit_ bci_PUSH_PAD8 [] + PUSH_PAD16 -> emit_ bci_PUSH_PAD16 [] + PUSH_PAD32 -> emit_ bci_PUSH_PAD32 [] PUSH_UBX8 lit -> do np <- literal lit - emit bci_PUSH_UBX8 [Op np] + emit_ bci_PUSH_UBX8 [Op np] PUSH_UBX16 lit -> do np <- literal lit - emit bci_PUSH_UBX16 [Op np] + emit_ bci_PUSH_UBX16 [Op np] PUSH_UBX32 lit -> do np <- literal lit - emit bci_PUSH_UBX32 [Op np] + emit_ bci_PUSH_UBX32 [Op np] PUSH_UBX lit nws -> do np <- literal lit - emit bci_PUSH_UBX [Op np, wOp nws] - + emit_ bci_PUSH_UBX [Op np, wOp nws] -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode - PUSH_ADDR nm -> do np <- lit [BCONPtrAddr nm] - emit bci_PUSH_UBX [Op np, SmallOp 1] - - PUSH_APPLY_N -> emit bci_PUSH_APPLY_N [] - PUSH_APPLY_V -> emit bci_PUSH_APPLY_V [] - PUSH_APPLY_F -> emit bci_PUSH_APPLY_F [] - PUSH_APPLY_D -> emit bci_PUSH_APPLY_D [] - PUSH_APPLY_L -> emit bci_PUSH_APPLY_L [] - PUSH_APPLY_P -> emit bci_PUSH_APPLY_P [] - PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP [] - PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP [] - PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP [] - PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP [] - PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP [] - - SLIDE n by -> emit bci_SLIDE [wOp n, wOp by] - ALLOC_AP n -> emit bci_ALLOC_AP [truncHalfWord platform n] - ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [truncHalfWord platform n] - ALLOC_PAP arity n -> emit bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] - MKAP off sz -> emit bci_MKAP [wOp off, truncHalfWord platform sz] - MKPAP off sz -> emit bci_MKPAP [wOp off, truncHalfWord platform sz] - UNPACK n -> emit bci_UNPACK [wOp n] - PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)] - emit bci_PACK [Op itbl_no, wOp sz] + PUSH_ADDR nm -> do np <- lit1 (BCONPtrAddr nm) + emit_ bci_PUSH_UBX [Op np, SmallOp 1] + + PUSH_APPLY_N -> emit_ bci_PUSH_APPLY_N [] + PUSH_APPLY_V -> emit_ bci_PUSH_APPLY_V [] + PUSH_APPLY_F -> emit_ bci_PUSH_APPLY_F [] + PUSH_APPLY_D -> emit_ bci_PUSH_APPLY_D [] + PUSH_APPLY_L -> emit_ bci_PUSH_APPLY_L [] + PUSH_APPLY_P -> emit_ bci_PUSH_APPLY_P [] + PUSH_APPLY_PP -> emit_ bci_PUSH_APPLY_PP [] + PUSH_APPLY_PPP -> emit_ bci_PUSH_APPLY_PPP [] + PUSH_APPLY_PPPP -> emit_ bci_PUSH_APPLY_PPPP [] + PUSH_APPLY_PPPPP -> emit_ bci_PUSH_APPLY_PPPPP [] + PUSH_APPLY_PPPPPP -> emit_ bci_PUSH_APPLY_PPPPPP [] + + SLIDE n by -> emit_ bci_SLIDE [wOp n, wOp by] + ALLOC_AP n -> emit_ bci_ALLOC_AP [truncHalfWord platform n] + ALLOC_AP_NOUPD n -> emit_ bci_ALLOC_AP_NOUPD [truncHalfWord platform n] + ALLOC_PAP arity n -> emit_ bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] + MKAP off sz -> emit_ bci_MKAP [wOp off, truncHalfWord platform sz] + MKPAP off sz -> emit_ bci_MKPAP [wOp off, truncHalfWord platform sz] + UNPACK n -> emit_ bci_UNPACK [wOp n] + PACK dcon sz -> do itbl_no <- lit1 (BCONPtrItbl (getName dcon)) + emit_ bci_PACK [Op itbl_no, wOp sz] LABEL lbl -> label lbl TESTLT_I i l -> do np <- int i - emit bci_TESTLT_I [Op np, LabelOp l] + emit_ bci_TESTLT_I [Op np, LabelOp l] TESTEQ_I i l -> do np <- int i - emit bci_TESTEQ_I [Op np, LabelOp l] + emit_ bci_TESTEQ_I [Op np, LabelOp l] TESTLT_W w l -> do np <- word w - emit bci_TESTLT_W [Op np, LabelOp l] + emit_ bci_TESTLT_W [Op np, LabelOp l] TESTEQ_W w l -> do np <- word w - emit bci_TESTEQ_W [Op np, LabelOp l] + emit_ bci_TESTEQ_W [Op np, LabelOp l] TESTLT_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTLT_I64 [Op np, LabelOp l] + emit_ bci_TESTLT_I64 [Op np, LabelOp l] TESTEQ_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTEQ_I64 [Op np, LabelOp l] + emit_ bci_TESTEQ_I64 [Op np, LabelOp l] TESTLT_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I32 [Op np, LabelOp l] + emit_ bci_TESTLT_I32 [Op np, LabelOp l] TESTEQ_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I32 [Op np, LabelOp l] + emit_ bci_TESTEQ_I32 [Op np, LabelOp l] TESTLT_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I16 [Op np, LabelOp l] + emit_ bci_TESTLT_I16 [Op np, LabelOp l] TESTEQ_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I16 [Op np, LabelOp l] + emit_ bci_TESTEQ_I16 [Op np, LabelOp l] TESTLT_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I8 [Op np, LabelOp l] + emit_ bci_TESTLT_I8 [Op np, LabelOp l] TESTEQ_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I8 [Op np, LabelOp l] + emit_ bci_TESTEQ_I8 [Op np, LabelOp l] TESTLT_W64 w l -> do np <- word64 w - emit bci_TESTLT_W64 [Op np, LabelOp l] + emit_ bci_TESTLT_W64 [Op np, LabelOp l] TESTEQ_W64 w l -> do np <- word64 w - emit bci_TESTEQ_W64 [Op np, LabelOp l] + emit_ bci_TESTEQ_W64 [Op np, LabelOp l] TESTLT_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W32 [Op np, LabelOp l] + emit_ bci_TESTLT_W32 [Op np, LabelOp l] TESTEQ_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W32 [Op np, LabelOp l] + emit_ bci_TESTEQ_W32 [Op np, LabelOp l] TESTLT_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W16 [Op np, LabelOp l] + emit_ bci_TESTLT_W16 [Op np, LabelOp l] TESTEQ_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W16 [Op np, LabelOp l] + emit_ bci_TESTEQ_W16 [Op np, LabelOp l] TESTLT_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W8 [Op np, LabelOp l] + emit_ bci_TESTLT_W8 [Op np, LabelOp l] TESTEQ_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W8 [Op np, LabelOp l] + emit_ bci_TESTEQ_W8 [Op np, LabelOp l] TESTLT_F f l -> do np <- float f - emit bci_TESTLT_F [Op np, LabelOp l] + emit_ bci_TESTLT_F [Op np, LabelOp l] TESTEQ_F f l -> do np <- float f - emit bci_TESTEQ_F [Op np, LabelOp l] + emit_ bci_TESTEQ_F [Op np, LabelOp l] TESTLT_D d l -> do np <- double d - emit bci_TESTLT_D [Op np, LabelOp l] + emit_ bci_TESTLT_D [Op np, LabelOp l] TESTEQ_D d l -> do np <- double d - emit bci_TESTEQ_D [Op np, LabelOp l] - TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l] - TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l] - CASEFAIL -> emit bci_CASEFAIL [] - SWIZZLE stkoff n -> emit bci_SWIZZLE [wOp stkoff, IOp n] - JMP l -> emit bci_JMP [LabelOp l] - ENTER -> emit bci_ENTER [] - RETURN rep -> emit (return_non_tuple rep) [] - RETURN_TUPLE -> emit bci_RETURN_T [] + emit_ bci_TESTEQ_D [Op np, LabelOp l] + TESTLT_P i l -> emit_ bci_TESTLT_P [SmallOp i, LabelOp l] + TESTEQ_P i l -> emit_ bci_TESTEQ_P [SmallOp i, LabelOp l] + CASEFAIL -> emit_ bci_CASEFAIL [] + SWIZZLE stkoff n -> emit_ bci_SWIZZLE [wOp stkoff, IOp n] + JMP l -> emit_ bci_JMP [LabelOp l] + ENTER -> emit_ bci_ENTER [] + RETURN rep -> emit_ (return_non_tuple rep) [] + RETURN_TUPLE -> emit_ bci_RETURN_T [] CCALL off m_addr i -> do np <- addr m_addr - emit bci_CCALL [wOp off, Op np, SmallOp i] - PRIMCALL -> emit bci_PRIMCALL [] + emit_ bci_CCALL [wOp off, Op np, SmallOp i] + PRIMCALL -> emit_ bci_PRIMCALL [] BRK_FUN arr tick_mod tickx info_mod infox cc -> do p1 <- ptr (BCOPtrBreakArray arr) tick_addr <- addr tick_mod info_addr <- addr info_mod np <- addr cc - emit bci_BRK_FUN [ Op p1 + emit_ bci_BRK_FUN [ Op p1 , Op tick_addr, Op info_addr , SmallOp tickx, SmallOp infox , Op np ] #if MIN_VERSION_rts(1,0,3) - BCO_NAME name -> do np <- lit [BCONPtrStr name] - emit bci_BCO_NAME [Op np] + BCO_NAME name -> do np <- lit1 (BCONPtrStr name) + emit_ bci_BCO_NAME [Op np] #endif + + where + emit_ = emit word_size + + literal :: Literal -> m Word literal (LitLabel fs _) = litlabel fs literal LitNullAddr = word 0 literal (LitFloat r) = float (fromRational r) literal (LitDouble r) = double (fromRational r) literal (LitChar c) = int (ord c) - literal (LitString bs) = lit [BCONPtrStr bs] + literal (LitString bs) = lit1 (BCONPtrStr bs) -- LitString requires a zero-terminator when emitted literal (LitNumber nt i) = case nt of LitNumInt -> word (fromIntegral i) @@ -559,10 +774,11 @@ assembleI platform i = case i of -- analysis messed up. literal (LitRubbish {}) = word 0 - litlabel fs = lit [BCONPtrLbl fs] - addr (RemotePtr a) = words [fromIntegral a] - words ws = lit (map BCONPtrWord ws) - word w = words [w] + litlabel fs = lit1 (BCONPtrLbl fs) + addr (RemotePtr a) = word (fromIntegral a) + words ws = lit (fmap BCONPtrWord ws) + word w = words (OnlyOne w) + word2 w1 w2 = words (OnlyTwo w1 w2) word_size = platformWordSize platform word_size_bits = platformWordSizeInBits platform @@ -573,36 +789,36 @@ assembleI platform i = case i of -- Note that we only support host endianness == target endianness for now, -- even with the external interpreter. This would need to be fixed to -- support host endianness /= target endianness - int :: Int -> Assembler Word + int :: Int -> m Word int i = word (fromIntegral i) - float :: Float -> Assembler Word + float :: Float -> m Word float f = word32 (castFloatToWord32 f) - double :: Double -> Assembler Word + double :: Double -> m Word double d = word64 (castDoubleToWord64 d) - word64 :: Word64 -> Assembler Word + word64 :: Word64 -> m Word word64 ww = case word_size of PW4 -> let !wl = fromIntegral ww !wh = fromIntegral (ww `unsafeShiftR` 32) in case platformByteOrder platform of - LittleEndian -> words [wl,wh] - BigEndian -> words [wh,wl] + LittleEndian -> word2 wl wh + BigEndian -> word2 wh wl PW8 -> word (fromIntegral ww) - word8 :: Word8 -> Assembler Word + word8 :: Word8 -> m Word word8 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 8)) - word16 :: Word16 -> Assembler Word + word16 :: Word16 -> m Word word16 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 16)) - word32 :: Word32 -> Assembler Word + word32 :: Word32 -> m Word word32 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> case word_size of ===================================== compiler/GHC/ByteCode/Instr.hs ===================================== @@ -36,6 +36,7 @@ import GHC.Stack.CCS (CostCentre) import GHC.Stg.Syntax import GHCi.BreakArray (BreakArray) import Language.Haskell.Syntax.Module.Name (ModuleName) +import GHC.Types.Unique -- ---------------------------------------------------------------------------- -- Bytecode instructions @@ -58,6 +59,10 @@ data ProtoBCO a newtype LocalLabel = LocalLabel { getLocalLabel :: Word32 } deriving (Eq, Ord) +-- Just so we can easily juse UniqFM. +instance Uniquable LocalLabel where + getUnique (LocalLabel w) = mkUniqueGrimily $ fromIntegral w + instance Outputable LocalLabel where ppr (LocalLabel lbl) = text "lbl:" <> ppr lbl ===================================== compiler/GHC/ByteCode/Types.hs ===================================== @@ -21,7 +21,7 @@ module GHC.ByteCode.Types , CgBreakInfo(..) , ModBreaks (..), BreakIndex, emptyModBreaks , CCostCentre - , FlatBag, sizeFlatBag, fromSizedSeq, elemsFlatBag + , FlatBag, sizeFlatBag, fromSmallArray, elemsFlatBag ) where import GHC.Prelude ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -59,7 +59,8 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Id.Make ( realWorldPrimId ) import GHC.Types.Basic -import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName ) +import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName, OccName ) +import GHC.Types.Name.Occurrence (occNameString) import GHC.Types.SrcLoc ( SrcSpan(..), realSrcLocSpan, mkRealSrcLoc ) import GHC.Types.Literal import GHC.Types.Tickish @@ -70,6 +71,7 @@ import qualified Data.ByteString.Builder as BB import Data.ByteString.Builder.Prim import Control.Monad +import Data.List (intercalate) {- Note [CorePrep Overview] @@ -247,11 +249,11 @@ corePrepPgm logger cp_cfg pgm_cfg withTiming logger (text "CorePrep"<+>brackets (ppr this_mod)) (\a -> a `seqList` ()) $ do - us <- mkSplitUniqSupply 's' let initialCorePrepEnv = mkInitialCorePrepEnv cp_cfg - let - implicit_binds = mkDataConWorkers + us <- mkSplitUniqSupply 's' + + let implicit_binds = mkDataConWorkers (cpPgm_generateDebugInfo pgm_cfg) mod_loc data_tycons -- NB: we must feed mkImplicitBinds through corePrep too @@ -711,13 +713,13 @@ cpePair :: TopLevelFlag -> RecFlag -> Demand -> Levity -> UniqSM (Floats, CpeRhs) -- Used for all bindings -- The binder is already cloned, hence an OutId -cpePair top_lvl is_rec dmd lev env bndr rhs +cpePair top_lvl is_rec dmd lev env0 bndr rhs = assert (not (isJoinId bndr)) $ -- those should use cpeJoinPair do { (floats1, rhs1) <- cpeRhsE env rhs -- See if we are allowed to float this stuff out of the RHS ; let dec = want_float_from_rhs floats1 rhs1 - ; (floats2, rhs2) <- executeFloatDecision dec floats1 rhs1 + ; (floats2, rhs2) <- executeFloatDecision env dec floats1 rhs1 -- Make the arity match up ; (floats3, rhs3) @@ -725,7 +727,7 @@ cpePair top_lvl is_rec dmd lev env bndr rhs then return (floats2, cpeEtaExpand arity rhs2) else warnPprTrace True "CorePrep: silly extra arguments:" (ppr bndr) $ -- Note [Silly extra arguments] - (do { v <- newVar (idType bndr) + (do { v <- newVar env (idType bndr) ; let (float, v') = mkNonRecFloat env Lifted v rhs2 ; return ( snocFloat floats2 float , cpeEtaExpand arity (Var v')) }) @@ -735,6 +737,8 @@ cpePair top_lvl is_rec dmd lev env bndr rhs ; return (floats4, rhs4) } where + env = pushBinderContext bndr env0 + arity = idArity bndr -- We must match this arity want_float_from_rhs floats rhs @@ -967,36 +971,36 @@ cpeBodyNF env expr cpeBody :: CorePrepEnv -> CoreExpr -> UniqSM (Floats, CpeBody) cpeBody env expr = do { (floats1, rhs) <- cpeRhsE env expr - ; (floats2, body) <- rhsToBody rhs + ; (floats2, body) <- rhsToBody env rhs ; return (floats1 `appFloats` floats2, body) } -------- -rhsToBody :: CpeRhs -> UniqSM (Floats, CpeBody) +rhsToBody :: CorePrepEnv -> CpeRhs -> UniqSM (Floats, CpeBody) -- Remove top level lambdas by let-binding -rhsToBody (Tick t expr) +rhsToBody env (Tick t expr) | tickishScoped t == NoScope -- only float out of non-scoped annotations - = do { (floats, expr') <- rhsToBody expr + = do { (floats, expr') <- rhsToBody env expr ; return (floats, mkTick t expr') } -rhsToBody (Cast e co) +rhsToBody env (Cast e co) -- You can get things like -- case e of { p -> coerce t (\s -> ...) } - = do { (floats, e') <- rhsToBody e + = do { (floats, e') <- rhsToBody env e ; return (floats, Cast e' co) } -rhsToBody expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] +rhsToBody env expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] | all isTyVar bndrs -- Type lambdas are ok = return (emptyFloats, expr) | otherwise -- Some value lambdas = do { let rhs = cpeEtaExpand (exprArity expr) expr - ; fn <- newVar (exprType rhs) + ; fn <- newVar env (exprType rhs) ; let float = Float (NonRec fn rhs) LetBound TopLvlFloatable ; return (unitFloat float, Var fn) } where (bndrs,_) = collectBinders expr -rhsToBody expr = return (emptyFloats, expr) +rhsToBody _env expr = return (emptyFloats, expr) {- Note [No eta reduction needed in rhsToBody] @@ -1168,7 +1172,7 @@ cpeApp top_env expr -- allocating CaseBound Floats for token and thing as needed = do { (floats1, token) <- cpeArg env topDmd token ; (floats2, thing) <- cpeBody env thing - ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar ty + ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar env ty ; let tup = mkCoreUnboxedTuple [token, Var case_bndr] ; let float = mkCaseFloat case_bndr thing ; return (floats1 `appFloats` floats2 `snocFloat` float, tup) } @@ -1577,7 +1581,7 @@ cpeArg env dmd arg ; let arg_ty = exprType arg1 lev = typeLevity arg_ty dec = wantFloatLocal NonRecursive dmd lev floats1 arg1 - ; (floats2, arg2) <- executeFloatDecision dec floats1 arg1 + ; (floats2, arg2) <- executeFloatDecision env dec floats1 arg1 -- Else case: arg1 might have lambdas, and we can't -- put them inside a wrapBinds @@ -1586,7 +1590,7 @@ cpeArg env dmd arg -- see Note [ANF-ising literal string arguments] ; if exprIsTrivial arg2 then return (floats2, arg2) - else do { v <- (`setIdDemandInfo` dmd) <$> newVar arg_ty + else do { v <- (`setIdDemandInfo` dmd) <$> newVar env arg_ty -- See Note [Pin demand info on floats] ; let arity = cpeArgArity env dec floats1 arg2 arg3 = cpeEtaExpand arity arg2 @@ -2424,13 +2428,13 @@ instance Outputable FloatDecision where ppr FloatNone = text "none" ppr FloatAll = text "all" -executeFloatDecision :: FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) -executeFloatDecision dec floats rhs +executeFloatDecision :: CorePrepEnv -> FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) +executeFloatDecision env dec floats rhs = case dec of FloatAll -> return (floats, rhs) FloatNone | isEmptyFloats floats -> return (emptyFloats, rhs) - | otherwise -> do { (floats', body) <- rhsToBody rhs + | otherwise -> do { (floats', body) <- rhsToBody env rhs ; return (emptyFloats, wrapBinds floats $ wrapBinds floats' body) } -- FloatNone case: `rhs` might have lambdas, and we can't @@ -2569,6 +2573,8 @@ data CorePrepEnv , cpe_subst :: Subst -- ^ See Note [CorePrepEnv: cpe_subst] , cpe_rec_ids :: UnVarSet -- Faster OutIdSet; See Note [Speculative evaluation] + + , cpe_context :: [OccName] -- ^ See Note [Binder context] } mkInitialCorePrepEnv :: CorePrepConfig -> CorePrepEnv @@ -2576,6 +2582,7 @@ mkInitialCorePrepEnv cfg = CPE { cpe_config = cfg , cpe_subst = emptySubst , cpe_rec_ids = emptyUnVarSet + , cpe_context = [] } extendCorePrepEnv :: CorePrepEnv -> Id -> Id -> CorePrepEnv @@ -2616,6 +2623,14 @@ cpSubstCo :: CorePrepEnv -> Coercion -> Coercion cpSubstCo (CPE { cpe_subst = subst }) co = substCo subst co -- substCo has a short-cut if the TCvSubst is empty +-- | See Note [Binder context] +pushBinderContext :: Id -> CorePrepEnv -> CorePrepEnv +pushBinderContext ident env + | lengthAtLeast (cpe_context env) 2 + = env + | otherwise + = env { cpe_context = getOccName ident : cpe_context env} + ------------------------------------------------------------------------------ -- Cloning binders -- --------------------------------------------------------------------------- @@ -2704,10 +2719,20 @@ fiddleCCall id -- Generating new binders -- --------------------------------------------------------------------------- -newVar :: Type -> UniqSM Id -newVar ty - = seqType ty `seq` mkSysLocalOrCoVarM (fsLit "sat") ManyTy ty - +newVar :: CorePrepEnv -> Type -> UniqSM Id +newVar env ty + -- See Note [Binder context] + = seqType ty `seq` mkSysLocalOrCoVarM (fsLit occ) ManyTy ty + where occ = intercalate "_" (map occNameString $ cpe_context env) ++ "_sat" + +{- Note [Binder context] + ~~~~~~~~~~~~~~~~~~~~~ + To ensure that the compiled program (specifically symbol names) + remains understandable to the user we maintain a context + of binders that we are currently under. This allows us to give + identifiers conjured during CorePrep more contextually-meaningful + names. This is done in `newVar`. + -} ------------------------------------------------------------------------------ -- Floating ticks ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -2,10 +2,19 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE UnliftedFFITypes #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +{-# OPTIONS_GHC -fno-unoptimized-core-for-interpreter #-} +#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected +-- +-- Also important, if you load this module into GHCi then the data representation of +-- FastString has to match that of the host compiler due to the shared FastString +-- table. Otherwise you will get segfaults when the table is consulted and the fields +-- from the FastString are in an incorrect order. -- | -- There are two principal string types used internally by GHC: ===================================== compiler/GHC/Data/FlatBag.hs ===================================== @@ -8,13 +8,11 @@ module GHC.Data.FlatBag , mappendFlatBag -- * Construction , fromList - , fromSizedSeq + , fromSmallArray ) where import GHC.Prelude -import GHC.Data.SizedSeq (SizedSeq, ssElts, sizeSS) - import Control.DeepSeq import GHC.Data.SmallArray @@ -125,5 +123,10 @@ fromList n elts = -- | Convert a 'SizedSeq' into its flattened representation. -- A 'FlatBag a' is more memory efficient than '[a]', if no further modification -- is necessary. -fromSizedSeq :: SizedSeq a -> FlatBag a -fromSizedSeq s = fromList (sizeSS s) (ssElts s) +fromSmallArray :: SmallArray a -> FlatBag a +fromSmallArray s = case sizeofSmallArray s of + 0 -> EmptyFlatBag + 1 -> UnitFlatBag (indexSmallArray s 0) + 2 -> TupleFlatBag (indexSmallArray s 0) (indexSmallArray s 1) + _ -> FlatBag s + ===================================== compiler/GHC/Data/SmallArray.hs ===================================== @@ -16,11 +16,18 @@ module GHC.Data.SmallArray , mapSmallArray , foldMapSmallArray , rnfSmallArray + + -- * IO Operations + , SmallMutableArrayIO + , newSmallArrayIO + , writeSmallArrayIO + , unsafeFreezeSmallArrayIO ) where import GHC.Exts import GHC.Prelude +import GHC.IO import GHC.ST import Control.DeepSeq @@ -28,6 +35,8 @@ data SmallArray a = SmallArray (SmallArray# a) data SmallMutableArray s a = SmallMutableArray (SmallMutableArray# s a) +type SmallMutableArrayIO a = SmallMutableArray RealWorld a + newSmallArray :: Int -- ^ size -> a -- ^ initial contents @@ -37,6 +46,9 @@ newSmallArray newSmallArray (I# sz) x s = case newSmallArray# sz x s of (# s', a #) -> (# s', SmallMutableArray a #) +newSmallArrayIO :: Int -> a -> IO (SmallMutableArrayIO a) +newSmallArrayIO sz x = IO $ \s -> newSmallArray sz x s + writeSmallArray :: SmallMutableArray s a -- ^ array -> Int -- ^ index @@ -46,6 +58,12 @@ writeSmallArray {-# INLINE writeSmallArray #-} writeSmallArray (SmallMutableArray a) (I# i) x = writeSmallArray# a i x +writeSmallArrayIO :: SmallMutableArrayIO a + -> Int + -> a + -> IO () +writeSmallArrayIO a ix v = IO $ \s -> (# writeSmallArray a ix v s, () #) + -- | Copy and freeze a slice of a mutable array. freezeSmallArray @@ -69,6 +87,9 @@ unsafeFreezeSmallArray (SmallMutableArray ma) s = case unsafeFreezeSmallArray# ma s of (# s', a #) -> (# s', SmallArray a #) +unsafeFreezeSmallArrayIO :: SmallMutableArrayIO a -> IO (SmallArray a) +unsafeFreezeSmallArrayIO arr = IO $ \s -> unsafeFreezeSmallArray arr s + -- | Get the size of a 'SmallArray' sizeofSmallArray :: SmallArray a ===================================== compiler/GHC/Prelude/Basic.hs ===================================== @@ -25,6 +25,8 @@ module GHC.Prelude.Basic , shiftL, shiftR , setBit, clearBit , head, tail + + , strictGenericLength ) where @@ -130,3 +132,15 @@ head = Prelude.head tail :: HasCallStack => [a] -> [a] tail = Prelude.tail {-# INLINE tail #-} + +{- | +The 'genericLength' function defined in base can't be specialised due to the +NOINLINE pragma. + +It is also not strict in the accumulator, and strictGenericLength is not exported. + +See #25706 for why it is important to use a strict, specialised version. + +-} +strictGenericLength :: Num a => [x] -> a +strictGenericLength = fromIntegral . length ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry -import Data.List ( genericReplicate, genericLength, intersperse +import Data.List ( genericReplicate, intersperse , partition, scanl', sortBy, zip4, zip6 ) import Foreign hiding (shiftL, shiftR) import Control.Monad @@ -240,11 +240,12 @@ ppBCEnv p -- Create a BCO and do a spot of peephole optimisation on the insns -- at the same time. mkProtoBCO - :: (Outputable name) - => Platform - -> Bool -- ^ True <=> label with @BCO_NAME@ instruction - -- see Note [BCO_NAME] - -> name + :: + Platform + -> Maybe Module + -- ^ Just cur_mod <=> label with @BCO_NAME@ instruction + -- see Note [BCO_NAME] + -> Name -> BCInstrList -> Either [CgStgAlt] (CgStgRhs) -- ^ original expression; for debugging only @@ -253,7 +254,7 @@ mkProtoBCO -> [StgWord] -- ^ bitmap -> Bool -- ^ True <=> is a return point, rather than a function -> [FFIInfo] - -> ProtoBCO name + -> ProtoBCO Name mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bitmap is_ret ffis = ProtoBCO { protoBCOName = nm, @@ -267,9 +268,9 @@ mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bit where #if MIN_VERSION_rts(1,0,3) maybe_add_bco_name instrs - | _add_bco_name = BCO_NAME str : instrs - where - str = BS.pack $ showSDocOneLine defaultSDocContext (ppr nm) + | Just cur_mod <- _add_bco_name = + let str = BS.pack $ showSDocOneLine defaultSDocContext (pprFullName cur_mod nm) + in BCO_NAME str : instrs #endif maybe_add_bco_name instrs = instrs @@ -393,7 +394,7 @@ schemeR_wrk fvs nm original_body (args, body) -- make the arg bitmap bits = argBits platform (reverse (map (idArgRep platform) all_args)) - bitmap_size = genericLength bits + bitmap_size = strictGenericLength bits bitmap = mkBitmap platform bits body_code <- schemeER_wrk sum_szsb_args p_init body @@ -607,7 +608,7 @@ schemeE d s p (StgLet _ext binds body) = do platform <- targetPlatform <$> getDynFlags let (xs,rhss) = case binds of StgNonRec x rhs -> ([x],[rhs]) StgRec xs_n_rhss -> unzip xs_n_rhss - n_binds = genericLength xs + n_binds = strictGenericLength xs fvss = map (fvsToEnv p') rhss @@ -616,7 +617,7 @@ schemeE d s p (StgLet _ext binds body) = do sizes = map (\rhs_fvs -> sum (map size_w rhs_fvs)) fvss -- the arity of each rhs - arities = map (genericLength . fst . collect) rhss + arities = map (strictGenericLength . fst . collect) rhss -- This p', d' defn is safe because all the items being pushed -- are ptrs, so all have size 1 word. d' and p' reflect the stack @@ -1398,7 +1399,7 @@ Note [unboxed tuple bytecodes and tuple_BCO] tupleBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name tupleBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1419,7 +1420,7 @@ tupleBCO platform args_info args = primCallBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name primCallBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1857,7 +1858,7 @@ implement_tagToId implement_tagToId d s p arg names = assert (notNull names) $ do (push_arg, arg_bytes) <- pushAtom d p (StgVarArg arg) - labels <- getLabelsBc (genericLength names) + labels <- getLabelsBc (strictGenericLength names) label_fail <- getLabelBc label_exit <- getLabelBc dflags <- getDynFlags @@ -2359,8 +2360,12 @@ getHscEnv = BcM $ \st -> return (st, bcm_hsc_env st) getProfile :: BcM Profile getProfile = targetProfile <$> getDynFlags -shouldAddBcoName :: BcM Bool -shouldAddBcoName = gopt Opt_AddBcoName <$> getDynFlags +shouldAddBcoName :: BcM (Maybe Module) +shouldAddBcoName = do + add <- gopt Opt_AddBcoName <$> getDynFlags + if add + then Just <$> getCurrentModule + else return Nothing emitBc :: ([FFIInfo] -> ProtoBCO Name) -> BcM (ProtoBCO Name) emitBc bco ===================================== libraries/ghc-boot/GHC/Data/SizedSeq.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving, DeriveGeneric, CPP #-} module GHC.Data.SizedSeq ( SizedSeq(..) , emptySS @@ -11,9 +11,12 @@ module GHC.Data.SizedSeq import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary -import Data.List (genericLength) import GHC.Generics +#if ! MIN_VERSION_base(4,20,0) +import Data.List (foldl') +#endif + data SizedSeq a = SizedSeq {-# UNPACK #-} !Word [a] deriving (Generic, Show) @@ -37,9 +40,9 @@ emptySS = SizedSeq 0 [] addToSS :: SizedSeq a -> a -> SizedSeq a addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) +-- NB, important this is eta-expand so that foldl' is inlined. addListToSS :: SizedSeq a -> [a] -> SizedSeq a -addListToSS (SizedSeq n r_xs) xs - = SizedSeq (n + genericLength xs) (reverse xs ++ r_xs) +addListToSS s xs = foldl' addToSS s xs ssElts :: SizedSeq a -> [a] ssElts (SizedSeq _ r_xs) = reverse r_xs ===================================== rts/StgCRunAsm.S ===================================== @@ -69,7 +69,7 @@ StgReturn: .section .note.GNU-stack,"", at progbits # else // Not ELF v2 -# error Only ELF v2 supported. + // ELF v1 is in StgCrun.c # endif #elif defined(powerpc_HOST_ARCH) ===================================== testsuite/tests/core-to-stg/T14895.stderr ===================================== @@ -11,10 +11,10 @@ T14895.go GHC.Internal.Data.Either.Left e [Occ=Once1] -> wild; GHC.Internal.Data.Either.Right a1 [Occ=Once1] -> let { - sat [Occ=Once1] :: b + go_sat [Occ=Once1] :: b [LclId] = {a1, f} \u [] f a1; - } in GHC.Internal.Data.Either.Right [sat]; + } in GHC.Internal.Data.Either.Right [go_sat]; }; ===================================== testsuite/tests/core-to-stg/T24124.stderr ===================================== @@ -9,16 +9,16 @@ T24124.testFun1 T24124.StrictPair a b #) [GblId, Arity=3, Str=, Cpr=1, Unf=OtherCon []] = {} \r [x y void] - case x of sat { + case x of testFun1_sat { __DEFAULT -> case case y of y [OS=OneShot] { - __DEFAULT -> T24124.MkStrictPair [sat y]; + __DEFAULT -> T24124.MkStrictPair [testFun1_sat y]; } of - sat + testFun1_sat { - __DEFAULT -> GHC.Internal.Types.MkSolo# [sat]; + __DEFAULT -> GHC.Internal.Types.MkSolo# [testFun1_sat]; }; }; ===================================== testsuite/tests/ghci/should_run/T21052.stdout ===================================== @@ -4,9 +4,9 @@ BCO_toplevel :: GHC.Internal.Types.IO [GHC.Internal.Types.Any] [LclIdX] = {} \u [] let { - sat :: [GHC.Internal.Types.Any] + _sat :: [GHC.Internal.Types.Any] [LclId, Unf=OtherCon []] = :! [GHC.Internal.Tuple.() GHC.Internal.Types.[]]; - } in GHC.Internal.Base.returnIO sat; + } in GHC.Internal.Base.returnIO _sat; ===================================== testsuite/tests/perf/should_run/ByteCodeAsm.hs ===================================== @@ -0,0 +1,66 @@ +module Main where + +import GHC.Driver.Session +import GHC +import qualified GHC.LanguageExtensions as LangExt + +import Control.Monad (forM_) +import Control.Monad.IO.Class (liftIO) +import System.Environment (getArgs) + +import GHC.ByteCode.Asm ( assembleBCO ) +import GHC.ByteCode.Instr +import Control.Monad +import GHC.Builtin.Names + +-- Testing the performance of the bytecode assembler + +-- A nonsensical byte-code program +instrs = [ STKCHECK 1234 + , PUSH_L 1 + , PUSH_LL 1 2 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH8 0 + , PUSH16 15 + , PUSH32 29 + , PUSH_PAD8 + , PUSH_APPLY_N + , PUSH_APPLY_V + , PUSH_APPLY_F + , PUSH_APPLY_D + , PUSH_APPLY_L + , PUSH_APPLY_P + , PUSH_APPLY_PP + , PUSH_APPLY_PPP + , PUSH_APPLY_PPPP + , PUSH_APPLY_PPPPP + , PUSH_APPLY_PPPPPP + , TESTLT_I 100 (LocalLabel 0) + , TESTEQ_I 100 (LocalLabel 0) + ] + ++ [ LABEL (LocalLabel n) | n <- [0..50] ] + ++ [ TESTEQ_I64 n (LocalLabel 49) | n <- [1243 .. 1253 + 50 ]] + ++ [ ENTER ] + ++ [ SLIDE x n | x <- [0..5], n <- [0..10] ] + ++ [ PUSH_G appAName | _ <- [0..100] ] + ++ [ PUSH_BCO fake_proto2 ] + +fake_proto = ProtoBCO appAName instrs [] 0 0 (Left []) [] + +instrs2 = [ STKCHECK 77, UNPACK 4, SLIDE 0 4, ENTER ] + +fake_proto2 = ProtoBCO appAName instrs2 [] 0 0 (Left []) [] + +main :: IO () +main = do + [libdir] <- getArgs + runGhc (Just libdir) $ do + dflags <- getSessionDynFlags + let platform = targetPlatform dflags + + -- ~1s on my machine + liftIO $ replicateM_ 100000 (assembleBCO platform fake_proto) ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -415,3 +415,11 @@ test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], com test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) test('T17949', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) + +test('ByteCodeAsm', + [ extra_run_opts('"' + config.libdir + '"') + , js_broken(22261) + , collect_stats('bytes allocated', 10), + ], + compile_and_run, + ['-package ghc']) ===================================== testsuite/tests/simplCore/should_compile/T20040.stderr ===================================== @@ -16,7 +16,9 @@ ifoldl' = Cons ipv2 ipv3 -> case z of z1 { __DEFAULT -> - case f z1 ipv2 of sat { __DEFAULT -> ifoldl' f sat ipv3; }; + case f z1 ipv2 of ifoldl'_sat { + __DEFAULT -> ifoldl' f ifoldl'_sat ipv3; + }; }; }; end Rec } ===================================== testsuite/tests/simplCore/should_compile/T23083.stderr ===================================== @@ -13,10 +13,10 @@ T23083.g :: ((GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer T23083.g = \ (f [Occ=Once1!] :: (GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> GHC.Internal.Bignum.Integer.Integer) (h [Occ=OnceL1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> let { - sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer + g_sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer [LclId, Unf=OtherCon []] - sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in - f sat + g_sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in + f g_sat -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T23083.$trModule4 :: GHC.Prim.Addr# ===================================== testsuite/tests/simplStg/should_compile/T15226b.stderr ===================================== @@ -8,13 +8,13 @@ T15226b.bar1 T15226b.Str (GHC.Internal.Maybe.Maybe a) #) [GblId, Arity=2, Str=, Cpr=1(, 1), Unf=OtherCon []] = {} \r [x void] - case x of sat { + case x of bar1_sat { __DEFAULT -> let { - sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) + bar1_sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) [LclId, Unf=OtherCon []] = - T15226b.Str! [sat]; - } in GHC.Internal.Types.MkSolo# [sat]; + T15226b.Str! [bar1_sat]; + } in GHC.Internal.Types.MkSolo# [bar1_sat]; }; T15226b.bar ===================================== testsuite/tests/simplStg/should_compile/T19717.stderr ===================================== @@ -6,14 +6,14 @@ Foo.f :: forall {a}. a -> [GHC.Internal.Maybe.Maybe a] case x of x1 { __DEFAULT -> let { - sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a + f_sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a [LclId, Unf=OtherCon []] = GHC.Internal.Maybe.Just! [x1]; } in let { - sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] + f_sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] [LclId, Unf=OtherCon []] = - :! [sat GHC.Internal.Types.[]]; - } in : [sat sat]; + :! [f_sat GHC.Internal.Types.[]]; + } in : [f_sat f_sat]; }; ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c9d6afe6a1e9bec12c5f2db226aa68b84ecc63c...890bec99b78a139565eac096e18f536ba7417029 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c9d6afe6a1e9bec12c5f2db226aa68b84ecc63c...890bec99b78a139565eac096e18f536ba7417029 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 13:34:15 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Wed, 05 Feb 2025 08:34:15 -0500 Subject: [Git][ghc/ghc][wip/T18462] More refactoring Message-ID: <67a368d7773bc_23a6f07b26901088cc@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 0c52281b by Sjoerd Visscher at 2025-02-05T14:34:07+01:00 More refactoring - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Build.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Id/Make.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Type.hs - testsuite/tests/ghc-api/exactprint/Test20239.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0c52281bbac87574f123164caa56f36d91866d0c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0c52281bbac87574f123164caa56f36d91866d0c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 13:55:02 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 05 Feb 2025 08:55:02 -0500 Subject: [Git][ghc/ghc][wip/specialise-assembler] perf: Speed up the bytecode assembler Message-ID: <67a36db5ee3e1_23a6f0cd4d581135b1@gitlab.mail> Matthew Pickering pushed to branch wip/specialise-assembler at Glasgow Haskell Compiler / GHC Commits: 2ec5a1a6 by Matthew Pickering at 2025-02-05T13:51:17+00:00 perf: Speed up the bytecode assembler This commit contains a number of optimisations to the bytecode assembler. In programs which generate a large amount of bytecode, the assembler is called a lot of times on many instructions. 1. Specialise the assembleI function for the two intepreters to avoid having to materialise the intermediate free-monad like structure. 2. Directly compute the UArray and SmallArray needed rather than going via the intermediate SizedSeq 3. Use optimised monads 4. Define unrolled "any" and "mapM6" functions which can be inlined and avoid calling recursive functions. The resulting generated code is much more direct. Before: ./ByteCodeAsm /home/matt/ghc-profiling-light/_build/stage1/lib/ +RTS -s 48,923,125,664 bytes allocated in the heap 678,221,152 bytes copied during GC 395,648 bytes maximum residency (2 sample(s)) 50,040 bytes maximum slop 6 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 11731 colls, 0 par 0.419s 0.425s 0.0000s 0.0004s Gen 1 2 colls, 0 par 0.001s 0.001s 0.0007s 0.0012s INIT time 0.000s ( 0.000s elapsed) MUT time 6.466s ( 6.484s elapsed) GC time 0.421s ( 0.426s elapsed) EXIT time 0.000s ( 0.000s elapsed) Total time 6.887s ( 6.910s elapsed) After: 1,518,321,200 bytes allocated in the heap 4,299,552 bytes copied during GC 322,288 bytes maximum residency (2 sample(s)) 50,280 bytes maximum slop 6 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 369 colls, 0 par 0.003s 0.003s 0.0000s 0.0002s Gen 1 2 colls, 0 par 0.001s 0.001s 0.0007s 0.0012s INIT time 0.001s ( 0.001s elapsed) MUT time 0.465s ( 0.466s elapsed) GC time 0.004s ( 0.004s elapsed) EXIT time 0.000s ( 0.000s elapsed) Total time 0.470s ( 0.471s elapsed) - - - - - 7 changed files: - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Data/FlatBag.hs - compiler/GHC/Data/SmallArray.hs - + testsuite/tests/perf/should_run/ByteCodeAsm.hs - testsuite/tests/perf/should_run/all.T Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -1,8 +1,12 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +{-# LANGUAGE PatternSynonyms #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- +-- -- (c) The University of Glasgow 2002-2006 -- @@ -12,10 +16,14 @@ module GHC.ByteCode.Asm ( bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, - mkNativeCallInfoLit + mkNativeCallInfoLit, + + -- * For testing + assembleBCO ) where -import GHC.Prelude +import GHC.Prelude hiding ( any ) + import GHC.ByteCode.Instr import GHC.ByteCode.InfoTable @@ -29,12 +37,14 @@ import GHC.Types.Name.Set import GHC.Types.Literal import GHC.Types.Unique.DSet import GHC.Types.SptEntry +import GHC.Types.Unique.FM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon import GHC.Data.SizedSeq +import GHC.Data.SmallArray import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.Cmm.Expr @@ -44,19 +54,21 @@ import GHC.Platform import GHC.Platform.Profile import Control.Monad -import Control.Monad.Trans.Class -import Control.Monad.Trans.State.Strict +import qualified Control.Monad.Trans.State.Strict as MTL import qualified Data.Array.Unboxed as Array -import Data.Array.Base ( UArray(..) ) +import qualified Data.Array.IO as Array +import Data.Array.Base ( UArray(..), unsafeWrite, numElements, unsafeFreeze ) import Foreign hiding (shiftL, shiftR) -import Data.Char ( ord ) -import Data.Map.Strict (Map) +import Data.Char (ord) import Data.Maybe (fromMaybe) -import qualified Data.Map.Strict as Map import GHC.Float (castFloatToWord32, castDoubleToWord64) +import qualified Data.List as List ( any ) +import GHC.Exts + + -- ----------------------------------------------------------------------------- -- Unlinked BCOs @@ -133,9 +145,9 @@ assembleBCOs interp profile proto_bcos tycons top_strs modbreaks spt_entries = d -- mallocStrings :: Interp -> FlatBag UnlinkedBCO -> IO (FlatBag UnlinkedBCO) mallocStrings interp ulbcos = do - let bytestrings = reverse (execState (mapM_ collect ulbcos) []) + let bytestrings = reverse (MTL.execState (mapM_ collect ulbcos) []) ptrs <- interpCmd interp (MallocStrings bytestrings) - return (evalState (mapM splice ulbcos) ptrs) + return (MTL.evalState (mapM splice ulbcos) ptrs) where splice bco at UnlinkedBCO{..} = do lits <- mapM spliceLit unlinkedBCOLits @@ -143,10 +155,10 @@ mallocStrings interp ulbcos = do return bco { unlinkedBCOLits = lits, unlinkedBCOPtrs = ptrs } spliceLit (BCONPtrStr _) = do - rptrs <- get + rptrs <- MTL.get case rptrs of (RemotePtr p : rest) -> do - put rest + MTL.put rest return (BCONPtrWord (fromIntegral p)) _ -> panic "mallocStrings:spliceLit" spliceLit other = return other @@ -159,13 +171,61 @@ mallocStrings interp ulbcos = do mapM_ collectPtr unlinkedBCOPtrs collectLit (BCONPtrStr bs) = do - strs <- get - put (bs:strs) + strs <- MTL.get + MTL.put (bs:strs) collectLit _ = return () collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () +data RunAsmReader = RunAsmReader { isn_array :: {-# UNPACK #-} !(Array.IOUArray Int Word16) + , ptr_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCOPtr) + , lit_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCONPtr ) + } + +data RunAsmResult = RunAsmResult { final_isn_array :: !(Array.UArray Int Word16) + , final_ptr_array :: !(SmallArray BCOPtr) + , final_lit_array :: !(SmallArray BCONPtr) } + +-- How many words we have written so far. +data AsmState = AsmState { nisn :: !Int, nptr :: !Int, nlit :: !Int } + + +{-# NOINLINE inspectInstrs #-} +-- | Perform analysis of the bytecode to determine +-- 1. How many instructions we will produce +-- 2. If we are going to need long jumps. +-- 3. The offsets that labels refer to +inspectInstrs :: Platform -> Bool -> Word -> [BCInstr] -> InspectState +inspectInstrs platform long_jump e instrs = + inspectAsm long_jump e (mapM_ (assembleInspectAsm platform) instrs) + +{-# NOINLINE runInstrs #-} +-- | Assemble the bytecode from the instructions. +runInstrs :: Platform -> Bool -> InspectState -> [BCInstr] -> IO RunAsmResult +runInstrs platform long_jumps is_state instrs = do + -- Produce arrays of exactly the right size, corresponding to the result of inspectInstrs. + isn_array <- Array.newArray_ (0, (fromIntegral $ instrCount is_state) - 1) + ptr_array <- newSmallArrayIO (fromIntegral $ ptrCount is_state) undefined + lit_array <- newSmallArrayIO (fromIntegral $ litCount is_state) undefined + let env :: LocalLabel -> Word + env lbl = fromMaybe + (pprPanic "assembleBCO.findLabel" (ppr lbl)) + (lookupUFM (lblEnv is_state) lbl) + let initial_state = AsmState 0 0 0 + let initial_reader = RunAsmReader{..} + runAsm long_jumps env initial_reader initial_state (mapM_ (\i -> assembleRunAsm platform i) instrs) + final_isn_array <- unsafeFreeze isn_array + final_ptr_array <- unsafeFreezeSmallArrayIO ptr_array + final_lit_array <- unsafeFreezeSmallArrayIO lit_array + return $ RunAsmResult {..} + +assembleRunAsm :: Platform -> BCInstr -> RunAsm () +assembleRunAsm p i = assembleI @RunAsm p i + +assembleInspectAsm :: Platform -> BCInstr -> InspectAsm () +assembleInspectAsm p i = assembleI @InspectAsm p i + assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm @@ -174,9 +234,7 @@ assembleBCO platform , protoBCOBitmapSize = bsize , protoBCOArity = arity }) = do -- pass 1: collect up the offsets of the local labels. - let asm = mapM_ (assembleI platform) instrs - - initial_offset = 0 + let initial_offset = 0 -- Jump instructions are variable-sized, there are long and short variants -- depending on the magnitude of the offset. However, we can't tell what @@ -186,30 +244,25 @@ assembleBCO platform -- and if the final size is indeed small enough for short jumps, we are -- done. Otherwise, we repeat the calculation, and we force all jumps in -- this BCO to be long. - (n_insns0, lbl_map0) = inspectAsm platform False initial_offset asm - ((n_insns, lbl_map), long_jumps) - | isLargeW (fromIntegral $ Map.size lbl_map0) - || isLargeW n_insns0 - = (inspectAsm platform True initial_offset asm, True) - | otherwise = ((n_insns0, lbl_map0), False) - - env :: LocalLabel -> Word - env lbl = fromMaybe - (pprPanic "assembleBCO.findLabel" (ppr lbl)) - (Map.lookup lbl lbl_map) + is0 = inspectInstrs platform False initial_offset instrs + (is1, long_jumps) + | isLargeInspectState is0 + = (inspectInstrs platform True initial_offset instrs, True) + | otherwise = (is0, False) + -- pass 2: run assembler and generate instructions, literals and pointers - let initial_state = (emptySS, emptySS, emptySS) - (final_insns, final_lits, final_ptrs) <- flip execStateT initial_state $ runAsm platform long_jumps env asm + RunAsmResult{..} <- runInstrs platform long_jumps is1 instrs -- precomputed size should be equal to final size - massertPpr (n_insns == sizeSS final_insns) + massertPpr (fromIntegral (instrCount is1) == numElements final_isn_array + && fromIntegral (ptrCount is1) == sizeofSmallArray final_ptr_array + && fromIntegral (litCount is1) == sizeofSmallArray final_lit_array) (text "bytecode instruction count mismatch") - let asm_insns = ssElts final_insns - !insns_arr = mkBCOByteArray $ Array.listArray (0 :: Int, fromIntegral n_insns - 1) asm_insns + let !insns_arr = mkBCOByteArray $ final_isn_array !bitmap_arr = mkBCOByteArray $ mkBitmapArray bsize bitmap - ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSizedSeq final_lits) (fromSizedSeq final_ptrs) + ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSmallArray final_lit_array) (fromSmallArray final_ptr_array) -- 8 Aug 01: Finalisers aren't safe when attached to non-primitive -- objects, since they might get run too early. Disable this until @@ -226,10 +279,6 @@ mkBitmapArray bsize bitmap = Array.listArray (0, length bitmap) $ fromIntegral bsize : map (fromInteger . fromStgWord) bitmap --- instrs nonptrs ptrs -type AsmState = (SizedSeq Word16, - SizedSeq BCONPtr, - SizedSeq BCOPtr) data Operand = Op Word @@ -249,39 +298,9 @@ truncHalfWord platform w = case platformWordSize platform of PW8 | w <= 4294967295 -> Op (fromIntegral w) _ -> pprPanic "GHC.ByteCode.Asm.truncHalfWord" (ppr w) -data Assembler a - = AllocPtr (IO BCOPtr) (Word -> Assembler a) - | AllocLit [BCONPtr] (Word -> Assembler a) - | AllocLabel LocalLabel (Assembler a) - | Emit Word16 [Operand] (Assembler a) - | NullAsm a - deriving (Functor) - -instance Applicative Assembler where - pure = NullAsm - (<*>) = ap - -instance Monad Assembler where - NullAsm x >>= f = f x - AllocPtr p k >>= f = AllocPtr p (k >=> f) - AllocLit l k >>= f = AllocLit l (k >=> f) - AllocLabel lbl k >>= f = AllocLabel lbl (k >>= f) - Emit w ops k >>= f = Emit w ops (k >>= f) - -ioptr :: IO BCOPtr -> Assembler Word -ioptr p = AllocPtr p return - -ptr :: BCOPtr -> Assembler Word -ptr = ioptr . return - -lit :: [BCONPtr] -> Assembler Word -lit l = AllocLit l return -label :: LocalLabel -> Assembler () -label w = AllocLabel w (return ()) - -emit :: Word16 -> [Operand] -> Assembler () -emit w ops = Emit w ops (return ()) +ptr :: MonadAssembler m => BCOPtr -> m Word +ptr = ioptr . return type LabelEnv = LocalLabel -> Word @@ -292,38 +311,142 @@ largeOp long_jumps op = case op of IOp i -> isLargeI i LabelOp _ -> long_jumps -runAsm :: Platform -> Bool -> LabelEnv -> Assembler a -> StateT AsmState IO a -runAsm platform long_jumps e = go +newtype RunAsm a = RunAsm' { runRunAsm :: Bool + -> LabelEnv + -> RunAsmReader + -> AsmState + -> IO (AsmState, a) } + +pattern RunAsm :: (Bool -> LabelEnv -> RunAsmReader -> AsmState -> IO (AsmState, a)) + -> RunAsm a +pattern RunAsm m <- RunAsm' m where - go (NullAsm x) = return x - go (AllocPtr p_io k) = do - p <- lift p_io - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_p1 = addToSS st_p0 p - in (sizeSS st_p0, (st_i0,st_l0,st_p1)) - go $ k w - go (AllocLit lits k) = do - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_l1 = addListToSS st_l0 lits - in (sizeSS st_l0, (st_i0,st_l1,st_p0)) - go $ k w - go (AllocLabel _ k) = go k - go (Emit w ops k) = do - let largeArgs = any (largeOp long_jumps) ops - opcode - | largeArgs = largeArgInstr w - | otherwise = w - words = concatMap expand ops - expand (SmallOp w) = [w] - expand (LabelOp w) = expand (Op (e w)) - expand (Op w) = if largeArgs then largeArg platform (fromIntegral w) else [fromIntegral w] - expand (IOp i) = if largeArgs then largeArg platform (fromIntegral i) else [fromIntegral i] - state $ \(st_i0,st_l0,st_p0) -> - let st_i1 = addListToSS st_i0 (opcode : words) - in ((), (st_i1,st_l0,st_p0)) - go k - -type LabelEnvMap = Map LocalLabel Word + RunAsm m = RunAsm' (oneShot $ \a -> oneShot $ \b -> oneShot $ \c -> oneShot $ \d -> m a b c d) +{-# COMPLETE RunAsm #-} + +instance Functor RunAsm where + fmap f (RunAsm x) = RunAsm (\a b c !s -> fmap (fmap f) (x a b c s)) + +instance Applicative RunAsm where + pure x = RunAsm $ \_ _ _ !s -> pure (s, x) + (RunAsm f) <*> (RunAsm x) = RunAsm $ \a b c !s -> do + (!s', f') <- f a b c s + (!s'', x') <- x a b c s' + return (s'', f' x') + {-# INLINE (<*>) #-} + + +instance Monad RunAsm where + return = pure + (RunAsm m) >>= f = RunAsm $ \a b c !s -> m a b c s >>= \(s', r) -> runRunAsm (f r) a b c s' + {-# INLINE (>>=) #-} + +runAsm :: Bool -> LabelEnv -> RunAsmReader -> AsmState -> RunAsm a -> IO a +runAsm long_jumps e r s (RunAsm'{runRunAsm}) = fmap snd $ runRunAsm long_jumps e r s + +expand :: PlatformWordSize -> Bool -> Operand -> RunAsm () +expand word_size largeArgs o = do + e <- askEnv + case o of + (SmallOp w) -> writeIsn w + (LabelOp w) -> let !r = e w in handleLargeArg r + (Op w) -> handleLargeArg w + (IOp i) -> handleLargeArg i + + where + handleLargeArg :: Integral a => a -> RunAsm () + handleLargeArg w = + if largeArgs + then largeArg word_size (fromIntegral w) + else writeIsn (fromIntegral w) + +lift :: IO a -> RunAsm a +lift io = RunAsm $ \_ _ _ s -> io >>= \a -> pure (s, a) + +askLongJumps :: RunAsm Bool +askLongJumps = RunAsm $ \a _ _ s -> pure (s, a) + +askEnv :: RunAsm LabelEnv +askEnv = RunAsm $ \_ b _ s -> pure (s, b) + +writePtr :: BCOPtr -> RunAsm Word +writePtr w + = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO ptr_array (nptr asm) w + let !n' = nptr asm + 1 + let !asm' = asm { nptr = n' } + return (asm', fromIntegral (nptr asm)) + +writeLit :: BCONPtr -> RunAsm Word +writeLit w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO lit_array (nlit asm) w + let !n' = nlit asm + 1 + let !asm' = asm { nlit = n' } + return (asm', fromIntegral (nlit asm)) + +writeLits :: OneOrTwo BCONPtr -> RunAsm Word +writeLits (OnlyOne l) = writeLit l +writeLits (OnlyTwo l1 l2) = writeLit l1 <* writeLit l2 + +writeIsn :: Word16 -> RunAsm () +writeIsn w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do +#if defined(DEBUG) + Array.writeArray isn_array (nisn asm) w +#else + unsafeWrite isn_array (nisn asm) w +#endif + let !n' = nisn asm + 1 + let !asm' = asm { nisn = n' } + return (asm', ()) + +{-# INLINE any #-} +-- Any is unrolled manually so that the call in `emit` can be eliminated without +-- relying on SpecConstr (which does not work across modules). +any :: (a -> Bool) -> [a] -> Bool +any _ [] = False +any f [x] = f x +any f [x,y] = f x || f y +any f [x,y,z] = f x || f y || f z +any f [x1,x2,x3,x4] = f x1 || f x2 || f x3 || f x4 +any f [x1,x2,x3,x4, x5] = f x1 || f x2 || f x3 || f x4 || f x5 +any f [x1,x2,x3,x4,x5,x6] = f x1 || f x2 || f x3 || f x4 || f x5 || f x6 +any f xs = List.any f xs + +{-# INLINE mapM6_ #-} +mapM6_ :: Monad m => (a -> m b) -> [a] -> m () +mapM6_ _ [] = return () +mapM6_ f [x] = () <$ f x +mapM6_ f [x,y] = () <$ f x <* f y +mapM6_ f [x,y,z] = () <$ f x <* f y <* f z +mapM6_ f [a1,a2,a3,a4] = () <$ f a1 <* f a2 <* f a3 <* f a4 +mapM6_ f [a1,a2,a3,a4,a5] = () <$ f a1 <* f a2 <* f a3 <* f a4 <* f a5 +mapM6_ f [a1,a2,a3,a4,a5,a6] = () <$ f a1 <* f a2 <* f a3 <* f a4 <* f a5 <* f a6 +mapM6_ f xs = mapM_ f xs + +instance MonadAssembler RunAsm where + ioptr p_io = do + p <- lift p_io + writePtr p + lit lits = writeLits lits + + label _ = return () + + emit pwordsize w ops = do + long_jumps <- askLongJumps + -- See the definition of `any` above + let largeArgs = any (largeOp long_jumps) ops + let opcode + | largeArgs = largeArgInstr w + | otherwise = w + writeIsn opcode + mapM6_ (expand pwordsize largeArgs) ops + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + +type LabelEnvMap = UniqFM LocalLabel Word data InspectState = InspectState { instrCount :: !Word @@ -332,27 +455,105 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } +instance Outputable InspectState where + ppr (InspectState i p l m) = text "InspectState" <+> ppr [ppr i, ppr p, ppr l, ppr (sizeUFM m)] + +isLargeInspectState :: InspectState -> Bool +isLargeInspectState InspectState{..} = + isLargeW (fromIntegral $ sizeUFM lblEnv) + || isLargeW instrCount + +newtype InspectEnv = InspectEnv { _inspectLongJumps :: Bool + } -inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) -inspectAsm platform long_jumps initial_offset - = go (InspectState initial_offset 0 0 Map.empty) +newtype InspectAsm a = InspectAsm' { runInspectAsm :: InspectEnv -> InspectState -> (# InspectState, a #) } + +pattern InspectAsm :: (InspectEnv -> InspectState -> (# InspectState, a #)) + -> InspectAsm a +pattern InspectAsm m <- InspectAsm' m where - go s (NullAsm _) = (instrCount s, lblEnv s) - go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) - where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) - where n = litCount s - go s (AllocLabel lbl k) = go s' k - where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } - go s (Emit _ ops k) = go s' k - where - s' = s { instrCount = instrCount s + size } - size = sum (map count ops) + 1 + InspectAsm m = InspectAsm' (oneShot $ \a -> oneShot $ \b -> m a b) +{-# COMPLETE InspectAsm #-} + +instance Functor InspectAsm where + fmap f (InspectAsm k) = InspectAsm $ \a b -> case k a b of + (# b', c #) -> (# b', f c #) + +instance Applicative InspectAsm where + pure x = InspectAsm $ \_ s -> (# s, x #) + (InspectAsm f) <*> (InspectAsm x) = InspectAsm $ \a b -> case f a b of + (# s', f' #) -> + case x a s' of + (# s'', x' #) -> (# s'', f' x' #) + +instance Monad InspectAsm where + return = pure + (InspectAsm m) >>= f = InspectAsm $ \ a b -> case m a b of + (# s', a' #) -> runInspectAsm (f a') a s' + +get_ :: InspectAsm InspectState +get_ = InspectAsm $ \_ b -> (# b, b #) + +put_ :: InspectState -> InspectAsm () +put_ !s = InspectAsm $ \_ _ -> (# s, () #) + +modify_ :: (InspectState -> InspectState) -> InspectAsm () +modify_ f = InspectAsm $ \_ s -> let !s' = f s in (# s', () #) + +ask_ :: InspectAsm InspectEnv +ask_ = InspectAsm $ \a b -> (# b, a #) + +inspectAsm :: Bool -> Word -> InspectAsm () -> InspectState +inspectAsm long_jumps initial_offset (InspectAsm s) = + case s (InspectEnv long_jumps) (InspectState initial_offset 0 0 emptyUFM) of + (# res, () #) -> res +{-# INLINE inspectAsm #-} + + + +instance MonadAssembler InspectAsm where + ioptr _ = do + s <- get_ + let n = ptrCount s + put_ (s { ptrCount = n + 1 }) + return n + + lit ls = do + s <- get_ + let n = litCount s + put_ (s { litCount = n + oneTwoLength ls }) + return n + + label lbl = modify_ (\s -> let !count = instrCount s in let !env' = addToUFM (lblEnv s) lbl count in s { lblEnv = env' }) + + emit pwordsize _ ops = do + InspectEnv long_jumps <- ask_ + -- Size is written in this way as `mapM6_` is also used by RunAsm, and guaranteed + -- to unroll for arguments up to size 6. + let size = (MTL.execState (mapM6_ (\x -> MTL.modify (count' x +)) ops) 0) + 1 largeOps = any (largeOp long_jumps) ops - count (SmallOp _) = 1 - count (LabelOp _) = count (Op 0) - count (Op _) = if largeOps then largeArg16s platform else 1 - count (IOp _) = if largeOps then largeArg16s platform else 1 + bigSize = largeArg16s pwordsize + count' = if largeOps then countLarge bigSize else countSmall bigSize + + s <- get_ + put_ (s { instrCount = instrCount s + size }) + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + +count :: Word -> Bool -> Operand -> Word +count _ _ (SmallOp _) = 1 +count big largeOps (LabelOp _) = if largeOps then big else 1 +count big largeOps (Op _) = if largeOps then big else 1 +count big largeOps (IOp _) = if largeOps then big else 1 +{-# INLINE count #-} + +countSmall, countLarge :: Word -> Operand -> Word +countLarge big x = count big True x +countSmall big x = count big False x + -- Bring in all the bci_ bytecode constants. #include "Bytecodes.h" @@ -360,47 +561,67 @@ inspectAsm platform long_jumps initial_offset largeArgInstr :: Word16 -> Word16 largeArgInstr bci = bci_FLAG_LARGE_ARGS .|. bci -largeArg :: Platform -> Word64 -> [Word16] -largeArg platform w = case platformWordSize platform of - PW8 -> [fromIntegral (w `shiftR` 48), - fromIntegral (w `shiftR` 32), - fromIntegral (w `shiftR` 16), - fromIntegral w] +{-# INLINE largeArg #-} +largeArg :: PlatformWordSize -> Word64 -> RunAsm () +largeArg wsize w = case wsize of + PW8 -> do writeIsn (fromIntegral (w `shiftR` 48)) + writeIsn (fromIntegral (w `shiftR` 32)) + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) PW4 -> assertPpr (w < fromIntegral (maxBound :: Word32)) - (text "largeArg too big:" <+> ppr w) $ - [fromIntegral (w `shiftR` 16), - fromIntegral w] + (text "largeArg too big:" <+> ppr w) $ do + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) -largeArg16s :: Platform -> Word -largeArg16s platform = case platformWordSize platform of +largeArg16s :: PlatformWordSize -> Word +largeArg16s pwordsize = case pwordsize of PW8 -> 4 PW4 -> 2 -assembleI :: Platform +data OneOrTwo a = OnlyOne a | OnlyTwo a a deriving (Functor) + +oneTwoLength :: OneOrTwo a -> Word +oneTwoLength (OnlyOne {}) = 1 +oneTwoLength (OnlyTwo {}) = 2 + +class Monad m => MonadAssembler m where + ioptr :: IO BCOPtr -> m Word + lit :: OneOrTwo BCONPtr -> m Word + label :: LocalLabel -> m () + emit :: PlatformWordSize -> Word16 -> [Operand] -> m () + +lit1 :: MonadAssembler m => BCONPtr -> m Word +lit1 p = lit (OnlyOne p) + +{-# SPECIALISE assembleI :: Platform -> BCInstr -> InspectAsm () #-} +{-# SPECIALISE assembleI :: Platform -> BCInstr -> RunAsm () #-} + +assembleI :: forall m . MonadAssembler m + => Platform -> BCInstr - -> Assembler () + -> m () assembleI platform i = case i of - STKCHECK n -> emit bci_STKCHECK [Op n] - PUSH_L o1 -> emit bci_PUSH_L [wOp o1] - PUSH_LL o1 o2 -> emit bci_PUSH_LL [wOp o1, wOp o2] - PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] - PUSH8 o1 -> emit bci_PUSH8 [bOp o1] - PUSH16 o1 -> emit bci_PUSH16 [bOp o1] - PUSH32 o1 -> emit bci_PUSH32 [bOp o1] - PUSH8_W o1 -> emit bci_PUSH8_W [bOp o1] - PUSH16_W o1 -> emit bci_PUSH16_W [bOp o1] - PUSH32_W o1 -> emit bci_PUSH32_W [bOp o1] + STKCHECK n -> emit_ bci_STKCHECK [Op n] + PUSH_L o1 -> emit_ bci_PUSH_L [wOp o1] + PUSH_LL o1 o2 -> emit_ bci_PUSH_LL [wOp o1, wOp o2] + PUSH_LLL o1 o2 o3 -> emit_ bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] + PUSH8 o1 -> emit_ bci_PUSH8 [bOp o1] + PUSH16 o1 -> emit_ bci_PUSH16 [bOp o1] + PUSH32 o1 -> emit_ bci_PUSH32 [bOp o1] + PUSH8_W o1 -> emit_ bci_PUSH8_W [bOp o1] + PUSH16_W o1 -> emit_ bci_PUSH16_W [bOp o1] + PUSH32_W o1 -> emit_ bci_PUSH32_W [bOp o1] PUSH_G nm -> do p <- ptr (BCOPtrName nm) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_BCO proto -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_ALTS proto pk -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit (push_alts pk) [Op p] + emit_ (push_alts pk) [Op p] PUSH_ALTS_TUPLE proto call_info tuple_proto -> do let ul_bco = assembleBCO platform proto ul_tuple_bco = assembleBCO platform @@ -409,127 +630,131 @@ assembleI platform i = case i of p_tup <- ioptr (liftM BCOPtrBCO ul_tuple_bco) info <- word (fromIntegral $ mkNativeCallInfoSig platform call_info) - emit bci_PUSH_ALTS_T + emit_ bci_PUSH_ALTS_T [Op p, Op info, Op p_tup] - PUSH_PAD8 -> emit bci_PUSH_PAD8 [] - PUSH_PAD16 -> emit bci_PUSH_PAD16 [] - PUSH_PAD32 -> emit bci_PUSH_PAD32 [] + PUSH_PAD8 -> emit_ bci_PUSH_PAD8 [] + PUSH_PAD16 -> emit_ bci_PUSH_PAD16 [] + PUSH_PAD32 -> emit_ bci_PUSH_PAD32 [] PUSH_UBX8 lit -> do np <- literal lit - emit bci_PUSH_UBX8 [Op np] + emit_ bci_PUSH_UBX8 [Op np] PUSH_UBX16 lit -> do np <- literal lit - emit bci_PUSH_UBX16 [Op np] + emit_ bci_PUSH_UBX16 [Op np] PUSH_UBX32 lit -> do np <- literal lit - emit bci_PUSH_UBX32 [Op np] + emit_ bci_PUSH_UBX32 [Op np] PUSH_UBX lit nws -> do np <- literal lit - emit bci_PUSH_UBX [Op np, wOp nws] - + emit_ bci_PUSH_UBX [Op np, wOp nws] -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode - PUSH_ADDR nm -> do np <- lit [BCONPtrAddr nm] - emit bci_PUSH_UBX [Op np, SmallOp 1] - - PUSH_APPLY_N -> emit bci_PUSH_APPLY_N [] - PUSH_APPLY_V -> emit bci_PUSH_APPLY_V [] - PUSH_APPLY_F -> emit bci_PUSH_APPLY_F [] - PUSH_APPLY_D -> emit bci_PUSH_APPLY_D [] - PUSH_APPLY_L -> emit bci_PUSH_APPLY_L [] - PUSH_APPLY_P -> emit bci_PUSH_APPLY_P [] - PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP [] - PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP [] - PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP [] - PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP [] - PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP [] - - SLIDE n by -> emit bci_SLIDE [wOp n, wOp by] - ALLOC_AP n -> emit bci_ALLOC_AP [truncHalfWord platform n] - ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [truncHalfWord platform n] - ALLOC_PAP arity n -> emit bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] - MKAP off sz -> emit bci_MKAP [wOp off, truncHalfWord platform sz] - MKPAP off sz -> emit bci_MKPAP [wOp off, truncHalfWord platform sz] - UNPACK n -> emit bci_UNPACK [wOp n] - PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)] - emit bci_PACK [Op itbl_no, wOp sz] + PUSH_ADDR nm -> do np <- lit1 (BCONPtrAddr nm) + emit_ bci_PUSH_UBX [Op np, SmallOp 1] + + PUSH_APPLY_N -> emit_ bci_PUSH_APPLY_N [] + PUSH_APPLY_V -> emit_ bci_PUSH_APPLY_V [] + PUSH_APPLY_F -> emit_ bci_PUSH_APPLY_F [] + PUSH_APPLY_D -> emit_ bci_PUSH_APPLY_D [] + PUSH_APPLY_L -> emit_ bci_PUSH_APPLY_L [] + PUSH_APPLY_P -> emit_ bci_PUSH_APPLY_P [] + PUSH_APPLY_PP -> emit_ bci_PUSH_APPLY_PP [] + PUSH_APPLY_PPP -> emit_ bci_PUSH_APPLY_PPP [] + PUSH_APPLY_PPPP -> emit_ bci_PUSH_APPLY_PPPP [] + PUSH_APPLY_PPPPP -> emit_ bci_PUSH_APPLY_PPPPP [] + PUSH_APPLY_PPPPPP -> emit_ bci_PUSH_APPLY_PPPPPP [] + + SLIDE n by -> emit_ bci_SLIDE [wOp n, wOp by] + ALLOC_AP n -> emit_ bci_ALLOC_AP [truncHalfWord platform n] + ALLOC_AP_NOUPD n -> emit_ bci_ALLOC_AP_NOUPD [truncHalfWord platform n] + ALLOC_PAP arity n -> emit_ bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] + MKAP off sz -> emit_ bci_MKAP [wOp off, truncHalfWord platform sz] + MKPAP off sz -> emit_ bci_MKPAP [wOp off, truncHalfWord platform sz] + UNPACK n -> emit_ bci_UNPACK [wOp n] + PACK dcon sz -> do itbl_no <- lit1 (BCONPtrItbl (getName dcon)) + emit_ bci_PACK [Op itbl_no, wOp sz] LABEL lbl -> label lbl TESTLT_I i l -> do np <- int i - emit bci_TESTLT_I [Op np, LabelOp l] + emit_ bci_TESTLT_I [Op np, LabelOp l] TESTEQ_I i l -> do np <- int i - emit bci_TESTEQ_I [Op np, LabelOp l] + emit_ bci_TESTEQ_I [Op np, LabelOp l] TESTLT_W w l -> do np <- word w - emit bci_TESTLT_W [Op np, LabelOp l] + emit_ bci_TESTLT_W [Op np, LabelOp l] TESTEQ_W w l -> do np <- word w - emit bci_TESTEQ_W [Op np, LabelOp l] + emit_ bci_TESTEQ_W [Op np, LabelOp l] TESTLT_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTLT_I64 [Op np, LabelOp l] + emit_ bci_TESTLT_I64 [Op np, LabelOp l] TESTEQ_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTEQ_I64 [Op np, LabelOp l] + emit_ bci_TESTEQ_I64 [Op np, LabelOp l] TESTLT_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I32 [Op np, LabelOp l] + emit_ bci_TESTLT_I32 [Op np, LabelOp l] TESTEQ_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I32 [Op np, LabelOp l] + emit_ bci_TESTEQ_I32 [Op np, LabelOp l] TESTLT_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I16 [Op np, LabelOp l] + emit_ bci_TESTLT_I16 [Op np, LabelOp l] TESTEQ_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I16 [Op np, LabelOp l] + emit_ bci_TESTEQ_I16 [Op np, LabelOp l] TESTLT_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I8 [Op np, LabelOp l] + emit_ bci_TESTLT_I8 [Op np, LabelOp l] TESTEQ_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I8 [Op np, LabelOp l] + emit_ bci_TESTEQ_I8 [Op np, LabelOp l] TESTLT_W64 w l -> do np <- word64 w - emit bci_TESTLT_W64 [Op np, LabelOp l] + emit_ bci_TESTLT_W64 [Op np, LabelOp l] TESTEQ_W64 w l -> do np <- word64 w - emit bci_TESTEQ_W64 [Op np, LabelOp l] + emit_ bci_TESTEQ_W64 [Op np, LabelOp l] TESTLT_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W32 [Op np, LabelOp l] + emit_ bci_TESTLT_W32 [Op np, LabelOp l] TESTEQ_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W32 [Op np, LabelOp l] + emit_ bci_TESTEQ_W32 [Op np, LabelOp l] TESTLT_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W16 [Op np, LabelOp l] + emit_ bci_TESTLT_W16 [Op np, LabelOp l] TESTEQ_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W16 [Op np, LabelOp l] + emit_ bci_TESTEQ_W16 [Op np, LabelOp l] TESTLT_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W8 [Op np, LabelOp l] + emit_ bci_TESTLT_W8 [Op np, LabelOp l] TESTEQ_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W8 [Op np, LabelOp l] + emit_ bci_TESTEQ_W8 [Op np, LabelOp l] TESTLT_F f l -> do np <- float f - emit bci_TESTLT_F [Op np, LabelOp l] + emit_ bci_TESTLT_F [Op np, LabelOp l] TESTEQ_F f l -> do np <- float f - emit bci_TESTEQ_F [Op np, LabelOp l] + emit_ bci_TESTEQ_F [Op np, LabelOp l] TESTLT_D d l -> do np <- double d - emit bci_TESTLT_D [Op np, LabelOp l] + emit_ bci_TESTLT_D [Op np, LabelOp l] TESTEQ_D d l -> do np <- double d - emit bci_TESTEQ_D [Op np, LabelOp l] - TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l] - TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l] - CASEFAIL -> emit bci_CASEFAIL [] - SWIZZLE stkoff n -> emit bci_SWIZZLE [wOp stkoff, IOp n] - JMP l -> emit bci_JMP [LabelOp l] - ENTER -> emit bci_ENTER [] - RETURN rep -> emit (return_non_tuple rep) [] - RETURN_TUPLE -> emit bci_RETURN_T [] + emit_ bci_TESTEQ_D [Op np, LabelOp l] + TESTLT_P i l -> emit_ bci_TESTLT_P [SmallOp i, LabelOp l] + TESTEQ_P i l -> emit_ bci_TESTEQ_P [SmallOp i, LabelOp l] + CASEFAIL -> emit_ bci_CASEFAIL [] + SWIZZLE stkoff n -> emit_ bci_SWIZZLE [wOp stkoff, IOp n] + JMP l -> emit_ bci_JMP [LabelOp l] + ENTER -> emit_ bci_ENTER [] + RETURN rep -> emit_ (return_non_tuple rep) [] + RETURN_TUPLE -> emit_ bci_RETURN_T [] CCALL off m_addr i -> do np <- addr m_addr - emit bci_CCALL [wOp off, Op np, SmallOp i] - PRIMCALL -> emit bci_PRIMCALL [] + emit_ bci_CCALL [wOp off, Op np, SmallOp i] + PRIMCALL -> emit_ bci_PRIMCALL [] BRK_FUN arr tick_mod tickx info_mod infox cc -> do p1 <- ptr (BCOPtrBreakArray arr) tick_addr <- addr tick_mod info_addr <- addr info_mod np <- addr cc - emit bci_BRK_FUN [ Op p1 + emit_ bci_BRK_FUN [ Op p1 , Op tick_addr, Op info_addr , SmallOp tickx, SmallOp infox , Op np ] #if MIN_VERSION_rts(1,0,3) - BCO_NAME name -> do np <- lit [BCONPtrStr name] - emit bci_BCO_NAME [Op np] + BCO_NAME name -> do np <- lit1 (BCONPtrStr name) + emit_ bci_BCO_NAME [Op np] #endif + + where + emit_ = emit word_size + + literal :: Literal -> m Word literal (LitLabel fs _) = litlabel fs literal LitNullAddr = word 0 literal (LitFloat r) = float (fromRational r) literal (LitDouble r) = double (fromRational r) literal (LitChar c) = int (ord c) - literal (LitString bs) = lit [BCONPtrStr bs] + literal (LitString bs) = lit1 (BCONPtrStr bs) -- LitString requires a zero-terminator when emitted literal (LitNumber nt i) = case nt of LitNumInt -> word (fromIntegral i) @@ -549,10 +774,11 @@ assembleI platform i = case i of -- analysis messed up. literal (LitRubbish {}) = word 0 - litlabel fs = lit [BCONPtrLbl fs] - addr (RemotePtr a) = words [fromIntegral a] - words ws = lit (map BCONPtrWord ws) - word w = words [w] + litlabel fs = lit1 (BCONPtrLbl fs) + addr (RemotePtr a) = word (fromIntegral a) + words ws = lit (fmap BCONPtrWord ws) + word w = words (OnlyOne w) + word2 w1 w2 = words (OnlyTwo w1 w2) word_size = platformWordSize platform word_size_bits = platformWordSizeInBits platform @@ -563,36 +789,36 @@ assembleI platform i = case i of -- Note that we only support host endianness == target endianness for now, -- even with the external interpreter. This would need to be fixed to -- support host endianness /= target endianness - int :: Int -> Assembler Word + int :: Int -> m Word int i = word (fromIntegral i) - float :: Float -> Assembler Word + float :: Float -> m Word float f = word32 (castFloatToWord32 f) - double :: Double -> Assembler Word + double :: Double -> m Word double d = word64 (castDoubleToWord64 d) - word64 :: Word64 -> Assembler Word + word64 :: Word64 -> m Word word64 ww = case word_size of PW4 -> let !wl = fromIntegral ww !wh = fromIntegral (ww `unsafeShiftR` 32) in case platformByteOrder platform of - LittleEndian -> words [wl,wh] - BigEndian -> words [wh,wl] + LittleEndian -> word2 wl wh + BigEndian -> word2 wh wl PW8 -> word (fromIntegral ww) - word8 :: Word8 -> Assembler Word + word8 :: Word8 -> m Word word8 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 8)) - word16 :: Word16 -> Assembler Word + word16 :: Word16 -> m Word word16 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 16)) - word32 :: Word32 -> Assembler Word + word32 :: Word32 -> m Word word32 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> case word_size of ===================================== compiler/GHC/ByteCode/Instr.hs ===================================== @@ -36,6 +36,7 @@ import GHC.Stack.CCS (CostCentre) import GHC.Stg.Syntax import GHCi.BreakArray (BreakArray) import Language.Haskell.Syntax.Module.Name (ModuleName) +import GHC.Types.Unique -- ---------------------------------------------------------------------------- -- Bytecode instructions @@ -58,6 +59,10 @@ data ProtoBCO a newtype LocalLabel = LocalLabel { getLocalLabel :: Word32 } deriving (Eq, Ord) +-- Just so we can easily juse UniqFM. +instance Uniquable LocalLabel where + getUnique (LocalLabel w) = mkUniqueGrimily $ fromIntegral w + instance Outputable LocalLabel where ppr (LocalLabel lbl) = text "lbl:" <> ppr lbl ===================================== compiler/GHC/ByteCode/Types.hs ===================================== @@ -21,7 +21,7 @@ module GHC.ByteCode.Types , CgBreakInfo(..) , ModBreaks (..), BreakIndex, emptyModBreaks , CCostCentre - , FlatBag, sizeFlatBag, fromSizedSeq, elemsFlatBag + , FlatBag, sizeFlatBag, fromSmallArray, elemsFlatBag ) where import GHC.Prelude ===================================== compiler/GHC/Data/FlatBag.hs ===================================== @@ -8,13 +8,11 @@ module GHC.Data.FlatBag , mappendFlatBag -- * Construction , fromList - , fromSizedSeq + , fromSmallArray ) where import GHC.Prelude -import GHC.Data.SizedSeq (SizedSeq, ssElts, sizeSS) - import Control.DeepSeq import GHC.Data.SmallArray @@ -125,5 +123,10 @@ fromList n elts = -- | Convert a 'SizedSeq' into its flattened representation. -- A 'FlatBag a' is more memory efficient than '[a]', if no further modification -- is necessary. -fromSizedSeq :: SizedSeq a -> FlatBag a -fromSizedSeq s = fromList (sizeSS s) (ssElts s) +fromSmallArray :: SmallArray a -> FlatBag a +fromSmallArray s = case sizeofSmallArray s of + 0 -> EmptyFlatBag + 1 -> UnitFlatBag (indexSmallArray s 0) + 2 -> TupleFlatBag (indexSmallArray s 0) (indexSmallArray s 1) + _ -> FlatBag s + ===================================== compiler/GHC/Data/SmallArray.hs ===================================== @@ -16,11 +16,18 @@ module GHC.Data.SmallArray , mapSmallArray , foldMapSmallArray , rnfSmallArray + + -- * IO Operations + , SmallMutableArrayIO + , newSmallArrayIO + , writeSmallArrayIO + , unsafeFreezeSmallArrayIO ) where import GHC.Exts import GHC.Prelude +import GHC.IO import GHC.ST import Control.DeepSeq @@ -28,6 +35,8 @@ data SmallArray a = SmallArray (SmallArray# a) data SmallMutableArray s a = SmallMutableArray (SmallMutableArray# s a) +type SmallMutableArrayIO a = SmallMutableArray RealWorld a + newSmallArray :: Int -- ^ size -> a -- ^ initial contents @@ -37,6 +46,9 @@ newSmallArray newSmallArray (I# sz) x s = case newSmallArray# sz x s of (# s', a #) -> (# s', SmallMutableArray a #) +newSmallArrayIO :: Int -> a -> IO (SmallMutableArrayIO a) +newSmallArrayIO sz x = IO $ \s -> newSmallArray sz x s + writeSmallArray :: SmallMutableArray s a -- ^ array -> Int -- ^ index @@ -46,6 +58,12 @@ writeSmallArray {-# INLINE writeSmallArray #-} writeSmallArray (SmallMutableArray a) (I# i) x = writeSmallArray# a i x +writeSmallArrayIO :: SmallMutableArrayIO a + -> Int + -> a + -> IO () +writeSmallArrayIO a ix v = IO $ \s -> (# writeSmallArray a ix v s, () #) + -- | Copy and freeze a slice of a mutable array. freezeSmallArray @@ -69,6 +87,9 @@ unsafeFreezeSmallArray (SmallMutableArray ma) s = case unsafeFreezeSmallArray# ma s of (# s', a #) -> (# s', SmallArray a #) +unsafeFreezeSmallArrayIO :: SmallMutableArrayIO a -> IO (SmallArray a) +unsafeFreezeSmallArrayIO arr = IO $ \s -> unsafeFreezeSmallArray arr s + -- | Get the size of a 'SmallArray' sizeofSmallArray :: SmallArray a ===================================== testsuite/tests/perf/should_run/ByteCodeAsm.hs ===================================== @@ -0,0 +1,66 @@ +module Main where + +import GHC.Driver.Session +import GHC +import qualified GHC.LanguageExtensions as LangExt + +import Control.Monad (forM_) +import Control.Monad.IO.Class (liftIO) +import System.Environment (getArgs) + +import GHC.ByteCode.Asm ( assembleBCO ) +import GHC.ByteCode.Instr +import Control.Monad +import GHC.Builtin.Names + +-- Testing the performance of the bytecode assembler + +-- A nonsensical byte-code program +instrs = [ STKCHECK 1234 + , PUSH_L 1 + , PUSH_LL 1 2 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH8 0 + , PUSH16 15 + , PUSH32 29 + , PUSH_PAD8 + , PUSH_APPLY_N + , PUSH_APPLY_V + , PUSH_APPLY_F + , PUSH_APPLY_D + , PUSH_APPLY_L + , PUSH_APPLY_P + , PUSH_APPLY_PP + , PUSH_APPLY_PPP + , PUSH_APPLY_PPPP + , PUSH_APPLY_PPPPP + , PUSH_APPLY_PPPPPP + , TESTLT_I 100 (LocalLabel 0) + , TESTEQ_I 100 (LocalLabel 0) + ] + ++ [ LABEL (LocalLabel n) | n <- [0..50] ] + ++ [ TESTEQ_I64 n (LocalLabel 49) | n <- [1243 .. 1253 + 50 ]] + ++ [ ENTER ] + ++ [ SLIDE x n | x <- [0..5], n <- [0..10] ] + ++ [ PUSH_G appAName | _ <- [0..100] ] + ++ [ PUSH_BCO fake_proto2 ] + +fake_proto = ProtoBCO appAName instrs [] 0 0 (Left []) [] + +instrs2 = [ STKCHECK 77, UNPACK 4, SLIDE 0 4, ENTER ] + +fake_proto2 = ProtoBCO appAName instrs2 [] 0 0 (Left []) [] + +main :: IO () +main = do + [libdir] <- getArgs + runGhc (Just libdir) $ do + dflags <- getSessionDynFlags + let platform = targetPlatform dflags + + -- ~1s on my machine + liftIO $ replicateM_ 100000 (assembleBCO platform fake_proto) ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -415,3 +415,11 @@ test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], com test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) test('T17949', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) + +test('ByteCodeAsm', + [ extra_run_opts('"' + config.libdir + '"') + , js_broken(22261) + , collect_stats('bytes allocated', 10), + ], + compile_and_run, + ['-package ghc']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2ec5a1a6079a96472af98d56d3bffaef85eabebf -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2ec5a1a6079a96472af98d56d3bffaef85eabebf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 13:58:02 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Wed, 05 Feb 2025 08:58:02 -0500 Subject: [Git][ghc/ghc][wip/ghc-9.10.2-submodules] 15 commits: gitlab-ci: Bump aarch64-darwin boostrap compiler to 9.6.4 Message-ID: <67a36e6a7c12e_23a6f0106df501141b4@gitlab.mail> Ben Gamari pushed to branch wip/ghc-9.10.2-submodules at Glasgow Haskell Compiler / GHC Commits: 45bb3061 by Ben Gamari at 2025-02-05T08:57:39-05:00 gitlab-ci: Bump aarch64-darwin boostrap compiler to 9.6.4 Bringing it into alignment with the other platforms. - - - - - 36459520 by Ben Gamari at 2025-02-05T08:57:39-05:00 Cabal: Bump to 3.12.1.0 - - - - - d782813f by Ben Gamari at 2025-02-05T08:57:39-05:00 bytestring: Bump to 0.12.2.0 - - - - - e38cbd2e by Ben Gamari at 2025-02-05T08:57:40-05:00 binary: Bump to 0.8.9.3 - - - - - 256ab0f4 by Ben Gamari at 2025-02-05T08:57:40-05:00 array: Bump to 0.5.8.0 - - - - - 05754423 by Ben Gamari at 2025-02-05T08:57:40-05:00 filepath: Bump to 1.5.4.0 - - - - - e5e298ae by Ben Gamari at 2025-02-05T08:57:40-05:00 hpc: Bump to 0.7.0.2 - - - - - 8c95c105 by Ben Gamari at 2025-02-05T08:57:40-05:00 parsec: Bump to 3.1.18.0 - - - - - 169ce9e9 by Ben Gamari at 2025-02-05T08:57:40-05:00 terminfo: Bump to 0.4.1.7 - - - - - c2afa4a5 by Ben Gamari at 2025-02-05T08:57:40-05:00 text: Bump to 2.1.2 - - - - - 9ee0f939 by Ben Gamari at 2025-02-05T08:57:40-05:00 unix: Bump to 2.8.6.0 - - - - - 532f7d59 by Ben Gamari at 2025-02-05T08:57:40-05:00 exceptions: Bump to 0.10.9 - - - - - 5d6fc594 by Ben Gamari at 2025-02-05T08:57:40-05:00 Win32: Bump to 2.14.1.0 - - - - - a3ca33bd by Ben Gamari at 2025-02-05T08:57:40-05:00 directory: Bump to 1.3.8.5 - - - - - 62673d90 by Ben Gamari at 2025-02-05T08:57:40-05:00 Bump process submodule to v1.6.25.0 (cherry picked from commit 18f532f3ed021fff9529f50da2006b8a8d8b1df7) - - - - - 22 changed files: - .gitlab/darwin/nix/sources.json - .gitlab/darwin/nix/sources.nix - .gitlab/darwin/toolchain.nix - hadrian/src/Settings/Warnings.hs - libraries/Cabal - libraries/Win32 - libraries/array - libraries/binary - libraries/bytestring - libraries/directory - libraries/exceptions - libraries/filepath - libraries/hpc - libraries/parsec - libraries/process - libraries/terminfo - libraries/text - libraries/unix - testsuite/tests/process/process004.hs - testsuite/tests/process/process004.stdout - testsuite/tests/process/process004.stdout-javascript-unknown-ghcjs - testsuite/tests/process/process004.stdout-mingw32 Changes: ===================================== .gitlab/darwin/nix/sources.json ===================================== @@ -5,10 +5,10 @@ "homepage": "https://github.com/nmattia/niv", "owner": "nmattia", "repo": "niv", - "rev": "e0ca65c81a2d7a4d82a189f1e23a48d59ad42070", - "sha256": "1pq9nh1d8nn3xvbdny8fafzw87mj7gsmp6pxkdl65w2g18rmcmzx", + "rev": "e2f66fe558481d6b569358d27db06f7e972ed71b", + "sha256": "1xn822jajags6bigdr1ssxvfiyd7d3adhnmmrr9x3maphchkr0x0", "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/e0ca65c81a2d7a4d82a189f1e23a48d59ad42070.tar.gz", + "url": "https://github.com/nmattia/niv/archive/e2f66fe558481d6b569358d27db06f7e972ed71b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { @@ -17,10 +17,10 @@ "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a", - "sha256": "1v9sy2i2dy3qksx4mf81gwzfl0jzpqccfkzq7fjxgq832f9d255i", + "rev": "9d3ae807ebd2981d593cddd0080856873139aa40", + "sha256": "0bjqgsprq9fgl5yh58dk59xmchi4dajq3sf5i447q02dbiasjsil", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/73de017ef2d18a04ac4bfd0c02650007ccb31c2a.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/9d3ae807ebd2981d593cddd0080856873139aa40.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } ===================================== .gitlab/darwin/nix/sources.nix ===================================== @@ -10,29 +10,50 @@ let let name' = sanitizeName name + "-src"; in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; fetch_tarball = pkgs: name: spec: let name' = sanitizeName name + "-src"; in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; fetch_git = name: spec: let ref = - if spec ? ref then spec.ref else + spec.ref or ( if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!" + ); + submodules = spec.submodules or false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + { } + else { }; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); fetch_local = spec: spec.path; @@ -66,16 +87,16 @@ let hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; hasThisAsNixpkgsPath = == ./.; in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import { } + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; # The actual fetching function. fetch = pkgs: name: spec: @@ -95,13 +116,13 @@ let # the path directly as opposed to the fetched source. replace = name: drv: let - saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + if ersatz == "" then drv else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; # Ports of functions for older nix versions @@ -112,7 +133,7 @@ let ); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); @@ -123,43 +144,46 @@ let concatStrings = builtins.concatStringsSep ""; # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; + optionalAttrs = cond: as: if cond then as else { }; # fetchTarball version that is compatible between all the versions of Nix builtins_fetchTarball = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchTarball; in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchTarball attrs; # fetchurl version that is compatible between all the versions of Nix builtins_fetchurl = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchurl; in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchurl attrs; # Create the final "sources" from the config mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) config.sources; + mapAttrs + ( + name: spec: + if builtins.hasAttr "outPath" spec + then + abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); } + ) + config.sources; # The "config" used by the fetchers mkConfig = { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) + , sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) , system ? builtins.currentSystem , pkgs ? mkPkgs sources system }: rec { @@ -171,4 +195,4 @@ let }; in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } +mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } ===================================== .gitlab/darwin/toolchain.nix ===================================== @@ -16,7 +16,7 @@ let ghcBindists = let version = ghc.version; in { aarch64-darwin = hostPkgs.fetchurl { url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-aarch64-apple-darwin.tar.xz"; - sha256 = "sha256-c1GTMJf3/yiW/t4QL532EswD5JVlgA4getkfsxj4TaA="; + sha256 = "sha256-Ja/8nOtvIDJwbsG0t7pdFL003ztSI9gGDyEK7OJf7qk="; }; x86_64-darwin = hostPkgs.fetchurl { url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz"; @@ -26,8 +26,7 @@ let }; ghc = pkgs.stdenv.mkDerivation rec { - # Using 9.6.2 because of #24050 - version = "9.6.2"; + version = "9.6.4"; name = "ghc"; src = ghcBindists.${pkgs.stdenv.hostPlatform.system}; configureFlags = [ ===================================== hadrian/src/Settings/Warnings.hs ===================================== @@ -56,7 +56,7 @@ ghcWarningsArgs = do , package primitive ? pure [ "-Wno-unused-imports" , "-Wno-deprecations" ] , package rts ? pure [ "-Wcpp-undef" ] - , package text ? pure [ "-Wno-deprecations" ] + , package text ? pure [ "-Wno-deprecations", "-Wno-unused-imports" ] , package terminfo ? pure [ "-Wno-unused-imports" ] , package transformers ? pure [ "-Wno-unused-matches" , "-Wno-unused-imports" ===================================== libraries/Cabal ===================================== @@ -1 +1 @@ -Subproject commit 59fd01457fa662bca17110bc7505ea52bf162135 +Subproject commit 260ecdc3d848782d4df49e629cb0a5dc9e96ca9e ===================================== libraries/Win32 ===================================== @@ -1 +1 @@ -Subproject commit 350ebd43f9a8d9e1ca767b0000f95bdfb42a5471 +Subproject commit 027cbcf0de25d681823ea92fb545a2604c3a6a8b ===================================== libraries/array ===================================== @@ -1 +1 @@ -Subproject commit a65f8a5e7c26fe9b8012b90cbbff8866f8d39113 +Subproject commit c9cb2c1e8762aa83b6e77af82c87a55e03e990e4 ===================================== libraries/binary ===================================== @@ -1 +1 @@ -Subproject commit a501955f7ab48da81d732958c8834caaa3e470b6 +Subproject commit a625eee2eb9dfb4019c051b59d6007c9dded88aa ===================================== libraries/bytestring ===================================== @@ -1 +1 @@ -Subproject commit 453c1dc110720a366f90ef84dc2d75a5cd8c28e0 +Subproject commit d984ad00644c0157bad04900434b9d36f23633c5 ===================================== libraries/directory ===================================== @@ -1 +1 @@ -Subproject commit 4b7c231d187cf253c5f446c4aed2fea26b81d5f9 +Subproject commit e8ee4d5565ec82272ca612034ba6029993e23fd0 ===================================== libraries/exceptions ===================================== @@ -1 +1 @@ -Subproject commit d9fba07b664e3c48f011baca1a8a204292ca2722 +Subproject commit 0b6abb3ac433c7d1d5c6f6a5a45b37f7c486e33b ===================================== libraries/filepath ===================================== @@ -1 +1 @@ -Subproject commit 87a09e296ea6fc137a0b32edda1bd0f54332642e +Subproject commit 65b0f8f31aac4a306135e27734988327f8eb1e6f ===================================== libraries/hpc ===================================== @@ -1 +1 @@ -Subproject commit 8bf6f8b08b0d72cb9231775b66ca572acc1d3197 +Subproject commit 37c56cf932e429950a199d0b1f39796677b052c5 ===================================== libraries/parsec ===================================== @@ -1 +1 @@ -Subproject commit 9c071b05fbb077afbaf0dd2dfdab21265859ae91 +Subproject commit b87122c1c74b8240e65044a8f600f0427d4dd9c3 ===================================== libraries/process ===================================== @@ -1 +1 @@ -Subproject commit dfbe62c7d9fc84d2550fc7e7db993dc0aa143ef5 +Subproject commit b8c88fb5bbdebbcbb3e7c734f0c7515dd3cef84e ===================================== libraries/terminfo ===================================== @@ -1 +1 @@ -Subproject commit 500399a1497dfe1786ba67d6d2bfced4832f3fed +Subproject commit 788ce671cb1cec54c3c9b3ac1c1ba189e8424819 ===================================== libraries/text ===================================== @@ -1 +1 @@ -Subproject commit cdb9e13b39079904eed9d75cd332b66ee0cad0c0 +Subproject commit ee0a8f8b9a4bd3fdad23e9ac0db56e7f08ce35cd ===================================== libraries/unix ===================================== @@ -1 +1 @@ -Subproject commit 69552a5267c7dc5c46a8bceec5ec4b40d26b9463 +Subproject commit 6be36ed54cc035c0f095d24bf3a451638d45513c ===================================== testsuite/tests/process/process004.hs ===================================== @@ -4,8 +4,13 @@ import System.IO.Error import System.Process main :: IO () -main = do test1 `catchIOError` \e -> putStrLn ("Exc: " ++ show e) - test2 `catchIOError` \e -> putStrLn ("Exc: " ++ show e) +main = do + -- N.B. Only show the error type since the exact error text + -- may depend upon precise system call which @process@ decided + -- to use. + let printError e = putStrLn ("Exc: " ++ show (ioeGetErrorType e)) + test1 `catchIOError` printError + test2 `catchIOError` printError test1 :: IO () test1 = do ===================================== testsuite/tests/process/process004.stdout ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: chdir: does not exist (No such file or directory) -Exc: true: runProcess: chdir: does not exist (No such file or directory) +Exc: does not exist +Exc: does not exist ===================================== testsuite/tests/process/process004.stdout-javascript-unknown-ghcjs ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: does not exist (No such file or directory) -Exc: true: runProcess: does not exist (No such file or directory) +Exc: does not exist +Exc: does not exist ===================================== testsuite/tests/process/process004.stdout-mingw32 ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: invalid argument (Invalid argument) -Exc: true: runProcess: invalid argument (Invalid argument) +Exc: invalid argument +Exc: invalid argument View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/74adf73854268462055a55514c45c6feee6ea72e...62673d90a4518d2b960caef8f3b6a8f552224b46 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/74adf73854268462055a55514c45c6feee6ea72e...62673d90a4518d2b960caef8f3b6a8f552224b46 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 14:45:43 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 05 Feb 2025 09:45:43 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] Inline join points for rhs without free vars Message-ID: <67a37997e67fc_26a0a4c092c635f8@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: c8c8b6b9 by Rodrigo Mesquita at 2025-02-05T14:34:45+00:00 Inline join points for rhs without free vars While investigating #25170, we ran into a program (T16473) that allocated 67% more because of a join point that failed to inline. Note [Duplicating join points] explains why we want to be conservative when inlining join points, using as an example a join point that captures a free variable `f` that becomes available in the continuation `blah` for further optimisations, as opposed to being lambda-abstracted. However, when the RHS of the join point has no free variables and is trivial, the same argument does not apply, and there's nothing to gain from preserving it. On the contrary, not inlining these trivial join points such as $j f x = K f x |> co can be actively harmful as they prevent useful optimisations from firing on the known constructor application. #25723 is such an example. Therefore, we've extended `uncondInlineJoin` to allow duplicating such closed trivial join points. See the updated Note [Duplicating join points] for further details. Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com> Fixes #25723 - - - - - 5 changed files: - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Unfold.hs - testsuite/tests/perf/compiler/all.T - testsuite/tests/simplCore/should_compile/T24229a.stderr - testsuite/tests/simplCore/should_compile/T24229b.stderr Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -4172,17 +4172,40 @@ application (K f x). So we might inline it to get K g y -> blah[g,y] But now we have to make `blah` into a join point, /abstracted/ -over `g` and `y`. In contrast, if we /don't/ inline $j we -don't need a join point for `blah` and we'll get - join $j x = let g=f, y=x in blah[g,y] +over `g` and `y`. We get + join $j2 g y = blah in case v of - p1 -> $j x1 - p2 -> $j x2 - p3 -> $j x3 + p1 -> $j2 f x1 + p2 -> $j2 f x2 + p3 -> $j2 f x3 +So now we can't see that `g` is always `f` in `blah`. + +In contrast, if we /don't/ inline $j we +don't need a new join point for `blah` and we'll get + join $j' x = let g=f, y=x in blah[g,y] + in case v of + p1 -> $j' x1 + p2 -> $j' x2 + p3 -> $j' x3 This can make a /massive/ difference, because `blah` can see what `f` is, instead of lambda-abstracting over it. +If instead the RHS of the join point is a simple application that has no free +variables, as in + + case (join $j x f = K f x ) + (in case v of ) + ( p1 -> $j x1 f1 ) of + ( p2 -> $j x2 f2 ) + ( p3 -> $j x3 f3 ) + K g y -> blah[g,y] + +then no information can be gained by preserving the join point (c.f. `f` being +free in the join point above and being useful to `blah`). In this case, it's +more beneficial to inline the join point (see (DJ3)(c)) to allow further +optimisations to fire. An example where failing to do this went wrong is #25723. + Beyond this, not-inlining join points reduces duplication. In the above example, if `blah` was small enough we'd inline it, but that duplicates code, for no gain. Best just to keep not-inline the join point in the first place. @@ -4207,12 +4230,16 @@ unconditional-inlining for join points. case-of-case friendly. (DJ3) When should `uncondInlineJoin` return True? - * (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see + (a) (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see the defn of exprIsTrivial. Also nullary constructors. - * The RHS is a call ($j x y z), where the arguments are all trivial and $j + (b) The RHS is a call ($j x y z), where the arguments are all trivial and $j is a join point: there is no point in creating an indirection. + (c) The RHS is a data constructor application (K x y z), where all arguments + are trivial and don't have free variables: keeping this join point has no + benefits and blocks other important optimisations from firing (see #25723) + (DJ4) By the same token we want to use Plan B in Note [Duplicating StrictArg] when the RHS of the new join point is a data constructor application. See the call to isDataConId in the StrictArg case of mkDupableContWithDmds. ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,18 +434,49 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body + + -- (DJ3)(a) | exprIsTrivial body = True -- Nullary constructors, literals + -- (DJ3)(b) | (Var v, args) <- collectArgs body , all exprIsTrivial args , isJoinId v -- Indirection to another join point; always inline = True + -- (DJ3)(c) + | trivialAppWithoutFreeArgs + = True + | otherwise = False + where + -- (DJ3)(c): + -- $j1 x y = K y x |> co -- YES, inline! + -- $j2 x = K f x -- No, don't! (because f is free) + trivialAppWithoutFreeArgs = go body + + go (App f a) + | go_arg a = go f + | otherwise = False + go (Cast e _) = go e + go (Tick _ e) = go e + go (Var v) + | isDataConId v = True -- e.g. $j a b = K a b + | v `elem` bndrs = True -- e.g. $j a b = b a + go _ = False + + go_arg (Type {}) = True + go_arg (Coercion {}) = True + go_arg (App f a) + -- we also want to inline ($j f = K (f @a)) + | isTyCoArg a = go f + go_arg (Var f) = f `elem` bndrs + go_arg _ = False + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -612,6 +612,17 @@ test ('T16473', compile_and_run, ['-O2 -flate-specialise']) +# Run this program. If inlining the join point fails, it'll start to allocate much more. +# The join point is only created when -fno-local-float-out +test ('T16473b', + [ collect_stats('bytes allocated',5) + , only_ways(['normal']) + , js_broken(22261) + ], + compile_and_run, + ['-O2 -fno-local-float-out']) + + test('T17516', [ collect_compiler_runtime(5), ], ===================================== testsuite/tests/simplCore/should_compile/T24229a.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 83, types: 113, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 79, types: 106, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } ===================================== testsuite/tests/simplCore/should_compile/T24229b.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 64, types: 90, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 60, types: 83, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c8c8b6b9aca79f25d604ff6f1db50f6830820b82 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c8c8b6b9aca79f25d604ff6f1db50f6830820b82 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 15:50:02 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Wed, 05 Feb 2025 10:50:02 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] 9.10.2 Changelog - Batch 6 Message-ID: <67a388aaa7306_27e9d45314d441f4@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: 5adb9d87 by Andreas Klebinger at 2025-02-05T14:04:15+01:00 9.10.2 Changelog - Batch 6 - - - - - 1 changed file: - docs/users_guide/9.10.2-notes.rst Changes: ===================================== docs/users_guide/9.10.2-notes.rst ===================================== @@ -15,11 +15,11 @@ Language Compiler ~~~~~~~~ -- Optimized lowering of BigNat# literals. (#23942, !12179) +- Optimized lowering of BigNat# literals. ((:ghc-ticket:`23942`), !12179) -- Fixed a bug where the jump shortcutting optimization could lead to unsoundness in pattern matching. (#24507) +- Fixed a bug where the jump shortcutting optimization could lead to unsoundness in pattern matching. ((:ghc-ticket:`24507`)) -- Look for haskell symbols only in relevant libraries. (#23415) +- Look for haskell symbols only in relevant libraries. ((:ghc-ticket:`23415`)) When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this change we would search for the symbol in @@ -32,7 +32,7 @@ Compiler from ~38 seconds down to ~2s. - Fixed a bug that could cause a linker error when `TypeData` and `StrictData` - where used in combination. (#24620) + where used in combination. ((:ghc-ticket:`24620`)) - The flag :ghc-flag:`-fprof-late` when combined with `-prof` will no longer prevent top level constructors from being statically allocated. @@ -45,24 +45,24 @@ Compiler The tradeoff is that calling `whoCreated` on top level value definitions like `foo` will be less informative. -- IPE profiling - optimize the representation of some internal representations. Leading to smaller executables. (#24504) +- IPE profiling - optimize the representation of some internal representations. Leading to smaller executables. ((:ghc-ticket:`24504`)) -- Fixed an issue where `-Wmissing-home-modules` caused quadratic compile time increases. (#24778) +- Fixed an issue where `-Wmissing-home-modules` caused quadratic compile time increases. ((:ghc-ticket:`24778`)) -- Fixed a crash when using `-prof` with `-forig-thunk-info`. (#24809) +- Fixed a crash when using `-prof` with `-forig-thunk-info`. ((:ghc-ticket:`24809`)) -- Better type inference in certain situations. (#24810) +- Better type inference in certain situations. ((:ghc-ticket:`24810`)) - Fixed a bug where the magic `inline` function sometimes failed to inline functions - if there were coercions involved. (#24808) + if there were coercions involved. ((:ghc-ticket:`24808`)) -- Fixed a bug where the simplifier sometimes destroyed join points during float out. (#24768) +- Fixed a bug where the simplifier sometimes destroyed join points during float out. ((:ghc-ticket:`24768`)) - PPC NCG: Fix sign hints in C calls. This bug caused segfaults when using FFI under some - circumstances. (#23034) + circumstances. ((:ghc-ticket:`23034`)) - Fixed a bug that caused GHC to panic when using the aarch64 ncg and -fregs-graph - on certain programs. (#24941) + on certain programs. ((:ghc-ticket:`24941`)) - The flag :ghc-flag:`-fkeep-auto-rules` that forces GHC to keep auto generated specialization rules was added. It was actually added ghc-9.10.1 already but @@ -74,27 +74,33 @@ Compiler - Various code generation improvements to the ARM backend. -- Fixed a bug that could case segfaults in GHCi when `-fworker-wrapper-cbv` was enabled. (#24870) +- Fixed a bug that could case segfaults in GHCi when `-fworker-wrapper-cbv` was enabled. ((:ghc-ticket:`24870`)) -- Fixed -freg-graphs for AARch64 NCG - -- Fixed a correctness issues for Int64/Word64 on 32bit backends (#24893) +- Fixed a correctness issues for Int64/Word64 on 32bit backends ((:ghc-ticket:`24893`)) - Various rts linker improvements: - R_X86_64_PC64 relocation support on windows - - Use m32 allocator for sections when NEED_PLT - works around (#24432) + - Use m32 allocator for sections when NEED_PLT - works around ((:ghc-ticket:`24432`)) - AArch64 - Skip NONE relocations -- Fixed a panic in the ghci debugger (#25109) +- AArch64 ncg: Multiway branches are now lowered to jump tables for better performance. ((:ghc-ticket:`19912`)) + +- Fixes related to better use of sse4 when using the llvm backend: + - Use +sse4.2 rather than +sse42, fixing ((:ghc-ticket:`25019`)), + - make SSE4.2 imply +popcnt, fixing ((:ghc-ticket:`25353`)). + +- Fixed a bug where the use of ``throw`` caused a loss of strictness ((:ghc-ticket:`25066`)). + +- Fixed incorrect behaviour that could occur when using ``control0#/prompt#`` ((:ghc-ticket:`25439`)) by making `prompt#` lazy. JavaScript backend ~~~~~~~~~~~~~~~~~~ -- Changes for better support of the Google Closure Compiler (#24602, !12330) +- Changes for better support of the Google Closure Compiler ((:ghc-ticket:`24602`), !12330) - JS Backend: support rubbish static literals -- Fix h$withCStringOnHeap helper (#25288) +- Fix h$withCStringOnHeap helper ((:ghc-ticket:`25288`)) WebAssembly backend ~~~~~~~~~~~~~~~~~~~ @@ -107,15 +113,20 @@ WebAssembly backend GHCi ~~~~ -- When using XDG directories ``.ghci_history`` now uses the ``$XDG_DATA_HOME`` variable as expected. (#24266) +- When using XDG directories ``.ghci_history`` now uses the ``$XDG_DATA_HOME`` variable as expected. ((:ghc-ticket:`24266`)) - Replaced some uses of lists with Arrays for better performance during bytecode compilation. -- GHCi: support cross-module inlining of breakpoints. Fixing #24712 +- GHCi: support cross-module inlining of breakpoints. Fixing (:ghc-ticket:`24712`) - Fix a bug where GHCi would not start alongside a local file called ``Prelude.hs`` or ``Prelude.lhs`` (:ghc-ticket:`10920`). +- Fixed a panic in the ghci debugger when using breakpoints around field selectors. ((:ghc-ticket:`25109`)) + +- Fixed a bug (:ghc-ticket:`25150`) where ghc would not consider ``-working-dir`` when + looking for foreign files. + Runtime system ~~~~~~~~~~~~~~ @@ -128,13 +139,19 @@ Runtime system - Emit warning when -M < -H. -- Fix a bug (#24672) causing programms on FreeBSD to occasionally terminate with the error: +- Fix a bug ((:ghc-ticket:`24672`)) causing programms on FreeBSD to occasionally terminate with the error: ``internal error: Ticker: read(timerfd) failed with Operation not supported and returned -1`` +- Fixed a bug ((:ghc-ticket:`25503`)) that sometimes caused the rts to terminate with ``internal error: alloc_adjustor_chunk: failed to allocate`` on windows. + This primarily affect programs making use of the ``foreign import "wrapper"`` functionality. + +- Fixed a bug in compacting gc that could result in program termination with ``update_fwd_large: unknown/strange object 38`` ((:ghc-ticket:`24791`)). + + Build system and packaging ~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Escape argument strings when storing them in the settings file. Fixes #24265 +- Escape argument strings when storing them in the settings file. Fixes (:ghc-ticket:`24265`) - Updated autoconf scripts to commit 948ae97ca5703224bd3eada06b7a69f40dd15a02 (dated 2024-01-01). (From https://git.savannah.gnu.org/cgit/config.git/) @@ -142,9 +159,9 @@ Build system and packaging - GHC now distinguishes more between the Cmm and C preprocessor. The new flags `-pgmCmmP` and `-optCmmP` can be used to control the Cmm preprocessor. C preprocessor flags will still be passed to the Cmm - preprocessor, expect for -g flags which have special handling. Fixes #24474 + preprocessor, expect for -g flags which have special handling. Fixes (:ghc-ticket:`24474`) -- Bindists: Fixed a bug in the Makefile which caused windows installs to duplicate files. (#24800) +- Bindists: Fixed a bug in the Makefile which caused windows installs to duplicate files. ((:ghc-ticket:`24800`)) - The packages ghc-internal and ghc-experimental are now versioned based on the GHC version they are shipped with. @@ -171,6 +188,9 @@ Build system and packaging ``ghc-experimental`` library ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* Primops and other ghc extensions are now exported via ``GHC.PrimOps`` +* The library is now versioned according to the ghc version it shipped with. + ``template-haskell`` library ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5adb9d87cb4290fe4242077be9d75a9325df15d1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5adb9d87cb4290fe4242077be9d75a9325df15d1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 16:08:03 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Wed, 05 Feb 2025 11:08:03 -0500 Subject: [Git][ghc/ghc][wip/T18462] More refactoring Message-ID: <67a38ce353bb8_27e9d48f79ec6530@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: abaf5b50 by Sjoerd Visscher at 2025-02-05T17:07:40+01:00 More refactoring - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Build.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Id/Make.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Type.hs - testsuite/tests/ghc-api/exactprint/Test20239.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/abaf5b50f1e074fc3e86025ca1ab116019a3efd9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/abaf5b50f1e074fc3e86025ca1ab116019a3efd9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 16:12:11 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Wed, 05 Feb 2025 11:12:11 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] Fix windows exports yet again Message-ID: <67a38ddb2bad_27e9d49708b070fb@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: e41456fc by Andreas Klebinger at 2025-02-05T16:49:41+01:00 Fix windows exports yet again - - - - - 1 changed file: - testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 Changes: ===================================== testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 ===================================== @@ -7197,7 +7197,7 @@ module Prelude.Experimental where data List a = ... pattern Solo :: forall a. a -> Solo a type Solo :: * -> * - data Solo a = ... + data Solo a = MkSolo a type Solo# :: forall (k :: GHC.Types.RuntimeRep). TYPE k -> TYPE (GHC.Types.TupleRep '[k]) data Solo# a = ... type Sum10# :: forall (k0 :: GHC.Types.RuntimeRep) (k1 :: GHC.Types.RuntimeRep) (k2 :: GHC.Types.RuntimeRep) (k3 :: GHC.Types.RuntimeRep) (k4 :: GHC.Types.RuntimeRep) (k5 :: GHC.Types.RuntimeRep) (k6 :: GHC.Types.RuntimeRep) (k7 :: GHC.Types.RuntimeRep) (k8 :: GHC.Types.RuntimeRep) (k9 :: GHC.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE (GHC.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9]) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e41456fca25b1407193536c4243dd19a82b40ab7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e41456fca25b1407193536c4243dd19a82b40ab7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 16:23:32 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 05 Feb 2025 11:23:32 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] Inline join points for rhs without free vars Message-ID: <67a3908488dbd_27e9d4cd3b7474df@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: 7abf2fe3 by Rodrigo Mesquita at 2025-02-05T16:23:21+00:00 Inline join points for rhs without free vars While investigating #25170, we ran into a program (T16473) that allocated 67% more because of a join point that failed to inline. Note [Duplicating join points] explains why we want to be conservative when inlining join points, using as an example a join point that captures a free variable `f` that becomes available in the continuation `blah` for further optimisations, as opposed to being lambda-abstracted. However, when the RHS of the join point has no free variables and is trivial, the same argument does not apply, and there's nothing to gain from preserving it. On the contrary, not inlining these trivial join points such as $j f x = K f x |> co can be actively harmful as they prevent useful optimisations from firing on the known constructor application. #25723 is such an example. Therefore, we've extended `uncondInlineJoin` to allow duplicating such closed trivial join points. See the updated Note [Duplicating join points] for further details. Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com> Fixes #25723 - - - - - 5 changed files: - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Unfold.hs - testsuite/tests/perf/compiler/all.T - testsuite/tests/simplCore/should_compile/T24229a.stderr - testsuite/tests/simplCore/should_compile/T24229b.stderr Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -4172,17 +4172,40 @@ application (K f x). So we might inline it to get K g y -> blah[g,y] But now we have to make `blah` into a join point, /abstracted/ -over `g` and `y`. In contrast, if we /don't/ inline $j we -don't need a join point for `blah` and we'll get - join $j x = let g=f, y=x in blah[g,y] +over `g` and `y`. We get + join $j2 g y = blah in case v of - p1 -> $j x1 - p2 -> $j x2 - p3 -> $j x3 + p1 -> $j2 f x1 + p2 -> $j2 f x2 + p3 -> $j2 f x3 +So now we can't see that `g` is always `f` in `blah`. + +In contrast, if we /don't/ inline $j we +don't need a new join point for `blah` and we'll get + join $j' x = let g=f, y=x in blah[g,y] + in case v of + p1 -> $j' x1 + p2 -> $j' x2 + p3 -> $j' x3 This can make a /massive/ difference, because `blah` can see what `f` is, instead of lambda-abstracting over it. +If instead the RHS of the join point is a simple application that has no free +variables, as in + + case (join $j x f = K f x ) + (in case v of ) + ( p1 -> $j x1 f1 ) of + ( p2 -> $j x2 f2 ) + ( p3 -> $j x3 f3 ) + K g y -> blah[g,y] + +then no information can be gained by preserving the join point (c.f. `f` being +free in the join point above and being useful to `blah`). In this case, it's +more beneficial to inline the join point (see (DJ3)(c)) to allow further +optimisations to fire. An example where failing to do this went wrong is #25723. + Beyond this, not-inlining join points reduces duplication. In the above example, if `blah` was small enough we'd inline it, but that duplicates code, for no gain. Best just to keep not-inline the join point in the first place. @@ -4207,12 +4230,16 @@ unconditional-inlining for join points. case-of-case friendly. (DJ3) When should `uncondInlineJoin` return True? - * (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see + (a) (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see the defn of exprIsTrivial. Also nullary constructors. - * The RHS is a call ($j x y z), where the arguments are all trivial and $j + (b) The RHS is a call ($j x y z), where the arguments are all trivial and $j is a join point: there is no point in creating an indirection. + (c) The RHS is a data constructor application (K x y z), where all arguments + are trivial and don't have free variables: keeping this join point has no + benefits and blocks other important optimisations from firing (see #25723) + (DJ4) By the same token we want to use Plan B in Note [Duplicating StrictArg] when the RHS of the new join point is a data constructor application. See the call to isDataConId in the StrictArg case of mkDupableContWithDmds. ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,18 +434,49 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body + + -- (DJ3)(a) | exprIsTrivial body = True -- Nullary constructors, literals + -- (DJ3)(b) | (Var v, args) <- collectArgs body , all exprIsTrivial args , isJoinId v -- Indirection to another join point; always inline = True + -- (DJ3)(c) + | trivialAppWithoutFreeArgs + = True + | otherwise = False + where + -- (DJ3)(c): + -- - $j1 x y = K y x |> co -- YES, inline! + -- - $j2 x = K f x -- No, don't! (because f is free) + trivialAppWithoutFreeArgs = go body + + go (App f a) + | go_arg a = go f + | otherwise = False + go (Cast e _) = go e + go (Tick _ e) = go e + go (Var v) + | isDataConId v = True -- e.g. $j a b = K a b + | v `elem` bndrs = True -- e.g. $j a b = b a + go _ = False + + go_arg (Type {}) = True + go_arg (Coercion {}) = True + go_arg (App f a) + -- we also want to inline ($j f = K (f @a)) + | isTyCoArg a = go f + go_arg (Var f) = f `elem` bndrs + go_arg _ = False + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -612,6 +612,17 @@ test ('T16473', compile_and_run, ['-O2 -flate-specialise']) +# Run this program. If inlining the join point fails, it'll start to allocate much more. +# The join point is only created when -fno-local-float-out +test ('T16473b', + [ collect_stats('bytes allocated',5) + , only_ways(['normal']) + , js_broken(22261) + ], + compile_and_run, + ['-O2 -fno-local-float-out']) + + test('T17516', [ collect_compiler_runtime(5), ], ===================================== testsuite/tests/simplCore/should_compile/T24229a.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 83, types: 113, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 79, types: 106, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } ===================================== testsuite/tests/simplCore/should_compile/T24229b.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 64, types: 90, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 60, types: 83, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7abf2fe337f1f3e11710450b4f5a70f1b0acbb56 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7abf2fe337f1f3e11710450b4f5a70f1b0acbb56 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 18:25:51 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 05 Feb 2025 13:25:51 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] Inline join points for rhs without free vars Message-ID: <67a3ad2f32487_27e9d421c5fc81593d@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: 23af5dd4 by Rodrigo Mesquita at 2025-02-05T18:25:36+00:00 Inline join points for rhs without free vars While investigating #25170, we ran into a program (T16473) that allocated 67% more because of a join point that failed to inline. Note [Duplicating join points] explains why we want to be conservative when inlining join points, using as an example a join point that captures a free variable `f` that becomes available in the continuation `blah` for further optimisations, as opposed to being lambda-abstracted. However, when the RHS of the join point has no free variables and is trivial, the same argument does not apply, and there's nothing to gain from preserving it. On the contrary, not inlining these trivial join points such as $j f x = K f x |> co can be actively harmful as they prevent useful optimisations from firing on the known constructor application. #25723 is such an example. Therefore, we've extended `uncondInlineJoin` to allow duplicating such closed trivial join points. See the updated Note [Duplicating join points] for further details. Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com> Fixes #25723 - - - - - 7 changed files: - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Unfold.hs - + testsuite/tests/perf/compiler/T16473b.hs - + testsuite/tests/perf/compiler/T16473b.stdout - testsuite/tests/perf/compiler/all.T - testsuite/tests/simplCore/should_compile/T24229a.stderr - testsuite/tests/simplCore/should_compile/T24229b.stderr Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -4172,17 +4172,40 @@ application (K f x). So we might inline it to get K g y -> blah[g,y] But now we have to make `blah` into a join point, /abstracted/ -over `g` and `y`. In contrast, if we /don't/ inline $j we -don't need a join point for `blah` and we'll get - join $j x = let g=f, y=x in blah[g,y] +over `g` and `y`. We get + join $j2 g y = blah in case v of - p1 -> $j x1 - p2 -> $j x2 - p3 -> $j x3 + p1 -> $j2 f x1 + p2 -> $j2 f x2 + p3 -> $j2 f x3 +So now we can't see that `g` is always `f` in `blah`. + +In contrast, if we /don't/ inline $j we +don't need a new join point for `blah` and we'll get + join $j' x = let g=f, y=x in blah[g,y] + in case v of + p1 -> $j' x1 + p2 -> $j' x2 + p3 -> $j' x3 This can make a /massive/ difference, because `blah` can see what `f` is, instead of lambda-abstracting over it. +If instead the RHS of the join point is a simple application that has no free +variables, as in + + case (join $j x f = K f x ) + (in case v of ) + ( p1 -> $j x1 f1 ) of + ( p2 -> $j x2 f2 ) + ( p3 -> $j x3 f3 ) + K g y -> blah[g,y] + +then no information can be gained by preserving the join point (c.f. `f` being +free in the join point above and being useful to `blah`). In this case, it's +more beneficial to inline the join point (see (DJ3)(c)) to allow further +optimisations to fire. An example where failing to do this went wrong is #25723. + Beyond this, not-inlining join points reduces duplication. In the above example, if `blah` was small enough we'd inline it, but that duplicates code, for no gain. Best just to keep not-inline the join point in the first place. @@ -4207,12 +4230,16 @@ unconditional-inlining for join points. case-of-case friendly. (DJ3) When should `uncondInlineJoin` return True? - * (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see + (a) (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see the defn of exprIsTrivial. Also nullary constructors. - * The RHS is a call ($j x y z), where the arguments are all trivial and $j + (b) The RHS is a call ($j x y z), where the arguments are all trivial and $j is a join point: there is no point in creating an indirection. + (c) The RHS is a data constructor application (K x y z), where all arguments + are trivial and don't have free variables: keeping this join point has no + benefits and blocks other important optimisations from firing (see #25723) + (DJ4) By the same token we want to use Plan B in Note [Duplicating StrictArg] when the RHS of the new join point is a data constructor application. See the call to isDataConId in the StrictArg case of mkDupableContWithDmds. ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,18 +434,49 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body + + -- (DJ3)(a) | exprIsTrivial body = True -- Nullary constructors, literals + -- (DJ3)(b) | (Var v, args) <- collectArgs body , all exprIsTrivial args , isJoinId v -- Indirection to another join point; always inline = True + -- (DJ3)(c) + | trivialAppWithoutFreeArgs + = True + | otherwise = False + where + -- (DJ3)(c): + -- - $j1 x y = K y x |> co -- YES, inline! + -- - $j2 x = K f x -- No, don't! (because f is free) + trivialAppWithoutFreeArgs = go body + + go (App f a) + | go_arg a = go f + | otherwise = False + go (Cast e _) = go e + go (Tick _ e) = go e + go (Var v) + | isDataConId v = True -- e.g. $j a b = K a b + | v `elem` bndrs = True -- e.g. $j a b = b a + go _ = False + + go_arg (Type {}) = True + go_arg (Coercion {}) = True + go_arg (App f a) + -- we also want to inline ($j f = K (f @a)) + | isTyCoArg a = go f + go_arg (Var f) = f `elem` bndrs + go_arg _ = False + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this ===================================== testsuite/tests/perf/compiler/T16473b.hs ===================================== @@ -0,0 +1,102 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeOperators #-} + +{-# OPTIONS_GHC -flate-specialise -O2 #-} + +module Main (main) where + +import qualified Control.Monad.State.Strict as S +import Data.Foldable +import Data.Functor.Identity +import Data.Kind +import Data.Monoid +import Data.Tuple + +main :: IO () +main = print $ badCore 100 + +badCore :: Int -> Int +badCore n = getSum $ fst $ run $ runState mempty $ for_ [0..n] $ \i -> modify (<> Sum i) + +data Union (r :: [Type -> Type]) a where + Union :: e a -> Union '[e] a + +decomp :: Union (e ': r) a -> e a +decomp (Union a) = a +{-# INLINE decomp #-} + +absurdU :: Union '[] a -> b +absurdU = absurdU + +newtype Semantic r a = Semantic + { runSemantic + :: forall m + . Monad m + => (forall x. Union r x -> m x) + -> m a + } + +instance Functor (Semantic f) where + fmap f (Semantic m) = Semantic $ \k -> fmap f $ m k + {-# INLINE fmap #-} + +instance Applicative (Semantic f) where + pure a = Semantic (\x -> const (pure a) x) + {-# INLINE pure #-} + Semantic f <*> Semantic a = Semantic $ \k -> f k <*> a k + {-# INLINE (<*>) #-} + +instance Monad (Semantic f) where + return = pure + {-# INLINE return #-} + Semantic ma >>= f = Semantic $ \k -> do + z <- ma k + runSemantic (f z) k + {-# INLINE (>>=) #-} + +data State s a + = Get (s -> a) + | Put s a + deriving Functor + +get :: Semantic '[State s] s +get = Semantic $ \k -> k $ Union $ Get id +{-# INLINE get #-} + +put :: s -> Semantic '[State s] () +put !s = Semantic $ \k -> k $ Union $! Put s () +{-# INLINE put #-} + +modify :: (s -> s) -> Semantic '[State s] () +modify f = do + !s <- get + put $! f s +{-# INLINE modify #-} + +runState :: s -> Semantic (State s ': r) a -> Semantic r (s, a) +runState = interpretInStateT $ \case + Get k -> fmap k S.get + Put s k -> S.put s >> pure k +{-# INLINE[3] runState #-} + +run :: Semantic '[] a -> a +run (Semantic m) = runIdentity $ m absurdU +{-# INLINE run #-} + +interpretInStateT + :: (forall x. e x -> S.StateT s (Semantic r) x) + -> s + -> Semantic (e ': r) a + -> Semantic r (s, a) +interpretInStateT f s (Semantic m) = Semantic $ \k -> + fmap swap $ flip S.runStateT s $ m $ \u -> + S.mapStateT (\z -> runSemantic z k) $ f $ decomp u +{-# INLINE interpretInStateT #-} + ===================================== testsuite/tests/perf/compiler/T16473b.stdout ===================================== @@ -0,0 +1 @@ +5050 ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -612,6 +612,17 @@ test ('T16473', compile_and_run, ['-O2 -flate-specialise']) +# Run this program. If inlining the join point fails, it'll start to allocate much more. +# The join point is only created when -fno-local-float-out +test ('T16473b', + [ collect_stats('bytes allocated',5) + , only_ways(['normal']) + , js_broken(22261) + ], + compile_and_run, + ['-O2 -fno-local-float-out']) + + test('T17516', [ collect_compiler_runtime(5), ], ===================================== testsuite/tests/simplCore/should_compile/T24229a.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 83, types: 113, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 79, types: 106, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } ===================================== testsuite/tests/simplCore/should_compile/T24229b.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 64, types: 90, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 60, types: 83, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/23af5dd4311d420c11e995e5647906ab002c78f4 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/23af5dd4311d420c11e995e5647906ab002c78f4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 20:46:57 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 05 Feb 2025 15:46:57 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: CorePrep: Name `sat` binders more descriptively Message-ID: <67a3ce416d0ff_2fbdf427e2dc4156b@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - 4f6eb892 by Matthew Pickering at 2025-02-05T15:46:39-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - b666e6c8 by Matthew Pickering at 2025-02-05T15:46:39-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 14 changed files: - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/StgToByteCode.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -53,7 +52,6 @@ import Data.Array.Base ( UArray(..) ) import Foreign hiding (shiftL, shiftR) import Data.Char ( ord ) -import Data.List ( genericLength ) import Data.Map.Strict (Map) import Data.Maybe (fromMaybe) import qualified Data.Map.Strict as Map @@ -168,15 +166,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm @@ -343,6 +332,7 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } + inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) inspectAsm platform long_jumps initial_offset = go (InspectState initial_offset 0 0 Map.empty) @@ -350,7 +340,7 @@ inspectAsm platform long_jumps initial_offset go s (NullAsm _) = (instrCount s, lblEnv s) go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + genericLength ls }) (k n) + go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) where n = litCount s go s (AllocLabel lbl k) = go s' k where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -210,9 +211,9 @@ linkFail who what nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastString label +nameToCLabel n suffix = mkFastStringByteString label where - encodeZ = zString . zEncodeFS + encodeZ = fastZStringToByteString . zEncodeFS (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. @@ -222,11 +223,14 @@ nameToCLabel n suffix = mkFastString label modulePart = encodeZ (moduleNameFS modName) occPart = encodeZ $ occNameMangledFS (nameOccName n) - label = concat - [ if pkgKey == mainUnit then "" else packagePart ++ "_" - , modulePart - , '_':occPart - , '_':suffix + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix ] ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -59,7 +59,8 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Id.Make ( realWorldPrimId ) import GHC.Types.Basic -import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName ) +import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName, OccName ) +import GHC.Types.Name.Occurrence (occNameString) import GHC.Types.SrcLoc ( SrcSpan(..), realSrcLocSpan, mkRealSrcLoc ) import GHC.Types.Literal import GHC.Types.Tickish @@ -70,6 +71,7 @@ import qualified Data.ByteString.Builder as BB import Data.ByteString.Builder.Prim import Control.Monad +import Data.List (intercalate) {- Note [CorePrep Overview] @@ -247,11 +249,11 @@ corePrepPgm logger cp_cfg pgm_cfg withTiming logger (text "CorePrep"<+>brackets (ppr this_mod)) (\a -> a `seqList` ()) $ do - us <- mkSplitUniqSupply 's' let initialCorePrepEnv = mkInitialCorePrepEnv cp_cfg - let - implicit_binds = mkDataConWorkers + us <- mkSplitUniqSupply 's' + + let implicit_binds = mkDataConWorkers (cpPgm_generateDebugInfo pgm_cfg) mod_loc data_tycons -- NB: we must feed mkImplicitBinds through corePrep too @@ -711,13 +713,13 @@ cpePair :: TopLevelFlag -> RecFlag -> Demand -> Levity -> UniqSM (Floats, CpeRhs) -- Used for all bindings -- The binder is already cloned, hence an OutId -cpePair top_lvl is_rec dmd lev env bndr rhs +cpePair top_lvl is_rec dmd lev env0 bndr rhs = assert (not (isJoinId bndr)) $ -- those should use cpeJoinPair do { (floats1, rhs1) <- cpeRhsE env rhs -- See if we are allowed to float this stuff out of the RHS ; let dec = want_float_from_rhs floats1 rhs1 - ; (floats2, rhs2) <- executeFloatDecision dec floats1 rhs1 + ; (floats2, rhs2) <- executeFloatDecision env dec floats1 rhs1 -- Make the arity match up ; (floats3, rhs3) @@ -725,7 +727,7 @@ cpePair top_lvl is_rec dmd lev env bndr rhs then return (floats2, cpeEtaExpand arity rhs2) else warnPprTrace True "CorePrep: silly extra arguments:" (ppr bndr) $ -- Note [Silly extra arguments] - (do { v <- newVar (idType bndr) + (do { v <- newVar env (idType bndr) ; let (float, v') = mkNonRecFloat env Lifted v rhs2 ; return ( snocFloat floats2 float , cpeEtaExpand arity (Var v')) }) @@ -735,6 +737,8 @@ cpePair top_lvl is_rec dmd lev env bndr rhs ; return (floats4, rhs4) } where + env = pushBinderContext bndr env0 + arity = idArity bndr -- We must match this arity want_float_from_rhs floats rhs @@ -967,36 +971,36 @@ cpeBodyNF env expr cpeBody :: CorePrepEnv -> CoreExpr -> UniqSM (Floats, CpeBody) cpeBody env expr = do { (floats1, rhs) <- cpeRhsE env expr - ; (floats2, body) <- rhsToBody rhs + ; (floats2, body) <- rhsToBody env rhs ; return (floats1 `appFloats` floats2, body) } -------- -rhsToBody :: CpeRhs -> UniqSM (Floats, CpeBody) +rhsToBody :: CorePrepEnv -> CpeRhs -> UniqSM (Floats, CpeBody) -- Remove top level lambdas by let-binding -rhsToBody (Tick t expr) +rhsToBody env (Tick t expr) | tickishScoped t == NoScope -- only float out of non-scoped annotations - = do { (floats, expr') <- rhsToBody expr + = do { (floats, expr') <- rhsToBody env expr ; return (floats, mkTick t expr') } -rhsToBody (Cast e co) +rhsToBody env (Cast e co) -- You can get things like -- case e of { p -> coerce t (\s -> ...) } - = do { (floats, e') <- rhsToBody e + = do { (floats, e') <- rhsToBody env e ; return (floats, Cast e' co) } -rhsToBody expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] +rhsToBody env expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] | all isTyVar bndrs -- Type lambdas are ok = return (emptyFloats, expr) | otherwise -- Some value lambdas = do { let rhs = cpeEtaExpand (exprArity expr) expr - ; fn <- newVar (exprType rhs) + ; fn <- newVar env (exprType rhs) ; let float = Float (NonRec fn rhs) LetBound TopLvlFloatable ; return (unitFloat float, Var fn) } where (bndrs,_) = collectBinders expr -rhsToBody expr = return (emptyFloats, expr) +rhsToBody _env expr = return (emptyFloats, expr) {- Note [No eta reduction needed in rhsToBody] @@ -1168,7 +1172,7 @@ cpeApp top_env expr -- allocating CaseBound Floats for token and thing as needed = do { (floats1, token) <- cpeArg env topDmd token ; (floats2, thing) <- cpeBody env thing - ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar ty + ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar env ty ; let tup = mkCoreUnboxedTuple [token, Var case_bndr] ; let float = mkCaseFloat case_bndr thing ; return (floats1 `appFloats` floats2 `snocFloat` float, tup) } @@ -1577,7 +1581,7 @@ cpeArg env dmd arg ; let arg_ty = exprType arg1 lev = typeLevity arg_ty dec = wantFloatLocal NonRecursive dmd lev floats1 arg1 - ; (floats2, arg2) <- executeFloatDecision dec floats1 arg1 + ; (floats2, arg2) <- executeFloatDecision env dec floats1 arg1 -- Else case: arg1 might have lambdas, and we can't -- put them inside a wrapBinds @@ -1586,7 +1590,7 @@ cpeArg env dmd arg -- see Note [ANF-ising literal string arguments] ; if exprIsTrivial arg2 then return (floats2, arg2) - else do { v <- (`setIdDemandInfo` dmd) <$> newVar arg_ty + else do { v <- (`setIdDemandInfo` dmd) <$> newVar env arg_ty -- See Note [Pin demand info on floats] ; let arity = cpeArgArity env dec floats1 arg2 arg3 = cpeEtaExpand arity arg2 @@ -2424,13 +2428,13 @@ instance Outputable FloatDecision where ppr FloatNone = text "none" ppr FloatAll = text "all" -executeFloatDecision :: FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) -executeFloatDecision dec floats rhs +executeFloatDecision :: CorePrepEnv -> FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) +executeFloatDecision env dec floats rhs = case dec of FloatAll -> return (floats, rhs) FloatNone | isEmptyFloats floats -> return (emptyFloats, rhs) - | otherwise -> do { (floats', body) <- rhsToBody rhs + | otherwise -> do { (floats', body) <- rhsToBody env rhs ; return (emptyFloats, wrapBinds floats $ wrapBinds floats' body) } -- FloatNone case: `rhs` might have lambdas, and we can't @@ -2569,6 +2573,8 @@ data CorePrepEnv , cpe_subst :: Subst -- ^ See Note [CorePrepEnv: cpe_subst] , cpe_rec_ids :: UnVarSet -- Faster OutIdSet; See Note [Speculative evaluation] + + , cpe_context :: [OccName] -- ^ See Note [Binder context] } mkInitialCorePrepEnv :: CorePrepConfig -> CorePrepEnv @@ -2576,6 +2582,7 @@ mkInitialCorePrepEnv cfg = CPE { cpe_config = cfg , cpe_subst = emptySubst , cpe_rec_ids = emptyUnVarSet + , cpe_context = [] } extendCorePrepEnv :: CorePrepEnv -> Id -> Id -> CorePrepEnv @@ -2616,6 +2623,14 @@ cpSubstCo :: CorePrepEnv -> Coercion -> Coercion cpSubstCo (CPE { cpe_subst = subst }) co = substCo subst co -- substCo has a short-cut if the TCvSubst is empty +-- | See Note [Binder context] +pushBinderContext :: Id -> CorePrepEnv -> CorePrepEnv +pushBinderContext ident env + | lengthAtLeast (cpe_context env) 2 + = env + | otherwise + = env { cpe_context = getOccName ident : cpe_context env} + ------------------------------------------------------------------------------ -- Cloning binders -- --------------------------------------------------------------------------- @@ -2704,10 +2719,20 @@ fiddleCCall id -- Generating new binders -- --------------------------------------------------------------------------- -newVar :: Type -> UniqSM Id -newVar ty - = seqType ty `seq` mkSysLocalOrCoVarM (fsLit "sat") ManyTy ty - +newVar :: CorePrepEnv -> Type -> UniqSM Id +newVar env ty + -- See Note [Binder context] + = seqType ty `seq` mkSysLocalOrCoVarM (fsLit occ) ManyTy ty + where occ = intercalate "_" (map occNameString $ cpe_context env) ++ "_sat" + +{- Note [Binder context] + ~~~~~~~~~~~~~~~~~~~~~ + To ensure that the compiled program (specifically symbol names) + remains understandable to the user we maintain a context + of binders that we are currently under. This allows us to give + identifiers conjured during CorePrep more contextually-meaningful + names. This is done in `newVar`. + -} ------------------------------------------------------------------------------ -- Floating ticks ===================================== compiler/GHC/Prelude/Basic.hs ===================================== @@ -25,6 +25,8 @@ module GHC.Prelude.Basic , shiftL, shiftR , setBit, clearBit , head, tail + + , strictGenericLength ) where @@ -130,3 +132,15 @@ head = Prelude.head tail :: HasCallStack => [a] -> [a] tail = Prelude.tail {-# INLINE tail #-} + +{- | +The 'genericLength' function defined in base can't be specialised due to the +NOINLINE pragma. + +It is also not strict in the accumulator, and strictGenericLength is not exported. + +See #25706 for why it is important to use a strict, specialised version. + +-} +strictGenericLength :: Num a => [x] -> a +strictGenericLength = fromIntegral . length ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry -import Data.List ( genericReplicate, genericLength, intersperse +import Data.List ( genericReplicate, intersperse , partition, scanl', sortBy, zip4, zip6 ) import Foreign hiding (shiftL, shiftR) import Control.Monad @@ -394,7 +394,7 @@ schemeR_wrk fvs nm original_body (args, body) -- make the arg bitmap bits = argBits platform (reverse (map (idArgRep platform) all_args)) - bitmap_size = genericLength bits + bitmap_size = strictGenericLength bits bitmap = mkBitmap platform bits body_code <- schemeER_wrk sum_szsb_args p_init body @@ -608,7 +608,7 @@ schemeE d s p (StgLet _ext binds body) = do platform <- targetPlatform <$> getDynFlags let (xs,rhss) = case binds of StgNonRec x rhs -> ([x],[rhs]) StgRec xs_n_rhss -> unzip xs_n_rhss - n_binds = genericLength xs + n_binds = strictGenericLength xs fvss = map (fvsToEnv p') rhss @@ -617,7 +617,7 @@ schemeE d s p (StgLet _ext binds body) = do sizes = map (\rhs_fvs -> sum (map size_w rhs_fvs)) fvss -- the arity of each rhs - arities = map (genericLength . fst . collect) rhss + arities = map (strictGenericLength . fst . collect) rhss -- This p', d' defn is safe because all the items being pushed -- are ptrs, so all have size 1 word. d' and p' reflect the stack @@ -1858,7 +1858,7 @@ implement_tagToId implement_tagToId d s p arg names = assert (notNull names) $ do (push_arg, arg_bytes) <- pushAtom d p (StgVarArg arg) - labels <- getLabelsBc (genericLength names) + labels <- getLabelsBc (strictGenericLength names) label_fail <- getLabelBc label_exit <- getLabelBc dflags <- getDynFlags ===================================== libraries/ghc-boot/GHC/Data/SizedSeq.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving, DeriveGeneric, CPP #-} module GHC.Data.SizedSeq ( SizedSeq(..) , emptySS @@ -11,9 +11,12 @@ module GHC.Data.SizedSeq import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary -import Data.List (genericLength) import GHC.Generics +#if ! MIN_VERSION_base(4,20,0) +import Data.List (foldl') +#endif + data SizedSeq a = SizedSeq {-# UNPACK #-} !Word [a] deriving (Generic, Show) @@ -37,9 +40,9 @@ emptySS = SizedSeq 0 [] addToSS :: SizedSeq a -> a -> SizedSeq a addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) +-- NB, important this is eta-expand so that foldl' is inlined. addListToSS :: SizedSeq a -> [a] -> SizedSeq a -addListToSS (SizedSeq n r_xs) xs - = SizedSeq (n + genericLength xs) (reverse xs ++ r_xs) +addListToSS s xs = foldl' addToSS s xs ssElts :: SizedSeq a -> [a] ssElts (SizedSeq _ r_xs) = reverse r_xs ===================================== testsuite/tests/core-to-stg/T14895.stderr ===================================== @@ -11,10 +11,10 @@ T14895.go GHC.Internal.Data.Either.Left e [Occ=Once1] -> wild; GHC.Internal.Data.Either.Right a1 [Occ=Once1] -> let { - sat [Occ=Once1] :: b + go_sat [Occ=Once1] :: b [LclId] = {a1, f} \u [] f a1; - } in GHC.Internal.Data.Either.Right [sat]; + } in GHC.Internal.Data.Either.Right [go_sat]; }; ===================================== testsuite/tests/core-to-stg/T24124.stderr ===================================== @@ -9,16 +9,16 @@ T24124.testFun1 T24124.StrictPair a b #) [GblId, Arity=3, Str=, Cpr=1, Unf=OtherCon []] = {} \r [x y void] - case x of sat { + case x of testFun1_sat { __DEFAULT -> case case y of y [OS=OneShot] { - __DEFAULT -> T24124.MkStrictPair [sat y]; + __DEFAULT -> T24124.MkStrictPair [testFun1_sat y]; } of - sat + testFun1_sat { - __DEFAULT -> GHC.Internal.Types.MkSolo# [sat]; + __DEFAULT -> GHC.Internal.Types.MkSolo# [testFun1_sat]; }; }; ===================================== testsuite/tests/ghci/should_run/T21052.stdout ===================================== @@ -4,9 +4,9 @@ BCO_toplevel :: GHC.Internal.Types.IO [GHC.Internal.Types.Any] [LclIdX] = {} \u [] let { - sat :: [GHC.Internal.Types.Any] + _sat :: [GHC.Internal.Types.Any] [LclId, Unf=OtherCon []] = :! [GHC.Internal.Tuple.() GHC.Internal.Types.[]]; - } in GHC.Internal.Base.returnIO sat; + } in GHC.Internal.Base.returnIO _sat; ===================================== testsuite/tests/simplCore/should_compile/T20040.stderr ===================================== @@ -16,7 +16,9 @@ ifoldl' = Cons ipv2 ipv3 -> case z of z1 { __DEFAULT -> - case f z1 ipv2 of sat { __DEFAULT -> ifoldl' f sat ipv3; }; + case f z1 ipv2 of ifoldl'_sat { + __DEFAULT -> ifoldl' f ifoldl'_sat ipv3; + }; }; }; end Rec } ===================================== testsuite/tests/simplCore/should_compile/T23083.stderr ===================================== @@ -13,10 +13,10 @@ T23083.g :: ((GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer T23083.g = \ (f [Occ=Once1!] :: (GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> GHC.Internal.Bignum.Integer.Integer) (h [Occ=OnceL1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> let { - sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer + g_sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer [LclId, Unf=OtherCon []] - sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in - f sat + g_sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in + f g_sat -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T23083.$trModule4 :: GHC.Prim.Addr# ===================================== testsuite/tests/simplStg/should_compile/T15226b.stderr ===================================== @@ -8,13 +8,13 @@ T15226b.bar1 T15226b.Str (GHC.Internal.Maybe.Maybe a) #) [GblId, Arity=2, Str=, Cpr=1(, 1), Unf=OtherCon []] = {} \r [x void] - case x of sat { + case x of bar1_sat { __DEFAULT -> let { - sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) + bar1_sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) [LclId, Unf=OtherCon []] = - T15226b.Str! [sat]; - } in GHC.Internal.Types.MkSolo# [sat]; + T15226b.Str! [bar1_sat]; + } in GHC.Internal.Types.MkSolo# [bar1_sat]; }; T15226b.bar ===================================== testsuite/tests/simplStg/should_compile/T19717.stderr ===================================== @@ -6,14 +6,14 @@ Foo.f :: forall {a}. a -> [GHC.Internal.Maybe.Maybe a] case x of x1 { __DEFAULT -> let { - sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a + f_sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a [LclId, Unf=OtherCon []] = GHC.Internal.Maybe.Just! [x1]; } in let { - sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] + f_sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] [LclId, Unf=OtherCon []] = - :! [sat GHC.Internal.Types.[]]; - } in : [sat sat]; + :! [f_sat GHC.Internal.Types.[]]; + } in : [f_sat f_sat]; }; ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7db1988edb0a4de3b951ed76bdf255c6a97de91f...b666e6c8fcaf6cb2ed1f65ce7feae1bff4324669 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7db1988edb0a4de3b951ed76bdf255c6a97de91f...b666e6c8fcaf6cb2ed1f65ce7feae1bff4324669 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 21:35:46 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Wed, 05 Feb 2025 16:35:46 -0500 Subject: [Git][ghc/ghc][ghc-9.10] 38 commits: 9.10.2 backport batch 5 - patch notes. Message-ID: <67a3d9b2e82f8_2fbdf4d9e6a84659c@gitlab.mail> Andreas Klebinger pushed to branch ghc-9.10 at Glasgow Haskell Compiler / GHC Commits: 1e9f966b by Andreas Klebinger at 2025-02-05T13:16:42+01:00 9.10.2 backport batch 5 - patch notes. - - - - - f959fbbf by Andreas Klebinger at 2025-02-05T13:16:44+01:00 9.10.2: Bump base to version 4.20.1 - - - - - 1fd4f8d4 by Andreas Klebinger at 2025-02-05T13:16:44+01:00 Allow unknown fd device types for setNonBlockingMode. This allows fds with a unknown device type to have blocking mode set. This happens for example for fds from the inotify subsystem. Fixes #25199. (cherry picked from commit 620becd72ec18ca08c1ed86759d65a0e614fe43c) - - - - - a610550e by Sylvain Henry at 2025-02-05T13:16:44+01:00 Fix interaction between fork and kqueue (#24672) A kqueue file descriptor isn't inherited by a child created with fork. As such we mustn't try to close this file descriptor as we would close a random one, e.g. the one used by timerfd. Fix #24672 (cherry picked from commit e7a26d7a6faf1ea534e036c5085a0a027dbb6f5f) - - - - - 877ce54e by Sylvain Henry at 2025-02-05T13:16:44+01:00 JS: fix h$withCStringOnHeap helper (#25288) strlen returns the length of the string without the \0 terminating byte, hence CString weren't properly allocated on the heap (ending \0 byte was missing). - - - - - 2694559a by Ben Gamari at 2025-02-05T13:16:44+01:00 base: Propagate `error` CallStack to thrown exception Previously `errorCallWithCallStackException` failed to propagate its `CallStack` argument, which represents the call-chain of the preceding `error` call, to the exception that it returned. Consequently, the call-stack of `error` calls were quite useless. Unfortunately, this is the second time that I have fixed this but it seems the first must have been lost in rebasing. Fixes a bug in the implementation of CLC proposal 164 <https://github.com/haskell/core-libraries-committee/issues/164> Fixes #24807. (cherry picked from commit 5f7c20bc6b9deacabb1fb099781f00371cdb4369) - - - - - 295066e0 by Matthew Pickering at 2025-02-05T13:16:44+01:00 driver: Fix -working-dir for foreign files -working-dir definitely needs more serious testing, there are some easy ways to test this. * Modify Cabal to call ghc using -working-dir rather than changing directory. * Modify the testsuite to run ghc using `-working-dir` rather than running GHC with cwd = temporary directory. However this will have to wait until after 9.12. Fixes #25150 (cherry picked from commit c20d51867c824e32c61bd1e002680bef268e4f51) - - - - - 66bc119e by Matthew Pickering at 2025-02-05T13:16:44+01:00 ci: Fix variable inheritence for ghcup-metadata testing job Downstream in ghcup-ci we use the CONFIGURE_ARGS variable to determine how to setup all the different jobs. On the downstream trigger this was being inherited from the default setting in .gitlab.yml file. Therefore this led to job failures as the necessary CONFIGURE_ARGS were not being passed to the configure script when installing the bindist. See docs: * https://docs.gitlab.com/ee/ci/yaml/#inherit * https://docs.gitlab.com/ee/ci/yaml/#triggerforward 1. inherit:variables:fals - This stops the global variables being inherited into the job and hence forwarded onto the downstream job. 2. trigger:forward:* - yaml_variables: true (default) pass yaml variables to downstream, this is important to pass the upstream pipeline id to downstream. - pipeline_variables: false (default) but don't pass pipeline variables (normal environment variables). Fixes #25294 (cherry picked from commit 7cb7172eff9e18ed1c98f65a98018f76c4fcc9f6) - - - - - 8115f185 by Andreas Klebinger at 2025-02-05T13:16:44+01:00 ghc-experimental: Expose primops and ghc extensions via GHC.PrimOps This will be the new place for functions that would have gone into GHC.Exts in the past but are not stable enough to do so now. Addresses #25242 (cherry picked from commit 39497eeda74fc7f1e7ea89292de395b16f69cee2) - - - - - 3d359ceb by Sven Tennie at 2025-02-05T13:16:44+01:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. (cherry picked from commit eb612fbc8e94d50c9895c02f3d6ee076f61b7773) - - - - - 9b4326cf by Sven Tennie at 2025-02-05T13:16:45+01:00 AArch64: Implement switch/jump tables (#19912) This improves the performance of Cmm switch statements (compared to a chain of if statements.) (cherry picked from commit 1d22611665117131d1c7c3c0287696e8efcc88f2) - - - - - c84829f6 by Andrzej Rybczak at 2025-02-05T13:16:45+01:00 Fix typo in the @since annotation of annotateIO (cherry picked from commit 55609880c3eeda2c13859c10c157d7df05496288) - - - - - 49c55699 by Cristiano Moraes at 2025-02-05T13:16:45+01:00 configure: Find C++ probing when GCC version is the latest but G++ is old #23118 (cherry picked from commit 78ad81ecef846f73fee0f6c1a86cd6f19aa29b21) - - - - - cfc314a3 by sheaf at 2025-02-05T13:16:45+01:00 LLVM: use sse4.2 instead of sse42 LLVM expects the former instead of the latter since version 3.4. Fixes #25019 (cherry picked from commit 694489edf35c35b29fbdf09a8e3fdc404469858f) - - - - - c9285fd3 by sheaf at 2025-02-05T13:16:45+01:00 LLVM: make SSE4.2 imply +popcnt For consistency with the NCG as well as with Clang and GCC, we make the SSE4.2 feature flag imply +popcnt when using the LLVM backend. Fixes #25353 (cherry picked from commit 06ae85071b95376bd1eb354f7cc7901aed45b625) - - - - - 494646ba by Ben Gamari at 2025-02-05T13:16:45+01:00 testsuite: Normalise trailing digits from hole fits output The type variables in the holes fit output from `abstract_refinement_hole_fits` is quite sensitive to compiler configuration. Specifically, a slight change in the inlining behavior of `throw` changes type variable naming in `(>>=)` and a few others. Ideally we would make hole fits output more deterministic but in the meantime we simply normalise this difference away as it not relevant to the test's goal. (cherry picked from commit d029f1700effa626ff622700b198ed49ee8b6c19) - - - - - c193dfb6 by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Add test for #25066 (cherry picked from commit da5d7d0d8bde06a1c29612fd17b6a579fc523036) - - - - - aae9f5eb by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Fix #25066 As noted in #25066, the exception backtrace proposal introduced a rather subtle performance regression due to simplification producing Core which the demand analyser concludes may diverge with a precise exception. The nature of the problem is more completely described in the new Note [Hiding precise exception signature in throw]. The (rather hacky) solution we use here hides the problematic optimisation through judicious use of `noinline`. Ultimately however we will want a more principled solution (e.g. #23847). Fixes #255066 CLC proposal: https://github.com/haskell/core-libraries-committee/issues/290 Metric Decrease: T9872d (cherry picked from commit eb7ddae1a2b3fb1be1cd635849516a6398327b29) - - - - - 69c96a5e by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Improve documentation of Control.Exception.Backtrace (cherry picked from commit 0060ece762d7a936daf28195676b6162c30dc845) - - - - - f7654701 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 9.10.2 - more changelogs - - - - - 095575a4 by Cheng Shao at 2025-02-05T13:16:45+01:00 Revert "compiler: start deprecating cmmToRawCmmHook" This reverts commit 1c064ef1f3e1aa2afc996e962ad53effa99ec5f4. Turns out the GHC-WPC project does use it to observe Cmm in the pipeline, see #25363. (cherry picked from commit 525d451e175c7d6acfa968ce99d8d3fc7a8af0c7) - - - - - c6574dc0 by Cheng Shao at 2025-02-05T13:16:45+01:00 rts: fix pointer overflow undefined behavior in bytecode interpreter This patch fixes an unnoticed undefined behavior in the bytecode interpreter. It can be caught by building `rts/Interpreter.c` with `-fsanitize=pointer-overflow`, the warning message is something like: ``` rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13 rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13 rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13 ``` Whenever we do something like `SpW(-1)`, the negative argument is implicitly converted to an unsigned integer type and causes pointer arithmetic overflow. It happens to be harmless for most targets since overflowing would wrap the result to desired value, but it's still coincidental and undefined behavior. Furthermore, it causes real damage to the wasm backend, given clang-20 will emit invalid wasm code that crashes at run-time for this kind of C code! (see https://github.com/llvm/llvm-project/issues/108770) The fix here is adding some explicit casts to ensure we always use the signed `ptrdiff_t` type as right hand operand of pointer arithmetic. (cherry picked from commit 5bcfefd5bb73c18a9bad63d1813968832b696f9a) - - - - - 6f063d52 by Zubin Duggal at 2025-02-05T13:16:45+01:00 rel-eng: ghcup metadata generation: generated yaml anchors with meaningful names (cherry picked from commit d83f5bd730a8aef37d8a38b3560590d9798f8e45) (cherry picked from commit 280b627869da55a22b4b9a3458e6115b06b5fff4) - - - - - cf621c89 by Zubin Duggal at 2025-02-05T13:16:45+01:00 release: copy zip files into the correct directory Fixes #25446 (cherry picked from commit 346e4cd1903b2cbcc9bb7c39652666c513eb2a59) - - - - - 92d3d9a0 by Zubin Duggal at 2025-02-05T13:16:45+01:00 release: Sign .gz bindists too Fixes #25447 (cherry picked from commit bbdbe2254df1bfc9157cfb409afc93f8157712cd) - - - - - 4381b865 by Sebastian Graf at 2025-02-05T13:16:45+01:00 DmdAnal: Make `prompt#` lazy (#25439) This applies the same treatment to `prompt#` as for `catch#`. See `Note [Strictness for mask/unmask/catch/prompt]`. Fixes #25439. (cherry picked from commit 00d58ae18a7ce8db6b2d57261a08ba8c1c2549b5) - - - - - 25797520 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Compacting GC: Handle black holes in large objects. As #14497 showed black holes can appear inside large objects when we capture a computation and later blackhole it like we do for AP_STACK closures. Fixes #24791 (cherry picked from commit 7f90f319531c312a074d21688b05f664f0d173fc) - - - - - db9e443a by Ben Gamari at 2025-02-05T13:16:45+01:00 rts: Allow ExecPage to allocate anywhere in address space Currently the ExecPage facility has two users: * GHCi, for constructing info tables, and * the adjustor allocation path Despite neither of these have any spatial locality constraints ExecPage was using the linker's `mmapAnonForLinker`, which tries hard to ensure that mappings end up nearby the executable image. This makes adjustor allocation needlessly subject to fragmentation concerns. We now instead return less constrained mappings, improving the robustness of the mechanism. Addresses #25503. (cherry picked from commit a104508d2ea5bbc61c4a756dca42fc043b329709) - - - - - cc5bebf9 by Ben Gamari at 2025-02-05T13:16:45+01:00 base: Fix incorrect mentions of GHC.Internal.Numeric These were incorrectly changed by the automated refactoring of the `ghc-internal` migration. Fixes #25521. (cherry picked from commit c3fc9b861fd00a85a4fcbd9960b8242d9fabe04b) - - - - - a0cc8121 by Arnaud Spiwack at 2025-02-05T13:16:45+01:00 Add test for #25428 (cherry picked from commit e6c957e49260230c4cb297aeec16be3293381fb7) - - - - - 655482c7 by Rodrigo Mesquita at 2025-02-05T13:16:45+01:00 ghc-internal: Derive version from ghc's version Fixes #25005 This also introduces ghc-experimental.cabal.in (cherry picked from commit 05116c83ec0d74bc66fa50181df8f577a09f24a6) - - - - - 59b542fe by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Change versionig of ghc-experimental to follow ghc versions. Just like ghc-internal it will now use the @ProjectVersionForLib@ macro for versioning. This means for ghc=9.10.1, ghc-experimental's version will be 9.1001.0 and so on. This fixes #25289 (cherry picked from commit 2293c0b7d709df7be04f596e72c97fd2435c4134) - - - - - bc0dcc49 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Update ghc-experimental-exports. We moved primops into ghc-experimental in a patch we backported. However some of the definitions moved don't exist on the 9.10 branch so we have to update the exports. - - - - - 91a2d560 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 Bump hackage state. This avoids some bound issues when using ghc-9.10.1 as boot compiler. - - - - - b1491a90 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 CI fixes for 9.10 backports: export tests and perf window. * Accept windows export changes. (No simd on 9.10) * Accept some slightly metric decreases. ------------------------- Metric Decrease: T15703 T9872d ------------------------- - - - - - edd3c128 by Andreas Klebinger at 2025-02-05T13:16:45+01:00 9.10 record more changes in changelog - - - - - 5adb9d87 by Andreas Klebinger at 2025-02-05T14:04:15+01:00 9.10.2 Changelog - Batch 6 - - - - - e41456fc by Andreas Klebinger at 2025-02-05T16:49:41+01:00 Fix windows exports yet again - - - - - 30 changed files: - .gitignore - .gitlab-ci.yml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Driver/Hooks.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - docs/users_guide/9.10.2-notes.rst - hadrian/cabal.project - hadrian/cfg/system.config.in - hadrian/src/Oracles/Setting.hs - hadrian/src/Rules/Generate.hs - libraries/base/base.cabal → libraries/base/base.cabal.in - libraries/base/changelog.md - libraries/base/src/Control/Exception/Backtrace.hs - libraries/base/src/Data/Char.hs - libraries/base/src/Data/Semigroup.hs - libraries/base/src/GHC/Exts.hs - libraries/base/src/Prelude.hs - libraries/base/tests/T19288.stderr - + libraries/base/tests/T24807.hs - + libraries/base/tests/T24807.stderr - + libraries/base/tests/T25066.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cc4470be68fa11ce296cef0684a11c4641f85ffe...e41456fca25b1407193536c4243dd19a82b40ab7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cc4470be68fa11ce296cef0684a11c4641f85ffe...e41456fca25b1407193536c4243dd19a82b40ab7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 22:04:19 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Wed, 05 Feb 2025 17:04:19 -0500 Subject: [Git][ghc/ghc][wip/ghc-9.10.2-submodules] darwin: Drop workaround for #20253 Message-ID: <67a3e06370a25_2fbdf414331a8471f2@gitlab.mail> Ben Gamari pushed to branch wip/ghc-9.10.2-submodules at Glasgow Haskell Compiler / GHC Commits: 2e2464df by Ben Gamari at 2025-02-05T17:03:48-05:00 darwin: Drop workaround for #20253 - - - - - 1 changed file: - .gitlab/darwin/toolchain.nix Changes: ===================================== .gitlab/darwin/toolchain.nix ===================================== @@ -56,19 +56,6 @@ let ''; - # N.B. Work around #20253. - nativeBuildInputs = [ pkgs.gnused ]; - postInstallPhase = '' - settings="$out/lib/ghc-${version}/settings" - sed -i -e "s%\"llc\"%\"${llvm}/bin/llc\"%" $settings - sed -i -e "s%\"opt\"%\"${llvm}/bin/opt\"%" $settings - sed -i -e "s%\"clang\"%\"/usr/bin/clang\"%" $settings - sed -i -e 's%("C compiler command", "")%("C compiler command", "/usr/bin/clang")%' $settings - sed -i -e 's%("C compiler flags", "")%("C compiler flags", "--target=${targetTriple}")%' $settings - sed -i -e 's%("C++ compiler flags", "")%("C++ compiler flags", "--target=${targetTriple}")%' $settings - sed -i -e 's%("C compiler link flags", "")%("C compiler link flags", "--target=${targetTriple}")%' $settings - ''; - # Sanity check: verify that we can compile hello world. doInstallCheck = true; installCheckPhase = '' View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e2464dfa14e9a47c7b5bc88fe2506ebcaf5ab2d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e2464dfa14e9a47c7b5bc88fe2506ebcaf5ab2d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 22:39:32 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Wed, 05 Feb 2025 17:39:32 -0500 Subject: [Git][ghc/ghc][wip/ghc-9.10.2-submodules] 16 commits: gitlab-ci: Bump aarch64-darwin boostrap compiler to 9.6.4 Message-ID: <67a3e8a4c3eb6_2fbdf4194100047560@gitlab.mail> Ben Gamari pushed to branch wip/ghc-9.10.2-submodules at Glasgow Haskell Compiler / GHC Commits: b9a58687 by Ben Gamari at 2025-02-05T17:39:12-05:00 gitlab-ci: Bump aarch64-darwin boostrap compiler to 9.6.4 Bringing it into alignment with the other platforms. - - - - - d267356b by Ben Gamari at 2025-02-05T17:39:12-05:00 Cabal: Bump to 3.12.1.0 - - - - - f12e0301 by Ben Gamari at 2025-02-05T17:39:12-05:00 bytestring: Bump to 0.12.2.0 - - - - - df343fbf by Ben Gamari at 2025-02-05T17:39:12-05:00 binary: Bump to 0.8.9.3 - - - - - a9c55dc1 by Ben Gamari at 2025-02-05T17:39:12-05:00 array: Bump to 0.5.8.0 - - - - - 403be2ab by Ben Gamari at 2025-02-05T17:39:12-05:00 filepath: Bump to 1.5.4.0 - - - - - fe9e35f5 by Ben Gamari at 2025-02-05T17:39:12-05:00 hpc: Bump to 0.7.0.2 - - - - - 029c857e by Ben Gamari at 2025-02-05T17:39:12-05:00 parsec: Bump to 3.1.18.0 - - - - - 1dc60f8b by Ben Gamari at 2025-02-05T17:39:13-05:00 terminfo: Bump to 0.4.1.7 - - - - - e52c2b20 by Ben Gamari at 2025-02-05T17:39:13-05:00 text: Bump to 2.1.2 - - - - - 599fe4e1 by Ben Gamari at 2025-02-05T17:39:13-05:00 unix: Bump to 2.8.6.0 - - - - - 4c939f91 by Ben Gamari at 2025-02-05T17:39:13-05:00 exceptions: Bump to 0.10.9 - - - - - 28cb62bb by Ben Gamari at 2025-02-05T17:39:13-05:00 Win32: Bump to 2.14.1.0 - - - - - 84f1ae6d by Ben Gamari at 2025-02-05T17:39:13-05:00 directory: Bump to 1.3.8.5 - - - - - f9fc515c by Ben Gamari at 2025-02-05T17:39:13-05:00 Bump process submodule to v1.6.25.0 (cherry picked from commit 18f532f3ed021fff9529f50da2006b8a8d8b1df7) - - - - - 04b2323b by Ben Gamari at 2025-02-05T17:39:13-05:00 darwin: Drop workaround for #20253 - - - - - 22 changed files: - .gitlab/darwin/nix/sources.json - .gitlab/darwin/nix/sources.nix - .gitlab/darwin/toolchain.nix - hadrian/src/Settings/Warnings.hs - libraries/Cabal - libraries/Win32 - libraries/array - libraries/binary - libraries/bytestring - libraries/directory - libraries/exceptions - libraries/filepath - libraries/hpc - libraries/parsec - libraries/process - libraries/terminfo - libraries/text - libraries/unix - testsuite/tests/process/process004.hs - testsuite/tests/process/process004.stdout - testsuite/tests/process/process004.stdout-javascript-unknown-ghcjs - testsuite/tests/process/process004.stdout-mingw32 Changes: ===================================== .gitlab/darwin/nix/sources.json ===================================== @@ -5,10 +5,10 @@ "homepage": "https://github.com/nmattia/niv", "owner": "nmattia", "repo": "niv", - "rev": "e0ca65c81a2d7a4d82a189f1e23a48d59ad42070", - "sha256": "1pq9nh1d8nn3xvbdny8fafzw87mj7gsmp6pxkdl65w2g18rmcmzx", + "rev": "e2f66fe558481d6b569358d27db06f7e972ed71b", + "sha256": "1xn822jajags6bigdr1ssxvfiyd7d3adhnmmrr9x3maphchkr0x0", "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/e0ca65c81a2d7a4d82a189f1e23a48d59ad42070.tar.gz", + "url": "https://github.com/nmattia/niv/archive/e2f66fe558481d6b569358d27db06f7e972ed71b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { @@ -17,10 +17,10 @@ "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a", - "sha256": "1v9sy2i2dy3qksx4mf81gwzfl0jzpqccfkzq7fjxgq832f9d255i", + "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", + "sha256": "1anwxmjpm21msnnlrjdz19w31bxnbpn4kgf93sn3npihi7wf4a8h", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/73de017ef2d18a04ac4bfd0c02650007ccb31c2a.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } ===================================== .gitlab/darwin/nix/sources.nix ===================================== @@ -10,29 +10,50 @@ let let name' = sanitizeName name + "-src"; in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; fetch_tarball = pkgs: name: spec: let name' = sanitizeName name + "-src"; in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; fetch_git = name: spec: let ref = - if spec ? ref then spec.ref else + spec.ref or ( if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!" + ); + submodules = spec.submodules or false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + { } + else { }; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); fetch_local = spec: spec.path; @@ -66,16 +87,16 @@ let hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; hasThisAsNixpkgsPath = == ./.; in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import { } + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; # The actual fetching function. fetch = pkgs: name: spec: @@ -95,13 +116,13 @@ let # the path directly as opposed to the fetched source. replace = name: drv: let - saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + if ersatz == "" then drv else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; # Ports of functions for older nix versions @@ -112,7 +133,7 @@ let ); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); @@ -123,43 +144,46 @@ let concatStrings = builtins.concatStringsSep ""; # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; + optionalAttrs = cond: as: if cond then as else { }; # fetchTarball version that is compatible between all the versions of Nix builtins_fetchTarball = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchTarball; in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchTarball attrs; # fetchurl version that is compatible between all the versions of Nix builtins_fetchurl = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchurl; in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchurl attrs; # Create the final "sources" from the config mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) config.sources; + mapAttrs + ( + name: spec: + if builtins.hasAttr "outPath" spec + then + abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); } + ) + config.sources; # The "config" used by the fetchers mkConfig = { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) + , sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) , system ? builtins.currentSystem , pkgs ? mkPkgs sources system }: rec { @@ -171,4 +195,4 @@ let }; in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } +mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } ===================================== .gitlab/darwin/toolchain.nix ===================================== @@ -16,7 +16,7 @@ let ghcBindists = let version = ghc.version; in { aarch64-darwin = hostPkgs.fetchurl { url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-aarch64-apple-darwin.tar.xz"; - sha256 = "sha256-c1GTMJf3/yiW/t4QL532EswD5JVlgA4getkfsxj4TaA="; + sha256 = "sha256-Ja/8nOtvIDJwbsG0t7pdFL003ztSI9gGDyEK7OJf7qk="; }; x86_64-darwin = hostPkgs.fetchurl { url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz"; @@ -26,8 +26,7 @@ let }; ghc = pkgs.stdenv.mkDerivation rec { - # Using 9.6.2 because of #24050 - version = "9.6.2"; + version = "9.6.4"; name = "ghc"; src = ghcBindists.${pkgs.stdenv.hostPlatform.system}; configureFlags = [ @@ -57,19 +56,6 @@ let ''; - # N.B. Work around #20253. - nativeBuildInputs = [ pkgs.gnused ]; - postInstallPhase = '' - settings="$out/lib/ghc-${version}/settings" - sed -i -e "s%\"llc\"%\"${llvm}/bin/llc\"%" $settings - sed -i -e "s%\"opt\"%\"${llvm}/bin/opt\"%" $settings - sed -i -e "s%\"clang\"%\"/usr/bin/clang\"%" $settings - sed -i -e 's%("C compiler command", "")%("C compiler command", "/usr/bin/clang")%' $settings - sed -i -e 's%("C compiler flags", "")%("C compiler flags", "--target=${targetTriple}")%' $settings - sed -i -e 's%("C++ compiler flags", "")%("C++ compiler flags", "--target=${targetTriple}")%' $settings - sed -i -e 's%("C compiler link flags", "")%("C compiler link flags", "--target=${targetTriple}")%' $settings - ''; - # Sanity check: verify that we can compile hello world. doInstallCheck = true; installCheckPhase = '' ===================================== hadrian/src/Settings/Warnings.hs ===================================== @@ -56,7 +56,7 @@ ghcWarningsArgs = do , package primitive ? pure [ "-Wno-unused-imports" , "-Wno-deprecations" ] , package rts ? pure [ "-Wcpp-undef" ] - , package text ? pure [ "-Wno-deprecations" ] + , package text ? pure [ "-Wno-deprecations", "-Wno-unused-imports" ] , package terminfo ? pure [ "-Wno-unused-imports" ] , package transformers ? pure [ "-Wno-unused-matches" , "-Wno-unused-imports" ===================================== libraries/Cabal ===================================== @@ -1 +1 @@ -Subproject commit 59fd01457fa662bca17110bc7505ea52bf162135 +Subproject commit 260ecdc3d848782d4df49e629cb0a5dc9e96ca9e ===================================== libraries/Win32 ===================================== @@ -1 +1 @@ -Subproject commit 350ebd43f9a8d9e1ca767b0000f95bdfb42a5471 +Subproject commit 027cbcf0de25d681823ea92fb545a2604c3a6a8b ===================================== libraries/array ===================================== @@ -1 +1 @@ -Subproject commit a65f8a5e7c26fe9b8012b90cbbff8866f8d39113 +Subproject commit c9cb2c1e8762aa83b6e77af82c87a55e03e990e4 ===================================== libraries/binary ===================================== @@ -1 +1 @@ -Subproject commit a501955f7ab48da81d732958c8834caaa3e470b6 +Subproject commit a625eee2eb9dfb4019c051b59d6007c9dded88aa ===================================== libraries/bytestring ===================================== @@ -1 +1 @@ -Subproject commit 453c1dc110720a366f90ef84dc2d75a5cd8c28e0 +Subproject commit d984ad00644c0157bad04900434b9d36f23633c5 ===================================== libraries/directory ===================================== @@ -1 +1 @@ -Subproject commit 4b7c231d187cf253c5f446c4aed2fea26b81d5f9 +Subproject commit e8ee4d5565ec82272ca612034ba6029993e23fd0 ===================================== libraries/exceptions ===================================== @@ -1 +1 @@ -Subproject commit d9fba07b664e3c48f011baca1a8a204292ca2722 +Subproject commit 0b6abb3ac433c7d1d5c6f6a5a45b37f7c486e33b ===================================== libraries/filepath ===================================== @@ -1 +1 @@ -Subproject commit 87a09e296ea6fc137a0b32edda1bd0f54332642e +Subproject commit 65b0f8f31aac4a306135e27734988327f8eb1e6f ===================================== libraries/hpc ===================================== @@ -1 +1 @@ -Subproject commit 8bf6f8b08b0d72cb9231775b66ca572acc1d3197 +Subproject commit 37c56cf932e429950a199d0b1f39796677b052c5 ===================================== libraries/parsec ===================================== @@ -1 +1 @@ -Subproject commit 9c071b05fbb077afbaf0dd2dfdab21265859ae91 +Subproject commit b87122c1c74b8240e65044a8f600f0427d4dd9c3 ===================================== libraries/process ===================================== @@ -1 +1 @@ -Subproject commit dfbe62c7d9fc84d2550fc7e7db993dc0aa143ef5 +Subproject commit b8c88fb5bbdebbcbb3e7c734f0c7515dd3cef84e ===================================== libraries/terminfo ===================================== @@ -1 +1 @@ -Subproject commit 500399a1497dfe1786ba67d6d2bfced4832f3fed +Subproject commit 788ce671cb1cec54c3c9b3ac1c1ba189e8424819 ===================================== libraries/text ===================================== @@ -1 +1 @@ -Subproject commit cdb9e13b39079904eed9d75cd332b66ee0cad0c0 +Subproject commit ee0a8f8b9a4bd3fdad23e9ac0db56e7f08ce35cd ===================================== libraries/unix ===================================== @@ -1 +1 @@ -Subproject commit 69552a5267c7dc5c46a8bceec5ec4b40d26b9463 +Subproject commit 6be36ed54cc035c0f095d24bf3a451638d45513c ===================================== testsuite/tests/process/process004.hs ===================================== @@ -4,8 +4,13 @@ import System.IO.Error import System.Process main :: IO () -main = do test1 `catchIOError` \e -> putStrLn ("Exc: " ++ show e) - test2 `catchIOError` \e -> putStrLn ("Exc: " ++ show e) +main = do + -- N.B. Only show the error type since the exact error text + -- may depend upon precise system call which @process@ decided + -- to use. + let printError e = putStrLn ("Exc: " ++ show (ioeGetErrorType e)) + test1 `catchIOError` printError + test2 `catchIOError` printError test1 :: IO () test1 = do ===================================== testsuite/tests/process/process004.stdout ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: chdir: does not exist (No such file or directory) -Exc: true: runProcess: chdir: does not exist (No such file or directory) +Exc: does not exist +Exc: does not exist ===================================== testsuite/tests/process/process004.stdout-javascript-unknown-ghcjs ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: does not exist (No such file or directory) -Exc: true: runProcess: does not exist (No such file or directory) +Exc: does not exist +Exc: does not exist ===================================== testsuite/tests/process/process004.stdout-mingw32 ===================================== @@ -1,2 +1,2 @@ -Exc: true: runInteractiveProcess: invalid argument (Invalid argument) -Exc: true: runProcess: invalid argument (Invalid argument) +Exc: invalid argument +Exc: invalid argument View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e2464dfa14e9a47c7b5bc88fe2506ebcaf5ab2d...04b2323bef52ed65419bb91c0a515d2f905b88d3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e2464dfa14e9a47c7b5bc88fe2506ebcaf5ab2d...04b2323bef52ed65419bb91c0a515d2f905b88d3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 22:42:49 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Wed, 05 Feb 2025 17:42:49 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] Proress. Renamed module State from Types Message-ID: <67a3e969b8cb1_2fbdf41a001a848934@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: 0137afec by Alan Zimmerman at 2025-02-05T22:41:51+00:00 Proress. Renamed module State from Types And at first blush it seems to handle preprocessor scopes properly. - - - - - 11 changed files: - compiler/GHC/Parser/HaddockLex.x - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PreProcess.hs - compiler/GHC/Parser/PreProcess/Eval.hs - compiler/GHC/Parser/PreProcess/Macro.hs - compiler/GHC/Parser/PreProcess/ParsePP.hs - compiler/GHC/Parser/PreProcess/Parser.y - compiler/GHC/Parser/PreProcess/Types.hs → compiler/GHC/Parser/PreProcess/State.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsParser.stdout - utils/check-cpp/Main.hs Changes: ===================================== compiler/GHC/Parser/HaddockLex.x ===================================== @@ -10,7 +10,7 @@ import GHC.Hs.Doc import GHC.Parser.Lexer hiding (AlexInput) import GHC.Parser.Lexer.Interface (adjustChar) import GHC.Parser.Annotation -import GHC.Parser.PreProcess.Types (PpState(..), initPpState) +import GHC.Parser.PreProcess.State (PpState(..), initPpState) import GHC.Types.SrcLoc import GHC.Types.SourceText import GHC.Data.StringBuffer ===================================== compiler/GHC/Parser/Lexer.x ===================================== @@ -247,6 +247,7 @@ $docsym = [\| \^ \* \$] -- recognise any of the GhcCPP keywords introduced by a leading # @cppkeyword = "define" | "include" | "undef" | "error" | "ifdef" | "ifndef" | "if" | "elif" | "else" | "endif" + | "dumpghccpp" -- ----------------------------------------------------------------------------- -- Alex "Identifier" ===================================== compiler/GHC/Parser/PreProcess.hs ===================================== @@ -4,8 +4,6 @@ {-# LANGUAGE BangPatterns #-} module GHC.Parser.PreProcess ( - -- ppLexer, - -- ppLexerDbg, lexer, lexerDbg, initPpState, @@ -24,7 +22,7 @@ import GHC.Parser.Lexer (P (..), PState (..), ParseResult (..), Token (..)) import GHC.Parser.Lexer qualified as Lexer import GHC.Parser.PreProcess.Macro import GHC.Parser.PreProcess.ParsePP -import GHC.Parser.PreProcess.Types +import GHC.Parser.PreProcess.State import GHC.Prelude import GHC.Types.SrcLoc @@ -75,11 +73,18 @@ ppLexer queueComments cont = Just inp -> do Lexer.setInput inp ppLexer queueComments cont - L _ (ITcpp continuation s) -> do + L l (ITcpp continuation s) -> do if continuation - then pushContinuation tk - else processCppToks s - contIgnoreTok tk + then do + pushContinuation tk + contIgnoreTok tk + else do + mdump <- processCppToks s + case mdump of + Just dump -> + -- We have a dump of the state, put it into an ignored token + contIgnoreTok (L l (ITcpp continuation (appendFS s (fsLit dump)))) + Nothing -> contIgnoreTok tk _ -> do state <- getCppState -- case (trace ("CPP state:" ++ show state) state) of @@ -90,17 +95,7 @@ ppLexer queueComments cont = -- --------------------------------------------------------------------- -preprocessElse :: PP () -preprocessElse = do - accepting <- getAccepting - setAccepting (not accepting) - -preprocessEnd :: PP () -preprocessEnd = do - -- TODO: nested context - setAccepting True - -processCppToks :: FastString -> PP () +processCppToks :: FastString -> PP (Maybe String) processCppToks fs = do let get (L _ (ITcpp _ s)) = s @@ -108,36 +103,38 @@ processCppToks fs = do -- Combine any prior continuation tokens cs <- popContinuation processCpp (reverse $ fs : map get cs) - return () -processCpp :: [FastString] -> PP () +processCpp :: [FastString] -> PP (Maybe String) processCpp fs = do let s = concatMap unpackFS fs - case parseDirective s of - Left err -> error $ show (err, s) - Right (CppInclude filename) -> do - ppInclude filename - Right (CppDefine name def) -> do - ppDefine (MacroName name Nothing) def - Right (CppIf cond) -> do - ppIf cond - return () - Right (CppIfdef name) -> do - defined <- ppIsDefined (MacroName name Nothing) - setAccepting defined - Right (CppIfndef name) -> do - defined <- ppIsDefined (MacroName name Nothing) - setAccepting (not defined) - Right CppElse -> do - accepting <- getAccepting - setAccepting (not accepting) - return () - Right CppEndif -> do - -- TODO: nested states - setAccepting True - return () - - return () + let directive = parseDirective s + if directive == Right CppDumpState + then return (Just "\ndumped state\n") + else do + case directive of + Left err -> error $ show (err, s) + Right (CppInclude filename) -> do + ppInclude filename + Right (CppDefine name def) -> do + ppDefine (MacroName name Nothing) def + Right (CppIf cond) -> do + ppIf cond + Right (CppIfdef name) -> do + defined <- ppIsDefined (MacroName name Nothing) + pushAccepting defined + Right (CppIfndef name) -> do + defined <- ppIsDefined (MacroName name Nothing) + pushAccepting (not defined) + Right CppElse -> do + accepting <- getAccepting + setAccepting (not accepting) + Right CppEndif -> do + popScope + Right CppDumpState -> do + return () + -- accepting <- getAccepting + -- return (trace ("processCpp:" ++ show (accepting,directive)) Nothing) + return Nothing -- pp_include start ----------------------- ===================================== compiler/GHC/Parser/PreProcess/Eval.hs ===================================== @@ -1,6 +1,6 @@ module GHC.Parser.PreProcess.Eval where -import GHC.Parser.PreProcess.Types +import GHC.Parser.PreProcess.State import GHC.Prelude -- --------------------------------------------------------------------- ===================================== compiler/GHC/Parser/PreProcess/Macro.hs ===================================== @@ -28,7 +28,7 @@ import GHC.Parser.PreProcess.Eval import GHC.Parser.PreProcess.ParsePP import GHC.Parser.PreProcess.Parser qualified as Parser import GHC.Parser.PreProcess.ParserM -import GHC.Parser.PreProcess.Types +import GHC.Parser.PreProcess.State import GHC.Prelude -- --------------------------------------------------------------------- ===================================== compiler/GHC/Parser/PreProcess/ParsePP.hs ===================================== @@ -7,7 +7,7 @@ import Data.List (intercalate) import GHC.Parser.Errors.Ppr () import GHC.Parser.PreProcess.Lexer import GHC.Parser.PreProcess.ParserM (Token (..), init_state) -import GHC.Parser.PreProcess.Types +import GHC.Parser.PreProcess.State import GHC.Prelude -- ===================================================================== @@ -28,6 +28,7 @@ parseDirective s = ("#" : "ifdef" : ts) -> Right $ cppIfdef ts ("#" : "else" : ts) -> Right $ cppElse ts ("#" : "endif" : ts) -> Right $ cppEndif ts + ("#" : "dumpghccpp" : ts) -> Right $ cppDumpState ts other -> Left ("unexpected directive: " ++ (combineToks other)) {- | Comply with the CPP requirement to not combine adjacent tokens. @@ -59,6 +60,9 @@ cppElse _ts = CppElse cppEndif :: [String] -> CppDirective cppEndif _ts = CppEndif +cppDumpState :: [String] -> CppDirective +cppDumpState _ts = CppDumpState + -- --------------------------------------------------------------------- cppLex :: String -> Either String [Token] ===================================== compiler/GHC/Parser/PreProcess/Parser.y ===================================== @@ -4,7 +4,7 @@ module GHC.Parser.PreProcess.Parser (parseExpr) where import GHC.Parser.PreProcess.Lexer (lex_tok) import GHC.Parser.PreProcess.ParserM (Token(..), ParserM, run_parser, get_pos, show_pos, happyError) -import GHC.Parser.PreProcess.Types +import GHC.Parser.PreProcess.State import GHC.Prelude -- Needed when invoking happy -ad -- import qualified GHC.Internal.Data.Tuple as Happy_Prelude ===================================== compiler/GHC/Parser/PreProcess/Types.hs → compiler/GHC/Parser/PreProcess/State.hs ===================================== @@ -1,4 +1,4 @@ -module GHC.Parser.PreProcess.Types where +module GHC.Parser.PreProcess.State where import Data.List.NonEmpty (NonEmpty (..), (<|)) import Data.List.NonEmpty qualified as NonEmpty @@ -54,6 +54,7 @@ data CppDirective | CppIf String | CppElse | CppEndif + | CppDumpState deriving (Show, Eq) -- --------------------------------------------------------------------- @@ -160,6 +161,9 @@ setAccepting on = do scope <- getScope setScope (scope{pp_accepting = on}) +pushAccepting :: Bool -> PP () +pushAccepting on = pushScope (PpScope Map.empty on) + pushAccepting' :: PpState -> Bool -> PpState pushAccepting' s on = pushScope' s (PpScope Map.empty on) ===================================== compiler/ghc.cabal.in ===================================== @@ -658,7 +658,7 @@ Library GHC.Parser.PreProcess.ParsePP GHC.Parser.PreProcess.ParserM GHC.Parser.PreProcess.Parser - GHC.Parser.PreProcess.Types + GHC.Parser.PreProcess.State GHC.Parser.String GHC.Parser.Types GHC.Parser.Utils ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -138,7 +138,7 @@ GHC.Parser.PreProcess.Macro GHC.Parser.PreProcess.ParsePP GHC.Parser.PreProcess.Parser GHC.Parser.PreProcess.ParserM -GHC.Parser.PreProcess.Types +GHC.Parser.PreProcess.State GHC.Parser.String GHC.Parser.Types GHC.Platform ===================================== utils/check-cpp/Main.hs ===================================== @@ -25,10 +25,17 @@ import GHC.Types.SrcLoc import GHC.Utils.Error import GHC.Utils.Outputable -import ParsePP -import ParseSimulate -import PreProcess -import Types +-- import ParsePP +-- import ParseSimulate +-- import PreProcess +-- import Types + +import GHC.Parser.PreProcess.ParsePP +-- import GHC.Parser.ParseSimulate +import GHC.Parser.PreProcess +import GHC.Parser.PreProcess as PP +import GHC.Parser.PreProcess.State +import GHC.Parser -- --------------------------------------------------------------------- @@ -69,9 +76,10 @@ strGetToks includes popts filename str = reverse $ lexAll pstate buf = stringToStringBuffer str -- cpp_enabled = Lexer.GhcCppBit `Lexer.xtest` Lexer.pExtsBitmap popts - lexAll state = case unP (ppLexerDbg True return) state of + lexAll state = case unP (PP.lexerDbg True return) state of -- POk _ t@(L _ ITeof) -> [t] POk s t@(L _ ITeof) -> trace ("lexall end:s=" ++ show (Lexer.pp s)) [t] + -- POk s t@(L _ ITeof) -> trace ("lexall end:s=" ++ showPprUnsafe (Lexer.comment_q s)) [t] POk state' t -> t : lexAll state' -- (trace ("lexAll: " ++ show (unLoc t)) state') PFailed pst -> error $ "failed" ++ showErrorMessages (GHC.GhcPsMessage <$> GHC.getPsErrorMessages pst) @@ -86,42 +94,42 @@ showErrorMessages msgs = getMessages $ msgs -strParserWrapper :: - -- | Haskell module source text (full Unicode is supported) - String -> - -- | the flags - DynFlags -> - -- | the filename (for source locations) - FilePath -> - [Located Token] -strParserWrapper str dflags filename = - case strParser str dflags filename of - (_, Left _err) -> error "oops" - (_, Right toks) -> toks - -{- | Parse a file, using the emulated haskell parser, returning the -resulting tokens only --} -strParser :: - -- | Haskell module source text (full Unicode is supported) - String -> - -- | the flags - DynFlags -> - -- | the filename (for source locations) - FilePath -> - (WarningMessages, Either ErrorMessages [Located Token]) -strParser str dflags filename = - let - loc = mkRealSrcLoc (mkFastString filename) 1 1 - buf = stringToStringBuffer str - in - case unP parseModuleNoHaddock (Lexer.initParserState initPpState (initParserOpts dflags) buf loc) of - PFailed pst -> - let (warns, errs) = Lexer.getPsMessages pst - in (GhcPsMessage <$> warns, Left $ GhcPsMessage <$> errs) - POk pst rdr_module -> - let (warns, _) = Lexer.getPsMessages pst - in (GhcPsMessage <$> warns, Right rdr_module) +-- strParserWrapper :: +-- -- | Haskell module source text (full Unicode is supported) +-- String -> +-- -- | the flags +-- DynFlags -> +-- -- | the filename (for source locations) +-- FilePath -> +-- [Located Token] +-- strParserWrapper str dflags filename = +-- case strParser str dflags filename of +-- (_, Left _err) -> error "oops" +-- (_, Right toks) -> toks + +-- {- | Parse a file, using the emulated haskell parser, returning the +-- resulting tokens only +-- -} +-- strParser :: +-- -- | Haskell module source text (full Unicode is supported) +-- String -> +-- -- | the flags +-- DynFlags -> +-- -- | the filename (for source locations) +-- FilePath -> +-- (WarningMessages, Either ErrorMessages [Located Token]) +-- strParser str dflags filename = +-- let +-- loc = mkRealSrcLoc (mkFastString filename) 1 1 +-- buf = stringToStringBuffer str +-- in +-- case unP parseModuleNoHaddock (Lexer.initParserState initPpState (initParserOpts dflags) buf loc) of +-- PFailed pst -> +-- let (warns, errs) = Lexer.getPsMessages pst +-- in (GhcPsMessage <$> warns, Left $ GhcPsMessage <$> errs) +-- POk pst rdr_module -> +-- let (warns, _) = Lexer.getPsMessages pst +-- in (GhcPsMessage <$> warns, Right rdr_module) initDynFlags :: (GHC.GhcMonad m) => m GHC.DynFlags initDynFlags = do @@ -338,3 +346,16 @@ t11 = do , "#endif" ] -- x = 1 + +t12 :: IO () +t12 = do + doTest + [ "#define FOO 4" + , "#if FOO > 3" + , "#dumpghccpp" + , "x = 1" + , "#else" + , "x = 5" + , "#endif" + ] + -- x = 1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0137afecab0854cb1cf89bef22940f28191845fc -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0137afecab0854cb1cf89bef22940f28191845fc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 22:45:46 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Wed, 05 Feb 2025 17:45:46 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/darwin-toolchain-update Message-ID: <67a3ea1adf8fa_2fbdf41ca0e08491eb@gitlab.mail> Ben Gamari pushed new branch wip/darwin-toolchain-update at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/darwin-toolchain-update You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Feb 5 23:45:56 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Wed, 05 Feb 2025 18:45:56 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/gitlab-ci-cleanup Message-ID: <67a3f8347847b_34d529345bac4371f@gitlab.mail> Ben Gamari pushed new branch wip/gitlab-ci-cleanup at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/gitlab-ci-cleanup You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 04:17:32 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 05 Feb 2025 23:17:32 -0500 Subject: [Git][ghc/ghc][master] perf: Replace uses of genericLength with strictGenericLength Message-ID: <67a437dcb3a19_3a2512106dc301040b1@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 4 changed files: - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/StgToByteCode.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -52,7 +52,6 @@ import Data.Array.Base ( UArray(..) ) import Foreign hiding (shiftL, shiftR) import Data.Char ( ord ) -import Data.List ( genericLength ) import Data.Map.Strict (Map) import Data.Maybe (fromMaybe) import qualified Data.Map.Strict as Map @@ -333,6 +332,7 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } + inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) inspectAsm platform long_jumps initial_offset = go (InspectState initial_offset 0 0 Map.empty) @@ -340,7 +340,7 @@ inspectAsm platform long_jumps initial_offset go s (NullAsm _) = (instrCount s, lblEnv s) go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + genericLength ls }) (k n) + go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) where n = litCount s go s (AllocLabel lbl k) = go s' k where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } ===================================== compiler/GHC/Prelude/Basic.hs ===================================== @@ -25,6 +25,8 @@ module GHC.Prelude.Basic , shiftL, shiftR , setBit, clearBit , head, tail + + , strictGenericLength ) where @@ -130,3 +132,15 @@ head = Prelude.head tail :: HasCallStack => [a] -> [a] tail = Prelude.tail {-# INLINE tail #-} + +{- | +The 'genericLength' function defined in base can't be specialised due to the +NOINLINE pragma. + +It is also not strict in the accumulator, and strictGenericLength is not exported. + +See #25706 for why it is important to use a strict, specialised version. + +-} +strictGenericLength :: Num a => [x] -> a +strictGenericLength = fromIntegral . length ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry -import Data.List ( genericReplicate, genericLength, intersperse +import Data.List ( genericReplicate, intersperse , partition, scanl', sortBy, zip4, zip6 ) import Foreign hiding (shiftL, shiftR) import Control.Monad @@ -394,7 +394,7 @@ schemeR_wrk fvs nm original_body (args, body) -- make the arg bitmap bits = argBits platform (reverse (map (idArgRep platform) all_args)) - bitmap_size = genericLength bits + bitmap_size = strictGenericLength bits bitmap = mkBitmap platform bits body_code <- schemeER_wrk sum_szsb_args p_init body @@ -608,7 +608,7 @@ schemeE d s p (StgLet _ext binds body) = do platform <- targetPlatform <$> getDynFlags let (xs,rhss) = case binds of StgNonRec x rhs -> ([x],[rhs]) StgRec xs_n_rhss -> unzip xs_n_rhss - n_binds = genericLength xs + n_binds = strictGenericLength xs fvss = map (fvsToEnv p') rhss @@ -617,7 +617,7 @@ schemeE d s p (StgLet _ext binds body) = do sizes = map (\rhs_fvs -> sum (map size_w rhs_fvs)) fvss -- the arity of each rhs - arities = map (genericLength . fst . collect) rhss + arities = map (strictGenericLength . fst . collect) rhss -- This p', d' defn is safe because all the items being pushed -- are ptrs, so all have size 1 word. d' and p' reflect the stack @@ -1858,7 +1858,7 @@ implement_tagToId implement_tagToId d s p arg names = assert (notNull names) $ do (push_arg, arg_bytes) <- pushAtom d p (StgVarArg arg) - labels <- getLabelsBc (genericLength names) + labels <- getLabelsBc (strictGenericLength names) label_fail <- getLabelBc label_exit <- getLabelBc dflags <- getDynFlags ===================================== libraries/ghc-boot/GHC/Data/SizedSeq.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving, DeriveGeneric, CPP #-} module GHC.Data.SizedSeq ( SizedSeq(..) , emptySS @@ -11,9 +11,12 @@ module GHC.Data.SizedSeq import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary -import Data.List (genericLength) import GHC.Generics +#if ! MIN_VERSION_base(4,20,0) +import Data.List (foldl') +#endif + data SizedSeq a = SizedSeq {-# UNPACK #-} !Word [a] deriving (Generic, Show) @@ -37,9 +40,9 @@ emptySS = SizedSeq 0 [] addToSS :: SizedSeq a -> a -> SizedSeq a addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) +-- NB, important this is eta-expand so that foldl' is inlined. addListToSS :: SizedSeq a -> [a] -> SizedSeq a -addListToSS (SizedSeq n r_xs) xs - = SizedSeq (n + genericLength xs) (reverse xs ++ r_xs) +addListToSS s xs = foldl' addToSS s xs ssElts :: SizedSeq a -> [a] ssElts (SizedSeq _ r_xs) = reverse r_xs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db19c8a95a187fa6fcfbcc9c96961044786cc945 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db19c8a95a187fa6fcfbcc9c96961044786cc945 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 04:17:56 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 05 Feb 2025 23:17:56 -0500 Subject: [Git][ghc/ghc][master] perf: nameToCLabel: Directly manipulate ByteString rather than going via strings Message-ID: <67a437f4c901b_3a251211efcc0108391@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 1 changed file: - compiler/GHC/ByteCode/Linker.hs Changes: ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -210,9 +211,9 @@ linkFail who what nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastString label +nameToCLabel n suffix = mkFastStringByteString label where - encodeZ = zString . zEncodeFS + encodeZ = fastZStringToByteString . zEncodeFS (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. @@ -222,11 +223,14 @@ nameToCLabel n suffix = mkFastString label modulePart = encodeZ (moduleNameFS modName) occPart = encodeZ $ occNameMangledFS (nameOccName n) - label = concat - [ if pkgKey == mainUnit then "" else packagePart ++ "_" - , modulePart - , '_':occPart - , '_':suffix + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix ] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5622a14a7a036ab36e28963a4fba826a5ac798a7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5622a14a7a036ab36e28963a4fba826a5ac798a7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 08:10:28 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 03:10:28 -0500 Subject: [Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] add more without extension tests Message-ID: <67a46e7497464_3a25123be8324137042@gitlab.mail> Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC Commits: 88307a2b by Patrick at 2025-02-06T16:10:16+08:00 add more without extension tests - - - - - 1 changed file: - testsuite/tests/indexed-types/should_compile/T25647b.hs Changes: ===================================== testsuite/tests/indexed-types/should_compile/T25647b.hs ===================================== @@ -20,6 +20,22 @@ newtype Fix1a f = In1a (f (Fix1a f)) newtype Fix1b f where In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: (Type -> Type) -> Type +newtype Fix2 f where + In2 :: forall (ff :: Type -> Type). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix3 :: (Type -> Type) -> Type +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f +type Fix4 :: (Type -> Type) -> Type +newtype Fix4 f where + In4 :: forall (ff :: Type -> Type). + ff (Fix4 ff) -> Fix4 ff -------------------- Data families with newtype instance ----------------- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88307a2b65330f34e2cbb8fff7804d04ab7490ba -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88307a2b65330f34e2cbb8fff7804d04ab7490ba You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 09:25:23 2025 From: gitlab at gitlab.haskell.org (Luite Stegeman (@luite)) Date: Thu, 06 Feb 2025 04:25:23 -0500 Subject: [Git][ghc/ghc][wip/backports-9.8] add missing part of backport Message-ID: <67a48003bb5ac_4f3ddcf9e0967c1@gitlab.mail> Luite Stegeman pushed to branch wip/backports-9.8 at Glasgow Haskell Compiler / GHC Commits: bec76ae8 by Luite Stegeman at 2025-02-06T10:24:43+01:00 add missing part of backport - - - - - 1 changed file: - compiler/cbits/genSym.c Changes: ===================================== compiler/cbits/genSym.c ===================================== @@ -21,6 +21,10 @@ #define HAVE_UNIQUE64 1 #endif +#if !defined(HAVE_UNIQUE64) +HsWord64 ghc_unique_counter64 = 0; +#endif + // This function has been added to the RTS. Here we pessimistically assume // that a threaded RTS is used. This function is only used for bootstrapping. #if !MIN_VERSION_GLASGOW_HASKELL(9,7,0,0) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bec76ae8d175075f77f6e322ab9df860acd61247 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bec76ae8d175075f77f6e322ab9df860acd61247 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 09:32:39 2025 From: gitlab at gitlab.haskell.org (Luite Stegeman (@luite)) Date: Thu, 06 Feb 2025 04:32:39 -0500 Subject: [Git][ghc/ghc][wip/backports-9.8] compiler: Fix CPP guards around ghc_unique_counter64 Message-ID: <67a481b7e1cd_4f3dd10f4a01003b9@gitlab.mail> Luite Stegeman pushed to branch wip/backports-9.8 at Glasgow Haskell Compiler / GHC Commits: 189a368b by Ben Gamari at 2025-02-06T10:32:27+01:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. (cherry-picked from commit 63d74f4d15ecaa8d711bd12fa64f77fce72b5f79) - - - - - 1 changed file: - compiler/cbits/genSym.c Changes: ===================================== compiler/cbits/genSym.c ===================================== @@ -9,11 +9,20 @@ // // The CPP is thus about the RTS version GHC is linked against, and not the // version of the GHC being built. -#if !MIN_VERSION_GLASGOW_HASKELL(9,8,4,0) -HsWord64 ghc_unique_counter64 = 0; + +#if MIN_VERSION_GLASGOW_HASKELL(9,9,0,0) +// Unique64 patch was present in 9.10 and later +#define HAVE_UNIQUE64 1 +#elif !MIN_VERSION_GLASGOW_HASKELL(9,9,0,0) && MIN_VERSION_GLASGOW_HASKELL(9,8,4,0) +// Unique64 patch was backported to 9.8.4 +#define HAVE_UNIQUE64 1 +#elif !MIN_VERSION_GLASGOW_HASKELL(9,7,0,0) && MIN_VERSION_GLASGOW_HASKELL(9,6,7,0) +// Unique64 patch was backported to 9.6.7 +#define HAVE_UNIQUE64 1 #endif -#if !MIN_VERSION_GLASGOW_HASKELL(9,3,0,0) -HsInt ghc_unique_inc = 1; + +#if !defined(HAVE_UNIQUE64) +HsWord64 ghc_unique_counter64 = 0; #endif // This function has been added to the RTS. Here we pessimistically assume View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/189a368ba74dbfe8a6e832fe0f9ffe56cd565824 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/189a368ba74dbfe8a6e832fe0f9ffe56cd565824 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 10:28:23 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 05:28:23 -0500 Subject: [Git][ghc/ghc][wip/T18462] More refactoring Message-ID: <67a48ec7d3442_4f3dde26fa8112245@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 5e63a9c0 by Sjoerd Visscher at 2025-02-06T11:28:16+01:00 More refactoring - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Build.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Id/Make.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Type.hs - testsuite/tests/ghc-api/exactprint/Test20239.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e63a9c0399cc66566cac060800391ef1aeef860 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e63a9c0399cc66566cac060800391ef1aeef860 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 12:10:05 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 07:10:05 -0500 Subject: [Git][ghc/ghc][wip/T18462] 41 commits: Rework built-in and punned names (#25174, #25179, #25180, #25182) Message-ID: <67a4a69d86aa_9220bc0954604f1@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 22cef556 by Sjoerd Visscher at 2025-02-06T13:09:37+01:00 Multiplicity annotation on records Add HsConFieldSpec - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Uniques.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e63a9c0399cc66566cac060800391ef1aeef860...22cef556b8ddf744176be5260bc45c7916caf36d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e63a9c0399cc66566cac060800391ef1aeef860...22cef556b8ddf744176be5260bc45c7916caf36d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 12:16:36 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 07:16:36 -0500 Subject: [Git][ghc/ghc][wip/T18462] Multiplicity annotation on records Message-ID: <67a4a82455342_9220b2994606314e@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: cc5bfb59 by Sjoerd Visscher at 2025-02-06T13:16:30+01:00 Multiplicity annotation on records Add HsConFieldSpec - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cc5bfb594fc794bb1a03b1ab6bdbce138f95caea -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cc5bfb594fc794bb1a03b1ab6bdbce138f95caea You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 12:28:56 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 07:28:56 -0500 Subject: [Git][ghc/ghc][wip/T25647] Fix up T25611d with explicit kind annotation Message-ID: <67a4ab0826cb3_9220b4c0c0c70493@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 123d8d42 by Patrick at 2025-02-06T20:27:57+08:00 Fix up T25611d with explicit kind annotation - - - - - 1 changed file: - testsuite/tests/indexed-types/should_compile/T25611d.hs Changes: ===================================== testsuite/tests/indexed-types/should_compile/T25611d.hs ===================================== @@ -20,7 +20,7 @@ data instance T p q where MkkV :: forall l. l Int# -> T l Int# type N :: TYPE r -> TYPE r -newtype N a = MkN a +newtype N (a::TYPE r) = MkN a f :: Int# -> N Int# f x = MkN x @@ -29,7 +29,7 @@ g :: Int -> N Int g x = MkN x data family D :: Type -> k -> k -newtype instance D Int a = MkD a +newtype instance D Int (a::TYPE r) = MkD a f1 :: Int# -> D Int Int# f1 x = MkD x View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/123d8d429aa6d16dc670adfef6d4011beca26fa2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/123d8d429aa6d16dc670adfef6d4011beca26fa2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 12:34:59 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 07:34:59 -0500 Subject: [Git][ghc/ghc][wip/T25647] fix up T25647_fail Message-ID: <67a4ac73b525f_9220b8469d0711a6@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 17ff8a1c by Patrick at 2025-02-06T20:34:01+08:00 fix up T25647_fail - - - - - 2 changed files: - testsuite/tests/typecheck/should_compile/T25647_fail.hs - testsuite/tests/typecheck/should_compile/T25647_fail.stderr Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.hs ===================================== @@ -1,6 +1,6 @@ {-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} -module T25647 where +module T25647_fail where import GHC.Exts import Data.Kind ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.stderr ===================================== @@ -1 +1,13 @@ - \ No newline at end of file +T25647_fail.hs:12:4: [GHC-89498] + A newtype must not be a GADT + In2 :: forall (ff :: * -> *). + ff (Fix2 @LiftedRep ff) -> Fix2 @LiftedRep ff + In the definition of data constructor ‘In2’ + In the newtype declaration for ‘Fix2’ + +T25647_fail.hs:17:3: [GHC-89498] + A newtype must not be a GADT + In4a :: forall (ff :: * -> *). + ff (Fix4a @LiftedRep ff) -> Fix4a @LiftedRep ff + In the definition of data constructor ‘In4a’ + In the newtype declaration for ‘Fix4a’ \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/17ff8a1c012673df292216174cb3ce5b845063f9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/17ff8a1c012673df292216174cb3ce5b845063f9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 12:46:46 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 07:46:46 -0500 Subject: [Git][ghc/ghc][wip/T25647] cleanup whitespace Message-ID: <67a4af3644768_9220baa4704724ae@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 919ae60a by Patrick at 2025-02-06T20:42:09+08:00 cleanup whitespace - - - - - 1 changed file: - compiler/GHC/Tc/TyCl/Instance.hs Changes: ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -976,7 +976,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs - -- DefaultNonStandardTyVars: see (GT4) in + -- DefaultNonStandardTyVars: see (GT4) in -- GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; let final_tvs = scopedSort (qtvs ++ outer_tvs) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/919ae60aa43fb906d807dd098f218d1931679d2f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/919ae60aa43fb906d807dd098f218d1931679d2f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:00:53 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 08:00:53 -0500 Subject: [Git][ghc/ghc][wip/T18462] Multiplicity annotation on records Message-ID: <67a4b285368a9_9220bf6b8787736@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 1bd1a8aa by Sjoerd Visscher at 2025-02-06T14:00:45+01:00 Multiplicity annotation on records Add HsConFieldSpec - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1bd1a8aadfacbd6131a3c62c89571a84beb33068 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1bd1a8aadfacbd6131a3c62c89571a84beb33068 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:02:21 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 08:02:21 -0500 Subject: [Git][ghc/ghc][wip/T18462] Multiplicity annotation on records Message-ID: <67a4b2ddec052_9220b10517c477896@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 0594590b by Sjoerd Visscher at 2025-02-06T14:02:15+01:00 Multiplicity annotation on records Add HsConFieldSpec - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0594590b9939b1e1b68506a574e288063278fe98 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0594590b9939b1e1b68506a574e288063278fe98 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:08:36 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Thu, 06 Feb 2025 08:08:36 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] 4 commits: Consider Wanteds with rewriters as insoluble Message-ID: <67a4b454afd24_9220b121538078370@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: 128825be by Simon Peyton Jones at 2025-02-06T13:28:48+01:00 Consider Wanteds with rewriters as insoluble This MR fixes #25325 See GHC.Tc.Types.Constraint, Note [Insoluble Wanteds], especially (IW2) There is a small change in the error message for T14172, but it looks entirely acceptable to me. (cherry picked from commit 083703a12cd34369e7ed2f0efc4a5baee47aedab) - - - - - d6f6d927 by Simon Peyton Jones at 2025-02-06T13:29:07+01:00 Wibbles (cherry picked from commit 0dfaeb66fb8457e7339abbd44d5c53a81ad8ae3a) - - - - - 8ee0a3df by Simon Peyton Jones at 2025-02-06T13:29:14+01:00 Spelling errors (cherry picked from commit 09d24d828e48c2588a317e6dad711f8673983703) - - - - - 68d3ab8b by Arnaud Spiwack at 2025-02-06T13:45:53+01:00 Don't bypass MonoLocalBind in empty patterns Fixes #25428 (cherry picked from commit 52d97f4ecd37bf598560dbded2d50649db5cfe1d) - - - - - 8 changed files: - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Types/Constraint.hs - testsuite/tests/linear/should_compile/all.T - testsuite/tests/polykinds/T14172.stderr - + testsuite/tests/typecheck/should_fail/T25325.hs - + testsuite/tests/typecheck/should_fail/T25325.stderr - testsuite/tests/typecheck/should_fail/all.T Changes: ===================================== compiler/GHC/Tc/Errors.hs ===================================== @@ -465,6 +465,8 @@ mkErrorItem ct flav = ctFlavour ct ; (suppress, m_evdest) <- case ctEvidence ct of + -- For this `suppress` stuff + -- see Note [Wanteds rewrite Wanteds] in GHC.Tc.Types.Constraint CtGiven {} -> return (False, Nothing) CtWanted { ctev_rewriters = rewriters, ctev_dest = dest } -> do { rewriters' <- zonkRewriterSet rewriters ===================================== compiler/GHC/Tc/Gen/Bind.hs ===================================== @@ -723,7 +723,6 @@ it's all cool; each signature has distinct type variables from the renamer.) {- Note [Non-variable pattern bindings aren't linear] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - A fundamental limitation of the typechecking algorithm is that we cannot have a binding which, at the same time, - is linear in its rhs @@ -735,17 +734,35 @@ https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0111-linear To address this we to do a few things -- When a pattern is annotated with a multiplicity annotation `let %q pat = rhs +- (NVP1) When a pattern is annotated with a multiplicity annotation `let %q pat = rhs in body` (note: multiplicity-annotated bindings are always parsed as a PatBind, see Note [Multiplicity annotations] in Language.Haskell.Syntax.Binds), - then the let is never generalised (we use the NoGen plan). -- Whenever the typechecker infers an AbsBind *and* the inner binding is a + then the let is never generalised (we use the NoGen plan). We do this with a + dedicated test in decideGeneralisationPlan. +- (NVP2) Whenever the typechecker infers an AbsBind *and* the inner binding is a non-variable PatBind, then the multiplicity of the binding is inferred to be - Many. This is a little infelicitous: sometimes the typechecker infers an - AbsBind where it didn't need to. This may cause some programs to be spuriously - rejected, when NoMonoLocalBinds is on. -- LinearLet implies MonoLocalBinds to avoid the AbsBind case altogether. - + Many. We do this by calling manyIfPats in tcPolyInfer. This is a little + infelicitous: sometimes the typechecker infers an AbsBind where it didn't need + to. This may cause some programs to be spuriously rejected, when + NoMonoLocalBinds is on. +- (NVP3) LinearLet implies MonoLocalBinds to avoid the AbsBind case altogether. +- (NVP4) Wrinkle: even when other conditions (including MonoLocalBinds), GHC + will generalise some binders, namely so-called closed binding groups. We need + to make sure that the test for (NVP1) has priority over the test for closed + binders. +- (NVP5) Wrinkle: Closed binding groups (NVP4) are usually fine to type with + multiplicity Many. But there's one exception: when there's no binder at all, + the binding group is considered closed. Even if the rhs contains arbitrary + variables. + + f :: () %1 -> Bool + f x = let !() = x in True + + If we consider `!() = x` as a generalisable group (which does nothing anyway), + then (NVP2) will infer the pattern as multiplicity Many, and reject the + function. We don't want that, see also #25428. So we take care not to + generalise in this case, by excluding the no-binder case from automatic + generalisation in decideGeneralisationPlan. -} tcPolyInfer @@ -762,7 +779,7 @@ tcPolyInfer rec_tc prag_fn tc_sig_fn bind_list ; apply_mr <- checkMonomorphismRestriction mono_infos bind_list -- AbsBinds which are PatBinds can't be linear. - -- See Note [Non-variable pattern bindings aren't linear] + -- See (NVP2) in Note [Non-variable pattern bindings aren't linear] ; binds' <- manyIfPats binds' ; traceTc "tcPolyInfer" (ppr apply_mr $$ ppr (map mbi_sig mono_infos)) @@ -1871,12 +1888,17 @@ decideGeneralisationPlan dflags top_lvl closed sig_fn lbinds -- See Note [Always generalise top-level bindings] | has_mult_anns_and_pats = False - -- See Note [Non-variable pattern bindings aren't linear] + -- See (NVP1) and (NVP4) in Note [Non-variable pattern bindings aren't linear] - | IsGroupClosed _ True <- closed = True + | IsGroupClosed _ True <- closed + , not (null binders) = True -- The 'True' means that all of the group's -- free vars have ClosedTypeId=True; so we can ignore - -- -XMonoLocalBinds, and generalise anyway + -- -XMonoLocalBinds, and generalise anyway. + -- Except if 'fv' is empty: there is no binder to generalise, so + -- generalising does nothing. And trying to generalise hurts linear + -- types (see #25428). So we don't force it. + -- See (NVP5) in Note [Non-variable pattern bindings aren't linear] in GHC.Tc.Gen.Bind. | has_partial_sigs = True -- See Note [Partial type signatures and generalisation] ===================================== compiler/GHC/Tc/Types/Constraint.hs ===================================== @@ -83,7 +83,7 @@ module GHC.Tc.Types.Constraint ( ctEvExpr, ctEvTerm, ctEvCoercion, ctEvEvId, ctEvRewriters, ctEvUnique, tcEvDestUnique, mkKindEqLoc, toKindLoc, toInvisibleLoc, mkGivenLoc, - ctEvRole, setCtEvPredType, setCtEvLoc, arisesFromGivens, + ctEvRole, setCtEvPredType, setCtEvLoc, tyCoVarsOfCtEvList, tyCoVarsOfCtEv, tyCoVarsOfCtEvsList, -- RewriterSet @@ -1312,25 +1312,51 @@ nonDefaultableTyVarsOfWC (WC { wc_simple = simples, wc_impl = implics, wc_errors insolubleWC :: WantedConstraints -> Bool insolubleWC (WC { wc_impl = implics, wc_simple = simples, wc_errors = errors }) = anyBag insolubleWantedCt simples + -- insolubleWantedCt: wanteds only: see Note [Given insolubles] || anyBag insolubleImplic implics || anyBag is_insoluble errors - - where + where is_insoluble (DE_Hole hole) = isOutOfScopeHole hole -- See Note [Insoluble holes] is_insoluble (DE_NotConcrete {}) = True insolubleWantedCt :: Ct -> Bool -- Definitely insoluble, in particular /excluding/ type-hole constraints -- Namely: --- a) an insoluble constraint as per 'insolubleCt', i.e. either +-- a) an insoluble constraint as per 'insolubleIrredCt', i.e. either -- - an insoluble equality constraint (e.g. Int ~ Bool), or -- - a custom type error constraint, TypeError msg :: Constraint -- b) that does not arise from a Given or a Wanted/Wanted fundep interaction +-- See Note [Insoluble Wanteds] +insolubleWantedCt ct + | CIrredCan ir_ct <- ct + -- CIrredCan: see (IW1) in Note [Insoluble Wanteds] + , IrredCt { ir_ev = ev } <- ir_ct + , CtWanted { ctev_loc = loc, ctev_rewriters = rewriters } <- ev + -- It's a Wanted + , insolubleIrredCt ir_ct + -- It's insoluble + , isEmptyRewriterSet rewriters + -- It has no rewriters; see (IW2) in Note [Insoluble Wanteds] + , not (isGivenLoc loc) + -- isGivenLoc: see (IW3) in Note [Insoluble Wanteds] + , not (isWantedWantedFunDepOrigin (ctLocOrigin loc)) + -- origin check: see (IW4) in Note [Insoluble Wanteds] + = True + + | otherwise + = False + +-- | Returns True of constraints that are definitely insoluble, +-- as well as TypeError constraints. +-- Can return 'True' for Given constraints, unlike 'insolubleWantedCt'. -- --- See Note [Given insolubles]. -insolubleWantedCt ct = insolubleCt ct && - not (arisesFromGivens ct) && - not (isWantedWantedFunDepOrigin (ctOrigin ct)) +-- The function is tuned for application /after/ constraint solving +-- i.e. assuming canonicalisation has been done +-- That's why it looks only for IrredCt; all insoluble constraints +-- are put into CIrredCan +insolubleCt :: Ct -> Bool +insolubleCt (CIrredCan ir_ct) = insolubleIrredCt ir_ct +insolubleCt _ = False insolubleIrredCt :: IrredCt -> Bool -- Returns True of Irred constraints that are /definitely/ insoluble @@ -1360,18 +1386,6 @@ insolubleIrredCt (IrredCt { ir_ev = ev, ir_reason = reason }) -- > Assert 'True _errMsg = () -- > Assert _check errMsg = errMsg --- | Returns True of constraints that are definitely insoluble, --- as well as TypeError constraints. --- Can return 'True' for Given constraints, unlike 'insolubleWantedCt'. --- --- The function is tuned for application /after/ constraint solving --- i.e. assuming canonicalisation has been done --- That's why it looks only for IrredCt; all insoluble constraints --- are put into CIrredCan -insolubleCt :: Ct -> Bool -insolubleCt (CIrredCan ir_ct) = insolubleIrredCt ir_ct -insolubleCt _ = False - -- | Does this hole represent an "out of scope" error? -- See Note [Insoluble holes] isOutOfScopeHole :: Hole -> Bool @@ -1415,6 +1429,31 @@ in GHC.Tc.Errors), so we may fail to report anything at all! Yikes. Bottom line: insolubleWC (called in GHC.Tc.Solver.setImplicationStatus) should ignore givens even if they are insoluble. +Note [Insoluble Wanteds] +~~~~~~~~~~~~~~~~~~~~~~~~ +insolubleWantedCt returns True of a Wanted constraint that definitely +can't be solved. But not quite all such constraints; see wrinkles. + +(IW1) insolubleWantedCt is tuned for application /after/ constraint + solving i.e. assuming canonicalisation has been done. That's why + it looks only for IrredCt; all insoluble constraints are put into + CIrredCan + +(IW2) We only treat it as insoluble if it has an empty rewriter set. (See Note + [Wanteds rewrite Wanteds].) Otherwise #25325 happens: a Wanted constraint A + that is /not/ insoluble rewrites some other Wanted constraint B, so B has A + in its rewriter set. Now B looks insoluble. The danger is that we'll + suppress reporting B because of its empty rewriter set; and suppress + reporting A because there is an insoluble B lying around. (This suppression + happens in GHC.Tc.Errors.mkErrorItem.) Solution: don't treat B as insoluble. + +(IW3) If the Wanted arises from a Given (how can that happen?), don't + treat it as a Wanted insoluble (obviously). + +(IW4) If the Wanted came from a Wanted/Wanted fundep interaction, don't + treat the constraint as insoluble. See Note [Suppressing confusing errors] + in GHC.Tc.Errors + Note [Insoluble holes] ~~~~~~~~~~~~~~~~~~~~~~ Hole constraints that ARE NOT treated as truly insoluble: @@ -2056,9 +2095,6 @@ tcEvDestUnique (HoleDest co_hole) = varUnique (coHoleCoVar co_hole) setCtEvLoc :: CtEvidence -> CtLoc -> CtEvidence setCtEvLoc ctev loc = ctev { ctev_loc = loc } -arisesFromGivens :: Ct -> Bool -arisesFromGivens ct = isGivenCt ct || isGivenLoc (ctLoc ct) - -- | Set the type of CtEvidence. -- -- This function ensures that the invariants on 'CtEvidence' hold, by updating ===================================== testsuite/tests/linear/should_compile/all.T ===================================== @@ -46,4 +46,4 @@ test('T23814', normal, compile, ['']) test('LinearLet', normal, compile, ['']) test('LinearLetPoly', normal, compile, ['']) test('LinearListComprehension', normal, compile, ['-dlinear-core-lint']) -test('T25428', expect_broken(25428), compile, ['']) +test('T25428', normal, compile, ['']) ===================================== testsuite/tests/polykinds/T14172.stderr ===================================== @@ -1,10 +1,7 @@ - T14172.hs:7:46: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘a'’ - Where: ‘a'’ is a rigid type variable bound by - the inferred type of - traverseCompose :: (a -> f b) -> g a -> f (h a') - at T14172.hs:8:1-46 + • Found type wildcard ‘_’ standing for ‘a'1 :: k0’ + Where: ‘k0’ is an ambiguous type variable + ‘a'1’ is an ambiguous type variable To use the inferred type, enable PartialTypeSignatures • In the first argument of ‘h’, namely ‘_’ In the first argument of ‘f’, namely ‘(h _)’ @@ -13,17 +10,19 @@ T14172.hs:7:46: error: [GHC-88464] T14172.hs:8:19: error: [GHC-25897] • Couldn't match type ‘a’ with ‘g'1 a'0’ - Expected: (f'0 a -> f (f'0 b)) -> g a -> f (h a') - Actual: (Unwrapped (Compose f'0 g'1 a'0) -> f (Unwrapped (h a'))) - -> Compose f'0 g'1 a'0 -> f (h a') + Expected: (f'0 a -> f (f'0 b)) -> g a -> f (h a'1) + Actual: (Unwrapped (Compose f'0 g'1 a'0) + -> f (Unwrapped (h a'1))) + -> Compose f'0 g'1 a'0 -> f (h a'1) ‘a’ is a rigid type variable bound by the inferred type of - traverseCompose :: (a -> f b) -> g a -> f (h a') + traverseCompose :: (a -> f b) -> g a -> f (h a'1) at T14172.hs:7:1-47 • In the first argument of ‘(.)’, namely ‘_Wrapping Compose’ In the expression: _Wrapping Compose . traverse In an equation for ‘traverseCompose’: traverseCompose = _Wrapping Compose . traverse • Relevant bindings include - traverseCompose :: (a -> f b) -> g a -> f (h a') + traverseCompose :: (a -> f b) -> g a -> f (h a'1) (bound at T14172.hs:8:1) + ===================================== testsuite/tests/typecheck/should_fail/T25325.hs ===================================== @@ -0,0 +1,14 @@ +module T25325 where + +import Control.Monad.State + +data (f :+: g) a = Inl (f a) | Inr (g a) + +newtype Buggy f m = Buggy { thing :: m Int } + +class GhcBug f where + demo :: MonadState (Buggy f m) m => f (m Int) -> m Int + +instance (GhcBug f, GhcBug g) => GhcBug (f :+: g) where + demo (Inl l) = demo l + demo (Inr r) = demo r ===================================== testsuite/tests/typecheck/should_fail/T25325.stderr ===================================== @@ -0,0 +1,15 @@ +T25325.hs:14:20: error: [GHC-39999] + • Could not deduce ‘MonadState (Buggy g m) m’ + arising from a use of ‘demo’ + from the context: (GhcBug f, GhcBug g) + bound by the instance declaration at T25325.hs:12:10-49 + or from: MonadState (Buggy (f :+: g) m) m + bound by the type signature for: + demo :: forall (m :: * -> *). + MonadState (Buggy (f :+: g) m) m => + (:+:) f g (m Int) -> m Int + at T25325.hs:13:5-8 + • In the expression: demo r + In an equation for ‘demo’: demo (Inr r) = demo r + In the instance declaration for ‘GhcBug (f :+: g)’ + ===================================== testsuite/tests/typecheck/should_fail/all.T ===================================== @@ -727,3 +727,4 @@ test('T24470a', normal, compile_fail, ['']) test('T24553', normal, compile_fail, ['']) test('T23739b', normal, compile_fail, ['']) +test('T25325', normal, compile_fail, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e41456fca25b1407193536c4243dd19a82b40ab7...68d3ab8bc994cb540e4ee67aa20fe70cff8e0dfe -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e41456fca25b1407193536c4243dd19a82b40ab7...68d3ab8bc994cb540e4ee67aa20fe70cff8e0dfe You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:18:19 2025 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Thu, 06 Feb 2025 08:18:19 -0500 Subject: [Git][ghc/ghc][wip/T24603] 8 commits: gitlab-ci: Don't use .full-ci to run test-primops Message-ID: <67a4b69b942fc_9220b1351550785af@gitlab.mail> Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC Commits: 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 89fd0c9b by Serge S. Gulin at 2025-02-06T16:18:07+03:00 Support for ARM64 Windows (LLVM-enabled) (fixes #24603) submodule Co-authored-by: Cheng Shao <terrorjack at type.dance> Co-authored-by: Dmitrii Egorov <egorov.d.i at icloud.com> Co-authored-by: Andrei Borzenkov <root at sandwitch.dev> - - - - - 3dfe6058 by Serge S. Gulin at 2025-02-06T16:18:07+03:00 Basic NCG support for HelloWorld - - - - - 30 changed files: - .gitlab-ci.yml - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/StgToByteCode.hs - libraries/Cabal - libraries/Win32 - libraries/base/src/System/CPUTime/Windows.hsc - libraries/base/tests/perf/encodingAllocations.hs - libraries/directory - libraries/ghc-boot/GHC/Data/SizedSeq.hs - libraries/haskeline - libraries/process - libraries/unix - llvm-targets - m4/ghc_tables_next_to_code.m4 - rts/StgCRun.c - rts/win32/veh_excn.c - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1d3de001ca88368a1fd0a604bc32f0f351ae8c9b...3dfe6058bf793d5aba4e2c99852a2267476d720c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1d3de001ca88368a1fd0a604bc32f0f351ae8c9b...3dfe6058bf793d5aba4e2c99852a2267476d720c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:19:06 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 08:19:06 -0500 Subject: [Git][ghc/ghc][wip/T18462] Multiplicity annotation on records Message-ID: <67a4b6caca23d_9220b1307608791f1@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 43a373ea by Sjoerd Visscher at 2025-02-06T14:18:57+01:00 Multiplicity annotation on records Add HsConFieldSpec - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/43a373ea038a572a98e02004a3774ca4a526abed -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/43a373ea038a572a98e02004a3774ca4a526abed You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:19:24 2025 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Thu, 06 Feb 2025 08:19:24 -0500 Subject: [Git][ghc/ghc][wip/T24603] Basic NCG support for HelloWorld Message-ID: <67a4b6dc6ce3a_9220b13371147967d@gitlab.mail> Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC Commits: d51b588c by Serge S. Gulin at 2025-02-06T16:18:58+03:00 Basic NCG support for HelloWorld - - - - - 5 changed files: - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Driver/Backend.hs - compiler/GHC/Driver/Session.hs - utils/ghc-toolchain/exe/Main.hs Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -1,6 +1,8 @@ {-# language GADTs, LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE CPP #-} + module GHC.CmmToAsm.AArch64.CodeGen ( cmmTopCodeGen , generateJumpTableForInstr @@ -284,7 +286,11 @@ generateJumpTableForInstr config (J_TBL ids (Just lbl) _) = ) where blockLabel = blockLbl blockid +#if defined(mingw32_HOST_OS) + in Just (CmmData (Section Text lbl) (CmmStaticsRaw lbl jumpTable)) +#else in Just (CmmData (Section ReadOnlyData lbl) (CmmStaticsRaw lbl jumpTable)) +#endif generateJumpTableForInstr _ _ = Nothing -- ----------------------------------------------------------------------------- @@ -2481,9 +2487,7 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = replace_jump !m !pos instr = do case instr of ANN ann instr -> do - replace_jump m pos instr >>= \ - (idx,instr':|instrs') -> - pure (idx, ANN ann instr':|instrs') + replace_jump m pos instr >>= (\(idx,instr':|instrs') -> pure (idx, ANN ann instr':|instrs')) BCOND cond t -> case target_in_range m t pos of InRange -> pure (pos+long_bc_jump_size, NE.singleton instr) ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -491,6 +491,34 @@ pprInstr platform instr = case instr of op_adrp o1 (pprAsmLabel platform lbl <> text "@page") $$ op_add o1 (pprAsmLabel platform lbl <> text "@pageoff") +#elif defined(mingw32_HOST_OS) + LDR _f o1 (OpImm (ImmIndex lbl' off)) | Just (_info, lbl) <- dynamicLinkerLabelInfo lbl' -> + op_adrp o1 (text "__imp_" <> pprAsmLabel platform lbl) $$ + op_ldr o1 (text ":lo12:__imp_" <> pprAsmLabel platform lbl) $$ + op_add o1 (char '#' <> int off) -- TODO: check that off is in 12bits. + + LDR _f o1 (OpImm (ImmIndex lbl off)) | isForeignLabel lbl -> + op_adrp o1 (pprAsmLabel platform lbl) $$ + op_add o1 (text ":lo12:" <> pprAsmLabel platform lbl) $$ + op_add o1 (char '#' <> int off) -- TODO: check that off is in 12bits. + + LDR _f o1 (OpImm (ImmIndex lbl off)) -> + op_adrp o1 (pprAsmLabel platform lbl) $$ + op_add o1 (text ":lo12:" <> pprAsmLabel platform lbl) $$ + op_add o1 (char '#' <> int off) -- TODO: check that off is in 12bits. + + LDR _f o1 (OpImm (ImmCLbl lbl')) | Just (_info, lbl) <- dynamicLinkerLabelInfo lbl' -> + op_adrp o1 (text "__imp_" <> pprAsmLabel platform lbl) $$ + op_ldr o1 (text ":lo12:__imp_" <> pprAsmLabel platform lbl) + + LDR _f o1 (OpImm (ImmCLbl lbl)) | isForeignLabel lbl -> + op_adrp o1 (pprAsmLabel platform lbl) $$ + op_add o1 (text ":lo12:" <> pprAsmLabel platform lbl) + + LDR _f o1 (OpImm (ImmCLbl lbl)) -> + op_adrp o1 (pprAsmLabel platform lbl) $$ + op_add o1 (text ":lo12:" <> pprAsmLabel platform lbl) + #else LDR _f o1 (OpImm (ImmIndex lbl' off)) | Just (_info, lbl) <- dynamicLinkerLabelInfo lbl' -> op_adrp o1 (text ":got:" <> pprAsmLabel platform lbl) $$ ===================================== compiler/GHC/Driver/Backend.hs ===================================== @@ -211,7 +211,7 @@ platformNcgSupported platform = if ArchX86_64 -> True ArchPPC -> True ArchPPC_64 {} -> True - ArchAArch64 -> platformOS platform /= OSMinGW32 + ArchAArch64 -> True ArchWasm32 -> True ArchRISCV64 -> True _ -> False ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -3588,6 +3588,14 @@ makeDynFlagsConsistent dflags , Nothing <- outputFile dflags = pgmError "--output must be specified when using --merge-objs" + | platformTablesNextToCode platform + && os == OSMinGW32 + && arch == ArchAArch64 + = case backendCodeOutput (backend dflags) of + LlvmCodeOutput -> pgmError "-fllvm is incompatible with enabled TablesNextToCode at Windows Aarch64" + NcgCodeOutput -> pgmError "-fasm is incompatible with enabled TablesNextToCode at Windows Aarch64" + _ -> (dflags, mempty) + | otherwise = (dflags, mempty) where loc = mkGeneralSrcSpan (fsLit "when making flags consistent") loop updated_dflags warning ===================================== utils/ghc-toolchain/exe/Main.hs ===================================== @@ -348,6 +348,7 @@ tablesNextToCodeSupported archOs = ArchPPC -> False ArchPPC_64 _ -> False ArchS390X -> False + ArchAArch64 -> archOS_OS archOs /= OSMinGW32 _ -> True determineTablesNextToCode View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d51b588c93b80d83aa25241e341fc22e6019262d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d51b588c93b80d83aa25241e341fc22e6019262d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:32:36 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 08:32:36 -0500 Subject: [Git][ghc/ghc][wip/T25647] fix up T23512a Message-ID: <67a4b9f4cc1a7_9220b16592d4820ba@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 8c08de98 by Patrick at 2025-02-06T21:32:28+08:00 fix up T23512a - - - - - 2 changed files: - compiler/GHC/Rename/Module.hs - testsuite/tests/rename/should_fail/T23512a.stderr Changes: ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -789,7 +789,7 @@ rnFamEqn doc atfi -- type instance F a b c = Either a b -- ^^^^^ lhs_loc = case map lhsTypeArgSrcSpan pats of - [] -> panic "rnFamEqn.lhs_loc" + [] -> getLocA tycon [loc] -> loc (loc:locs) -> loc `combineSrcSpans` last locs ===================================== testsuite/tests/rename/should_fail/T23512a.stderr ===================================== @@ -1,6 +1,3 @@ - T23512a.hs:6:31: error: [GHC-76037] Not in scope: type variable ‘j’ T23512a.hs:6:36: error: [GHC-76037] Not in scope: type variable ‘j’ - -T23512a.hs:9:20: error: [GHC-76037] Not in scope: type variable ‘k’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8c08de98d6dc757148a3315c37d9d6cfd06356bd -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8c08de98d6dc757148a3315c37d9d6cfd06356bd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:40:21 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 08:40:21 -0500 Subject: [Git][ghc/ghc][wip/T25647] add more examples to T25647b Message-ID: <67a4bbc578277_9220b1a0c00c8402f@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 10c832d1 by Patrick at 2025-02-06T21:39:56+08:00 add more examples to T25647b - - - - - 1 changed file: - testsuite/tests/typecheck/should_compile/T25647b.hs Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647b.hs ===================================== @@ -20,6 +20,21 @@ newtype Fix1a f = In1a (f (Fix1a f)) newtype Fix1b f where In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: (Type -> Type) -> Type +newtype Fix2 f where + In2 :: forall (ff :: Type -> Type). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix3 :: (Type -> Type) -> Type +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix4 :: (Type -> Type) -> Type +newtype Fix4 f where + In4 :: forall (ff :: Type -> Type). + ff (Fix4 ff) -> Fix4 ff -------------------- Data families with newtype instance ----------------- @@ -45,3 +60,6 @@ newtype instance Dix3 f = DIn3 (f (Dix3 f)) data family Dix5 :: (k -> TYPE r) -> k newtype instance Dix5 f = DIn5 (f (Dix5 f)) +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/10c832d19e3aa921ff97f01e5fde0e416fba49a0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/10c832d19e3aa921ff97f01e5fde0e416fba49a0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:44:11 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 08:44:11 -0500 Subject: [Git][ghc/ghc][wip/T18462] Multiplicity annotation on records Message-ID: <67a4bcabd2acd_9220b1d15bf4847f0@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 792dc955 by Sjoerd Visscher at 2025-02-06T14:44:02+01:00 Multiplicity annotation on records Add HsConFieldSpec - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/792dc955fcab09b4e17418da8fe4db5726e821e2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/792dc955fcab09b4e17418da8fe4db5726e821e2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:48:25 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Thu, 06 Feb 2025 08:48:25 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] hadrian: Bump directory bound to >=1.3.9 Message-ID: <67a4bda932815_9220b1b370e4852a5@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: 15ca7b2c by Andreas Klebinger at 2025-02-06T14:25:25+01:00 hadrian: Bump directory bound to >=1.3.9 Earlier versions of `directory` are racy on Windows due to #24382. - - - - - 4 changed files: - .gitlab/ci.sh - hadrian/cabal.project - hadrian/hadrian.cabal - hadrian/stack.yaml Changes: ===================================== .gitlab/ci.sh ===================================== @@ -7,7 +7,8 @@ set -Eeuo pipefail # Configuration: -HACKAGE_INDEX_STATE="2024-05-13T15:04:38Z" +# N.B. You may want to also update the index-state in hadrian/cabal.project. +HACKAGE_INDEX_STATE="2025-02-03T15:14:19Z" MIN_HAPPY_VERSION="1.20" MIN_ALEX_VERSION="3.2.6" ===================================== hadrian/cabal.project ===================================== @@ -3,7 +3,7 @@ packages: ./ ../libraries/ghc-platform/ -- This essentially freezes the build plan for hadrian --- It would be wise to keep this up to date with the state set in ci.sh +-- It would be wise to keep this up to date with the state set in .gitlab/ci.sh. index-state: 2025-02-03T15:14:19Z -- unordered-containers-0.2.20-r1 requires template-haskell < 2.22 ===================================== hadrian/hadrian.cabal ===================================== @@ -156,7 +156,10 @@ executable hadrian , base >= 4.11 && < 5 , bytestring >= 0.10 && < 0.13 , containers >= 0.5 && < 0.8 - , directory >= 1.3.1.0 && < 1.4 + + -- N.B. directory >=1.3.9 as earlier versions are + -- afflicted by #24382. + , directory >= 1.3.9.0 && < 1.4 , extra >= 1.4.7 , filepath , time ===================================== hadrian/stack.yaml ===================================== @@ -21,3 +21,10 @@ nix: extra-deps: - Cabal-3.10.1.0 - Cabal-syntax-3.10.1.0 + +# needed due to Hadrian's lower bound on directory +- directory-1.3.9.0 +- file-io-0.1.4 +- filepath-1.4.300.2 +- process-1.6.25.0 +- unix-2.8.5.1 \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/15ca7b2c06f9727b7a8c5ca663c3b6779489daa6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/15ca7b2c06f9727b7a8c5ca663c3b6779489daa6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:52:41 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 06 Feb 2025 08:52:41 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/symbol-cache-perf Message-ID: <67a4bea988784_9220b1dd164c8697@gitlab.mail> Matthew Pickering pushed new branch wip/symbol-cache-perf at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/symbol-cache-perf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:56:05 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 08:56:05 -0500 Subject: [Git][ghc/ghc][wip/T25647] add Dix6 to T25647_fail Message-ID: <67a4bf751dd3a_9220b202860c8852f@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: dec5bfda by Patrick at 2025-02-06T21:55:55+08:00 add Dix6 to T25647_fail - - - - - 2 changed files: - testsuite/tests/typecheck/should_compile/T25647_fail.hs - testsuite/tests/typecheck/should_compile/T25647_fail.stderr Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.hs ===================================== @@ -15,3 +15,7 @@ newtype Fix2 f :: TYPE r where type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r newtype Fix4a f where In4a :: ff (Fix4a ff) -> Fix4a ff + +data family Dix6 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix6 f where + DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.stderr ===================================== @@ -10,4 +10,14 @@ T25647_fail.hs:17:3: [GHC-89498] In4a :: forall (ff :: * -> *). ff (Fix4a @LiftedRep ff) -> Fix4a @LiftedRep ff In the definition of data constructor ‘In4a’ - In the newtype declaration for ‘Fix4a’ \ No newline at end of file + In the newtype declaration for ‘Fix4a’ + +T25647_fail.hs:21:3: [GHC-18872] + Couldn't match a lifted type with an unlifted type + When matching types + ff :: TYPE IntRep -> TYPE IntRep + f0 :: * -> TYPE IntRep + Expected: Dix6 f0 + Actual: Dix6 ff + In the result type of data constructor ‘DIn6’ + In the newtype family instance declaration for ‘Dix6’ \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dec5bfda539e865a8f9efe01c222564570c1adb5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dec5bfda539e865a8f9efe01c222564570c1adb5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 13:58:32 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 06 Feb 2025 08:58:32 -0500 Subject: [Git][ghc/ghc][wip/symbol-cache-perf] perf: Key the interpreter symbol cache by Name rather than FastString Message-ID: <67a4c008bdc25_9220b213df74930a@gitlab.mail> Matthew Pickering pushed to branch wip/symbol-cache-perf at Glasgow Haskell Compiler / GHC Commits: e94de04a by Matthew Pickering at 2025-02-06T13:58:11+00:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8 changed files: - compiler/GHC.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC.hs ===================================== @@ -420,7 +420,6 @@ import GHC.Types.Name.Ppr import GHC.Types.TypeEnv import GHC.Types.Breakpoint import GHC.Types.PkgQual -import GHC.Types.Unique.FM import GHC.Unit import GHC.Unit.Env as UnitEnv @@ -705,7 +704,7 @@ setTopSessionDynFlags :: GhcMonad m => DynFlags -> m () setTopSessionDynFlags dflags = do hsc_env <- getSession logger <- getLogger - lookup_cache <- liftIO $ newMVar emptyUFM + lookup_cache <- liftIO $ mkInterpSymbolCache -- Interpreter interp <- if ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -2,6 +2,7 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -12,7 +13,6 @@ module GHC.ByteCode.Linker ( linkBCO , lookupStaticPtr , lookupIE - , nameToCLabel , linkFail ) where @@ -26,7 +26,6 @@ import GHCi.ResolvedBCO import GHC.Builtin.PrimOps import GHC.Builtin.PrimOps.Ids -import GHC.Builtin.Names import GHC.Unit.Types @@ -43,8 +42,6 @@ import GHC.Types.Name.Env import qualified GHC.Types.Id as Id import GHC.Types.Unique.DFM -import Language.Haskell.Syntax.Module.Name - -- Standard libraries import Data.Array.Unboxed import Foreign.Ptr @@ -92,30 +89,30 @@ lookupLiteral interp pkgs_loaded le ptr = case ptr of lookupStaticPtr :: Interp -> FastString -> IO (Ptr ()) lookupStaticPtr interp addr_of_label_string = do - m <- lookupSymbol interp addr_of_label_string + m <- lookupSymbol interp (IFaststringSymbol addr_of_label_string) case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker: can't find label" - (unpackFS addr_of_label_string) + (ppr addr_of_label_string) lookupIE :: Interp -> PkgsLoaded -> ItblEnv -> Name -> IO (Ptr ()) lookupIE interp pkgs_loaded ie con_nm = case lookupNameEnv ie con_nm of Just (_, ItblPtr a) -> return (fromRemotePtr (castRemotePtr a)) Nothing -> do -- try looking up in the object files. - let sym_to_find1 = nameToCLabel con_nm "con_info" - m <- lookupHsSymbol interp pkgs_loaded con_nm "con_info" + let sym_to_find1 = IConInfoSymbol con_nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find1 case m of Just addr -> return addr Nothing -> do -- perhaps a nullary constructor? - let sym_to_find2 = nameToCLabel con_nm "static_info" - n <- lookupHsSymbol interp pkgs_loaded con_nm "static_info" + let sym_to_find2 = IStaticInfoSymbol con_nm + n <- lookupHsSymbol interp pkgs_loaded sym_to_find2 case n of Just addr -> return addr Nothing -> linkFail "GHC.ByteCode.Linker.lookupIE" - (unpackFS sym_to_find1 ++ " or " ++ - unpackFS sym_to_find2) + (ppr sym_to_find1 <> " or " <> + ppr sym_to_find2) -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode lookupAddr :: Interp -> PkgsLoaded -> AddrEnv -> Name -> IO (Ptr ()) @@ -123,21 +120,21 @@ lookupAddr interp pkgs_loaded ae addr_nm = do case lookupNameEnv ae addr_nm of Just (_, AddrPtr ptr) -> return (fromRemotePtr ptr) Nothing -> do -- try looking up in the object files. - let sym_to_find = nameToCLabel addr_nm "bytes" + let sym_to_find = IBytesSymbol addr_nm -- see Note [Bytes label] in GHC.Cmm.CLabel - m <- lookupHsSymbol interp pkgs_loaded addr_nm "bytes" + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker.lookupAddr" - (unpackFS sym_to_find) + (ppr sym_to_find) lookupPrimOp :: Interp -> PkgsLoaded -> PrimOp -> IO (RemotePtr ()) lookupPrimOp interp pkgs_loaded primop = do let sym_to_find = primopToCLabel primop "closure" - m <- lookupHsSymbol interp pkgs_loaded (Id.idName $ primOpId primop) "closure" + m <- lookupHsSymbol interp pkgs_loaded (IClosureSymbol (Id.idName $ primOpId primop)) case m of Just p -> return (toRemotePtr p) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" (text sym_to_find) resolvePtr :: Interp @@ -157,11 +154,11 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of | otherwise -> assertPpr (isExternalName nm) (ppr nm) $ do - let sym_to_find = nameToCLabel nm "closure" - m <- lookupHsSymbol interp pkgs_loaded nm "closure" + let sym_to_find = IClosureSymbol nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p)) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find) + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (ppr sym_to_find) BCOPtrPrimOp op -> ResolvedBCOStaticPtr <$> lookupPrimOp interp pkgs_loaded op @@ -176,11 +173,10 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of -- loaded units. -- -- See Note [Looking up symbols in the relevant objects]. -lookupHsSymbol :: Interp -> PkgsLoaded -> Name -> String -> IO (Maybe (Ptr ())) -lookupHsSymbol interp pkgs_loaded nm sym_suffix = do - massertPpr (isExternalName nm) (ppr nm) - let sym_to_find = nameToCLabel nm sym_suffix - pkg_id = moduleUnitId $ nameModule nm +lookupHsSymbol :: Interp -> PkgsLoaded -> InterpSymbol (Suffix s) -> IO (Maybe (Ptr ())) +lookupHsSymbol interp pkgs_loaded sym_to_find = do + massertPpr (isExternalName (interpSymbolName sym_to_find)) (ppr sym_to_find) + let pkg_id = moduleUnitId $ nameModule (interpSymbolName sym_to_find) loaded_dlls = maybe [] loaded_pkg_hs_dlls $ lookupUDFM pkgs_loaded pkg_id go (dll:dlls) = do @@ -194,12 +190,12 @@ lookupHsSymbol interp pkgs_loaded nm sym_suffix = do go loaded_dlls -linkFail :: String -> String -> IO a +linkFail :: String -> SDoc -> IO a linkFail who what = throwGhcExceptionIO (ProgramError $ unlines [ "",who , "During interactive linking, GHCi couldn't find the following symbol:" - , ' ' : ' ' : what + , ' ' : ' ' : showSDocUnsafe what , "This may be due to you not asking GHCi to load extra object files," , "archives or DLLs needed by your current session. Restart GHCi, specifying" , "the missing library using the -L/path/to/object/dir and -lmissinglibname" @@ -210,28 +206,8 @@ linkFail who what ]) -nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastStringByteString label - where - encodeZ = fastZStringToByteString . zEncodeFS - (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of - -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers - -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. - mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS - mod -> mod - packagePart = encodeZ (unitFS pkgKey) - modulePart = encodeZ (moduleNameFS modName) - occPart = encodeZ $ occNameMangledFS (nameOccName n) - - label = mconcat $ - [ packagePart `mappend` "_" | pkgKey /= mainUnit ] - ++ - [modulePart - , "_" - , occPart - , "_" - , fromString suffix - ] + + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2901,7 +2901,7 @@ jsCodeGen hsc_env srcspan i this_mod stg_binds_with_deps binding_id = do jsLinkObject logger tmpfs tmp_dir js_config unit_env inst out_obj roots -- look up "id_sym" closure and create a StablePtr (HValue) from it - href <- lookupClosure interp (unpackFS id_sym) >>= \case + href <- lookupClosure interp (IFaststringSymbol id_sym) >>= \case Nothing -> pprPanic "Couldn't find just linked TH closure" (ppr id_sym) Just r -> pure r ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -217,12 +217,12 @@ loadName interp hsc_env name = do case lookupNameEnv (closure_env (linker_env pls)) name of Just (_,aa) -> return (pls,(aa, links, pkgs)) Nothing -> assertPpr (isExternalName name) (ppr name) $ - do let sym_to_find = nameToCLabel name "closure" - m <- lookupClosure interp (unpackFS sym_to_find) + do let sym_to_find = IClosureSymbol name + m <- lookupClosure interp sym_to_find r <- case m of Just hvref -> mkFinalizedHValue interp hvref Nothing -> linkFail "GHC.Linker.Loader.loadName" - (unpackFS sym_to_find) + (ppr sym_to_find) return (pls,(r, links, pkgs)) loadDependencies @@ -909,7 +909,7 @@ dynLoadObjs interp hsc_env pls at LoaderState{..} objs = do m <- loadDLL interp soFile case m of Right _ -> return $! pls { temp_sos = (libPath, libName) : temp_sos } - Left err -> linkFail msg err + Left err -> linkFail msg (text err) where msg = "GHC.Linker.Loader.dynLoadObjs: Loading temp shared object failed" ===================================== compiler/GHC/Runtime/Interpreter.hs ===================================== @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} -- | Interacting with the iserv interpreter, whether it is running on an -- external process or in the current process. @@ -83,7 +84,6 @@ import GHC.Data.Maybe import GHC.Data.FastString import GHC.Types.SrcLoc -import GHC.Types.Unique.FM import GHC.Types.Basic import GHC.Utils.Panic @@ -116,6 +116,12 @@ import GHC.Stack.CCS (CostCentre,CostCentreStack) import System.Directory import System.Process +import GHC.Builtin.Names +import GHC.Types.Name + +-- Standard libraries +import GHC.Exts + {- Note [Remote GHCi] ~~~~~~~~~~~~~~~~~~ When the flag -fexternal-interpreter is given to GHC, interpreted code @@ -457,38 +463,65 @@ handleSeqHValueStatus interp unit_env eval_status = initObjLinker :: Interp -> IO () initObjLinker interp = interpCmd interp InitLinker -lookupSymbol :: Interp -> FastString -> IO (Maybe (Ptr ())) +lookupSymbol :: Interp -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbol interp str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) ExtWasm i -> withWasmInterp i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) -lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> FastString -> IO (Maybe (Ptr ())) +lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbolInDLL interp dll str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbolInDLL dll (unpackFS str)) + sendMessage inst (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) -- wasm dyld doesn't track which symbol comes from which .so ExtWasm {} -> lookupSymbol interp str -lookupClosure :: Interp -> String -> IO (Maybe HValueRef) +interpSymbolToCLabel :: forall s . InterpSymbol s -> FastString +interpSymbolToCLabel s = eliminateInterpSymbol s interpretedInterpSymbol $ \is -> + let + n = interpSymbolName is + suffix = interpSymbolSuffix is + + encodeZ = fastZStringToByteString . zEncodeFS + (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of + -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. + mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS + mod -> mod + packagePart = encodeZ (unitFS pkgKey) + modulePart = encodeZ (moduleNameFS modName) + occPart = encodeZ $ occNameMangledFS (nameOccName n) + + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix + ] + in mkFastStringByteString label + +lookupClosure :: Interp -> InterpSymbol s -> IO (Maybe HValueRef) lookupClosure interp str = - interpCmd interp (LookupClosure str) + interpCmd interp (LookupClosure (unpackFS (interpSymbolToCLabel str))) -- | 'withSymbolCache' tries to find a symbol in the 'interpLookupSymbolCache' -- which maps symbols to the address where they are loaded. @@ -496,7 +529,7 @@ lookupClosure interp str = -- a miss we run the action which determines the symbol's address and populate -- the cache with the answer. withSymbolCache :: Interp - -> FastString + -> InterpSymbol s -- ^ The symbol we are looking up in the cache -> IO (Maybe (Ptr ())) -- ^ An action which determines the address of the symbol we @@ -513,21 +546,19 @@ withSymbolCache interp str determine_addr = do -- The analysis in #23415 further showed this cache should also benefit the -- internal interpreter's loading times, and needn't be used by the external -- interpreter only. - cache <- readMVar (interpLookupSymbolCache interp) - case lookupUFM cache str of - Just p -> return (Just p) + cached_val <- lookupInterpSymbolCache str (interpSymbolCache interp) + case cached_val of + Just {} -> return cached_val Nothing -> do - maddr <- determine_addr case maddr of Nothing -> return Nothing Just p -> do - let upd_cache cache' = addToUFM cache' str p - modifyMVar_ (interpLookupSymbolCache interp) (pure . upd_cache) - return (Just p) + updateInterpSymbolCache str (interpSymbolCache interp) p + return maddr purgeLookupSymbolCache :: Interp -> IO () -purgeLookupSymbolCache interp = modifyMVar_ (interpLookupSymbolCache interp) (const (pure emptyUFM)) +purgeLookupSymbolCache interp = purgeInterpSymbolCache (interpSymbolCache interp) -- | loadDLL loads a dynamic library using the OS's native linker -- (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either ===================================== compiler/GHC/Runtime/Interpreter/Types.hs ===================================== @@ -1,4 +1,6 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} -- | Types used by the runtime interpreter module GHC.Runtime.Interpreter.Types @@ -10,6 +12,20 @@ module GHC.Runtime.Interpreter.Types , ExtInterpInstance (..) , ExtInterpState (..) , InterpStatus(..) + -- * InterpSymbolCache + , InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + + -- * IServ , IServ , IServConfig(..) @@ -30,9 +46,6 @@ import GHC.Linker.Types import GHCi.RemoteTypes import GHCi.Message ( Pipe ) -import GHC.Types.Unique.FM -import GHC.Data.FastString ( FastString ) -import Foreign import GHC.Platform import GHC.Utils.TmpFs @@ -42,6 +55,7 @@ import GHC.Unit.State import GHC.Unit.Types import GHC.StgToJS.Types import GHC.StgToJS.Linker.Types +import GHC.Runtime.Interpreter.Types.SymbolCache import Control.Concurrent import System.Process ( ProcessHandle, CreateProcess ) @@ -56,7 +70,7 @@ data Interp = Interp , interpLoader :: !Loader -- ^ Interpreter loader - , interpLookupSymbolCache :: !(MVar (UniqFM FastString (Ptr ()))) + , interpSymbolCache :: !InterpSymbolCache -- ^ LookupSymbol cache } ===================================== compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs ===================================== @@ -0,0 +1,142 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} + +-- | The SymbolCache is used to cache lookups for specific symbols when using +-- the interpreter. +module GHC.Runtime.Interpreter.Types.SymbolCache ( + InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + ) where + +import GHC.Prelude + +import GHC.Types.Unique.FM +import GHC.Types.Name +import GHC.Data.FastString +import Foreign + +import Control.Concurrent +import GHC.Utils.Outputable +import GHC.TypeLits + + +-- The symbols records the suffix which each cache deals with. +newtype SymbolCache (s :: Symbol) = SymbolCache { _getSymbolCache :: UniqFM Name (Ptr ()) } + +-- Each cache is keyed by Name, there is one cache for each type of symbol we will +-- potentially lookup. The caches are keyed by 'Name' so that it is not necessary to consult +-- a complicated `FastString` each time. +data InterpSymbolCache = InterpSymbolCache { + interpClosureCache :: MVar (SymbolCache "closure") + , interpConInfoCache :: MVar (SymbolCache "con_info") + , interpStaticInfoCache :: MVar (SymbolCache "static_info") + , interpBytesCache :: MVar (SymbolCache "bytes") + , interpFaststringCache :: MVar (UniqFM FastString (Ptr ())) + } + +data SuffixOrInterpreted = Suffix Symbol | Interpreted + +data InterpSymbol (s :: SuffixOrInterpreted) where + IClosureSymbol :: Name -> InterpSymbol (Suffix "closure") + IConInfoSymbol :: Name -> InterpSymbol (Suffix "con_info") + IStaticInfoSymbol :: Name -> InterpSymbol (Suffix "static_info") + IBytesSymbol :: Name -> InterpSymbol (Suffix "bytes") + IFaststringSymbol :: FastString -> InterpSymbol Interpreted + +instance Outputable (InterpSymbol s) where + ppr s = eliminateInterpSymbol s + (\(IFaststringSymbol s) -> text "interpreted:" <> ppr s) + (\s -> text (interpSymbolSuffix s) <> colon <> ppr (interpSymbolName s)) + +eliminateInterpSymbol :: InterpSymbol s -> (InterpSymbol Interpreted -> r) + -> (forall x . InterpSymbol (Suffix x) -> r) + -> r +eliminateInterpSymbol s k1 k2 = + case s of + IFaststringSymbol {} -> k1 s + IBytesSymbol {} -> k2 s + IStaticInfoSymbol {} -> k2 s + IConInfoSymbol {} -> k2 s + IClosureSymbol {} -> k2 s + + +interpSymbolName :: InterpSymbol (Suffix s) -> Name +interpSymbolName (IClosureSymbol n) = n +interpSymbolName (IConInfoSymbol n) = n +interpSymbolName (IStaticInfoSymbol n) = n +interpSymbolName (IBytesSymbol n) = n + +interpretedInterpSymbol :: InterpSymbol Interpreted -> FastString +interpretedInterpSymbol (IFaststringSymbol s) = s + +interpSymbolSuffix :: InterpSymbol (Suffix s) -> String +interpSymbolSuffix (IClosureSymbol {}) = "closure" +interpSymbolSuffix (IConInfoSymbol {}) = "con_info" +interpSymbolSuffix (IStaticInfoSymbol {}) = "static_info" +interpSymbolSuffix (IBytesSymbol {}) = "bytes" + +emptySymbolCache :: SymbolCache s +emptySymbolCache = SymbolCache emptyUFM + +lookupSymbolCache :: InterpSymbol (Suffix s) -> SymbolCache s -> Maybe (Ptr ()) +lookupSymbolCache s (SymbolCache cache) = lookupUFM cache (interpSymbolName s) + +insertSymbolCache :: InterpSymbol (Suffix s) -> Ptr () -> SymbolCache s -> SymbolCache s +insertSymbolCache s v (SymbolCache cache) = SymbolCache (addToUFM cache (interpSymbolName s) v) + +lookupInterpSymbolCache :: InterpSymbol s -> InterpSymbolCache -> IO (Maybe (Ptr ())) +lookupInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var -> (\cache -> lookupUFM cache f) <$> readMVar mvar_var) + (\s mvar_var -> lookupSymbolCache s <$> readMVar mvar_var) + + +updateInterpSymbolCache :: InterpSymbol s + -> InterpSymbolCache -> Ptr () -> IO () +updateInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ addToUFM cache f v)) + (\s mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ insertSymbolCache s v cache)) + +withInterpSymbolCache :: + (InterpSymbol Interpreted -> MVar (UniqFM FastString (Ptr ())) -> r) + -> (forall x . InterpSymbol (Suffix x) -> MVar (SymbolCache x) -> r) + -> InterpSymbol s + -> InterpSymbolCache + -> r +withInterpSymbolCache k1 k2 key InterpSymbolCache{..} = + case key of + IClosureSymbol {} -> k2 key interpClosureCache + IConInfoSymbol {} -> k2 key interpConInfoCache + IStaticInfoSymbol {} -> k2 key interpStaticInfoCache + IBytesSymbol {} -> k2 key interpBytesCache + IFaststringSymbol {} -> k1 key interpFaststringCache + +-- | Clear all symbol caches. +purgeInterpSymbolCache :: InterpSymbolCache -> IO () +purgeInterpSymbolCache (InterpSymbolCache a b c d e) = do + modifyMVar_ a (\_ -> do + modifyMVar_ b (\_ -> do + modifyMVar_ c (\_ -> do + modifyMVar_ d (\_ -> do + modifyMVar_ e (\_ -> pure emptyUFM) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + +mkInterpSymbolCache :: IO InterpSymbolCache +mkInterpSymbolCache = do + InterpSymbolCache <$> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptyUFM ===================================== compiler/ghc.cabal.in ===================================== @@ -699,6 +699,7 @@ Library GHC.Runtime.Interpreter.JS GHC.Runtime.Interpreter.Process GHC.Runtime.Interpreter.Types + GHC.Runtime.Interpreter.Types.SymbolCache GHC.Runtime.Interpreter.Wasm GHC.Runtime.Loader GHC.Runtime.Utils View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e94de04a9a4e5d4d3d14a3f73c1926470faf7cbf -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e94de04a9a4e5d4d3d14a3f73c1926470faf7cbf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 14:00:00 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 09:00:00 -0500 Subject: [Git][ghc/ghc][wip/T25647] 20 commits: interpreter: Always print unit and module name in BCO_NAME instruction Message-ID: <67a4c0607a8eb_9220b20fc98493685@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - d960d879 by Simon Peyton Jones at 2025-02-06T13:59:43+00:00 WIP towards #25267 - - - - - c7399d43 by Simon Peyton Jones at 2025-02-06T13:59:43+00:00 Wibbles - - - - - 06fe5c89 by Simon Peyton Jones at 2025-02-06T13:59:43+00:00 Default tyvars in data/newtype insnstances This is what fixes #25647 - - - - - dd1e8a1f by Simon Peyton Jones at 2025-02-06T13:59:43+00:00 wibbles Including fix for #25725 - - - - - 7401f532 by Simon Peyton Jones at 2025-02-06T13:59:43+00:00 Wibble - - - - - 2a43fc17 by Patrick at 2025-02-06T13:59:43+00:00 add more tests - - - - - 552684c2 by Patrick at 2025-02-06T13:59:43+00:00 Fix up T25611d with explicit kind annotation - - - - - df781af6 by Patrick at 2025-02-06T13:59:43+00:00 fix up T25647_fail - - - - - b96f5a99 by Patrick at 2025-02-06T13:59:43+00:00 cleanup whitespace - - - - - 81aa3efe by Patrick at 2025-02-06T13:59:43+00:00 fix up T23512a - - - - - 8d3f6768 by Patrick at 2025-02-06T13:59:43+00:00 add more examples to T25647b - - - - - af267833 by Patrick at 2025-02-06T13:59:43+00:00 add Dix6 to T25647_fail - - - - - 28 changed files: - .gitlab-ci.yml - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/Language/Haskell/Syntax/Decls.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/indexed-types/should_compile/T25611d.hs - testsuite/tests/rename/should_fail/T23512a.stderr - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - + testsuite/tests/typecheck/should_compile/T25647_fail.hs - + testsuite/tests/typecheck/should_compile/T25647_fail.stderr - + testsuite/tests/typecheck/should_compile/T25647a.hs - + testsuite/tests/typecheck/should_compile/T25647b.hs - + testsuite/tests/typecheck/should_compile/T25725.hs - testsuite/tests/typecheck/should_compile/all.T - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -909,7 +909,10 @@ test-primops-label: extends: .test-primops-validate-template rules: - if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/' - - *full-ci + # We do not use *.full-ci here since that would imply running in nightly + # where we do not have the normal validate jobs. We have the -nightly job + # below to handle this case. + - if: '$CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/' test-primops-nightly: extends: .test-primops ===================================== .gitlab/rel_eng/upload_ghc_libs.py ===================================== @@ -94,9 +94,23 @@ def prep_ghc(): build_copy_file(PACKAGES['ghc'], 'GHC/Settings/Config.hs') def prep_ghc_boot_th(): - # Drop ghc-internal from `hs-source-dirs` as Hackage rejects this + # Drop references to `ghc-internal` from `hs-source-dirs` as Hackage rejects + # out-of-sdist references and this packages is only uploaded for documentation + # purposes. modify_file(PACKAGES['ghc-boot-th'], 'ghc-boot-th.cabal', - lambda s: s.replace('../ghc-internal/src', '')) + lambda s: s.replace('../ghc-internal/src', '') + .replace('GHC.Internal.TH.Lib.Map', '') + .replace('GHC.Internal.TH.PprLib', '') + .replace('GHC.Internal.TH.Ppr', '') + .replace('GHC.Internal.TH.Lib,', '') + .replace('GHC.Internal.TH.Lib', '') + .replace('GHC.Internal.TH.Lift,', '') + .replace('GHC.Internal.TH.Quote,', '') + .replace('GHC.Internal.TH.Syntax', '') + .replace('GHC.Internal.ForeignSrcLang', '') + .replace('GHC.Internal.LanguageExtensions', '') + .replace('GHC.Internal.Lexeme', '') + ) PACKAGES = { pkg.name: pkg ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -8,7 +8,7 @@ -- | Bytecode assembler and linker module GHC.ByteCode.Asm ( - assembleBCOs, assembleOneBCO, + assembleBCOs, bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, @@ -34,7 +34,6 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon -import GHC.Data.FlatBag import GHC.Data.SizedSeq import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -53,7 +52,6 @@ import Data.Array.Base ( UArray(..) ) import Foreign hiding (shiftL, shiftR) import Data.Char ( ord ) -import Data.List ( genericLength ) import Data.Map.Strict (Map) import Data.Maybe (fromMaybe) import qualified Data.Map.Strict as Map @@ -168,15 +166,6 @@ mallocStrings interp ulbcos = do collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () - -assembleOneBCO :: Interp -> Profile -> ProtoBCO Name -> IO UnlinkedBCO -assembleOneBCO interp profile pbco = do - -- TODO: the profile should be bundled with the interpreter: the rts ways are - -- fixed for an interpreter - ubco <- assembleBCO (profilePlatform profile) pbco - UnitFlatBag ubco' <- mallocStrings interp (UnitFlatBag ubco) - return ubco' - assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm @@ -343,6 +332,7 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } + inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) inspectAsm platform long_jumps initial_offset = go (InspectState initial_offset 0 0 Map.empty) @@ -350,7 +340,7 @@ inspectAsm platform long_jumps initial_offset go s (NullAsm _) = (instrCount s, lblEnv s) go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + genericLength ls }) (k n) + go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) where n = litCount s go s (AllocLabel lbl k) = go s' k where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -210,9 +211,9 @@ linkFail who what nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastString label +nameToCLabel n suffix = mkFastStringByteString label where - encodeZ = zString . zEncodeFS + encodeZ = fastZStringToByteString . zEncodeFS (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. @@ -222,11 +223,14 @@ nameToCLabel n suffix = mkFastString label modulePart = encodeZ (moduleNameFS modName) occPart = encodeZ $ occNameMangledFS (nameOccName n) - label = concat - [ if pkgKey == mainUnit then "" else packagePart ++ "_" - , modulePart - , '_':occPart - , '_':suffix + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix ] ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -59,7 +59,8 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Id.Make ( realWorldPrimId ) import GHC.Types.Basic -import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName ) +import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName, OccName ) +import GHC.Types.Name.Occurrence (occNameString) import GHC.Types.SrcLoc ( SrcSpan(..), realSrcLocSpan, mkRealSrcLoc ) import GHC.Types.Literal import GHC.Types.Tickish @@ -70,6 +71,7 @@ import qualified Data.ByteString.Builder as BB import Data.ByteString.Builder.Prim import Control.Monad +import Data.List (intercalate) {- Note [CorePrep Overview] @@ -247,11 +249,11 @@ corePrepPgm logger cp_cfg pgm_cfg withTiming logger (text "CorePrep"<+>brackets (ppr this_mod)) (\a -> a `seqList` ()) $ do - us <- mkSplitUniqSupply 's' let initialCorePrepEnv = mkInitialCorePrepEnv cp_cfg - let - implicit_binds = mkDataConWorkers + us <- mkSplitUniqSupply 's' + + let implicit_binds = mkDataConWorkers (cpPgm_generateDebugInfo pgm_cfg) mod_loc data_tycons -- NB: we must feed mkImplicitBinds through corePrep too @@ -711,13 +713,13 @@ cpePair :: TopLevelFlag -> RecFlag -> Demand -> Levity -> UniqSM (Floats, CpeRhs) -- Used for all bindings -- The binder is already cloned, hence an OutId -cpePair top_lvl is_rec dmd lev env bndr rhs +cpePair top_lvl is_rec dmd lev env0 bndr rhs = assert (not (isJoinId bndr)) $ -- those should use cpeJoinPair do { (floats1, rhs1) <- cpeRhsE env rhs -- See if we are allowed to float this stuff out of the RHS ; let dec = want_float_from_rhs floats1 rhs1 - ; (floats2, rhs2) <- executeFloatDecision dec floats1 rhs1 + ; (floats2, rhs2) <- executeFloatDecision env dec floats1 rhs1 -- Make the arity match up ; (floats3, rhs3) @@ -725,7 +727,7 @@ cpePair top_lvl is_rec dmd lev env bndr rhs then return (floats2, cpeEtaExpand arity rhs2) else warnPprTrace True "CorePrep: silly extra arguments:" (ppr bndr) $ -- Note [Silly extra arguments] - (do { v <- newVar (idType bndr) + (do { v <- newVar env (idType bndr) ; let (float, v') = mkNonRecFloat env Lifted v rhs2 ; return ( snocFloat floats2 float , cpeEtaExpand arity (Var v')) }) @@ -735,6 +737,8 @@ cpePair top_lvl is_rec dmd lev env bndr rhs ; return (floats4, rhs4) } where + env = pushBinderContext bndr env0 + arity = idArity bndr -- We must match this arity want_float_from_rhs floats rhs @@ -967,36 +971,36 @@ cpeBodyNF env expr cpeBody :: CorePrepEnv -> CoreExpr -> UniqSM (Floats, CpeBody) cpeBody env expr = do { (floats1, rhs) <- cpeRhsE env expr - ; (floats2, body) <- rhsToBody rhs + ; (floats2, body) <- rhsToBody env rhs ; return (floats1 `appFloats` floats2, body) } -------- -rhsToBody :: CpeRhs -> UniqSM (Floats, CpeBody) +rhsToBody :: CorePrepEnv -> CpeRhs -> UniqSM (Floats, CpeBody) -- Remove top level lambdas by let-binding -rhsToBody (Tick t expr) +rhsToBody env (Tick t expr) | tickishScoped t == NoScope -- only float out of non-scoped annotations - = do { (floats, expr') <- rhsToBody expr + = do { (floats, expr') <- rhsToBody env expr ; return (floats, mkTick t expr') } -rhsToBody (Cast e co) +rhsToBody env (Cast e co) -- You can get things like -- case e of { p -> coerce t (\s -> ...) } - = do { (floats, e') <- rhsToBody e + = do { (floats, e') <- rhsToBody env e ; return (floats, Cast e' co) } -rhsToBody expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] +rhsToBody env expr@(Lam {}) -- See Note [No eta reduction needed in rhsToBody] | all isTyVar bndrs -- Type lambdas are ok = return (emptyFloats, expr) | otherwise -- Some value lambdas = do { let rhs = cpeEtaExpand (exprArity expr) expr - ; fn <- newVar (exprType rhs) + ; fn <- newVar env (exprType rhs) ; let float = Float (NonRec fn rhs) LetBound TopLvlFloatable ; return (unitFloat float, Var fn) } where (bndrs,_) = collectBinders expr -rhsToBody expr = return (emptyFloats, expr) +rhsToBody _env expr = return (emptyFloats, expr) {- Note [No eta reduction needed in rhsToBody] @@ -1168,7 +1172,7 @@ cpeApp top_env expr -- allocating CaseBound Floats for token and thing as needed = do { (floats1, token) <- cpeArg env topDmd token ; (floats2, thing) <- cpeBody env thing - ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar ty + ; case_bndr <- (`setIdUnfolding` evaldUnfolding) <$> newVar env ty ; let tup = mkCoreUnboxedTuple [token, Var case_bndr] ; let float = mkCaseFloat case_bndr thing ; return (floats1 `appFloats` floats2 `snocFloat` float, tup) } @@ -1577,7 +1581,7 @@ cpeArg env dmd arg ; let arg_ty = exprType arg1 lev = typeLevity arg_ty dec = wantFloatLocal NonRecursive dmd lev floats1 arg1 - ; (floats2, arg2) <- executeFloatDecision dec floats1 arg1 + ; (floats2, arg2) <- executeFloatDecision env dec floats1 arg1 -- Else case: arg1 might have lambdas, and we can't -- put them inside a wrapBinds @@ -1586,7 +1590,7 @@ cpeArg env dmd arg -- see Note [ANF-ising literal string arguments] ; if exprIsTrivial arg2 then return (floats2, arg2) - else do { v <- (`setIdDemandInfo` dmd) <$> newVar arg_ty + else do { v <- (`setIdDemandInfo` dmd) <$> newVar env arg_ty -- See Note [Pin demand info on floats] ; let arity = cpeArgArity env dec floats1 arg2 arg3 = cpeEtaExpand arity arg2 @@ -2424,13 +2428,13 @@ instance Outputable FloatDecision where ppr FloatNone = text "none" ppr FloatAll = text "all" -executeFloatDecision :: FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) -executeFloatDecision dec floats rhs +executeFloatDecision :: CorePrepEnv -> FloatDecision -> Floats -> CpeRhs -> UniqSM (Floats, CpeRhs) +executeFloatDecision env dec floats rhs = case dec of FloatAll -> return (floats, rhs) FloatNone | isEmptyFloats floats -> return (emptyFloats, rhs) - | otherwise -> do { (floats', body) <- rhsToBody rhs + | otherwise -> do { (floats', body) <- rhsToBody env rhs ; return (emptyFloats, wrapBinds floats $ wrapBinds floats' body) } -- FloatNone case: `rhs` might have lambdas, and we can't @@ -2569,6 +2573,8 @@ data CorePrepEnv , cpe_subst :: Subst -- ^ See Note [CorePrepEnv: cpe_subst] , cpe_rec_ids :: UnVarSet -- Faster OutIdSet; See Note [Speculative evaluation] + + , cpe_context :: [OccName] -- ^ See Note [Binder context] } mkInitialCorePrepEnv :: CorePrepConfig -> CorePrepEnv @@ -2576,6 +2582,7 @@ mkInitialCorePrepEnv cfg = CPE { cpe_config = cfg , cpe_subst = emptySubst , cpe_rec_ids = emptyUnVarSet + , cpe_context = [] } extendCorePrepEnv :: CorePrepEnv -> Id -> Id -> CorePrepEnv @@ -2616,6 +2623,14 @@ cpSubstCo :: CorePrepEnv -> Coercion -> Coercion cpSubstCo (CPE { cpe_subst = subst }) co = substCo subst co -- substCo has a short-cut if the TCvSubst is empty +-- | See Note [Binder context] +pushBinderContext :: Id -> CorePrepEnv -> CorePrepEnv +pushBinderContext ident env + | lengthAtLeast (cpe_context env) 2 + = env + | otherwise + = env { cpe_context = getOccName ident : cpe_context env} + ------------------------------------------------------------------------------ -- Cloning binders -- --------------------------------------------------------------------------- @@ -2704,10 +2719,20 @@ fiddleCCall id -- Generating new binders -- --------------------------------------------------------------------------- -newVar :: Type -> UniqSM Id -newVar ty - = seqType ty `seq` mkSysLocalOrCoVarM (fsLit "sat") ManyTy ty - +newVar :: CorePrepEnv -> Type -> UniqSM Id +newVar env ty + -- See Note [Binder context] + = seqType ty `seq` mkSysLocalOrCoVarM (fsLit occ) ManyTy ty + where occ = intercalate "_" (map occNameString $ cpe_context env) ++ "_sat" + +{- Note [Binder context] + ~~~~~~~~~~~~~~~~~~~~~ + To ensure that the compiled program (specifically symbol names) + remains understandable to the user we maintain a context + of binders that we are currently under. This allows us to give + identifiers conjured during CorePrep more contextually-meaningful + names. This is done in `newVar`. + -} ------------------------------------------------------------------------------ -- Floating ticks ===================================== compiler/GHC/Prelude/Basic.hs ===================================== @@ -25,6 +25,8 @@ module GHC.Prelude.Basic , shiftL, shiftR , setBit, clearBit , head, tail + + , strictGenericLength ) where @@ -130,3 +132,15 @@ head = Prelude.head tail :: HasCallStack => [a] -> [a] tail = Prelude.tail {-# INLINE tail #-} + +{- | +The 'genericLength' function defined in base can't be specialised due to the +NOINLINE pragma. + +It is also not strict in the accumulator, and strictGenericLength is not exported. + +See #25706 for why it is important to use a strict, specialised version. + +-} +strictGenericLength :: Num a => [x] -> a +strictGenericLength = fromIntegral . length ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -659,6 +659,7 @@ rnClsInstDecl (ClsInstDecl { cid_ext = (inst_warn_ps, _, _) rnFamEqn :: HsDocContext -> AssocTyFamInfo -> FamEqn GhcPs rhs + -> FreeKiTyVars -- Implicit binders of the rhs payload -> (HsDocContext -> rhs -> RnM (rhs', FreeVars)) -> RnM (FamEqn GhcRn rhs', FreeVars) rnFamEqn doc atfi @@ -666,7 +667,7 @@ rnFamEqn doc atfi , feqn_bndrs = outer_bndrs , feqn_pats = pats , feqn_fixity = fixity - , feqn_rhs = payload }) rn_payload + , feqn_rhs = payload }) payload_kvs rn_payload = do { tycon' <- lookupFamInstName mb_cls tycon -- all_imp_vars represent the implicitly bound type variables. This is @@ -697,7 +698,7 @@ rnFamEqn doc atfi -- -- For associated type family instances, exclude the type variables -- bound by the instance head with filterInScopeM (#19649). - ; all_imp_vars <- filterInScopeM $ pat_kity_vars + ; all_imp_vars <- filterInScopeM $ (pat_kity_vars ++ payload_kvs) ; bindHsOuterTyVarBndrs doc mb_cls all_imp_vars outer_bndrs $ \rn_outer_bndrs -> do { (pats', pat_fvs) <- rnLHsTypeArgs (FamPatCtx tycon) pats @@ -788,7 +789,7 @@ rnFamEqn doc atfi -- type instance F a b c = Either a b -- ^^^^^ lhs_loc = case map lhsTypeArgSrcSpan pats of - [] -> panic "rnFamEqn.lhs_loc" + [] -> getLocA tycon [loc] -> loc (loc:locs) -> loc `combineSrcSpans` last locs @@ -847,8 +848,9 @@ rnTyFamInstEqn :: AssocTyFamInfo -> TyFamInstEqn GhcPs -> RnM (TyFamInstEqn GhcRn, FreeVars) rnTyFamInstEqn atfi eqn@(FamEqn { feqn_tycon = tycon }) - = rnFamEqn (TySynCtx tycon) atfi eqn rnTySyn - + = rnFamEqn (TySynCtx tycon) atfi eqn + [{- No implicit vars on RHS of a type instance -}] + rnTySyn rnTyFamDefltDecl :: Name -> TyFamDefltDecl GhcPs @@ -859,9 +861,9 @@ rnDataFamInstDecl :: AssocTyFamInfo -> DataFamInstDecl GhcPs -> RnM (DataFamInstDecl GhcRn, FreeVars) rnDataFamInstDecl atfi (DataFamInstDecl { dfid_eqn = - eqn@(FamEqn { feqn_tycon = tycon })}) - = do { (eqn', fvs) <- - rnFamEqn (TyDataCtx tycon) atfi eqn rnDataDefn + eqn@(FamEqn { feqn_tycon = tycon, feqn_rhs = defn })}) + = do { let implicit_kvs = extractDataDefnKindVars defn + ; (eqn', fvs) <- rnFamEqn (TyDataCtx tycon) atfi eqn implicit_kvs rnDataDefn ; return (DataFamInstDecl { dfid_eqn = eqn' }, fvs) } -- Renaming of the associated types in instances. ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry -import Data.List ( genericReplicate, genericLength, intersperse +import Data.List ( genericReplicate, intersperse , partition, scanl', sortBy, zip4, zip6 ) import Foreign hiding (shiftL, shiftR) import Control.Monad @@ -240,11 +240,12 @@ ppBCEnv p -- Create a BCO and do a spot of peephole optimisation on the insns -- at the same time. mkProtoBCO - :: (Outputable name) - => Platform - -> Bool -- ^ True <=> label with @BCO_NAME@ instruction - -- see Note [BCO_NAME] - -> name + :: + Platform + -> Maybe Module + -- ^ Just cur_mod <=> label with @BCO_NAME@ instruction + -- see Note [BCO_NAME] + -> Name -> BCInstrList -> Either [CgStgAlt] (CgStgRhs) -- ^ original expression; for debugging only @@ -253,7 +254,7 @@ mkProtoBCO -> [StgWord] -- ^ bitmap -> Bool -- ^ True <=> is a return point, rather than a function -> [FFIInfo] - -> ProtoBCO name + -> ProtoBCO Name mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bitmap is_ret ffis = ProtoBCO { protoBCOName = nm, @@ -267,9 +268,9 @@ mkProtoBCO platform _add_bco_name nm instrs_ordlist origin arity bitmap_size bit where #if MIN_VERSION_rts(1,0,3) maybe_add_bco_name instrs - | _add_bco_name = BCO_NAME str : instrs - where - str = BS.pack $ showSDocOneLine defaultSDocContext (ppr nm) + | Just cur_mod <- _add_bco_name = + let str = BS.pack $ showSDocOneLine defaultSDocContext (pprFullName cur_mod nm) + in BCO_NAME str : instrs #endif maybe_add_bco_name instrs = instrs @@ -393,7 +394,7 @@ schemeR_wrk fvs nm original_body (args, body) -- make the arg bitmap bits = argBits platform (reverse (map (idArgRep platform) all_args)) - bitmap_size = genericLength bits + bitmap_size = strictGenericLength bits bitmap = mkBitmap platform bits body_code <- schemeER_wrk sum_szsb_args p_init body @@ -607,7 +608,7 @@ schemeE d s p (StgLet _ext binds body) = do platform <- targetPlatform <$> getDynFlags let (xs,rhss) = case binds of StgNonRec x rhs -> ([x],[rhs]) StgRec xs_n_rhss -> unzip xs_n_rhss - n_binds = genericLength xs + n_binds = strictGenericLength xs fvss = map (fvsToEnv p') rhss @@ -616,7 +617,7 @@ schemeE d s p (StgLet _ext binds body) = do sizes = map (\rhs_fvs -> sum (map size_w rhs_fvs)) fvss -- the arity of each rhs - arities = map (genericLength . fst . collect) rhss + arities = map (strictGenericLength . fst . collect) rhss -- This p', d' defn is safe because all the items being pushed -- are ptrs, so all have size 1 word. d' and p' reflect the stack @@ -1398,7 +1399,7 @@ Note [unboxed tuple bytecodes and tuple_BCO] tupleBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name tupleBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1419,7 +1420,7 @@ tupleBCO platform args_info args = primCallBCO :: Platform -> NativeCallInfo -> [(PrimRep, ByteOff)] -> [FFIInfo] -> ProtoBCO Name primCallBCO platform args_info args = - mkProtoBCO platform False invented_name body_code (Left []) + mkProtoBCO platform Nothing invented_name body_code (Left []) 0{-no arity-} bitmap_size bitmap False{-is alts-} where {- @@ -1857,7 +1858,7 @@ implement_tagToId implement_tagToId d s p arg names = assert (notNull names) $ do (push_arg, arg_bytes) <- pushAtom d p (StgVarArg arg) - labels <- getLabelsBc (genericLength names) + labels <- getLabelsBc (strictGenericLength names) label_fail <- getLabelBc label_exit <- getLabelBc dflags <- getDynFlags @@ -2359,8 +2360,12 @@ getHscEnv = BcM $ \st -> return (st, bcm_hsc_env st) getProfile :: BcM Profile getProfile = targetProfile <$> getDynFlags -shouldAddBcoName :: BcM Bool -shouldAddBcoName = gopt Opt_AddBcoName <$> getDynFlags +shouldAddBcoName :: BcM (Maybe Module) +shouldAddBcoName = do + add <- gopt Opt_AddBcoName <$> getDynFlags + if add + then Just <$> getCurrentModule + else return Nothing emitBc :: ([FFIInfo] -> ProtoBCO Name) -> BcM (ProtoBCO Name) emitBc bco ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -3141,7 +3141,7 @@ tcDataDefn err_ctxt roles_info tc_name -- via inferInitialKinds , dd_cons = cons , dd_derivs = derivs }) - = bindTyClTyVars tc_name $ \ tc_bndrs res_kind -> + = bindTyClTyVars tc_name $ \ tc_bndrs tc_res_kind -> -- The TyCon tyvars must scope over -- - the stupid theta (dd_ctxt) -- - for H98 constructors only, the ConDecl @@ -3152,18 +3152,18 @@ tcDataDefn err_ctxt roles_info tc_name ; tcg_env <- getGblEnv ; let hsc_src = tcg_src tcg_env ; unless (mk_permissive_kind hsc_src cons) $ - checkDataKindSig (DataDeclSort (dataDefnConsNewOrData cons)) res_kind + checkDataKindSig (DataDeclSort (dataDefnConsNewOrData cons)) tc_res_kind - ; stupid_tc_theta <- pushLevelAndSolveEqualities skol_info tc_bndrs $ + ; tc_stupid_theta <- pushLevelAndSolveEqualities skol_info tc_bndrs $ tcHsContext ctxt -- See Note [Error on unconstrained meta-variables] in GHC.Tc.Utils.TcMType -- Example: (typecheck/should_fail/T17567StupidTheta) -- data (forall a. a b ~ a c) => T b c -- The kind of 'a' is unconstrained. - ; dvs <- candidateQTyVarsOfTypes stupid_tc_theta + ; dvs <- candidateQTyVarsOfTypes tc_stupid_theta ; let err_ctx tidy_env - = do { (tidy_env2, theta) <- zonkTidyTcTypes tidy_env stupid_tc_theta + = do { (tidy_env2, theta) <- zonkTidyTcTypes tidy_env tc_stupid_theta ; return (tidy_env2, UninfTyCtx_DataContext theta) } ; doNotQuantifyTyVars dvs err_ctx @@ -3177,12 +3177,12 @@ tcDataDefn err_ctxt roles_info tc_name ; (bndrs, stupid_theta, res_kind) <- initZonkEnv NoFlexi $ runZonkBndrT (zonkTyVarBindersX tc_bndrs) $ \ bndrs -> - do { stupid_theta <- zonkTcTypesToTypesX stupid_tc_theta - ; res_kind <- zonkTcTypeToTypeX res_kind + do { stupid_theta <- zonkTcTypesToTypesX tc_stupid_theta + ; res_kind <- zonkTcTypeToTypeX tc_res_kind ; return (bndrs, stupid_theta, res_kind) } ; tycon <- fixM $ \ rec_tycon -> do - { data_cons <- tcConDecls DDataType rec_tycon tc_bndrs res_kind cons + { data_cons <- tcConDecls DDataType rec_tycon tc_bndrs tc_res_kind cons ; tc_rhs <- mk_tc_rhs hsc_src rec_tycon data_cons ; tc_rep_nm <- newTyConRepName tc_name @@ -3360,24 +3360,52 @@ So, we use bindOuterFamEqnTKBndrs (which does not create an implication for the telescope), and generalise over /all/ the variables in the LHS, without treating the explicitly-quantified ones specially. Wrinkles: - - When generalising, include the explicit user-specified forall'd +(GT1) When generalising, include the explicit user-specified forall'd variables, so that we get an error from Validity.checkFamPatBinders if a forall'd variable is not bound on the LHS - - We still want to complain about a bad telescope among the user-specified +(GT2) We still want to complain about a bad telescope among the user-specified variables. So in checkFamTelescope we emit an implication constraint quantifying only over them, purely so that we get a good telescope error. - - Note that, unlike a type signature like +(GT3) Note that, unlike a type signature like f :: forall (a::k). blah we do /not/ care about the Inferred/Specified designation or order for the final quantified tyvars. Type-family instances are not invoked directly in Haskell source code, so visible type application etc plays no role. -See also Note [Re-quantify type variables in rules] in -GHC.Tc.Gen.Rule, which explains a /very/ similar design when -generalising over the type of a rewrite rule. +(GT4) Consider #25647 (with UnliftedNewtypes) + type N :: forall r. (TYPE r -> TYPE r) -> TYPE r + newtype N f where { MkN :: ff (N ff) -> N ff } + When kind-checking the type signature for MkN we'll start wtih + ff :: TYPE kappa -> TYPE kappa + MkN :: ff (N @kappa) ff -> N @kappa ff + Then we generalise /and default the RuntimeRep variable kappa/ + (via `kindGeneralizeAll` in `tcConDecl`), thus kappa := LiftedRep + + But now the newtype looks like a GADT and we get an error + A newtype must not be a GADT + + This seems OK. We are just following the rules. + + But this variant (the original report in #25647) + data family Fix2 :: (k -> Type) -> k + newtype instance Fix2 f where { In2 :: f (Fix2 f) -> Fix2 f } + At the `newtype instance`, we first + 1. Find the kind of the newtype instance in `tcDataFamInstHeader` + 2. Typecheck the newtype definitition itself in `tcConDecl` + In step 1 we do /not/ want to get + newtype instance forall r . Fix2 (f :: TYPE r -> TYPE r) :: TYPE r where + If we do, we'll get that same "newtype must not be GADT" error as for N above. + Rather, we want to default the RuntimeRep variable r := LiftedRep. Hence + the use of `DefaultNonStandardTyVars` in `tcDataFamInstHeader`. The key thing + is that we must make the /same/ choice here as we do in kind-checking the data + constructor's type. + +See also Note [Re-quantify type variables in rules] in GHC.Tc.Gen.Rule, which +explains a /very/ similar design when generalising over the type of a rewrite +rule. -} @@ -3753,23 +3781,30 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs res_kind tag_map ; return (NE.singleton dc) } -tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map - -- NB: don't use res_kind here, as it's ill-scoped. Instead, +tcConDecl new_or_data dd_info rep_tycon tc_bndrs _tc_res_kind tag_map + -- NB: don't use _tc_res_kind here, as it's ill-scoped. Instead, -- we get the res_kind by typechecking the result type. (ConDeclGADT { con_names = names , con_bndrs = L _ outer_hs_bndrs , con_mb_cxt = cxt, con_g_args = hs_args , con_res_ty = hs_res_ty }) = addErrCtxt (DataConDefCtxt names) $ - do { traceTc "tcConDecl 1 gadt" (ppr names) + do { traceTc "tcConDecl 1 gadt" (ppr names $$ ppr _tc_res_kind) ; let L _ name :| _ = names ; skol_info <- mkSkolemInfo (DataConSkol name) - ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts))) + ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind))) <- pushLevelAndSolveEqualitiesX "tcConDecl:GADT" $ tcOuterTKBndrs skol_info outer_hs_bndrs $ do { ctxt <- tcHsContext cxt + ; (res_ty, res_kind) <- tcInferLHsTypeKind hs_res_ty - -- See Note [GADT return kinds] + -- See Note [GADT return kinds] + + -- See Note [Datatype return kinds] + ; let exp_kind = getArgExpKind new_or_data res_kind + ; btys <- tcConGADTArgs exp_kind hs_args + + ; traceTc "tcConDecl 1a gadt" (ppr res_ty <+> dcolon <+> ppr res_kind) -- For data instances (only), ensure that the return type, -- res_ty, is a substitution instance of the header. @@ -3784,13 +3819,9 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map addErrCtxt (DataConResTyCtxt names) $ unifyType Nothing res_ty head_shape } - -- See Note [Datatype return kinds] - ; let exp_kind = getArgExpKind new_or_data res_kind - ; btys <- tcConGADTArgs exp_kind hs_args - ; let (arg_tys, stricts) = unzip btys ; field_lbls <- lookupConstructorFields name - ; return (ctxt, arg_tys, res_ty, field_lbls, stricts) + ; return (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind) } ; outer_bndrs <- scopedSortOuter outer_bndrs @@ -3801,7 +3832,10 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map tcMkPhiTy ctxt $ tcMkScaledFunTys arg_tys $ res_ty) - ; traceTc "tcConDecl:GADT" (ppr names $$ ppr res_ty $$ ppr tkvs) + ; traceTc "tcConDecl:GADT" (vcat [ text "names:" <+> ppr names + , text "tkvs:" <+> ppr tkvs + , text "res_ty:" <+> ppr res_ty + , text "res_kind:" <+> ppr res_kind ]) ; reportUnsolvedEqualities skol_info tkvs tclvl wanted ; let tvbndrs = mkTyVarBinders InferredSpec tkvs ++ outer_tv_bndrs ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -790,10 +790,10 @@ tcDataFamInstDecl mb_clsinfo tv_skol_env , text "eta_tcbs" <+> ppr eta_tcbs ] ; (rep_tc, (axiom, ax_rhs)) <- fixM $ \ ~(rec_rep_tc, _) -> do { data_cons <- tcExtendTyVarEnv (binderVars tc_ty_binders) $ - -- For H98 decls, the tyvars scope - -- over the data constructors - tcConDecls (DDataInstance orig_res_ty) rec_rep_tc tc_ty_binders tc_res_kind - hs_cons + -- tcExtendTyVarEnv: for H98 decls, the tyvars + -- scope over the data constructors + tcConDecls (DDataInstance orig_res_ty) rec_rep_tc + tc_ty_binders tc_res_kind hs_cons ; rep_tc_name <- newFamInstTyConName lfam_name pats ; axiom_name <- newFamInstAxiomName lfam_name [pats] @@ -943,11 +943,6 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- with its parent class ; addConsistencyConstraints mb_clsinfo lhs_ty - -- Add constraints from the data constructors - -- Fix #25611 - -- See DESIGN CHOICE in Note [Kind inference for data family instances] - ; when is_H98_or_newtype $ kcConDecls lhs_applied_kind hs_cons - -- Check that the result kind of the TyCon applied to its args -- is compatible with the explicit signature (or Type, if there -- is none) @@ -956,6 +951,11 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity ; res_kind <- tc_kind_sig m_ksig ; _ <- unifyKind (Just . HsTypeRnThing $ unLoc hs_lhs) lhs_applied_kind res_kind + -- Add constraints from the data constructors + -- Fix #25611 + -- See DESIGN CHOICE in Note [Kind inference for data family instances] + ; when is_H98_or_newtype $ kcConDecls lhs_applied_kind hs_cons + ; traceTc "tcDataFamInstHeader" $ vcat [ ppr fam_tc, ppr m_ksig, ppr lhs_applied_kind, ppr res_kind, ppr m_ksig] ; return ( stupid_theta @@ -975,7 +975,10 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs + -- DefaultNonStandardTyVars: see (GT4) in + -- GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] + ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] @@ -999,7 +1002,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- Split up the LHS type to get the type patterns -- For the scopedSort see Note [Generalising in tcTyFamInstEqnGuts] - ; let pats = unravelFamInstPats lhs_ty + ; let pats = unravelFamInstPats lhs_ty ; return (final_tvs, mkVarSet non_user_tvs, pats, master_res_kind, stupid_theta) } where ===================================== compiler/Language/Haskell/Syntax/Decls.hs ===================================== @@ -809,9 +809,11 @@ data HsDataDefn pass -- The payload of a data type defn -- *and* for data family instances = -- | Declares a data type or newtype, giving its constructors -- @ - -- data/newtype T a = - -- data/newtype instance T [a] = + -- data/newtype T a :: ksig = + -- data/newtype instance T [a] :: ksig = -- @ + -- The HsDataDefn describes the (optional) kind signature and the + -- but not the `data T a` or `newtype T [a]` headers HsDataDefn { dd_ext :: XCHsDataDefn pass, dd_ctxt :: Maybe (LHsContext pass), -- ^ Context dd_cType :: Maybe (XRec pass CType), ===================================== libraries/ghc-boot/GHC/Data/SizedSeq.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving, DeriveGeneric, CPP #-} module GHC.Data.SizedSeq ( SizedSeq(..) , emptySS @@ -11,9 +11,12 @@ module GHC.Data.SizedSeq import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary -import Data.List (genericLength) import GHC.Generics +#if ! MIN_VERSION_base(4,20,0) +import Data.List (foldl') +#endif + data SizedSeq a = SizedSeq {-# UNPACK #-} !Word [a] deriving (Generic, Show) @@ -37,9 +40,9 @@ emptySS = SizedSeq 0 [] addToSS :: SizedSeq a -> a -> SizedSeq a addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) +-- NB, important this is eta-expand so that foldl' is inlined. addListToSS :: SizedSeq a -> [a] -> SizedSeq a -addListToSS (SizedSeq n r_xs) xs - = SizedSeq (n + genericLength xs) (reverse xs ++ r_xs) +addListToSS s xs = foldl' addToSS s xs ssElts :: SizedSeq a -> [a] ssElts (SizedSeq _ r_xs) = reverse r_xs ===================================== testsuite/tests/core-to-stg/T14895.stderr ===================================== @@ -11,10 +11,10 @@ T14895.go GHC.Internal.Data.Either.Left e [Occ=Once1] -> wild; GHC.Internal.Data.Either.Right a1 [Occ=Once1] -> let { - sat [Occ=Once1] :: b + go_sat [Occ=Once1] :: b [LclId] = {a1, f} \u [] f a1; - } in GHC.Internal.Data.Either.Right [sat]; + } in GHC.Internal.Data.Either.Right [go_sat]; }; ===================================== testsuite/tests/core-to-stg/T24124.stderr ===================================== @@ -9,16 +9,16 @@ T24124.testFun1 T24124.StrictPair a b #) [GblId, Arity=3, Str=, Cpr=1, Unf=OtherCon []] = {} \r [x y void] - case x of sat { + case x of testFun1_sat { __DEFAULT -> case case y of y [OS=OneShot] { - __DEFAULT -> T24124.MkStrictPair [sat y]; + __DEFAULT -> T24124.MkStrictPair [testFun1_sat y]; } of - sat + testFun1_sat { - __DEFAULT -> GHC.Internal.Types.MkSolo# [sat]; + __DEFAULT -> GHC.Internal.Types.MkSolo# [testFun1_sat]; }; }; ===================================== testsuite/tests/ghci/should_run/T21052.stdout ===================================== @@ -4,9 +4,9 @@ BCO_toplevel :: GHC.Internal.Types.IO [GHC.Internal.Types.Any] [LclIdX] = {} \u [] let { - sat :: [GHC.Internal.Types.Any] + _sat :: [GHC.Internal.Types.Any] [LclId, Unf=OtherCon []] = :! [GHC.Internal.Tuple.() GHC.Internal.Types.[]]; - } in GHC.Internal.Base.returnIO sat; + } in GHC.Internal.Base.returnIO _sat; ===================================== testsuite/tests/indexed-types/should_compile/T25611d.hs ===================================== @@ -20,7 +20,7 @@ data instance T p q where MkkV :: forall l. l Int# -> T l Int# type N :: TYPE r -> TYPE r -newtype N a = MkN a +newtype N (a::TYPE r) = MkN a f :: Int# -> N Int# f x = MkN x @@ -29,7 +29,7 @@ g :: Int -> N Int g x = MkN x data family D :: Type -> k -> k -newtype instance D Int a = MkD a +newtype instance D Int (a::TYPE r) = MkD a f1 :: Int# -> D Int Int# f1 x = MkD x ===================================== testsuite/tests/rename/should_fail/T23512a.stderr ===================================== @@ -1,6 +1,3 @@ - T23512a.hs:6:31: error: [GHC-76037] Not in scope: type variable ‘j’ T23512a.hs:6:36: error: [GHC-76037] Not in scope: type variable ‘j’ - -T23512a.hs:9:20: error: [GHC-76037] Not in scope: type variable ‘k’ ===================================== testsuite/tests/simplCore/should_compile/T20040.stderr ===================================== @@ -16,7 +16,9 @@ ifoldl' = Cons ipv2 ipv3 -> case z of z1 { __DEFAULT -> - case f z1 ipv2 of sat { __DEFAULT -> ifoldl' f sat ipv3; }; + case f z1 ipv2 of ifoldl'_sat { + __DEFAULT -> ifoldl' f ifoldl'_sat ipv3; + }; }; }; end Rec } ===================================== testsuite/tests/simplCore/should_compile/T23083.stderr ===================================== @@ -13,10 +13,10 @@ T23083.g :: ((GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer T23083.g = \ (f [Occ=Once1!] :: (GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> GHC.Internal.Bignum.Integer.Integer) (h [Occ=OnceL1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer) -> let { - sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer + g_sat [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer -> GHC.Internal.Bignum.Integer.Integer [LclId, Unf=OtherCon []] - sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in - f sat + g_sat = \ (eta [Occ=Once1] :: GHC.Internal.Bignum.Integer.Integer) -> case h of h1 [Occ=Once1] { __DEFAULT -> T23083.$$ @GHC.Internal.Bignum.Integer.Integer @GHC.Internal.Bignum.Integer.Integer h1 eta } } in + f g_sat -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T23083.$trModule4 :: GHC.Prim.Addr# ===================================== testsuite/tests/simplStg/should_compile/T15226b.stderr ===================================== @@ -8,13 +8,13 @@ T15226b.bar1 T15226b.Str (GHC.Internal.Maybe.Maybe a) #) [GblId, Arity=2, Str=, Cpr=1(, 1), Unf=OtherCon []] = {} \r [x void] - case x of sat { + case x of bar1_sat { __DEFAULT -> let { - sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) + bar1_sat [Occ=Once1] :: T15226b.Str (GHC.Internal.Maybe.Maybe a) [LclId, Unf=OtherCon []] = - T15226b.Str! [sat]; - } in GHC.Internal.Types.MkSolo# [sat]; + T15226b.Str! [bar1_sat]; + } in GHC.Internal.Types.MkSolo# [bar1_sat]; }; T15226b.bar ===================================== testsuite/tests/simplStg/should_compile/T19717.stderr ===================================== @@ -6,14 +6,14 @@ Foo.f :: forall {a}. a -> [GHC.Internal.Maybe.Maybe a] case x of x1 { __DEFAULT -> let { - sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a + f_sat [Occ=Once1] :: GHC.Internal.Maybe.Maybe a [LclId, Unf=OtherCon []] = GHC.Internal.Maybe.Just! [x1]; } in let { - sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] + f_sat [Occ=Once1] :: [GHC.Internal.Maybe.Maybe a] [LclId, Unf=OtherCon []] = - :! [sat GHC.Internal.Types.[]]; - } in : [sat sat]; + :! [f_sat GHC.Internal.Types.[]]; + } in : [f_sat f_sat]; }; ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.hs ===================================== @@ -0,0 +1,21 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647_fail where + +import GHC.Exts +import Data.Kind + +-- Rejected because in the type signature for In2 we default +-- the runtime-rep variable to LiftedRep, and that makes In2 +-- into a GADT +newtype Fix2 f :: TYPE r where + In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff + +-- Rejected for the same reason +type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4a f where + In4a :: ff (Fix4a ff) -> Fix4a ff + +data family Dix6 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix6 f where + DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.stderr ===================================== @@ -0,0 +1,23 @@ +T25647_fail.hs:12:4: [GHC-89498] + A newtype must not be a GADT + In2 :: forall (ff :: * -> *). + ff (Fix2 @LiftedRep ff) -> Fix2 @LiftedRep ff + In the definition of data constructor ‘In2’ + In the newtype declaration for ‘Fix2’ + +T25647_fail.hs:17:3: [GHC-89498] + A newtype must not be a GADT + In4a :: forall (ff :: * -> *). + ff (Fix4a @LiftedRep ff) -> Fix4a @LiftedRep ff + In the definition of data constructor ‘In4a’ + In the newtype declaration for ‘Fix4a’ + +T25647_fail.hs:21:3: [GHC-18872] + Couldn't match a lifted type with an unlifted type + When matching types + ff :: TYPE IntRep -> TYPE IntRep + f0 :: * -> TYPE IntRep + Expected: Dix6 f0 + Actual: Dix6 ff + In the result type of data constructor ‘DIn6’ + In the newtype family instance declaration for ‘Dix6’ \ No newline at end of file ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -0,0 +1,72 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647a where + +import GHC.Exts +import Data.Kind + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r +newtype Fix2 f :: TYPE r where + In2 :: forall r (ff :: TYPE r -> TYPE r). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f +type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f +type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4 f where + In4 :: forall rr (ff :: TYPE rr -> TYPE rr). + ff (Fix4 ff) -> Fix4 @rr ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in GADT syntax +-- The newtype instance defaults to LiftedRep +data family Dix4 :: (k -> TYPE r) -> k +newtype instance Dix4 f where + DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +-- -- newtype instance that is not TYPE 'LiftedRep +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff + + ===================================== testsuite/tests/typecheck/should_compile/T25647b.hs ===================================== @@ -0,0 +1,65 @@ +{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647b where + +import GHC.Exts +import Data.Kind + +--------------------------- +-- without UnliftedNewtypes +--------------------------- + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: (Type -> Type) -> Type +newtype Fix2 f where + In2 :: forall (ff :: Type -> Type). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix3 :: (Type -> Type) -> Type +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix4 :: (Type -> Type) -> Type +newtype Fix4 f where + In4 :: forall (ff :: Type -> Type). + ff (Fix4 ff) -> Fix4 ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/typecheck/should_compile/T25725.hs ===================================== @@ -0,0 +1,17 @@ +{-# LANGUAGE TypeFamilies, PolyKinds #-} + +module T25725 where + +import Data.Kind +import GHC.Exts + +--This one was OK +data D :: TYPE r -> Type where + MkD :: p -> D p + +-- But this was rejected +data family Dix4 :: Type -> k +data instance Dix4 Int :: TYPE r -> Type where + DIn4 :: p -> Dix4 Int p + + ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -933,3 +933,6 @@ test('T25266', normal, compile, ['']) test('T25266a', normal, compile_fail, ['']) test('T25266b', normal, compile, ['']) test('T25597', normal, compile, ['']) +test('T25647a', normal, compile, ['']) +test('T25647b', normal, compile, ['']) +test('T25647_fail', normal, compile_fail, ['']) ===================================== utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs ===================================== @@ -36,6 +36,7 @@ parseArch :: Cc -> String -> M Arch parseArch cc arch = case arch of "i386" -> pure ArchX86 + "i686" -> pure ArchX86 "x86_64" -> pure ArchX86_64 "amd64" -> pure ArchX86_64 "powerpc" -> pure ArchPPC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dec5bfda539e865a8f9efe01c222564570c1adb5...af26783367a1ebfb33b27de21d9c84f2b01fe187 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dec5bfda539e865a8f9efe01c222564570c1adb5...af26783367a1ebfb33b27de21d9c84f2b01fe187 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 14:57:28 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 09:57:28 -0500 Subject: [Git][ghc/ghc][wip/T25647] add Dix7 for T25647a Message-ID: <67a4cdd82bfcd_df8a72ff6c0104558@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: edf3368d by Patrick at 2025-02-06T22:57:21+08:00 add Dix7 for T25647a - - - - - 1 changed file: - testsuite/tests/typecheck/should_compile/T25647a.hs Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -69,4 +69,6 @@ newtype instance Dix5 f = DIn5 (f (Dix5 f)) -- newtype instance Dix6 f where -- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff +data family Dix7 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix7 f = DIn7 (f (Dix7 f)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/edf3368d8a9aec51111850718e5f3cd6cb033605 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/edf3368d8a9aec51111850718e5f3cd6cb033605 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 15:15:48 2025 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Thu, 06 Feb 2025 10:15:48 -0500 Subject: [Git][ghc/ghc][wip/T24603] Remove trailing whtespace to make CI greener Message-ID: <67a4d224ce476_df8a768cd74114752@gitlab.mail> Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC Commits: 50b2fab5 by Serge S. Gulin at 2025-02-06T15:15:45+00:00 Remove trailing whtespace to make CI greener - - - - - 1 changed file: - compiler/GHC/Driver/Session.hs Changes: ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -3588,8 +3588,8 @@ makeDynFlagsConsistent dflags , Nothing <- outputFile dflags = pgmError "--output must be specified when using --merge-objs" - | platformTablesNextToCode platform - && os == OSMinGW32 + | platformTablesNextToCode platform + && os == OSMinGW32 && arch == ArchAArch64 = case backendCodeOutput (backend dflags) of LlvmCodeOutput -> pgmError "-fllvm is incompatible with enabled TablesNextToCode at Windows Aarch64" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/50b2fab5c020419acfc7c9a7d4af81044a10e7ce -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/50b2fab5c020419acfc7c9a7d4af81044a10e7ce You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 16:56:26 2025 From: gitlab at gitlab.haskell.org (Sjoerd Visscher (@trac-sjoerd_visscher)) Date: Thu, 06 Feb 2025 11:56:26 -0500 Subject: [Git][ghc/ghc][wip/T18462] Multiplicity annotation on records Message-ID: <67a4e9ba18799_1112fe4ab528157d0@gitlab.mail> Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC Commits: 68e3e2c7 by Sjoerd Visscher at 2025-02-06T17:56:17+01:00 Multiplicity annotation on records Add HsConFieldSpec - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/68e3e2c7a34d8bb89dc39dea44f1883274a63d48 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/68e3e2c7a34d8bb89dc39dea44f1883274a63d48 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 17:50:29 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Thu, 06 Feb 2025 12:50:29 -0500 Subject: [Git][ghc/ghc][wip/T25647] change DefaultingStrategy of tcTyFamInstEqnGuts as well Message-ID: <67a4f664f3dfd_12044194d784821e5@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 0f24af76 by Patrick at 2025-02-07T01:50:06+08:00 change DefaultingStrategy of tcTyFamInstEqnGuts as well - - - - - 1 changed file: - compiler/GHC/Tc/TyCl.hs Changes: ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -3451,7 +3451,7 @@ tcTyFamInstEqnGuts fam_tc mb_clsinfo outer_hs_bndrs hs_pats hs_rhs_ty -- See Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f24af764b53cc2e99c8aac68bea812a8dafbfae -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f24af764b53cc2e99c8aac68bea812a8dafbfae You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 17:55:40 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 06 Feb 2025 12:55:40 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: perf: Replace uses of genericLength with strictGenericLength Message-ID: <67a4f79ccc269_12044194d78485132@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - fd9c9f7f by Matthew Pickering at 2025-02-06T12:55:15-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - 27f2df7a by Matthew Pickering at 2025-02-06T12:55:16-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 15 changed files: - compiler/GHC.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/GHC/StgToByteCode.hs - compiler/ghc.cabal.in - libraries/ghc-boot/GHC/Data/SizedSeq.hs - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c Changes: ===================================== compiler/GHC.hs ===================================== @@ -420,7 +420,6 @@ import GHC.Types.Name.Ppr import GHC.Types.TypeEnv import GHC.Types.Breakpoint import GHC.Types.PkgQual -import GHC.Types.Unique.FM import GHC.Unit import GHC.Unit.Env as UnitEnv @@ -705,7 +704,7 @@ setTopSessionDynFlags :: GhcMonad m => DynFlags -> m () setTopSessionDynFlags dflags = do hsc_env <- getSession logger <- getLogger - lookup_cache <- liftIO $ newMVar emptyUFM + lookup_cache <- liftIO $ mkInterpSymbolCache -- Interpreter interp <- if ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -52,7 +52,6 @@ import Data.Array.Base ( UArray(..) ) import Foreign hiding (shiftL, shiftR) import Data.Char ( ord ) -import Data.List ( genericLength ) import Data.Map.Strict (Map) import Data.Maybe (fromMaybe) import qualified Data.Map.Strict as Map @@ -333,6 +332,7 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } + inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) inspectAsm platform long_jumps initial_offset = go (InspectState initial_offset 0 0 Map.empty) @@ -340,7 +340,7 @@ inspectAsm platform long_jumps initial_offset go s (NullAsm _) = (instrCount s, lblEnv s) go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + genericLength ls }) (k n) + go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) where n = litCount s go s (AllocLabel lbl k) = go s' k where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -1,6 +1,8 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -11,7 +13,6 @@ module GHC.ByteCode.Linker ( linkBCO , lookupStaticPtr , lookupIE - , nameToCLabel , linkFail ) where @@ -25,7 +26,6 @@ import GHCi.ResolvedBCO import GHC.Builtin.PrimOps import GHC.Builtin.PrimOps.Ids -import GHC.Builtin.Names import GHC.Unit.Types @@ -42,8 +42,6 @@ import GHC.Types.Name.Env import qualified GHC.Types.Id as Id import GHC.Types.Unique.DFM -import Language.Haskell.Syntax.Module.Name - -- Standard libraries import Data.Array.Unboxed import Foreign.Ptr @@ -91,30 +89,30 @@ lookupLiteral interp pkgs_loaded le ptr = case ptr of lookupStaticPtr :: Interp -> FastString -> IO (Ptr ()) lookupStaticPtr interp addr_of_label_string = do - m <- lookupSymbol interp addr_of_label_string + m <- lookupSymbol interp (IFaststringSymbol addr_of_label_string) case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker: can't find label" - (unpackFS addr_of_label_string) + (ppr addr_of_label_string) lookupIE :: Interp -> PkgsLoaded -> ItblEnv -> Name -> IO (Ptr ()) lookupIE interp pkgs_loaded ie con_nm = case lookupNameEnv ie con_nm of Just (_, ItblPtr a) -> return (fromRemotePtr (castRemotePtr a)) Nothing -> do -- try looking up in the object files. - let sym_to_find1 = nameToCLabel con_nm "con_info" - m <- lookupHsSymbol interp pkgs_loaded con_nm "con_info" + let sym_to_find1 = IConInfoSymbol con_nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find1 case m of Just addr -> return addr Nothing -> do -- perhaps a nullary constructor? - let sym_to_find2 = nameToCLabel con_nm "static_info" - n <- lookupHsSymbol interp pkgs_loaded con_nm "static_info" + let sym_to_find2 = IStaticInfoSymbol con_nm + n <- lookupHsSymbol interp pkgs_loaded sym_to_find2 case n of Just addr -> return addr Nothing -> linkFail "GHC.ByteCode.Linker.lookupIE" - (unpackFS sym_to_find1 ++ " or " ++ - unpackFS sym_to_find2) + (ppr sym_to_find1 <> " or " <> + ppr sym_to_find2) -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode lookupAddr :: Interp -> PkgsLoaded -> AddrEnv -> Name -> IO (Ptr ()) @@ -122,21 +120,21 @@ lookupAddr interp pkgs_loaded ae addr_nm = do case lookupNameEnv ae addr_nm of Just (_, AddrPtr ptr) -> return (fromRemotePtr ptr) Nothing -> do -- try looking up in the object files. - let sym_to_find = nameToCLabel addr_nm "bytes" + let sym_to_find = IBytesSymbol addr_nm -- see Note [Bytes label] in GHC.Cmm.CLabel - m <- lookupHsSymbol interp pkgs_loaded addr_nm "bytes" + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker.lookupAddr" - (unpackFS sym_to_find) + (ppr sym_to_find) lookupPrimOp :: Interp -> PkgsLoaded -> PrimOp -> IO (RemotePtr ()) lookupPrimOp interp pkgs_loaded primop = do let sym_to_find = primopToCLabel primop "closure" - m <- lookupHsSymbol interp pkgs_loaded (Id.idName $ primOpId primop) "closure" + m <- lookupHsSymbol interp pkgs_loaded (IClosureSymbol (Id.idName $ primOpId primop)) case m of Just p -> return (toRemotePtr p) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" (text sym_to_find) resolvePtr :: Interp @@ -156,11 +154,11 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of | otherwise -> assertPpr (isExternalName nm) (ppr nm) $ do - let sym_to_find = nameToCLabel nm "closure" - m <- lookupHsSymbol interp pkgs_loaded nm "closure" + let sym_to_find = IClosureSymbol nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p)) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find) + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (ppr sym_to_find) BCOPtrPrimOp op -> ResolvedBCOStaticPtr <$> lookupPrimOp interp pkgs_loaded op @@ -175,11 +173,10 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of -- loaded units. -- -- See Note [Looking up symbols in the relevant objects]. -lookupHsSymbol :: Interp -> PkgsLoaded -> Name -> String -> IO (Maybe (Ptr ())) -lookupHsSymbol interp pkgs_loaded nm sym_suffix = do - massertPpr (isExternalName nm) (ppr nm) - let sym_to_find = nameToCLabel nm sym_suffix - pkg_id = moduleUnitId $ nameModule nm +lookupHsSymbol :: Interp -> PkgsLoaded -> InterpSymbol (Suffix s) -> IO (Maybe (Ptr ())) +lookupHsSymbol interp pkgs_loaded sym_to_find = do + massertPpr (isExternalName (interpSymbolName sym_to_find)) (ppr sym_to_find) + let pkg_id = moduleUnitId $ nameModule (interpSymbolName sym_to_find) loaded_dlls = maybe [] loaded_pkg_hs_dlls $ lookupUDFM pkgs_loaded pkg_id go (dll:dlls) = do @@ -193,12 +190,12 @@ lookupHsSymbol interp pkgs_loaded nm sym_suffix = do go loaded_dlls -linkFail :: String -> String -> IO a +linkFail :: String -> SDoc -> IO a linkFail who what = throwGhcExceptionIO (ProgramError $ unlines [ "",who , "During interactive linking, GHCi couldn't find the following symbol:" - , ' ' : ' ' : what + , ' ' : ' ' : showSDocUnsafe what , "This may be due to you not asking GHCi to load extra object files," , "archives or DLLs needed by your current session. Restart GHCi, specifying" , "the missing library using the -L/path/to/object/dir and -lmissinglibname" @@ -209,25 +206,8 @@ linkFail who what ]) -nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastString label - where - encodeZ = zString . zEncodeFS - (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of - -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers - -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. - mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS - mod -> mod - packagePart = encodeZ (unitFS pkgKey) - modulePart = encodeZ (moduleNameFS modName) - occPart = encodeZ $ occNameMangledFS (nameOccName n) - - label = concat - [ if pkgKey == mainUnit then "" else packagePart ++ "_" - , modulePart - , '_':occPart - , '_':suffix - ] + + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2901,7 +2901,7 @@ jsCodeGen hsc_env srcspan i this_mod stg_binds_with_deps binding_id = do jsLinkObject logger tmpfs tmp_dir js_config unit_env inst out_obj roots -- look up "id_sym" closure and create a StablePtr (HValue) from it - href <- lookupClosure interp (unpackFS id_sym) >>= \case + href <- lookupClosure interp (IFaststringSymbol id_sym) >>= \case Nothing -> pprPanic "Couldn't find just linked TH closure" (ppr id_sym) Just r -> pure r ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -217,12 +217,12 @@ loadName interp hsc_env name = do case lookupNameEnv (closure_env (linker_env pls)) name of Just (_,aa) -> return (pls,(aa, links, pkgs)) Nothing -> assertPpr (isExternalName name) (ppr name) $ - do let sym_to_find = nameToCLabel name "closure" - m <- lookupClosure interp (unpackFS sym_to_find) + do let sym_to_find = IClosureSymbol name + m <- lookupClosure interp sym_to_find r <- case m of Just hvref -> mkFinalizedHValue interp hvref Nothing -> linkFail "GHC.Linker.Loader.loadName" - (unpackFS sym_to_find) + (ppr sym_to_find) return (pls,(r, links, pkgs)) loadDependencies @@ -909,7 +909,7 @@ dynLoadObjs interp hsc_env pls at LoaderState{..} objs = do m <- loadDLL interp soFile case m of Right _ -> return $! pls { temp_sos = (libPath, libName) : temp_sos } - Left err -> linkFail msg err + Left err -> linkFail msg (text err) where msg = "GHC.Linker.Loader.dynLoadObjs: Loading temp shared object failed" ===================================== compiler/GHC/Prelude/Basic.hs ===================================== @@ -25,6 +25,8 @@ module GHC.Prelude.Basic , shiftL, shiftR , setBit, clearBit , head, tail + + , strictGenericLength ) where @@ -130,3 +132,15 @@ head = Prelude.head tail :: HasCallStack => [a] -> [a] tail = Prelude.tail {-# INLINE tail #-} + +{- | +The 'genericLength' function defined in base can't be specialised due to the +NOINLINE pragma. + +It is also not strict in the accumulator, and strictGenericLength is not exported. + +See #25706 for why it is important to use a strict, specialised version. + +-} +strictGenericLength :: Num a => [x] -> a +strictGenericLength = fromIntegral . length ===================================== compiler/GHC/Runtime/Interpreter.hs ===================================== @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} -- | Interacting with the iserv interpreter, whether it is running on an -- external process or in the current process. @@ -83,7 +84,6 @@ import GHC.Data.Maybe import GHC.Data.FastString import GHC.Types.SrcLoc -import GHC.Types.Unique.FM import GHC.Types.Basic import GHC.Utils.Panic @@ -116,6 +116,12 @@ import GHC.Stack.CCS (CostCentre,CostCentreStack) import System.Directory import System.Process +import GHC.Builtin.Names +import GHC.Types.Name + +-- Standard libraries +import GHC.Exts + {- Note [Remote GHCi] ~~~~~~~~~~~~~~~~~~ When the flag -fexternal-interpreter is given to GHC, interpreted code @@ -457,38 +463,65 @@ handleSeqHValueStatus interp unit_env eval_status = initObjLinker :: Interp -> IO () initObjLinker interp = interpCmd interp InitLinker -lookupSymbol :: Interp -> FastString -> IO (Maybe (Ptr ())) +lookupSymbol :: Interp -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbol interp str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) ExtWasm i -> withWasmInterp i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) -lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> FastString -> IO (Maybe (Ptr ())) +lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbolInDLL interp dll str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbolInDLL dll (unpackFS str)) + sendMessage inst (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) -- wasm dyld doesn't track which symbol comes from which .so ExtWasm {} -> lookupSymbol interp str -lookupClosure :: Interp -> String -> IO (Maybe HValueRef) +interpSymbolToCLabel :: forall s . InterpSymbol s -> FastString +interpSymbolToCLabel s = eliminateInterpSymbol s interpretedInterpSymbol $ \is -> + let + n = interpSymbolName is + suffix = interpSymbolSuffix is + + encodeZ = fastZStringToByteString . zEncodeFS + (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of + -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. + mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS + mod -> mod + packagePart = encodeZ (unitFS pkgKey) + modulePart = encodeZ (moduleNameFS modName) + occPart = encodeZ $ occNameMangledFS (nameOccName n) + + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix + ] + in mkFastStringByteString label + +lookupClosure :: Interp -> InterpSymbol s -> IO (Maybe HValueRef) lookupClosure interp str = - interpCmd interp (LookupClosure str) + interpCmd interp (LookupClosure (unpackFS (interpSymbolToCLabel str))) -- | 'withSymbolCache' tries to find a symbol in the 'interpLookupSymbolCache' -- which maps symbols to the address where they are loaded. @@ -496,7 +529,7 @@ lookupClosure interp str = -- a miss we run the action which determines the symbol's address and populate -- the cache with the answer. withSymbolCache :: Interp - -> FastString + -> InterpSymbol s -- ^ The symbol we are looking up in the cache -> IO (Maybe (Ptr ())) -- ^ An action which determines the address of the symbol we @@ -513,21 +546,19 @@ withSymbolCache interp str determine_addr = do -- The analysis in #23415 further showed this cache should also benefit the -- internal interpreter's loading times, and needn't be used by the external -- interpreter only. - cache <- readMVar (interpLookupSymbolCache interp) - case lookupUFM cache str of - Just p -> return (Just p) + cached_val <- lookupInterpSymbolCache str (interpSymbolCache interp) + case cached_val of + Just {} -> return cached_val Nothing -> do - maddr <- determine_addr case maddr of Nothing -> return Nothing Just p -> do - let upd_cache cache' = addToUFM cache' str p - modifyMVar_ (interpLookupSymbolCache interp) (pure . upd_cache) - return (Just p) + updateInterpSymbolCache str (interpSymbolCache interp) p + return maddr purgeLookupSymbolCache :: Interp -> IO () -purgeLookupSymbolCache interp = modifyMVar_ (interpLookupSymbolCache interp) (const (pure emptyUFM)) +purgeLookupSymbolCache interp = purgeInterpSymbolCache (interpSymbolCache interp) -- | loadDLL loads a dynamic library using the OS's native linker -- (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either ===================================== compiler/GHC/Runtime/Interpreter/Types.hs ===================================== @@ -1,4 +1,6 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} -- | Types used by the runtime interpreter module GHC.Runtime.Interpreter.Types @@ -10,6 +12,20 @@ module GHC.Runtime.Interpreter.Types , ExtInterpInstance (..) , ExtInterpState (..) , InterpStatus(..) + -- * InterpSymbolCache + , InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + + -- * IServ , IServ , IServConfig(..) @@ -30,9 +46,6 @@ import GHC.Linker.Types import GHCi.RemoteTypes import GHCi.Message ( Pipe ) -import GHC.Types.Unique.FM -import GHC.Data.FastString ( FastString ) -import Foreign import GHC.Platform import GHC.Utils.TmpFs @@ -42,6 +55,7 @@ import GHC.Unit.State import GHC.Unit.Types import GHC.StgToJS.Types import GHC.StgToJS.Linker.Types +import GHC.Runtime.Interpreter.Types.SymbolCache import Control.Concurrent import System.Process ( ProcessHandle, CreateProcess ) @@ -56,7 +70,7 @@ data Interp = Interp , interpLoader :: !Loader -- ^ Interpreter loader - , interpLookupSymbolCache :: !(MVar (UniqFM FastString (Ptr ()))) + , interpSymbolCache :: !InterpSymbolCache -- ^ LookupSymbol cache } ===================================== compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs ===================================== @@ -0,0 +1,142 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} + +-- | The SymbolCache is used to cache lookups for specific symbols when using +-- the interpreter. +module GHC.Runtime.Interpreter.Types.SymbolCache ( + InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + ) where + +import GHC.Prelude + +import GHC.Types.Unique.FM +import GHC.Types.Name +import GHC.Data.FastString +import Foreign + +import Control.Concurrent +import GHC.Utils.Outputable +import GHC.TypeLits + + +-- The symbols records the suffix which each cache deals with. +newtype SymbolCache (s :: Symbol) = SymbolCache { _getSymbolCache :: UniqFM Name (Ptr ()) } + +-- Each cache is keyed by Name, there is one cache for each type of symbol we will +-- potentially lookup. The caches are keyed by 'Name' so that it is not necessary to consult +-- a complicated `FastString` each time. +data InterpSymbolCache = InterpSymbolCache { + interpClosureCache :: MVar (SymbolCache "closure") + , interpConInfoCache :: MVar (SymbolCache "con_info") + , interpStaticInfoCache :: MVar (SymbolCache "static_info") + , interpBytesCache :: MVar (SymbolCache "bytes") + , interpFaststringCache :: MVar (UniqFM FastString (Ptr ())) + } + +data SuffixOrInterpreted = Suffix Symbol | Interpreted + +data InterpSymbol (s :: SuffixOrInterpreted) where + IClosureSymbol :: Name -> InterpSymbol (Suffix "closure") + IConInfoSymbol :: Name -> InterpSymbol (Suffix "con_info") + IStaticInfoSymbol :: Name -> InterpSymbol (Suffix "static_info") + IBytesSymbol :: Name -> InterpSymbol (Suffix "bytes") + IFaststringSymbol :: FastString -> InterpSymbol Interpreted + +instance Outputable (InterpSymbol s) where + ppr s = eliminateInterpSymbol s + (\(IFaststringSymbol s) -> text "interpreted:" <> ppr s) + (\s -> text (interpSymbolSuffix s) <> colon <> ppr (interpSymbolName s)) + +eliminateInterpSymbol :: InterpSymbol s -> (InterpSymbol Interpreted -> r) + -> (forall x . InterpSymbol (Suffix x) -> r) + -> r +eliminateInterpSymbol s k1 k2 = + case s of + IFaststringSymbol {} -> k1 s + IBytesSymbol {} -> k2 s + IStaticInfoSymbol {} -> k2 s + IConInfoSymbol {} -> k2 s + IClosureSymbol {} -> k2 s + + +interpSymbolName :: InterpSymbol (Suffix s) -> Name +interpSymbolName (IClosureSymbol n) = n +interpSymbolName (IConInfoSymbol n) = n +interpSymbolName (IStaticInfoSymbol n) = n +interpSymbolName (IBytesSymbol n) = n + +interpretedInterpSymbol :: InterpSymbol Interpreted -> FastString +interpretedInterpSymbol (IFaststringSymbol s) = s + +interpSymbolSuffix :: InterpSymbol (Suffix s) -> String +interpSymbolSuffix (IClosureSymbol {}) = "closure" +interpSymbolSuffix (IConInfoSymbol {}) = "con_info" +interpSymbolSuffix (IStaticInfoSymbol {}) = "static_info" +interpSymbolSuffix (IBytesSymbol {}) = "bytes" + +emptySymbolCache :: SymbolCache s +emptySymbolCache = SymbolCache emptyUFM + +lookupSymbolCache :: InterpSymbol (Suffix s) -> SymbolCache s -> Maybe (Ptr ()) +lookupSymbolCache s (SymbolCache cache) = lookupUFM cache (interpSymbolName s) + +insertSymbolCache :: InterpSymbol (Suffix s) -> Ptr () -> SymbolCache s -> SymbolCache s +insertSymbolCache s v (SymbolCache cache) = SymbolCache (addToUFM cache (interpSymbolName s) v) + +lookupInterpSymbolCache :: InterpSymbol s -> InterpSymbolCache -> IO (Maybe (Ptr ())) +lookupInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var -> (\cache -> lookupUFM cache f) <$> readMVar mvar_var) + (\s mvar_var -> lookupSymbolCache s <$> readMVar mvar_var) + + +updateInterpSymbolCache :: InterpSymbol s + -> InterpSymbolCache -> Ptr () -> IO () +updateInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ addToUFM cache f v)) + (\s mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ insertSymbolCache s v cache)) + +withInterpSymbolCache :: + (InterpSymbol Interpreted -> MVar (UniqFM FastString (Ptr ())) -> r) + -> (forall x . InterpSymbol (Suffix x) -> MVar (SymbolCache x) -> r) + -> InterpSymbol s + -> InterpSymbolCache + -> r +withInterpSymbolCache k1 k2 key InterpSymbolCache{..} = + case key of + IClosureSymbol {} -> k2 key interpClosureCache + IConInfoSymbol {} -> k2 key interpConInfoCache + IStaticInfoSymbol {} -> k2 key interpStaticInfoCache + IBytesSymbol {} -> k2 key interpBytesCache + IFaststringSymbol {} -> k1 key interpFaststringCache + +-- | Clear all symbol caches. +purgeInterpSymbolCache :: InterpSymbolCache -> IO () +purgeInterpSymbolCache (InterpSymbolCache a b c d e) = do + modifyMVar_ a (\_ -> do + modifyMVar_ b (\_ -> do + modifyMVar_ c (\_ -> do + modifyMVar_ d (\_ -> do + modifyMVar_ e (\_ -> pure emptyUFM) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + +mkInterpSymbolCache :: IO InterpSymbolCache +mkInterpSymbolCache = do + InterpSymbolCache <$> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptyUFM ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Types.Name.Env (mkNameEnv) import GHC.Types.Tickish import GHC.Types.SptEntry -import Data.List ( genericReplicate, genericLength, intersperse +import Data.List ( genericReplicate, intersperse , partition, scanl', sortBy, zip4, zip6 ) import Foreign hiding (shiftL, shiftR) import Control.Monad @@ -394,7 +394,7 @@ schemeR_wrk fvs nm original_body (args, body) -- make the arg bitmap bits = argBits platform (reverse (map (idArgRep platform) all_args)) - bitmap_size = genericLength bits + bitmap_size = strictGenericLength bits bitmap = mkBitmap platform bits body_code <- schemeER_wrk sum_szsb_args p_init body @@ -608,7 +608,7 @@ schemeE d s p (StgLet _ext binds body) = do platform <- targetPlatform <$> getDynFlags let (xs,rhss) = case binds of StgNonRec x rhs -> ([x],[rhs]) StgRec xs_n_rhss -> unzip xs_n_rhss - n_binds = genericLength xs + n_binds = strictGenericLength xs fvss = map (fvsToEnv p') rhss @@ -617,7 +617,7 @@ schemeE d s p (StgLet _ext binds body) = do sizes = map (\rhs_fvs -> sum (map size_w rhs_fvs)) fvss -- the arity of each rhs - arities = map (genericLength . fst . collect) rhss + arities = map (strictGenericLength . fst . collect) rhss -- This p', d' defn is safe because all the items being pushed -- are ptrs, so all have size 1 word. d' and p' reflect the stack @@ -1858,7 +1858,7 @@ implement_tagToId implement_tagToId d s p arg names = assert (notNull names) $ do (push_arg, arg_bytes) <- pushAtom d p (StgVarArg arg) - labels <- getLabelsBc (genericLength names) + labels <- getLabelsBc (strictGenericLength names) label_fail <- getLabelBc label_exit <- getLabelBc dflags <- getDynFlags ===================================== compiler/ghc.cabal.in ===================================== @@ -699,6 +699,7 @@ Library GHC.Runtime.Interpreter.JS GHC.Runtime.Interpreter.Process GHC.Runtime.Interpreter.Types + GHC.Runtime.Interpreter.Types.SymbolCache GHC.Runtime.Interpreter.Wasm GHC.Runtime.Loader GHC.Runtime.Utils ===================================== libraries/ghc-boot/GHC/Data/SizedSeq.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving, DeriveGeneric, CPP #-} module GHC.Data.SizedSeq ( SizedSeq(..) , emptySS @@ -11,9 +11,12 @@ module GHC.Data.SizedSeq import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary -import Data.List (genericLength) import GHC.Generics +#if ! MIN_VERSION_base(4,20,0) +import Data.List (foldl') +#endif + data SizedSeq a = SizedSeq {-# UNPACK #-} !Word [a] deriving (Generic, Show) @@ -37,9 +40,9 @@ emptySS = SizedSeq 0 [] addToSS :: SizedSeq a -> a -> SizedSeq a addToSS (SizedSeq n r_xs) x = SizedSeq (n+1) (x:r_xs) +-- NB, important this is eta-expand so that foldl' is inlined. addListToSS :: SizedSeq a -> [a] -> SizedSeq a -addListToSS (SizedSeq n r_xs) xs - = SizedSeq (n + genericLength xs) (reverse xs ++ r_xs) +addListToSS s xs = foldl' addToSS s xs ssElts :: SizedSeq a -> [a] ssElts (SizedSeq _ r_xs) = reverse r_xs ===================================== rts/Interpreter.c ===================================== @@ -182,6 +182,8 @@ int rts_stop_on_exception = 0; #if defined(INTERP_STATS) +#define N_CODES 128 + /* Hacky stats, for tuning the interpreter ... */ int it_unknown_entries[N_CLOSURE_TYPES]; int it_total_unknown_entries; @@ -195,8 +197,8 @@ int it_slides; int it_insns; int it_BCO_entries; -int it_ofreq[27]; -int it_oofreq[27][27]; +int it_ofreq[N_CODES]; +int it_oofreq[N_CODES][N_CODES]; int it_lastopc; @@ -210,9 +212,9 @@ void interp_startup ( void ) for (i = 0; i < N_CLOSURE_TYPES; i++) it_unknown_entries[i] = 0; it_slides = it_insns = it_BCO_entries = 0; - for (i = 0; i < 27; i++) it_ofreq[i] = 0; - for (i = 0; i < 27; i++) - for (j = 0; j < 27; j++) + for (i = 0; i < N_CODES; i++) it_ofreq[i] = 0; + for (i = 0; i < N_CODES; i++) + for (j = 0; j < N_CODES; j++) it_oofreq[i][j] = 0; it_lastopc = 0; } @@ -234,14 +236,14 @@ void interp_shutdown ( void ) } debugBelch("%d insns, %d slides, %d BCO_entries\n", it_insns, it_slides, it_BCO_entries); - for (i = 0; i < 27; i++) + for (i = 0; i < N_CODES; i++) debugBelch("opcode %2d got %d\n", i, it_ofreq[i] ); for (k = 1; k < 20; k++) { o_max = 0; i_max = j_max = 0; - for (i = 0; i < 27; i++) { - for (j = 0; j < 27; j++) { + for (i = 0; i < N_CODES; i++) { + for (j = 0; j < N_CODES; j++) { if (it_oofreq[i][j] > o_max) { o_max = it_oofreq[i][j]; i_max = i; j_max = j; @@ -259,6 +261,12 @@ void interp_shutdown ( void ) #else // !INTERP_STATS +void interp_startup( void ){ +} + +void interp_shutdown( void ){ +} + #define INTERP_TICK(n) /* nothing */ #endif @@ -419,7 +427,7 @@ eval: eval_obj: obj = UNTAG_CLOSURE(tagged_obj); - INTERP_TICK(it_total_evals); + INTERP_TICK(it_total_entries); IF_DEBUG(interpreter, debugBelch( @@ -1098,7 +1106,7 @@ run_BCO: INTERP_TICK(it_insns); #if defined(INTERP_STATS) - ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < 27 ); + ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < N_CODES ); it_ofreq[ (int)instrs[bciPtr] ] ++; it_oofreq[ it_lastopc ][ (int)instrs[bciPtr] ] ++; it_lastopc = (int)instrs[bciPtr]; ===================================== rts/Interpreter.h ===================================== @@ -9,3 +9,5 @@ #pragma once RTS_PRIVATE Capability *interpretBCO (Capability* cap); +void interp_startup ( void ); +void interp_shutdown ( void ); ===================================== rts/RtsMain.c ===================================== @@ -17,6 +17,7 @@ #include "Prelude.h" #include "Task.h" #include "Excn.h" +#include "Interpreter.h" #if defined(DEBUG) # include "Printer.h" /* for printing */ @@ -56,6 +57,8 @@ int hs_main ( int argc, char *argv[], // program args hs_init_ghc(&argc, &argv, rts_config); + interp_startup(); + BEGIN_WINDOWS_VEH_HANDLER // kick off the computation by creating the main thread with a pointer @@ -96,6 +99,8 @@ int hs_main ( int argc, char *argv[], // program args END_WINDOWS_VEH_HANDLER + interp_shutdown(); + shutdownHaskellAndExit(exit_status, 0 /* !fastExit */); // No code beyond this point. Dead code elimination will remove it } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b666e6c8fcaf6cb2ed1f65ce7feae1bff4324669...27f2df7adfcd9ffbd04749d5aba962e84c39ff6b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b666e6c8fcaf6cb2ed1f65ce7feae1bff4324669...27f2df7adfcd9ffbd04749d5aba962e84c39ff6b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 18:58:56 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Thu, 06 Feb 2025 13:58:56 -0500 Subject: [Git][ghc/ghc] Deleted branch wip/backports-9.8 Message-ID: <67a5067074b80_1204411a38bac97577@gitlab.mail> Ben Gamari deleted branch wip/backports-9.8 at Glasgow Haskell Compiler / GHC -- You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 18:59:00 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Thu, 06 Feb 2025 13:59:00 -0500 Subject: [Git][ghc/ghc][ghc-9.8] compiler: Fix CPP guards around ghc_unique_counter64 Message-ID: <67a50674d1de_12044119e8ee097729@gitlab.mail> Ben Gamari pushed to branch ghc-9.8 at Glasgow Haskell Compiler / GHC Commits: 189a368b by Ben Gamari at 2025-02-06T10:32:27+01:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. (cherry-picked from commit 63d74f4d15ecaa8d711bd12fa64f77fce72b5f79) - - - - - 1 changed file: - compiler/cbits/genSym.c Changes: ===================================== compiler/cbits/genSym.c ===================================== @@ -9,11 +9,20 @@ // // The CPP is thus about the RTS version GHC is linked against, and not the // version of the GHC being built. -#if !MIN_VERSION_GLASGOW_HASKELL(9,8,4,0) -HsWord64 ghc_unique_counter64 = 0; + +#if MIN_VERSION_GLASGOW_HASKELL(9,9,0,0) +// Unique64 patch was present in 9.10 and later +#define HAVE_UNIQUE64 1 +#elif !MIN_VERSION_GLASGOW_HASKELL(9,9,0,0) && MIN_VERSION_GLASGOW_HASKELL(9,8,4,0) +// Unique64 patch was backported to 9.8.4 +#define HAVE_UNIQUE64 1 +#elif !MIN_VERSION_GLASGOW_HASKELL(9,7,0,0) && MIN_VERSION_GLASGOW_HASKELL(9,6,7,0) +// Unique64 patch was backported to 9.6.7 +#define HAVE_UNIQUE64 1 #endif -#if !MIN_VERSION_GLASGOW_HASKELL(9,3,0,0) -HsInt ghc_unique_inc = 1; + +#if !defined(HAVE_UNIQUE64) +HsWord64 ghc_unique_counter64 = 0; #endif // This function has been added to the RTS. Here we pessimistically assume View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/189a368ba74dbfe8a6e832fe0f9ffe56cd565824 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/189a368ba74dbfe8a6e832fe0f9ffe56cd565824 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 20:37:30 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Thu, 06 Feb 2025 15:37:30 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/T25693 Message-ID: <67a51d8aee0ec_1204412ad426810466@gitlab.mail> Ben Gamari pushed new branch wip/T25693 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25693 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 22:15:48 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 06 Feb 2025 17:15:48 -0500 Subject: [Git][ghc/ghc][master] interpreter: Fix INTERP_STATS profiling code Message-ID: <67a53494794ba_18a337d407c43925@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - 3 changed files: - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c Changes: ===================================== rts/Interpreter.c ===================================== @@ -182,6 +182,8 @@ int rts_stop_on_exception = 0; #if defined(INTERP_STATS) +#define N_CODES 128 + /* Hacky stats, for tuning the interpreter ... */ int it_unknown_entries[N_CLOSURE_TYPES]; int it_total_unknown_entries; @@ -195,8 +197,8 @@ int it_slides; int it_insns; int it_BCO_entries; -int it_ofreq[27]; -int it_oofreq[27][27]; +int it_ofreq[N_CODES]; +int it_oofreq[N_CODES][N_CODES]; int it_lastopc; @@ -210,9 +212,9 @@ void interp_startup ( void ) for (i = 0; i < N_CLOSURE_TYPES; i++) it_unknown_entries[i] = 0; it_slides = it_insns = it_BCO_entries = 0; - for (i = 0; i < 27; i++) it_ofreq[i] = 0; - for (i = 0; i < 27; i++) - for (j = 0; j < 27; j++) + for (i = 0; i < N_CODES; i++) it_ofreq[i] = 0; + for (i = 0; i < N_CODES; i++) + for (j = 0; j < N_CODES; j++) it_oofreq[i][j] = 0; it_lastopc = 0; } @@ -234,14 +236,14 @@ void interp_shutdown ( void ) } debugBelch("%d insns, %d slides, %d BCO_entries\n", it_insns, it_slides, it_BCO_entries); - for (i = 0; i < 27; i++) + for (i = 0; i < N_CODES; i++) debugBelch("opcode %2d got %d\n", i, it_ofreq[i] ); for (k = 1; k < 20; k++) { o_max = 0; i_max = j_max = 0; - for (i = 0; i < 27; i++) { - for (j = 0; j < 27; j++) { + for (i = 0; i < N_CODES; i++) { + for (j = 0; j < N_CODES; j++) { if (it_oofreq[i][j] > o_max) { o_max = it_oofreq[i][j]; i_max = i; j_max = j; @@ -259,6 +261,12 @@ void interp_shutdown ( void ) #else // !INTERP_STATS +void interp_startup( void ){ +} + +void interp_shutdown( void ){ +} + #define INTERP_TICK(n) /* nothing */ #endif @@ -419,7 +427,7 @@ eval: eval_obj: obj = UNTAG_CLOSURE(tagged_obj); - INTERP_TICK(it_total_evals); + INTERP_TICK(it_total_entries); IF_DEBUG(interpreter, debugBelch( @@ -1098,7 +1106,7 @@ run_BCO: INTERP_TICK(it_insns); #if defined(INTERP_STATS) - ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < 27 ); + ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < N_CODES ); it_ofreq[ (int)instrs[bciPtr] ] ++; it_oofreq[ it_lastopc ][ (int)instrs[bciPtr] ] ++; it_lastopc = (int)instrs[bciPtr]; ===================================== rts/Interpreter.h ===================================== @@ -9,3 +9,5 @@ #pragma once RTS_PRIVATE Capability *interpretBCO (Capability* cap); +void interp_startup ( void ); +void interp_shutdown ( void ); ===================================== rts/RtsMain.c ===================================== @@ -17,6 +17,7 @@ #include "Prelude.h" #include "Task.h" #include "Excn.h" +#include "Interpreter.h" #if defined(DEBUG) # include "Printer.h" /* for printing */ @@ -56,6 +57,8 @@ int hs_main ( int argc, char *argv[], // program args hs_init_ghc(&argc, &argv, rts_config); + interp_startup(); + BEGIN_WINDOWS_VEH_HANDLER // kick off the computation by creating the main thread with a pointer @@ -96,6 +99,8 @@ int hs_main ( int argc, char *argv[], // program args END_WINDOWS_VEH_HANDLER + interp_shutdown(); + shutdownHaskellAndExit(exit_status, 0 /* !fastExit */); // No code beyond this point. Dead code elimination will remove it } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/66c7f65676801367f440a6a644f87d71157d2f3f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/66c7f65676801367f440a6a644f87d71157d2f3f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 22:16:37 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 06 Feb 2025 17:16:37 -0500 Subject: [Git][ghc/ghc][master] perf: Key the interpreter symbol cache by Name rather than FastString Message-ID: <67a534c523aff_18a337b80e984347a@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8 changed files: - compiler/GHC.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC.hs ===================================== @@ -420,7 +420,6 @@ import GHC.Types.Name.Ppr import GHC.Types.TypeEnv import GHC.Types.Breakpoint import GHC.Types.PkgQual -import GHC.Types.Unique.FM import GHC.Unit import GHC.Unit.Env as UnitEnv @@ -705,7 +704,7 @@ setTopSessionDynFlags :: GhcMonad m => DynFlags -> m () setTopSessionDynFlags dflags = do hsc_env <- getSession logger <- getLogger - lookup_cache <- liftIO $ newMVar emptyUFM + lookup_cache <- liftIO $ mkInterpSymbolCache -- Interpreter interp <- if ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -2,6 +2,7 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -12,7 +13,6 @@ module GHC.ByteCode.Linker ( linkBCO , lookupStaticPtr , lookupIE - , nameToCLabel , linkFail ) where @@ -26,7 +26,6 @@ import GHCi.ResolvedBCO import GHC.Builtin.PrimOps import GHC.Builtin.PrimOps.Ids -import GHC.Builtin.Names import GHC.Unit.Types @@ -43,8 +42,6 @@ import GHC.Types.Name.Env import qualified GHC.Types.Id as Id import GHC.Types.Unique.DFM -import Language.Haskell.Syntax.Module.Name - -- Standard libraries import Data.Array.Unboxed import Foreign.Ptr @@ -92,30 +89,30 @@ lookupLiteral interp pkgs_loaded le ptr = case ptr of lookupStaticPtr :: Interp -> FastString -> IO (Ptr ()) lookupStaticPtr interp addr_of_label_string = do - m <- lookupSymbol interp addr_of_label_string + m <- lookupSymbol interp (IFaststringSymbol addr_of_label_string) case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker: can't find label" - (unpackFS addr_of_label_string) + (ppr addr_of_label_string) lookupIE :: Interp -> PkgsLoaded -> ItblEnv -> Name -> IO (Ptr ()) lookupIE interp pkgs_loaded ie con_nm = case lookupNameEnv ie con_nm of Just (_, ItblPtr a) -> return (fromRemotePtr (castRemotePtr a)) Nothing -> do -- try looking up in the object files. - let sym_to_find1 = nameToCLabel con_nm "con_info" - m <- lookupHsSymbol interp pkgs_loaded con_nm "con_info" + let sym_to_find1 = IConInfoSymbol con_nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find1 case m of Just addr -> return addr Nothing -> do -- perhaps a nullary constructor? - let sym_to_find2 = nameToCLabel con_nm "static_info" - n <- lookupHsSymbol interp pkgs_loaded con_nm "static_info" + let sym_to_find2 = IStaticInfoSymbol con_nm + n <- lookupHsSymbol interp pkgs_loaded sym_to_find2 case n of Just addr -> return addr Nothing -> linkFail "GHC.ByteCode.Linker.lookupIE" - (unpackFS sym_to_find1 ++ " or " ++ - unpackFS sym_to_find2) + (ppr sym_to_find1 <> " or " <> + ppr sym_to_find2) -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode lookupAddr :: Interp -> PkgsLoaded -> AddrEnv -> Name -> IO (Ptr ()) @@ -123,21 +120,21 @@ lookupAddr interp pkgs_loaded ae addr_nm = do case lookupNameEnv ae addr_nm of Just (_, AddrPtr ptr) -> return (fromRemotePtr ptr) Nothing -> do -- try looking up in the object files. - let sym_to_find = nameToCLabel addr_nm "bytes" + let sym_to_find = IBytesSymbol addr_nm -- see Note [Bytes label] in GHC.Cmm.CLabel - m <- lookupHsSymbol interp pkgs_loaded addr_nm "bytes" + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker.lookupAddr" - (unpackFS sym_to_find) + (ppr sym_to_find) lookupPrimOp :: Interp -> PkgsLoaded -> PrimOp -> IO (RemotePtr ()) lookupPrimOp interp pkgs_loaded primop = do let sym_to_find = primopToCLabel primop "closure" - m <- lookupHsSymbol interp pkgs_loaded (Id.idName $ primOpId primop) "closure" + m <- lookupHsSymbol interp pkgs_loaded (IClosureSymbol (Id.idName $ primOpId primop)) case m of Just p -> return (toRemotePtr p) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" (text sym_to_find) resolvePtr :: Interp @@ -157,11 +154,11 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of | otherwise -> assertPpr (isExternalName nm) (ppr nm) $ do - let sym_to_find = nameToCLabel nm "closure" - m <- lookupHsSymbol interp pkgs_loaded nm "closure" + let sym_to_find = IClosureSymbol nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p)) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find) + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (ppr sym_to_find) BCOPtrPrimOp op -> ResolvedBCOStaticPtr <$> lookupPrimOp interp pkgs_loaded op @@ -176,11 +173,10 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of -- loaded units. -- -- See Note [Looking up symbols in the relevant objects]. -lookupHsSymbol :: Interp -> PkgsLoaded -> Name -> String -> IO (Maybe (Ptr ())) -lookupHsSymbol interp pkgs_loaded nm sym_suffix = do - massertPpr (isExternalName nm) (ppr nm) - let sym_to_find = nameToCLabel nm sym_suffix - pkg_id = moduleUnitId $ nameModule nm +lookupHsSymbol :: Interp -> PkgsLoaded -> InterpSymbol (Suffix s) -> IO (Maybe (Ptr ())) +lookupHsSymbol interp pkgs_loaded sym_to_find = do + massertPpr (isExternalName (interpSymbolName sym_to_find)) (ppr sym_to_find) + let pkg_id = moduleUnitId $ nameModule (interpSymbolName sym_to_find) loaded_dlls = maybe [] loaded_pkg_hs_dlls $ lookupUDFM pkgs_loaded pkg_id go (dll:dlls) = do @@ -194,12 +190,12 @@ lookupHsSymbol interp pkgs_loaded nm sym_suffix = do go loaded_dlls -linkFail :: String -> String -> IO a +linkFail :: String -> SDoc -> IO a linkFail who what = throwGhcExceptionIO (ProgramError $ unlines [ "",who , "During interactive linking, GHCi couldn't find the following symbol:" - , ' ' : ' ' : what + , ' ' : ' ' : showSDocUnsafe what , "This may be due to you not asking GHCi to load extra object files," , "archives or DLLs needed by your current session. Restart GHCi, specifying" , "the missing library using the -L/path/to/object/dir and -lmissinglibname" @@ -210,28 +206,8 @@ linkFail who what ]) -nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastStringByteString label - where - encodeZ = fastZStringToByteString . zEncodeFS - (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of - -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers - -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. - mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS - mod -> mod - packagePart = encodeZ (unitFS pkgKey) - modulePart = encodeZ (moduleNameFS modName) - occPart = encodeZ $ occNameMangledFS (nameOccName n) - - label = mconcat $ - [ packagePart `mappend` "_" | pkgKey /= mainUnit ] - ++ - [modulePart - , "_" - , occPart - , "_" - , fromString suffix - ] + + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2901,7 +2901,7 @@ jsCodeGen hsc_env srcspan i this_mod stg_binds_with_deps binding_id = do jsLinkObject logger tmpfs tmp_dir js_config unit_env inst out_obj roots -- look up "id_sym" closure and create a StablePtr (HValue) from it - href <- lookupClosure interp (unpackFS id_sym) >>= \case + href <- lookupClosure interp (IFaststringSymbol id_sym) >>= \case Nothing -> pprPanic "Couldn't find just linked TH closure" (ppr id_sym) Just r -> pure r ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -217,12 +217,12 @@ loadName interp hsc_env name = do case lookupNameEnv (closure_env (linker_env pls)) name of Just (_,aa) -> return (pls,(aa, links, pkgs)) Nothing -> assertPpr (isExternalName name) (ppr name) $ - do let sym_to_find = nameToCLabel name "closure" - m <- lookupClosure interp (unpackFS sym_to_find) + do let sym_to_find = IClosureSymbol name + m <- lookupClosure interp sym_to_find r <- case m of Just hvref -> mkFinalizedHValue interp hvref Nothing -> linkFail "GHC.Linker.Loader.loadName" - (unpackFS sym_to_find) + (ppr sym_to_find) return (pls,(r, links, pkgs)) loadDependencies @@ -909,7 +909,7 @@ dynLoadObjs interp hsc_env pls at LoaderState{..} objs = do m <- loadDLL interp soFile case m of Right _ -> return $! pls { temp_sos = (libPath, libName) : temp_sos } - Left err -> linkFail msg err + Left err -> linkFail msg (text err) where msg = "GHC.Linker.Loader.dynLoadObjs: Loading temp shared object failed" ===================================== compiler/GHC/Runtime/Interpreter.hs ===================================== @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} -- | Interacting with the iserv interpreter, whether it is running on an -- external process or in the current process. @@ -83,7 +84,6 @@ import GHC.Data.Maybe import GHC.Data.FastString import GHC.Types.SrcLoc -import GHC.Types.Unique.FM import GHC.Types.Basic import GHC.Utils.Panic @@ -116,6 +116,12 @@ import GHC.Stack.CCS (CostCentre,CostCentreStack) import System.Directory import System.Process +import GHC.Builtin.Names +import GHC.Types.Name + +-- Standard libraries +import GHC.Exts + {- Note [Remote GHCi] ~~~~~~~~~~~~~~~~~~ When the flag -fexternal-interpreter is given to GHC, interpreted code @@ -457,38 +463,65 @@ handleSeqHValueStatus interp unit_env eval_status = initObjLinker :: Interp -> IO () initObjLinker interp = interpCmd interp InitLinker -lookupSymbol :: Interp -> FastString -> IO (Maybe (Ptr ())) +lookupSymbol :: Interp -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbol interp str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) ExtWasm i -> withWasmInterp i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) -lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> FastString -> IO (Maybe (Ptr ())) +lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbolInDLL interp dll str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbolInDLL dll (unpackFS str)) + sendMessage inst (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) -- wasm dyld doesn't track which symbol comes from which .so ExtWasm {} -> lookupSymbol interp str -lookupClosure :: Interp -> String -> IO (Maybe HValueRef) +interpSymbolToCLabel :: forall s . InterpSymbol s -> FastString +interpSymbolToCLabel s = eliminateInterpSymbol s interpretedInterpSymbol $ \is -> + let + n = interpSymbolName is + suffix = interpSymbolSuffix is + + encodeZ = fastZStringToByteString . zEncodeFS + (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of + -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. + mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS + mod -> mod + packagePart = encodeZ (unitFS pkgKey) + modulePart = encodeZ (moduleNameFS modName) + occPart = encodeZ $ occNameMangledFS (nameOccName n) + + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix + ] + in mkFastStringByteString label + +lookupClosure :: Interp -> InterpSymbol s -> IO (Maybe HValueRef) lookupClosure interp str = - interpCmd interp (LookupClosure str) + interpCmd interp (LookupClosure (unpackFS (interpSymbolToCLabel str))) -- | 'withSymbolCache' tries to find a symbol in the 'interpLookupSymbolCache' -- which maps symbols to the address where they are loaded. @@ -496,7 +529,7 @@ lookupClosure interp str = -- a miss we run the action which determines the symbol's address and populate -- the cache with the answer. withSymbolCache :: Interp - -> FastString + -> InterpSymbol s -- ^ The symbol we are looking up in the cache -> IO (Maybe (Ptr ())) -- ^ An action which determines the address of the symbol we @@ -513,21 +546,19 @@ withSymbolCache interp str determine_addr = do -- The analysis in #23415 further showed this cache should also benefit the -- internal interpreter's loading times, and needn't be used by the external -- interpreter only. - cache <- readMVar (interpLookupSymbolCache interp) - case lookupUFM cache str of - Just p -> return (Just p) + cached_val <- lookupInterpSymbolCache str (interpSymbolCache interp) + case cached_val of + Just {} -> return cached_val Nothing -> do - maddr <- determine_addr case maddr of Nothing -> return Nothing Just p -> do - let upd_cache cache' = addToUFM cache' str p - modifyMVar_ (interpLookupSymbolCache interp) (pure . upd_cache) - return (Just p) + updateInterpSymbolCache str (interpSymbolCache interp) p + return maddr purgeLookupSymbolCache :: Interp -> IO () -purgeLookupSymbolCache interp = modifyMVar_ (interpLookupSymbolCache interp) (const (pure emptyUFM)) +purgeLookupSymbolCache interp = purgeInterpSymbolCache (interpSymbolCache interp) -- | loadDLL loads a dynamic library using the OS's native linker -- (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either ===================================== compiler/GHC/Runtime/Interpreter/Types.hs ===================================== @@ -1,4 +1,6 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} -- | Types used by the runtime interpreter module GHC.Runtime.Interpreter.Types @@ -10,6 +12,20 @@ module GHC.Runtime.Interpreter.Types , ExtInterpInstance (..) , ExtInterpState (..) , InterpStatus(..) + -- * InterpSymbolCache + , InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + + -- * IServ , IServ , IServConfig(..) @@ -30,9 +46,6 @@ import GHC.Linker.Types import GHCi.RemoteTypes import GHCi.Message ( Pipe ) -import GHC.Types.Unique.FM -import GHC.Data.FastString ( FastString ) -import Foreign import GHC.Platform import GHC.Utils.TmpFs @@ -42,6 +55,7 @@ import GHC.Unit.State import GHC.Unit.Types import GHC.StgToJS.Types import GHC.StgToJS.Linker.Types +import GHC.Runtime.Interpreter.Types.SymbolCache import Control.Concurrent import System.Process ( ProcessHandle, CreateProcess ) @@ -56,7 +70,7 @@ data Interp = Interp , interpLoader :: !Loader -- ^ Interpreter loader - , interpLookupSymbolCache :: !(MVar (UniqFM FastString (Ptr ()))) + , interpSymbolCache :: !InterpSymbolCache -- ^ LookupSymbol cache } ===================================== compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs ===================================== @@ -0,0 +1,142 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} + +-- | The SymbolCache is used to cache lookups for specific symbols when using +-- the interpreter. +module GHC.Runtime.Interpreter.Types.SymbolCache ( + InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + ) where + +import GHC.Prelude + +import GHC.Types.Unique.FM +import GHC.Types.Name +import GHC.Data.FastString +import Foreign + +import Control.Concurrent +import GHC.Utils.Outputable +import GHC.TypeLits + + +-- The symbols records the suffix which each cache deals with. +newtype SymbolCache (s :: Symbol) = SymbolCache { _getSymbolCache :: UniqFM Name (Ptr ()) } + +-- Each cache is keyed by Name, there is one cache for each type of symbol we will +-- potentially lookup. The caches are keyed by 'Name' so that it is not necessary to consult +-- a complicated `FastString` each time. +data InterpSymbolCache = InterpSymbolCache { + interpClosureCache :: MVar (SymbolCache "closure") + , interpConInfoCache :: MVar (SymbolCache "con_info") + , interpStaticInfoCache :: MVar (SymbolCache "static_info") + , interpBytesCache :: MVar (SymbolCache "bytes") + , interpFaststringCache :: MVar (UniqFM FastString (Ptr ())) + } + +data SuffixOrInterpreted = Suffix Symbol | Interpreted + +data InterpSymbol (s :: SuffixOrInterpreted) where + IClosureSymbol :: Name -> InterpSymbol (Suffix "closure") + IConInfoSymbol :: Name -> InterpSymbol (Suffix "con_info") + IStaticInfoSymbol :: Name -> InterpSymbol (Suffix "static_info") + IBytesSymbol :: Name -> InterpSymbol (Suffix "bytes") + IFaststringSymbol :: FastString -> InterpSymbol Interpreted + +instance Outputable (InterpSymbol s) where + ppr s = eliminateInterpSymbol s + (\(IFaststringSymbol s) -> text "interpreted:" <> ppr s) + (\s -> text (interpSymbolSuffix s) <> colon <> ppr (interpSymbolName s)) + +eliminateInterpSymbol :: InterpSymbol s -> (InterpSymbol Interpreted -> r) + -> (forall x . InterpSymbol (Suffix x) -> r) + -> r +eliminateInterpSymbol s k1 k2 = + case s of + IFaststringSymbol {} -> k1 s + IBytesSymbol {} -> k2 s + IStaticInfoSymbol {} -> k2 s + IConInfoSymbol {} -> k2 s + IClosureSymbol {} -> k2 s + + +interpSymbolName :: InterpSymbol (Suffix s) -> Name +interpSymbolName (IClosureSymbol n) = n +interpSymbolName (IConInfoSymbol n) = n +interpSymbolName (IStaticInfoSymbol n) = n +interpSymbolName (IBytesSymbol n) = n + +interpretedInterpSymbol :: InterpSymbol Interpreted -> FastString +interpretedInterpSymbol (IFaststringSymbol s) = s + +interpSymbolSuffix :: InterpSymbol (Suffix s) -> String +interpSymbolSuffix (IClosureSymbol {}) = "closure" +interpSymbolSuffix (IConInfoSymbol {}) = "con_info" +interpSymbolSuffix (IStaticInfoSymbol {}) = "static_info" +interpSymbolSuffix (IBytesSymbol {}) = "bytes" + +emptySymbolCache :: SymbolCache s +emptySymbolCache = SymbolCache emptyUFM + +lookupSymbolCache :: InterpSymbol (Suffix s) -> SymbolCache s -> Maybe (Ptr ()) +lookupSymbolCache s (SymbolCache cache) = lookupUFM cache (interpSymbolName s) + +insertSymbolCache :: InterpSymbol (Suffix s) -> Ptr () -> SymbolCache s -> SymbolCache s +insertSymbolCache s v (SymbolCache cache) = SymbolCache (addToUFM cache (interpSymbolName s) v) + +lookupInterpSymbolCache :: InterpSymbol s -> InterpSymbolCache -> IO (Maybe (Ptr ())) +lookupInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var -> (\cache -> lookupUFM cache f) <$> readMVar mvar_var) + (\s mvar_var -> lookupSymbolCache s <$> readMVar mvar_var) + + +updateInterpSymbolCache :: InterpSymbol s + -> InterpSymbolCache -> Ptr () -> IO () +updateInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ addToUFM cache f v)) + (\s mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ insertSymbolCache s v cache)) + +withInterpSymbolCache :: + (InterpSymbol Interpreted -> MVar (UniqFM FastString (Ptr ())) -> r) + -> (forall x . InterpSymbol (Suffix x) -> MVar (SymbolCache x) -> r) + -> InterpSymbol s + -> InterpSymbolCache + -> r +withInterpSymbolCache k1 k2 key InterpSymbolCache{..} = + case key of + IClosureSymbol {} -> k2 key interpClosureCache + IConInfoSymbol {} -> k2 key interpConInfoCache + IStaticInfoSymbol {} -> k2 key interpStaticInfoCache + IBytesSymbol {} -> k2 key interpBytesCache + IFaststringSymbol {} -> k1 key interpFaststringCache + +-- | Clear all symbol caches. +purgeInterpSymbolCache :: InterpSymbolCache -> IO () +purgeInterpSymbolCache (InterpSymbolCache a b c d e) = do + modifyMVar_ a (\_ -> do + modifyMVar_ b (\_ -> do + modifyMVar_ c (\_ -> do + modifyMVar_ d (\_ -> do + modifyMVar_ e (\_ -> pure emptyUFM) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + +mkInterpSymbolCache :: IO InterpSymbolCache +mkInterpSymbolCache = do + InterpSymbolCache <$> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptyUFM ===================================== compiler/ghc.cabal.in ===================================== @@ -699,6 +699,7 @@ Library GHC.Runtime.Interpreter.JS GHC.Runtime.Interpreter.Process GHC.Runtime.Interpreter.Types + GHC.Runtime.Interpreter.Types.SymbolCache GHC.Runtime.Interpreter.Wasm GHC.Runtime.Loader GHC.Runtime.Utils View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f71c2835bfacac879b294bbcd475d7acfac4adfb -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f71c2835bfacac879b294bbcd475d7acfac4adfb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Feb 6 23:25:47 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Thu, 06 Feb 2025 18:25:47 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] 42 commits: CorePrep: Name `sat` binders more descriptively Message-ID: <67a544fbc40e0_1b036292a0b813486@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - df49e5c4 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 GHC-CPP: first rough proof of concept Processes #define FOO #ifdef FOO x = 1 #endif Into [ITcppIgnored [L loc ITcppDefine] ,ITcppIgnored [L loc ITcppIfdef] ,ITvarid "x" ,ITequal ,ITinteger (IL {il_text = SourceText "1", il_neg = False, il_value = 1}) ,ITcppIgnored [L loc ITcppEndif] ,ITeof] In time, ITcppIgnored will be pushed into a comment - - - - - b2a302c2 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Tidy up before re-visiting the continuation mechanic - - - - - c64b4f94 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Switch preprocessor to continuation passing style Proof of concept, needs tidying up - - - - - a5c04c9b by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Small cleanup - - - - - cec8c02b by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Get rid of some cruft - - - - - a2859c50 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Starting to integrate. Need to get the pragma recognised and set - - - - - 1dc916dc by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Make cppTokens extend to end of line, and process CPP comments - - - - - 3daf1203 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Remove unused ITcppDefined - - - - - 1216a224 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Allow spaces between # and keyword for preprocessor directive - - - - - fe6ef138 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Process CPP continuation lines They are emited as separate ITcppContinue tokens. Perhaps the processing should be more like a comment, and keep on going to the end. BUT, the last line needs to be slurped as a whole. - - - - - 35a2f2ca by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Accumulate CPP continuations, process when ready Can be simplified further, we only need one CPP token - - - - - 3840209f by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Simplify Lexer interface. Only ITcpp We transfer directive lines through it, then parse them from scratch in the preprocessor. - - - - - f01dc66b by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Deal with directive on last line, with no trailing \n - - - - - b818afbf by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Start parsing and processing the directives - - - - - f39b8d55 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Prepare for processing include files - - - - - dcaf6ec2 by Alan Zimmerman at 2025-02-06T18:12:11+00:00 Move PpState into PreProcess And initParserState, initPragState too - - - - - c12e6fac by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Process nested include files Also move PpState out of Lexer.x, so it is easy to evolve it in a ghci session, loading utils/check-cpp/Main.hs - - - - - 9088bf5e by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Split into separate files - - - - - bcdc3b91 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Starting on expression parser. But it hangs. Time for Text.Parsec.Expr - - - - - d19fed4a by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Start integrating the ghc-cpp work >From https://github.com/alanz/ghc-cpp - - - - - fec96f5d by Alan Zimmerman at 2025-02-06T18:12:12+00:00 WIP - - - - - c7860ea4 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Fixup after rebase - - - - - 85435784 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 WIP - - - - - 0002e194 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Fixup after rebase, including all tests pass - - - - - 43f024fa by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Change pragma usage to GHC_CPP from GhcCPP - - - - - 742b1d33 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Some comments - - - - - b7c75bd1 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Reformat - - - - - 29c5b9b1 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Delete unused file - - - - - d875742d by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Rename module Parse to ParsePP - - - - - cb028d2e by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Clarify naming in the parser - - - - - adefda60 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 WIP. Switching to alex/happy to be able to work in-tree Since Parsec is not available - - - - - e3156dba by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Layering is now correct - GHC lexer, emits CPP tokens - accumulated in Preprocessor state - Lexed by CPP lexer, CPP command extracted, tokens concated with spaces (to get rid of token pasting via comments) - if directive lexed and parsed by CPP lexer/parser, and evaluated - - - - - a4ccfe9e by Alan Zimmerman at 2025-02-06T18:12:12+00:00 First example working Loading Example1.hs into ghci, getting the right results ``` {-# LANGUAGE GHC_CPP #-} module Example1 where y = 3 x = "hello" "bye now" foo = putStrLn x ``` - - - - - c1739002 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Rebase, and all tests pass except whitespace for generated parser - - - - - 21f4e397 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 More plumbing. Ready for testing tomorrow. - - - - - febafc74 by Alan Zimmerman at 2025-02-06T18:12:12+00:00 Proress. Renamed module State from Types And at first blush it seems to handle preprocessor scopes properly. - - - - - f2c26471 by Alan Zimmerman at 2025-02-06T23:23:13+00:00 Insert basic GHC version macros into parser __GLASGOW_HASKELL__ __GLASGOW_HASKELL_FULL_VERSION__ __GLASGOW_HASKELL_PATCHLEVEL1__ __GLASGOW_HASKELL_PATCHLEVEL2__ - - - - - 30 changed files: - compiler/GHC.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Parser/Monad.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Config/Parser.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Parser.hs-boot - compiler/GHC/Parser.y - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/HaddockLex.x - compiler/GHC/Parser/Header.hs - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - + compiler/GHC/Parser/PreProcess.hs - + compiler/GHC/Parser/PreProcess/Eval.hs - + compiler/GHC/Parser/PreProcess/Lexer.x - + compiler/GHC/Parser/PreProcess/Macro.hs - + compiler/GHC/Parser/PreProcess/ParsePP.hs - + compiler/GHC/Parser/PreProcess/Parser.y - + compiler/GHC/Parser/PreProcess/ParserM.hs - + compiler/GHC/Parser/PreProcess/State.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0137afecab0854cb1cf89bef22940f28191845fc...f2c26471cb9ae42192d7ee70c66a4251070817c3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0137afecab0854cb1cf89bef22940f28191845fc...f2c26471cb9ae42192d7ee70c66a4251070817c3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 02:27:29 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Thu, 06 Feb 2025 21:27:29 -0500 Subject: [Git][ghc/ghc][wip/T25452] 76 commits: warnings: Find out if a qualified name is in the interactive scope directly Message-ID: <67a56f911358e_1f8f7e110920c4279c@gitlab.mail> Ben Gamari pushed to branch wip/T25452 at Glasgow Haskell Compiler / GHC Commits: f56558be by Matthew Pickering at 2025-01-07T13:53:03-05:00 warnings: Find out if a qualified name is in the interactive scope directly There were two ad-hoc mechanisms used to determine which modules were in the interactive scope. 1. Look at everything in the GRE, to see what is imported qualified. 2. Look at the last loaded module in the HPT. (1) Is very inefficient, GlobalRdrEnvs can be very big. (2) is incorrect, there is no reason to assume the "last" thing added to the HPT has any relevance to module loading order. Happily, the same checks can be implemented directly by looking at the interactive imports from the interactive context. This mirrors what happens for normal imports. Arguably, the error reporting code shouldn't be doing this kind of processing and it should be an option is set when rendering the error message. However, this just improves the situation and doesn't block progress on that front in future. See #14225 and #15611 Fixes #25600 - - - - - 84155cdb by Simon Peyton Jones at 2025-01-07T13:53:40-05:00 Tidy up kcConDecls Addresses #25630 In particular, * Introduce ConArgKind and use it. * Make kcConDecls and tcConDecls work the same way concerning the kind of argument types - - - - - 6c12b6cf by Bryan Richter at 2025-01-07T18:15:02-05:00 Remove tmp files after toolchain check Fixes #25620 - - - - - 42826a89 by Cheng Shao at 2025-01-07T18:15:39-05:00 xxhash: bump to v0.8.3 - - - - - 185f17e4 by sheaf at 2025-01-07T18:16:15-05:00 Fix typo in GHC.Tc.Solver.Solve.runTcPluginsWanted - - - - - 23099752 by Luite Stegeman at 2025-01-08T00:33:33+01:00 Add flags for switching off speculative evaluation. We found that speculative evaluation can increase the amount of allocations in some circumstances. This patch adds new flags for selectively disabling speculative evaluation, allowing us to test the effect of the optimization. The new flags are: -fspec-eval globally enable speculative evaluation -fspec-eval-dictfun enable speculative evaluation for dictionary functions (no effect if speculative evaluation is globally disabled) The new flags are on by default for all optimisation levels. See #25284 - - - - - 0161badc by Ben Gamari at 2025-01-09T17:30:05-05:00 rts/printClosure: Print IPE information for thunks and functions This makes it considerably easier to grok the structure of the heap when IPE information is available. - - - - - 023f36f5 by Rodrigo Mesquita at 2025-01-10T14:57:48-05:00 user_guide: Note -pgmP/-optP are for /Haskell/-CPP Fixes #25574 - - - - - e1c133f2 by Ben Gamari at 2025-01-10T14:58:25-05:00 dump-decls: Suppress unit-ids While the testsuite driver already normalizes these away, they are nevertheless a severe nuisance when diffing outside of the testsuite. Intriguingly, this doesn't completely eliminate the unit IDs; some wired-in names are still printed. However, this is a cheap and helpful improvement over the status quo so I am simply going to accept this. Fixes #25334. - - - - - 2e7bf446 by sheaf at 2025-01-13T10:55:26+01:00 Remove SDocs from ErrCtxt & ErrInfo This commit: - turns the SDoc used in ErrCtxt into a proper error datatype, ErrCtxtMsg, which contains all the different error contexts that can be added, - replaces ErrInfo with [ErrCtxt]. ErrInfo used to contain two SDocs; the first is replaced with [ErrCtxt], and the second is removed, with the relevant information being put in the appropriate error message constructors. Fixes #23436 - - - - - 2d62b970 by Mike Pilgrem at 2025-01-13T12:59:10-05:00 Re CLC #300 - Specify fmap for NonEmpty as map See: * https://github.com/haskell/core-libraries-committee/issues/300 Seeks to: * move existing instances for NonEmpty (except of Eq and Ord) out of GHC.Internal.Base into new GHC.Internal.Data.NonEmpty (to avoid otherwise unavoidable cycles in the module graph); * move map out of Data.List.NonEmpty (base package) into GHC.Internal.Data.NonEmpty; * define fmap as map for NonEmpty instance of Functor, avoiding code duplication; * re-export map from existing GHC.Internal.Data.List.NonEmpty; and * re-export map from Data.List.NonEmpty (base package); without breaking anything in the GHC repository. Various tests *.stdout and *.stderr files are amended also. - - - - - ab3ab3e3 by Luite Stegeman at 2025-01-13T12:59:58-05:00 compiler/coreprep: Turn off dictionary speculation by default Speculative evaluation can cause performance regressions, therefore we turn it off by default. It can be enabled again with the -fspec-eval-dictfun flag See #25284 - - - - - 3d9cacd5 by Patrick at 2025-01-14T02:34:46+08:00 Enhance kind inference for data family instances This commit improves kind inference for data family instances by kind-checking the constructors, for H98 and newtype declarations (ONLY), as well as kind-checking the result kind signature (when using GADT syntax). This fixes #25611. Typechecker changes: In `tcDataFamInstHeader`, we now kind-check the constructors using `kcConDecls`, for H98-style decls and newtype decls ONLY. See Note [Kind inference for data family instances]. Testsuite changes: - The T25611{a,b,c,d} tests test the new kind inference implementation. - a,b: infer result kind from constructors (H98 case) - c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail, which now passes - d: GADT case, checking that we don't infer overly rigid kinds when kind-checking the constructors in data family instances. - DataInstanceKindsDefaults tests defaulting data instance kinds without UnliftedNewtypes or UnliftedDatatypes, as outlined in Note [Defaulting result kind of newtype/data family instance]. Also a few notes are updated to reflect the changes. Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones at gmail.com> - - - - - f6493dbc by amesgen at 2025-01-15T18:47:23-05:00 wasm: prevent bundlers from resolving import("node:timers") This fixes the following esbuild error: ✘ [ERROR] Could not resolve "node:timers" www/ghc_wasm_jsffi.js:66:25: 66 │ return (await import("node:timers")).setImmediate; ╵ ~~~~~~~~~~~~~ The package "node:timers" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "--platform=node" to do that, which will remove this error. Previously (i.e. after !13503), one had to work around this by passing `--external:node:timers`. - - - - - 87e82e2e by sheaf at 2025-01-16T14:51:45+01:00 Use checkTyEqRhs to make types concrete This commit refactors makeTypeConcrete to call checkTyEqRhs with the appropriate parameters. This avoids duplicating subtle logic in two places in the compiler. Changes: 1. Refactor of 'TyEqFlags'. Now 'TyEqFlags' stores a 'TEFTask', which is a description of which of the following checks we want to perform in 'checkTyEqRhs': - occurs check - level check - concreteness check In the process, the 'AreUnifying' datatype has been removed, as it is no longer needed. 2. Refactor of 'checkTyVar': a. Make use of the new 'TEFTask' data type to decide which checks to perform. In particular, this ensures that we perform **both** a concreteness check and a level check when both are required; previously we only did a concreteness check (that was a bug!). b. Recursively call 'checkTyVar' on the kind of unfilled metavariables. This deals with a bug in which we failed to uphold the invariant that the kind of a concrete type must itself be concrete. See test cases T23051, T23176. 3. Re-write of 'makeTypeConcrete', which now simply calls 'checkTyEqRhs' with appropriate 'TyEqFlags'/'TEFTask'. This gets rid of code duplication and risk for the two code paths going out-of-sync. Fixes #25616. See also #23883. - - - - - 5a8f35bd by ARATA Mizuki at 2025-01-17T11:17:49-05:00 x86 NCG: Use correct format for MOVD in the implementation of unpackInt64X2# MOVD takes the input format. Fixes #25658 - - - - - 14f8a7ec by Mateusz Goślinowski at 2025-01-17T22:49:09+00:00 Allow multiline strings in JS FFI (#25633) - - - - - 854c2f75 by Simon Peyton Jones at 2025-01-18T02:54:08-05:00 Fix a buglet in tcSplitForAllTyVarsReqTVBindersN The problem was that an equation in `split` had two guards (one about visiblity and one about `n_req`). So it fell thorugh if /either/ was False. But the next equation then assumed an invisible binder. Simple bug, easily fixed. Fixes #25661. - - - - - 264a1186 by sheaf at 2025-01-18T10:05:56+00:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - bf4f5ad3 by Jade at 2025-01-18T10:05:56+00:00 Add structured errors to GHCi (#23338) This patch creates the 'GhciCommandErrorMessage' data type which implents the 'Diagnostic' class and also provides error code for these error conditions. - - - - - b6f54188 by Ben Gamari at 2025-01-18T12:38:46-05:00 Revert "Division by constants optimization" This appears to be responsible for the regression described in #25653. This reverts commit daff1e30219d136977c71f42e82ccc58c9013cfb. - - - - - 0fd90de8 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Introduce div2 test This is a useful test from !8392 which is worth keeping around. - - - - - 32680979 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Test shift correctness in mul2 test - - - - - 163aa50a by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Add regression test for #25653 - - - - - 44778963 by Matthew Pickering at 2025-01-20T11:23:08+00:00 driver: Store an ExternalModuleGraph in the EPS We now store an ExternalModuleGraph in the EPS. When an new interface is loaded, the module graph is extended with a node for the loaded interface. The result is a partial module graph. If you want to run a transitive closure query on the graph you must first force the transitive closure to be loaded by using `loadExternalGraphBelow`. The primary advantage (for now) is that the transitive dependency calculation does not have to be repeated in getLinkDeps. If your module had many dependencies and many splices, performing this calculation at every splice site took a significant amount of time. We might also want to use this module graph in future for considering questions such as reachability of rules or accessibilty of instance imported by levelled imported. This patch removes another place in the compiler where transitive dependency is calculated in an ad-hoc manner. In general, the transitive dependency calculation should be cached and computed using a ModuleGraph abstraction. The transitive dependency query required by getLinkDeps operates on a graph without hs-boot nodes. If a linkable from a module in a loop is needed, then all modules in the loop are necessary to be available to execute that module. Therefore there is a query in `ModuleGraph` and `ExternalModuleGraph` which allows a transitive closure query to be performed on a graph without loops. Fixes #25634 ------------------------- Metric Decrease: MultiLayerModulesTH_Make MultiLayerModulesTH_OneShot Metric Increase: mhu-perf ------------------------- Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - b3c0acfc by Cheng Shao at 2025-01-20T11:53:10-05:00 hie: fix hie.yaml to use default hie-bios script !13778 accidentally changed hie.yaml to use hie-bios.bat as the default hie-bios script, which completely breaks hie support on non-Windows platforms. This patch reverts that change. - - - - - 595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. - - - - - 09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00 Fix :info pretty-printing of UNPACKed fields This patch: * Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int` as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the `:info` command. * Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one unpacks a newtype) from being printed in `:info` output unless `-dppr-debug` is enabled. Fixes #25651. - - - - - 6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00 driver: Store the HomePackageTable in a mutable reference This commit refactors the HomePackageTable and HomeUnitGraph: (1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511) (2) And it reworks these structures into their own modules to simplify the driver. The refactor is driven by the introduction of IO in the HPT interface, but is a bit more aggressive in simplifying the interfaces to enforce correct usage (ie to avoid performance pitfalls). Specifically: - The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph` - The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable` - The HPT now stores an `IORef` with the table of loaded home package modules. - The interface to the HPT now requires IO - The interface now enforces that the HPT is a datastructure that only grows - This is not enforced in the interface, but, clients of the HPT should never care about there being more or less entries in the HPT when these additional entries are not relevant to their result. - The exception to the invariant that the HPT is monotonically increasing is `restrictHpt`, a function which is called at a "barrier point" (during which there are no other threads inspecting or inserting in the HPT). The invariant can be temporarily broken at this point (currently, after upsweep). This is safe because a single thread holds control over the structure (thus the invariant being broken is never observed). The hug_var and associated structures in the driver, which aimed to improve memory usage in the driver by updating in place a HUG during upsweep, are no longer required as the HPT entries in the HUG are now themselves mutable by construction. This was previously explained in Note [ModuleNameSet, efficiency and space leaks], which is no longer relevant and was deleted. Fixes #25511 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> ------------------------- Metric Decrease: MultiComponentModulesRecomp MultiLayerModulesRecomp ------------------------- - - - - - f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 Fix build with gcc-15 which defaults to C23 standard (-std=gnu23) Fixes #25662 ``` utils/hp2ps/Utilities.c:6:14: error: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c:5:1: error: note: ‘malloc’ is declared in header ‘<stdlib.h>’ 4 | #include "Error.h" +++ |+#include <stdlib.h> 5 | | 5 | | ^ utils/hp2ps/Utilities.c: In function ‘xmalloc’: utils/hp2ps/Utilities.c:80:17: error: error: too many arguments to function ‘malloc’; expected 0, have 1 80 | r = (void*) malloc(n); | ^~~~~~ ~ | 80 | r = (void*) malloc(n); | ^ utils/hp2ps/Utilities.c:6:14: error: note: declared here 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c: In function ‘xrealloc’: utils/hp2ps/Utilities.c:92:18: error: warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:92:18: error: note: ‘realloc’ is declared in header ‘<stdlib.h>’ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:94:9: error: error: too many arguments to function ‘realloc’; expected 0, have 2 94 | r = realloc(p, n); | ^~~~~~~ ~ | 94 | r = realloc(p, n); | ^ utils/hp2ps/Utilities.c:92:18: error: note: declared here 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ ``` - - - - - 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 97a72fdd by Ben Gamari at 2025-02-06T21:26:48-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 0c283e02 by Ben Gamari at 2025-02-06T21:26:56-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 571f6a7f by Ben Gamari at 2025-02-06T21:26:58-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 01ca7ca8 by Ben Gamari at 2025-02-06T21:27:01-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 88aa496c by Ben Gamari at 2025-02-06T21:27:04-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 40e51186 by Ben Gamari at 2025-02-06T21:27:07-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Uniques.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/Config.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/985e73beb05bf1b22df3f2ed529e8006820e02d5...40e51186bd46f30382558de995c6a096b6d840c8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/985e73beb05bf1b22df3f2ed529e8006820e02d5...40e51186bd46f30382558de995c6a096b6d840c8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 02:41:49 2025 From: gitlab at gitlab.haskell.org (Matthew Craven (@clyring)) Date: Thu, 06 Feb 2025 21:41:49 -0500 Subject: [Git][ghc/ghc][wip/TagToEnum-class] 5560 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <67a572ed3733b_1f8f7e152460c43737@gitlab.mail> Matthew Craven pushed to branch wip/TagToEnum-class at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 Move parser + parser tests out to own package. We move some types out that are necessary as well and then re-export and specialise them in the core Haddock. Reason for moving out spec tests is that if we're working on the parser, we can simply work on that and we can ignore the rest of Haddock. The downside is that it's a little inconvenient if at the end of the day we want to see that everything passes. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 Remove no longer necessary parser error handling. We can now drop some Maybe tests and even lets us strip an error handling monad away in a few places. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 Please the GHC build-system. As I can not figure out how to do this properly, if we're in GHC tree, we treat the library as being the same package. If we're not in the tree, we require that the library be installed separately. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 Revert "Accomodate change in PatSyn representation" This reverts commit 57aa591362d7c8ba21285fccd6a958629a422091. I am reverting this because I pushed it to master when it was meant to stay on a wip-branch. Sorry Gergo and everyone who had trouble due to this. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 Update cabal files Update repository urls, use subdir property for haddock-library and use a separate versioning scheme for haddock-library in preparation for release. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 haddock-library: Do not depend on haddock-library in test suite I think you either add src to hs-source-dirs or the library to build-depends. But doing both does not make sense (AFAICT). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 Use Travis with multiple GHC versions When using HEAD, we build haddock-library directly from repository as a dependency (and thanks to --enable-tests, the tests get ran anyway). In all other cases, we manually run the tests on haddock-library only and don't test the main project. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 Drop DocParagraph from front of headers I can not remember why they were wrapped in paragraphs to begin with and it seems unnecessary now that I test it. Closes haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 Don't mangle append order for nested lists. The benefit of this is that the ‘top-level’ element of such lists is properly wrapped in <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 Merge branch 'reverts' This reverts any changes that were made to have Haddock compile with 7.9. When 7.10 release comes, we can simply re-apply all the patches and any patches that occur on ghc-head branch from now on. This allows us to build master with 7.8.3 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#313 by doing some list munging. I get rid of the Monoid instance because we weren't satisfying the laws. Convenience of having <> didn't outweigh the shock-factor of having it behave badly. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#188. Because the change is in GHC 7.9 and we now work against 7.8.3, this test no longer makes sense. We revert it until 7.10 becomes the standard version. If anything, there should be a test for this in GHC itself. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 Fix extra whitespace on signatures and update all test cases This was long overdue, now running ./accept.lhs on a clean test from master will not generate a bunch of changes. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 Changes due to ghc api changes in package representation Also fix a bug with finding the package name and version given a module. This had become wrong due to the package key changes (it was very hacky in the first place). We now look up the package key in the package db to get the package info properly. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 Import Data.Word w/o import-list This is needed to keep the compilation warning free (and thus pass GHC's ./validate) regardless of whether Word is re-exported from Prelude or not See https://ghc.haskell.org/trac/ghc/ticket/9531 for more details - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 Revert "Followup changes to addition of -fwarn-context-quantification" This reverts commit 4023817d7c0e46db012ba2eea28022626841ca9b temporarily as the respective feature hasn't landed in GHC HEAD yet, but this commit blocks later commits from being referenced in GHC HEAD. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 Revert "Fix import of 'empty' due to AMP." This reverts commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 since it turns out we don't need to re-export `empty` from Control.Monad after all. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 Fix improper lazy IO use Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 Fix use-after-close lazy IO bug Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results. Signed-off-by: David Feuer <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 Allow an optional colon after the closing bracket of definition lists This is to disambiguate them from markdown links and will be require with a future release. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 Turn some uses of error into recoverable warnings This should at the very least not abort when something weird happens. It does feel like we should have a type that carries these errors until the end however as the user might not see them unless they are printed at the end. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 Allow the parser to spit out meta-info Currently we only use it only for ‘since’ annotations but with these patches it should be fairly simple to add new attributes if we wish to. Closes haskell/haddock#26. It seems to work fine but due to 7.10 rush I don't have the chance to do more exhaustive testing right now. The way the meta is output (emphasis at the end of the whole comment) is fairly arbitrary and subject to bikeshedding. Note that this makes test for Bug310 fail due to interface version bump: it can't find the docs for base with this interface version so it fails. There is not much we can do to help this because it tests for ’built-in’ identifier, not something we can provide ourselves. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 Changes due to ghc api changes in package representation Also fix a bug with finding the package name and version given a module. This had become wrong due to the package key changes (it was very hacky in the first place). We now look up the package key in the package db to get the package info properly. Conflicts: haddock-api/src/Haddock.hs - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 Import Data.Word w/o import-list This is needed to keep the compilation warning free (and thus pass GHC's ./validate) regardless of whether Word is re-exported from Prelude or not See https://ghc.haskell.org/trac/ghc/ticket/9531 for more details - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 Support for PartialTypeSignatures Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs haddock-api/src/Haddock/Interface/Create.hs - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 Treat GHC 7.10 the same as GHC 7.9 ...since the current GHC 7.9 is going to become GHC 7.10 real-soon-now anyway - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 Fixup ghc.mk (follow-up to 1739375eb23342) This makes the GHC build-system aware of the data-files to be copied into the bindist (as haddock.cabal doesn't list those anymore) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 Update test files Test: a correct behaviour for fields comma-separating values. I'm surprised we had no bug open for this. Maybe it affects how haskell/haddock#301 renders now but I doubt. Operators: Seems GHC is giving us a new order for operators, something must have changed on their side again. cc @haasn , this makes the fixity to the side not match the order on the LHS which is a bit unpleasant. Maybe the fixity can be made to match the GHC order? Bug335: We expand examples by default now. Bug310: Now inferred safe. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --package-name and --package-version flags Used for --hoogle amongst other things. Now we need to teach cabal to use it. The situation is still a bit sub-par because if the flags aren't passed in, the crash will occur. Closes haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --package-name and --package-version flags Used for --hoogle amongst other things. Now we need to teach cabal to use it. The situation is still a bit sub-par because if the flags aren't passed in, the crash will occur. Closes haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 Prevent Synopsis from using up too much horizontal space When long type signatures occur in the Synopsis, the element is stretched beyond the width of the window. Scrollbars don't appear, so it's impossible to read anything when this happens. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Test for anchor defaulting I delete the old tests because it turns out that: * test runner would never put them in scope of each other even with imports so just one would suffice * test runner actually needed some hacking to keep links so in the end we would end up with no anchors making them useless - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 Output method documentation in Hoogle backend One thing of note is that we no longer preserve grouping of methods and print each method on its own line. We could preserve it if no documentation is present for any methods in the group if someone asks for it though. Fixes haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 ApiAnnotations : strings in warnings do not return SourceText The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 Update after wild card renaming refactoring in D613 Summary: * Move `Post*` type instances to `Haddock.Types` as other modules than `Haddock.Interface.Rename` will rely on these type instances. * Update after wild card renaming refactoring in D613. Reviewers: simonpj, austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D954 GHC Trac Issues: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 Fix haddock: internal error: spliceURL UnhelpfulSpan (#207) Inferred type signatures don't have SrcSpans, so let's use the one from the declaration. I've tested this manually on the test-case from haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 Fix alignment of Source links in instance table in Firefox Due to a Firefox bug [1], a combination of 'whitespace: nowrap' on the parent element with 'float: right' on the inner element can cause the floated element to be displaced downwards for no apparent reason. To work around this, the left side is wrapped in its own <span> and set to 'float: left'. As a precautionary measure to prevent the parent element from collapsing entirely, we also add the classic "clearfix" hack. The latter is not strictly needed but it helps prevent bugs if the layout is altered again in the future. Fixes haskell/haddock#384. Remark: line 159 of src/Haddock/Backends/Xhtml/Layout.hs was indented to prevent confusion over the operator precedence of (<+>) vs (<<). [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=488725 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 ApiAnnotations : strings in warnings do not return SourceText The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 Update after wild card renaming refactoring in D613 Summary: * Move `Post*` type instances to `Haddock.Types` as other modules than `Haddock.Interface.Rename` will rely on these type instances. * Update after wild card renaming refactoring in D613. Reviewers: simonpj, austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D954 GHC Trac Issues: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - a3ee3b99 by Moritz Angermann at 2023-12-12T19:50:58-05:00 Drop hard Xcode dependency XCODE_VERSION calls out to `xcodebuild`, which is only available when having `Xcode` installed. The CommandLineTools are not sufficient. To install Xcode, you must have an apple id to download the Xcode.xip from apple. We do not use xcodebuild anywhere in our build explicilty. At best it appears to be a proxy for checking the linker or the compiler. These should rather be done with ``` xcrun ld -version ``` or similar, and not by proxy through Xcode. The CLR should be sufficient for building software on macOS. - - - - - 1c9496e0 by Vladislav Zavialov at 2023-12-12T19:51:34-05:00 docs: update information on RequiredTypeArguments Update the User's Guide and Release Notes to account for the recent progress in the implementation of RequiredTypeArguments. - - - - - d0b17576 by Ben Gamari at 2023-12-13T06:33:37-05:00 rts/eventlog: Fix off-by-one in assertion Previously we failed to account for the NULL terminator `postString` asserted that there is enough room in the buffer for the string. - - - - - a10f9b9b by Ben Gamari at 2023-12-13T06:33:37-05:00 rts/eventlog: Honor result of ensureRoomForVariableEvent is Previously we would keep plugging along, even if isn't enough room for the event. - - - - - 0e0f41c0 by Ben Gamari at 2023-12-13T06:33:37-05:00 rts/eventlog: Avoid truncating event sizes Previously ensureRoomForVariableEvent would truncate the desired size to 16-bits, resulting in #24197. Fixes #24197. - - - - - 64e724c8 by Artin Ghasivand at 2023-12-13T06:34:20-05:00 Remove the "Derived Constraint" argument of TcPluginSolver, docs - - - - - fe6d97dd by Vladislav Zavialov at 2023-12-13T06:34:56-05:00 EPA: Move tokens into GhcPs extension fields (#23447) Summary of changes * Remove Language.Haskell.Syntax.Concrete * Move all tokens into GhcPs extension fields (LHsToken -> EpToken) * Create new TTG extension fields as needed * Drop the MultAnn wrapper Updates the haddock submodule. Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 8106e695 by Zubin Duggal at 2023-12-13T06:35:34-05:00 testsuite: use copy_files in T23405 This prevents the tree from being dirtied when the file is modified. - - - - - ed0e4099 by Bryan Richter at 2023-12-14T04:30:53-05:00 Document ghc package's PVP-noncompliance This changes nothing, it just makes the status quo explicit. - - - - - 8bef8d9f by Luite Stegeman at 2023-12-14T04:31:33-05:00 JS: Mark spurious CI failures js_fragile(24259) This marks the spurious test failures on the JS platform as js_fragile(24259), so we don't hold up merge requests while fixing the underlying issues. See #24259 - - - - - 1c79526a by Finley McIlwaine at 2023-12-15T12:24:40-08:00 Late plugins - - - - - 000c3302 by Finley McIlwaine at 2023-12-15T12:24:40-08:00 withTiming on LateCCs and late plugins - - - - - be4551ac by Finley McIlwaine at 2023-12-15T12:24:40-08:00 add test for late plugins - - - - - 7c29da9f by Finley McIlwaine at 2023-12-15T12:24:40-08:00 Document late plugins - - - - - 9a52ae46 by Ben Gamari at 2023-12-20T07:07:26-05:00 Fix thunk update ordering Previously we attempted to ensure soundness of concurrent thunk update by synchronizing on the access of the thunk's info table pointer field. This was believed to be sufficient since the indirectee (which may expose a closure allocated by another core) would not be examined until the info table pointer update is complete. However, it turns out that this can result in data races in the presence of multiple threads racing a update a single thunk. For instance, consider this interleaving under the old scheme: Thread A Thread B --------- --------- t=0 Enter t 1 Push update frame 2 Begin evaluation 4 Pause thread 5 t.indirectee=tso 6 Release t.info=BLACKHOLE 7 ... (e.g. GC) 8 Resume thread 9 Finish evaluation 10 Relaxed t.indirectee=x 11 Load t.info 12 Acquire fence 13 Inspect t.indirectee 14 Release t.info=BLACKHOLE Here Thread A enters thunk `t` but is soon paused, resulting in `t` being lazily blackholed at t=6. Then, at t=10 Thread A finishes evaluation and updates `t.indirectee` with a relaxed store. Meanwhile, Thread B enters the blackhole. Under the old scheme this would introduce an acquire-fence but this would only synchronize with Thread A at t=6. Consequently, the result of the evaluation, `x`, is not visible to Thread B, introducing a data race. We fix this by treating the `indirectee` field as we do all other mutable fields. This means we must always access this field with acquire-loads and release-stores. See #23185. - - - - - f4b53538 by Vladislav Zavialov at 2023-12-20T07:08:02-05:00 docs: Fix link to 051-ghc-base-libraries.rst The proposal is no longer available at the previous URL. - - - - - f7e21fab by Matthew Pickering at 2023-12-21T14:57:40+00:00 hadrian: Build all executables in bin/ folder In the end the bindist creation logic copies them all into the bin folder. There is no benefit to building a specific few binaries in the lib/bin folder anymore. This also removes the ad-hoc logic to copy the touchy and unlit executables from stage0 into stage1. It takes <1s to build so we might as well just build it. - - - - - 0038d052 by Zubin Duggal at 2023-12-22T23:28:00-05:00 testsuite: mark jspace as fragile on i386. This test has been flaky for some time and has been failing consistently on i386-linux since 8e0446df landed. See #24261 - - - - - dfd670a0 by Ben Bellick at 2023-12-24T10:10:31-05:00 Deprecate -ddump-json and introduce -fdiagnostics-as-json 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. - - - - - 609e6225 by Ben Bellick at 2023-12-24T10:10:31-05:00 Deprecate -ddump-json and introduce -fdiagnostics-as-json 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. - - - - - 865513b2 by Ömer Sinan Ağacan at 2023-12-24T10:11:13-05:00 Fix BNF in user manual 6.6.8.2: formal syntax for instance declarations - - - - - c247b6be by Zubin Duggal at 2023-12-25T16:01:23-05:00 docs: document permissibility of -XOverloadedLabels (#24249) Document the permissibility introduced by https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0170-unrestricted-overloadedlabels.rst - - - - - e5b7eb59 by Ömer Sinan Ağacan at 2023-12-25T16:02:03-05:00 Fix a code block syntax in user manual sec. 6.8.8.6 - - - - - 2db11c08 by Ben Gamari at 2023-12-29T15:35:48-05:00 genSym: Reimplement via CAS on 32-bit platforms Previously the remaining use of the C implementation on 32-bit platforms resulted in a subtle bug, #24261. This was due to the C object (which used the RTS's `atomic_inc64` macro) being compiled without `-threaded` yet later being used in a threaded compiler. Side-step this issue by using the pure Haskell `genSym` implementation on all platforms. This required implementing `fetchAddWord64Addr#` in terms of CAS on 64-bit platforms. - - - - - 19328a8c by Xiaoyan Ren at 2023-12-29T15:36:30-05:00 Do not color the diagnostic code in error messages (#24172) - - - - - 685b467c by Krzysztof Gogolewski at 2023-12-29T15:37:06-05:00 Enforce that bindings of implicit parameters are lifted Fixes #24298 - - - - - bc4d67b7 by Matthew Craven at 2023-12-31T06:15:42-05:00 StgToCmm: Detect some no-op case-continuations ...and generate no code for them. Fixes #24264. - - - - - 5b603139 by Krzysztof Gogolewski at 2023-12-31T06:16:18-05:00 Revert "testsuite: mark jspace as fragile on i386." This reverts commit 0038d052c8c80b4b430bb2aa1c66d5280be1aa95. The atomicity bug should be fixed by !11802. - - - - - d55216ad by Krzysztof Gogolewski at 2024-01-01T12:05:49-05:00 Refactor: store [[PrimRep]] rather than [Type] in STG StgConApp stored a list of types. This list was used exclusively during unarisation of unboxed sums (mkUbxSum). However, this is at a wrong level of abstraction: STG shouldn't be concerned with Haskell types, only PrimReps. Update the code to store a [[PrimRep]]. Also, there's no point in storing this list when we're not dealing with an unboxed sum. - - - - - 8b340bc7 by Ömer Sinan Ağacan at 2024-01-01T12:06:29-05:00 Kind signatures docs: mention that they're allowed in newtypes - - - - - 989bf8e5 by Zubin Duggal at 2024-01-03T20:08:47-05:00 ci: Ensure we use the correct bindist name for the test artifact when generating release ghcup metadata Fixes #24268 - - - - - 89299a89 by Krzysztof Gogolewski at 2024-01-03T20:09:23-05:00 Refactor: remove calls to typePrimRepArgs The function typePrimRepArgs is just a thin wrapper around typePrimRep, adding a VoidRep if the list is empty. However, in StgToByteCode, we were discarding that VoidRep anyway, so there's no point in calling it. - - - - - c7be0c68 by mmzk1526 at 2024-01-03T20:10:07-05:00 Use "-V" for alex version check for better backward compatibility Fixes #24302. In recent versions of alex, "-v" is used for "--verbose" instead of "-version". - - - - - 67dbcc0a by Krzysztof Gogolewski at 2024-01-05T02:07:18-05:00 Fix VoidRep handling in ghci debugger 'go' inside extractSubTerms was giving a bad result given a VoidRep, attempting to round towards the next multiple of 0. I don't understand much about the debugger but the code should be better than it was. Fixes #24306 - - - - - 90ea574e by Krzysztof Gogolewski at 2024-01-05T02:07:54-05:00 VoidRep-related refactor * In GHC.StgToByteCode, replace bcIdPrimId with idPrimRep, bcIdArgRep with idArgRep, atomPrimRep with stgArgRep1. All of them were duplicates. * In GHC.Stg.Unarise, we were converting a PrimRep to a Type and back to PrimRep. Remove the calls to primRepToType and typePrimRep1 which cancel out. * In GHC.STG.Lint, GHC.StgToCmm, GHC.Types.RepType we were filtering out VoidRep from the result of typePrimRep. But typePrimRep never returns VoidRep - remove the filtering. - - - - - eaf72479 by brian at 2024-01-06T23:03:09-05:00 Add unaligned Addr# primops Implements CLC proposal #154: https://github.com/haskell/core-libraries-committee/issues/154 * add unaligned addr primops * add tests * accept tests * add documentation * fix js primops * uncomment in access ops * use Word64 in tests * apply suggestions * remove extra file * move docs * remove random options * use setByteArray# primop * better naming * update base-exports test * add base-exports for other architectures - - - - - d471d445 by Krzysztof Gogolewski at 2024-01-06T23:03:47-05:00 Remove VoidRep from PrimRep, introduce PrimOrVoidRep This introduces data PrimOrVoidRep = VoidRep | NVRep PrimRep changes typePrimRep1 to return PrimOrVoidRep, and adds a new function typePrimRepU to be used when the argument is definitely non-void. Details in Note [VoidRep] in GHC.Types.RepType. Fixes #19520 - - - - - 48720a07 by Matthew Craven at 2024-01-08T18:57:36-05:00 Apply Note [Sensitivity to unique increment] to LargeRecord - - - - - 9e2e180f by Sebastian Graf at 2024-01-08T18:58:13-05:00 Debugging: Add diffUFM for convenient diffing between UniqFMs - - - - - 948f3e35 by Sebastian Graf at 2024-01-08T18:58:13-05:00 Rename Opt_D_dump_stranal to Opt_D_dump_dmdanal ... and Opt_D_dump_str_signatures to Opt_D_dump_dmd_signatures - - - - - 4e217e3e by Sebastian Graf at 2024-01-08T18:58:13-05:00 Deprecate -ddump-stranal and -ddump-str-signatures ... and suggest -ddump-dmdanal and -ddump-dmd-signatures instead - - - - - 6c613c90 by Sebastian Graf at 2024-01-08T18:58:13-05:00 Move testsuite/tests/stranal to testsuite/tests/dmdanal A separate commit so that the rename is obvious to Git(Lab) - - - - - c929f02b by Sebastian Graf at 2024-01-08T18:58:13-05:00 CoreSubst: Stricten `substBndr` and `cloneBndr` Doing so reduced allocations of `cloneBndr` by about 25%. ``` T9233(normal) ghc/alloc 672,488,656 663,083,216 -1.4% GOOD T9675(optasm) ghc/alloc 423,029,256 415,812,200 -1.7% geo. mean -0.1% minimum -1.7% maximum +0.1% ``` Metric Decrease: T9233 - - - - - e3ca78f3 by Krzysztof Gogolewski at 2024-01-10T17:35:59-05:00 Deprecate -Wsemigroup This warning was used to prepare for Semigroup becoming a superclass of Monoid, and for (<>) being exported from Prelude. This happened in GHC 8.4 in 8ae263ceb3566 and feac0a3bc69fd3. The leftover logic for (<>) has been removed in GHC 9.8, 4d29ecdfcc79. Now the warning does nothing at all and can be deprecated. - - - - - 08d14925 by amesgen at 2024-01-10T17:36:42-05:00 WASM metadata: use correct GHC version - - - - - 7a808419 by Xiaoyan Ren at 2024-01-10T17:37:24-05:00 Allow SCC declarations in TH (#24081) - - - - - 28827c51 by Xiaoyan Ren at 2024-01-10T17:37:24-05:00 Fix prettyprinting of SCC pragmas - - - - - ae9cc1a8 by Matthew Craven at 2024-01-10T17:38:01-05:00 Fix loopification in the presence of void arguments This also removes Note [Void arguments in self-recursive tail calls], which was just misleading. It's important to count void args both in the function's arity and at the call site. Fixes #24295. - - - - - b718b145 by Zubin Duggal at 2024-01-10T17:38:36-05:00 testsuite: Teach testsuite driver about c++ sources - - - - - 09cb57ad by Zubin Duggal at 2024-01-10T17:38:36-05:00 driver: Set -DPROFILING when compiling C++ sources with profiling Earlier, we used to pass all preprocessor flags to the c++ compiler. This meant that -DPROFILING was passed to the c++ compiler because it was a part of C++ flags However, this was incorrect and the behaviour was changed in 8ff3134ed4aa323b0199ad683f72165e51a59ab6. See #21291. But that commit exposed this bug where -DPROFILING was no longer being passed when compiling c++ sources. The fix is to explicitly include -DPROFILING in `opt_cxx` when profiling is enabled to ensure we pass the correct options for the way to both C and C++ compilers Fixes #24286 - - - - - 2cf9dd96 by Zubin Duggal at 2024-01-10T17:38:36-05:00 testsuite: rename objcpp -> objcxx To avoid confusion with C Pre Processsor - - - - - af6932d6 by Simon Peyton Jones at 2024-01-10T17:39:12-05:00 Make TYPE and CONSTRAINT not-apart Issue #24279 showed up a bug in the logic in GHC.Core.Unify.unify_ty which is supposed to make TYPE and CONSTRAINT be not-apart. Easily fixed. - - - - - 4a39b5ff by Zubin Duggal at 2024-01-10T17:39:48-05:00 ci: Fix typo in mk_ghcup_metadata.py There was a missing colon in the fix to #24268 in 989bf8e53c08eb22de716901b914b3607bc8dd08 - - - - - 13503451 by Zubin Duggal at 2024-01-10T17:40:24-05:00 release-ci: remove release-x86_64-linux-deb11-release+boot_nonmoving_gc job There is no reason to have this release build or distribute this variation. This configuration is for testing purposes only. - - - - - afca46a4 by Sebastian Graf at 2024-01-10T17:41:00-05:00 Parser: Add a Note detailing why we need happy's `error` to implement layout - - - - - eaf8a06d by Krzysztof Gogolewski at 2024-01-11T00:43:17+01:00 Turn -Wtype-equality-out-of-scope on by default Also remove -Wnoncanonical-{monoid,monad}-instances from -Wcompat, since they are enabled by default. Refresh wcompat-warnings/ test with new -Wcompat warnings. Part of #24267 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 42bee5aa by Sebastian Graf at 2024-01-12T21:16:21-05:00 Arity: Require called *exactly once* for eta exp with -fpedantic-bottoms (#24296) In #24296, we had a program in which we eta expanded away an error despite the presence of `-fpedantic-bottoms`. This was caused by turning called *at least once* lambdas into one-shot lambdas, while with `-fpedantic-bottoms` it is only sound to eta expand over lambdas that are called *exactly* once. An example can be found in `Note [Combining arity type with demand info]`. Fixes #24296. - - - - - 7e95f738 by Andreas Klebinger at 2024-01-12T21:16:57-05:00 Aarch64: Enable -mfma by default. Fixes #24311 - - - - - e43788d0 by Jason Shipman at 2024-01-14T12:47:38-05:00 Add more instances for Compose: Fractional, RealFrac, Floating, RealFloat CLC proposal #226 https://github.com/haskell/core-libraries-committee/issues/226 - - - - - ae6d8cd2 by Sebastian Graf at 2024-01-14T12:48:15-05:00 Pmc: COMPLETE pragmas associated with Family TyCons should apply to representation TyCons as well (#24326) Fixes #24326. - - - - - c5fc7304 by sheaf at 2024-01-15T14:15:29-05:00 Use lookupOccRn_maybe in TH.lookupName When looking up a value, we want to be able to find both variables and record fields. So we should not use the lookupSameOccRn_maybe function, as we can't know ahead of time which record field namespace a record field with the given textual name will belong to. Fixes #24293 - - - - - da908790 by Krzysztof Gogolewski at 2024-01-15T14:16:05-05:00 Make the build more strict on documentation errors * Detect undefined labels. This can be tested by adding :ref:`nonexistent` to a documentation rst file; attempting to build docs will fail. Fixed the undefined label in `9.8.1-notes.rst`. * Detect errors. While we have plenty of warnings, we can at least enforce that Sphinx does not report errors. Fixed the error in `required_type_arguments.rst`. Unrelated change: I have documented that the `-dlint` enables `-fcatch-nonexhaustive-cases`, as can be verified by checking `enableDLint`. - - - - - 5077416e by Javier Sagredo at 2024-01-16T15:40:06-05:00 Profiling: Adds an option to not start time profiling at startup Using the functionality provided by d89deeba47ce04a5198a71fa4cbc203fe2c90794, this patch creates a new rts flag `--no-automatic-time-samples` which disables the time profiling when starting a program. It is then expected that the user starts it whenever it is needed. Fixes #24337 - - - - - 5776008c by Matthew Pickering at 2024-01-16T15:40:42-05:00 eventlog: Fix off-by-one error in postIPE We were missing the extra_comma from the calculation of the size of the payload of postIPE. This was causing assertion failures when the event would overflow the buffer by one byte, as ensureRoomForVariable event would report there was enough space for `n` bytes but then we would write `n + 1` bytes into the buffer. Fixes #24287 - - - - - 66dc09b1 by Simon Peyton Jones at 2024-01-16T15:41:18-05:00 Improve SpecConstr (esp nofib/spectral/ansi) This MR makes three improvements to SpecConstr: see #24282 * It fixes an outright (and recently-introduced) bug in `betterPat`, which was wrongly forgetting to compare the lengths of the argument lists. * It enhances ConVal to inclue a boolean for work-free-ness, so that the envt can contain non-work-free constructor applications, so that we can do more: see Note [ConVal work-free-ness] * It rejigs `subsumePats` so that it doesn't reverse the list. This can make a difference because, when patterns overlap, we arbitrarily pick the first. There is no "right" way, but this retains the old pre-subsumePats behaviour, thereby "fixing" the regression in #24282. Nofib results +======================================== | spectral/ansi -21.14% | spectral/hartel/comp_lab_zift -0.12% | spectral/hartel/parstof +0.09% | spectral/last-piece -2.32% | spectral/multiplier +6.03% | spectral/para +0.60% | spectral/simple -0.26% +======================================== | geom mean -0.18% +---------------------------------------- The regression in `multiplier` is sad, but it simply replicates GHC's previous behaviour (e.g. GHC 9.6). - - - - - 65da79b3 by Matthew Pickering at 2024-01-16T15:41:54-05:00 hadrian: Reduce Cabal verbosity The comment claims that `simpleUserHooks` decrease verbosity, and it does, but only for the `postConf` phase. The other phases are too verbose with `-V`. At the moment > 5000 lines of the build log are devoted to output from `cabal copy`. So I take the simple approach and just decrease the verbosity level again. If the output of `postConf` is essential then it would be better to implement our own `UserHooks` which doesn't decrease the verbosity for `postConf`. Fixes #24338 - - - - - 16414d7d by Matthew Pickering at 2024-01-17T10:54:59-05:00 Stop retaining old ModGuts throughout subsequent simplifier phases Each phase of the simplifier typically rewrites the majority of ModGuts, so we want to be able to release the old ModGuts as soon as possible. `name_ppr_ctxt` lives throught the whole optimiser phase and it was retaining a reference to `ModGuts`, so we were failing to release the old `ModGuts` until the end of the phase (potentially doubling peak memory usage for that particular phase). This was discovered using eras profiling (#24332) Fixes #24328 - - - - - 7f0879e1 by Matthew Pickering at 2024-01-17T10:55:35-05:00 Update nofib submodule - - - - - 320454d3 by Cheng Shao at 2024-01-17T23:02:40+00:00 ci: bump ci-images for updated wasm image - - - - - 2eca52b4 by Cheng Shao at 2024-01-17T23:06:44+00:00 base: treat all FDs as "nonblocking" on wasm On posix platforms, when performing read/write on FDs, we check the nonblocking flag first. For FDs without this flag (e.g. stdout), we call fdReady() first, which in turn calls poll() to wait for I/O to be available on that FD. This is problematic for wasm32-wasi: although select()/poll() is supported via the poll_oneoff() wasi syscall, that syscall is rather heavyweight and runtime behavior differs in different wasi implementations. The issue is even worse when targeting browsers, given there's no satisfactory way to implement async I/O as a synchronous syscall, so existing JS polyfills for wasi often give up and simply return ENOSYS. Before we have a proper I/O manager that avoids poll_oneoff() for async I/O on wasm, this patch improves the status quo a lot by merely pretending all FDs are "nonblocking". Read/write on FDs will directly invoke read()/write(), which are much more reliably handled in existing wasi implementations, especially those in browsers. Fixes #23275 and the following test cases: T7773 isEOF001 openFile009 T4808 cgrun025 Approved by CLC proposal #234: https://github.com/haskell/core-libraries-committee/issues/234 - - - - - 83c6c710 by Andrew Lelechenko at 2024-01-18T05:21:49-05:00 base: clarify how to disable warnings about partiality of Data.List.{head,tail} - - - - - c4078f2f by Simon Peyton Jones at 2024-01-18T05:22:25-05:00 Fix four bug in handling of (forall cv. body_ty) These bugs are all described in #24335 It's not easy to provoke the bug, hence no test case. - - - - - 119586ea by Alexis King at 2024-01-19T00:08:00-05:00 Always refresh profiling CCSes after running pending initializers Fixes #24171. - - - - - 9718d970 by Oleg Grenrus at 2024-01-19T00:08:36-05:00 Set default-language: GHC2021 in ghc library Go through compiler/ sources, and remove all BangPatterns (and other GHC2021 enabled extensions in these files). - - - - - 3ef71669 by Matthew Pickering at 2024-01-19T21:55:16-05:00 testsuite: Remove unused have_library function Also remove the hence unused testsuite option `--test-package-db`. Fixes #24342 - - - - - 5b7fa20c by Jade at 2024-01-19T21:55:53-05:00 Fix Spelling in the compiler Tracking: #16591 - - - - - 09875f48 by Matthew Pickering at 2024-01-20T12:20:44-05:00 testsuite: Implement `isInTreeCompiler` in a more robust way Just a small refactoring to avoid redundantly specifying the same strings in two different places. - - - - - 0d12b987 by Jade at 2024-01-20T12:21:20-05:00 Change maintainer email from cvs-ghc at haskell.org to ghc-devs at haskell.org. Fixes #22142 - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - 1fa1c00c by Jade at 2024-01-23T19:17:03-05:00 Enhance Documentation of functions exported by Data.Function This patch aims to improve the documentation of functions exported in Data.Function Tracking: #17929 Fixes: #10065 - - - - - ab47a43d by Jade at 2024-01-23T19:17:39-05:00 Improve documentation of hGetLine. - Add explanation for whether a newline is returned - Add examples Fixes #14804 - - - - - dd4af0e5 by Cheng Shao at 2024-01-23T19:18:17-05:00 Fix genapply for cross-compilation by nuking fragile CPP logic This commit fixes incorrectly built genapply when cross compiling (#24347) by nuking all fragile CPP logic in it from the orbit. All target-specific info are now read from DerivedConstants.h at runtime, see added note for details. Also removes a legacy Makefile and adds haskell language server support for genapply. - - - - - 0cda2b8b by Cheng Shao at 2024-01-23T19:18:17-05:00 rts: enable wasm32 register mapping The wasm backend didn't properly make use of all Cmm global registers due to #24347. Now that it is fixed, this patch re-enables full register mapping for wasm32, and we can now generate smaller & faster wasm modules that doesn't always spill arguments onto the stack. Fixes #22460 #24152. - - - - - 0325a6e5 by Greg Steuck at 2024-01-24T01:29:44-05:00 Avoid utf8 in primops.txt.pp comments They don't make it through readFile' without explicitly setting the encoding. See https://gitlab.haskell.org/ghc/ghc/-/issues/17755 - - - - - 1aaf0bd8 by David Binder at 2024-01-24T01:30:20-05:00 Bump hpc and hpc-bin submodule Bump hpc to 0.7.0.1 Bump hpc-bin to commit d1780eb2 - - - - - e693a4e8 by Ben Gamari at 2024-01-24T01:30:56-05:00 testsuite: Ignore stderr in T8089 Otherwise spurious "Killed: 9" messages to stderr may cause the test to fail. Fixes #24361. - - - - - a40f4ab2 by sheaf at 2024-01-24T14:04:33-05:00 Fix FMA instruction on LLVM We were emitting the wrong instructions for fused multiply-add operations on LLVM: - the instruction name is "llvm.fma.f32" or "llvm.fma.f64", not "fmadd" - LLVM does not support other instructions such as "fmsub"; instead we implement these by flipping signs of some arguments - the instruction is an LLVM intrinsic, which requires handling it like a normal function call instead of a machine instruction Fixes #24223 - - - - - 69abc786 by Andrei Borzenkov at 2024-01-24T14:05:09-05:00 Add changelog entry for renaming tuples from (,,...,,) to Tuple<n> (24291) - - - - - 0ac8f385 by Cheng Shao at 2024-01-25T00:27:48-05:00 compiler: remove unused GHC.Linker module The GHC.Linker module is empty and unused, other than as a hack for the make build system. We can remove it now that make is long gone; the note is moved to GHC.Linker.Loader instead. - - - - - 699da01b by Hécate Moonlight at 2024-01-25T00:28:27-05:00 Clarification for newtype constructors when using `coerce` - - - - - b2d8cd85 by Matt Walker at 2024-01-26T09:50:08-05:00 Fix #24308 Add tests for semicolon separated where clauses - - - - - 0da490a1 by Ben Gamari at 2024-01-26T17:34:41-05:00 hsc2hs: Bump submodule - - - - - 3f442fd2 by Ben Gamari at 2024-01-26T17:34:41-05:00 Bump containers submodule to 0.7 - - - - - 82a1c656 by Sebastian Nagel at 2024-01-29T02:32:40-05:00 base: with{Binary}File{Blocking} only annotates own exceptions Fixes #20886 This ensures that inner, unrelated exceptions are not misleadingly annotated with the opened file. - - - - - 9294a086 by Andreas Klebinger at 2024-01-29T02:33:15-05:00 Fix fma warning when using llvm on aarch64. On aarch64 fma is always on so the +fma flag doesn't exist for that target. Hence no need to try and pass +fma to llvm. Fixes #24379 - - - - - ced2e731 by sheaf at 2024-01-29T17:27:12-05:00 No shadowing warnings for NoFieldSelector fields This commit ensures we don't emit shadowing warnings when a user shadows a field defined with NoFieldSelectors. Fixes #24381 - - - - - 8eeadfad by Patrick at 2024-01-29T17:27:51-05:00 Fix bug wrong span of nested_doc_comment #24378 close #24378 1. Update the start position of span in `nested_doc_comment` correctly. and hence the spans of identifiers of haddoc can be computed correctly. 2. add test `HaddockSpanIssueT24378`. - - - - - a557580f by Alexey Radkov at 2024-01-30T19:41:52-05:00 Fix irrelevant dodgy-foreign-imports warning on import f-pointers by value A test *сс018* is attached (not sure about the naming convention though). Note that without the fix, the test fails with the *dodgy-foreign-imports* warning passed to stderr. The warning disappears after the fix. GHC shouldn't warn on imports of natural function pointers from C by value (which is feasible with CApiFFI), such as ```haskell foreign import capi "cc018.h value f" f :: FunPtr (Int -> IO ()) ``` where ```c void (*f)(int); ``` See a related real-world use-case [here](https://gitlab.com/daniel-casanueva/pcre-light/-/merge_requests/17). There, GHC warns on import of C function pointer `pcre_free`. - - - - - ca99efaf by Alexey Radkov at 2024-01-30T19:41:53-05:00 Rename test cc018 -> T24034 - - - - - 88c38dd5 by Ben Gamari at 2024-01-30T19:42:28-05:00 rts/TraverseHeap.c: Ensure that PosixSource.h is included first - - - - - ca2e919e by Simon Peyton Jones at 2024-01-31T09:29:45+00:00 Make decomposeRuleLhs a bit more clever This fixes #24370 by making decomposeRuleLhs undertand dictionary /functions/ as well as plain /dictionaries/ - - - - - 94ce031d by Teo Camarasu at 2024-02-01T05:49:49-05:00 doc: Add -Dn flag to user guide Resolves #24394 - - - - - 31553b11 by Ben Gamari at 2024-02-01T12:21:29-05:00 cmm: Introduce MO_RelaxedRead In hand-written Cmm it can sometimes be necessary to atomically load from memory deep within an expression (e.g. see the `CHECK_GC` macro). This MachOp provides a convenient way to do so without breaking the expression into multiple statements. - - - - - 0785cf81 by Ben Gamari at 2024-02-01T12:21:29-05:00 codeGen: Use relaxed accesses in ticky bumping - - - - - be423dda by Ben Gamari at 2024-02-01T12:21:29-05:00 base: use atomic write when updating timer manager - - - - - 8a310e35 by Ben Gamari at 2024-02-01T12:21:29-05:00 Use relaxed atomics to manipulate TSO status fields - - - - - d6809ee4 by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Add necessary barriers when manipulating TSO owner - - - - - 39e3ac5d by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Use `switch` to branch on why_blocked This is a semantics-preserving refactoring. - - - - - 515eb33d by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix synchronization on thread blocking state We now use a release barrier whenever we update a thread's blocking state. This required widening StgTSO.why_blocked as AArch64 does not support atomic writes on 16-bit values. - - - - - eb38812e by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix data race in threadPaused This only affects an assertion in the debug RTS and only needs relaxed ordering. - - - - - 26c48dd6 by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix data race in threadStatus# - - - - - 6af43ab4 by Ben Gamari at 2024-02-01T12:21:29-05:00 rts: Fix data race in Interpreter's preemption check - - - - - 9502ad3c by Ben Gamari at 2024-02-01T12:21:29-05:00 rts/Messages: Fix data race - - - - - 60802db5 by Ben Gamari at 2024-02-01T12:21:30-05:00 rts/Prof: Fix data race - - - - - ef8ccef5 by Ben Gamari at 2024-02-01T12:21:30-05:00 rts: Use relaxed ordering on dirty/clean info tables updates When changing the dirty/clean state of a mutable object we needn't have any particular ordering. - - - - - 76fe2b75 by Ben Gamari at 2024-02-01T12:21:30-05:00 codeGen: Use relaxed-read in closureInfoPtr - - - - - a6316eb4 by Ben Gamari at 2024-02-01T12:21:30-05:00 STM: Use acquire loads when possible Full sequential consistency is not needed here. - - - - - 6bddfd3d by Ben Gamari at 2024-02-01T12:21:30-05:00 rts: Use fence rather than redundant load Previously we would use an atomic load to ensure acquire ordering. However, we now have `ACQUIRE_FENCE_ON`, which allows us to express this more directly. - - - - - 55c65dbc by Ben Gamari at 2024-02-01T12:21:30-05:00 rts: Fix data races in profiling timer - - - - - 856b5e75 by Ben Gamari at 2024-02-01T12:21:30-05:00 Add Note [C11 memory model] - - - - - 6534da24 by Cheng Shao at 2024-02-01T12:22:07-05:00 compiler: move generic cmm optimization logic in NCG to a standalone module This commit moves GHC.CmmToAsm.cmmToCmm to a standalone module, GHC.Cmm.GenericOpt. The main motivation is enabling this logic to be run in the wasm backend NCG code, which is defined in other modules that's imported by GHC.CmmToAsm, causing a cyclic dependency issue. - - - - - 87e34888 by Cheng Shao at 2024-02-01T12:22:07-05:00 compiler: explicitly disable PIC in wasm32 NCG This commit explicitly disables the ncgPIC flag for the wasm32 target. The wasm backend doesn't support PIC for the time being. - - - - - c6ce242e by Cheng Shao at 2024-02-01T12:22:07-05:00 compiler: enable generic cmm optimizations in wasm backend NCG This commit enables the generic cmm optimizations in other NCGs to be run in the wasm backend as well, followed by a late cmm control-flow optimization pass. The added optimizations do catch some corner cases not handled by the pre-NCG cmm pipeline and are useful in generating smaller CFGs. - - - - - 151dda4e by Andrei Borzenkov at 2024-02-01T12:22:43-05:00 Namespacing for WARNING/DEPRECATED pragmas (#24396) New syntax for WARNING and DEPRECATED pragmas was added, namely namespace specifierss: namespace_spec ::= 'type' | 'data' | {- empty -} warning ::= warning_category namespace_spec namelist strings deprecation ::= namespace_spec namelist strings A new data type was introduced to represent these namespace specifiers: data NamespaceSpecifier = NoSpecifier | TypeNamespaceSpecifier (EpToken "type") | DataNamespaceSpecifier (EpToken "data") Extension field XWarning now contains this NamespaceSpecifier. lookupBindGroupOcc function was changed: it now takes NamespaceSpecifier and checks that the namespace of the found names matches the passed flag. With this change {-# WARNING data D "..." #-} pragma will only affect value namespace and {-# WARNING type D "..." #-} will only affect type namespace. The same logic is applicable to DEPRECATED pragmas. Finding duplicated warnings inside rnSrcWarnDecls now takes into consideration NamespaceSpecifier flag to allow warnings with the same names that refer to different namespaces. - - - - - 38c3afb6 by Bryan Richter at 2024-02-01T12:23:19-05:00 CI: Disable the test-cabal-reinstall job Fixes #24363 - - - - - 27020458 by Matthew Craven at 2024-02-03T01:53:26-05:00 Bump bytestring submodule to something closer to 0.12.1 ...mostly so that 16d6b7e835ffdcf9b894e79f933dd52348dedd0c (which reworks unaligned writes in Builder) and the stuff in https://github.com/haskell/bytestring/pull/631 can see wider testing. The less-terrible code for unaligned writes used in Builder on hosts not known to be ulaigned-friendly also takes less effort for GHC to compile, resulting in a metric decrease for T21839c on some platforms. The metric increase on T21839r is caused by the unrelated commit 750dac33465e7b59100698a330b44de7049a345c. It perhaps warrants further analysis and discussion (see #23822) but is not critical. Metric Decrease: T21839c Metric Increase: T21839r - - - - - cdddeb0f by Rodrigo Mesquita at 2024-02-03T01:54:02-05:00 Work around autotools setting C11 standard in CC/CXX In autoconf >=2.70, C11 is set by default for $CC and $CXX via the -std=...11 flag. In this patch, we split the "-std" flag out of the $CC and $CXX variables, which we traditionally assume to be just the executable name/path, and move it to $CFLAGS/$CXXFLAGS instead. Fixes #24324 - - - - - 5ff7cc26 by Apoorv Ingle at 2024-02-03T13:14:46-06:00 Expand `do` blocks right before typechecking using the `HsExpansion` philosophy. - Fixes #18324 #20020 #23147 #22788 #15598 #22086 #21206 - The change is detailed in - Note [Expanding HsDo with HsExpansion] in `GHC.Tc.Gen.Do` - Note [Doing HsExpansion in the Renamer vs Typechecker] in `GHC.Rename.Expr` expains the rational of doing expansions in type checker as opposed to in the renamer - Adds new datatypes: - `GHC.Hs.Expr.XXExprGhcRn`: new datatype makes this expansion work easier 1. Expansion bits for Expressions, Statements and Patterns in (`ExpandedThingRn`) 2. `PopErrCtxt` a special GhcRn Phase only artifcat to pop the previous error message in the error context stack - `GHC.Basic.Origin` now tracks the reason for expansion in case of Generated This is useful for type checking cf. `GHC.Tc.Gen.Expr.tcExpr` case for `HsLam` - Kills `HsExpansion` and `HsExpanded` as we have inlined them in `XXExprGhcRn` and `XXExprGhcTc` - Ensures warnings such as 1. Pattern match checks 2. Failable patterns 3. non-() return in body statements are preserved - Kill `HsMatchCtxt` in favor of `TcMatchAltChecker` - Testcases: * T18324 T20020 T23147 T22788 T15598 T22086 * T23147b (error message check), * DoubleMatch (match inside a match for pmc check) * pattern-fails (check pattern match with non-refutable pattern, eg. newtype) * Simple-rec (rec statements inside do statment) * T22788 (code snippet from #22788) * DoExpanion1 (Error messages for body statments) * DoExpansion2 (Error messages for bind statements) * DoExpansion3 (Error messages for let statements) Also repoint haddock to the right submodule so that the test (haddockHypsrcTest) pass Metric Increase 'compile_time/bytes allocated': T9020 The testcase is a pathalogical example of a `do`-block with many statements that do nothing. Given that we are expanding the statements into function binds, we will have to bear a (small) 2% cost upfront in the compiler to unroll the statements. - - - - - 0df8ce27 by Vladislav Zavialov at 2024-02-04T03:55:14-05:00 Reduce parser allocations in allocateCommentsP In the most common case, the comment queue is empty, so we can skip the work of processing it. This reduces allocations by about 10% in the parsing001 test. Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - cfd68290 by Simon Peyton Jones at 2024-02-05T17:58:33-05:00 Stop dropping a case whose binder is demanded This MR fixes #24251. See Note [Case-to-let for strictly-used binders] in GHC.Core.Opt.Simplify.Iteration, plus #24251, for lots of discussion. Final Nofib changes over 0.1%: +----------------------------------------- | imaginary/digits-of-e2 -2.16% | imaginary/rfib -0.15% | real/fluid -0.10% | real/gamteb -1.47% | real/gg -0.20% | real/maillist +0.19% | real/pic -0.23% | real/scs -0.43% | shootout/n-body -0.41% | shootout/spectral-norm -0.12% +======================================== | geom mean -0.05% Pleasingly, overall executable size is down by just over 1%. Compile times (in perf/compiler) wobble around a bit +/- 0.5%, but the geometric mean is -0.1% which seems good. - - - - - e4d137bb by Simon Peyton Jones at 2024-02-05T17:58:33-05:00 Add Note [Bangs in Integer functions] ...to document the bangs in the functions in GHC.Num.Integer - - - - - ce90f12f by Andrei Borzenkov at 2024-02-05T17:59:09-05:00 Hide WARNING/DEPRECATED namespacing under -XExplicitNamespaces (#24396) - - - - - e2ea933f by Simon Peyton Jones at 2024-02-06T10:12:04-05:00 Refactoring in preparation for lazy skolemisation * Make HsMatchContext and HsStmtContext be parameterised over the function name itself, rather than over the pass. See [mc_fun field of FunRhs] in Language.Haskell.Syntax.Expr - Replace types HsMatchContext GhcPs --> HsMatchContextPs HsMatchContext GhcRn --> HsMatchContextRn HsMatchContext GhcTc --> HsMatchContextRn (sic! not Tc) HsStmtContext GhcRn --> HsStmtContextRn - Kill off convertHsMatchCtxt * Split GHC.Tc.Type.BasicTypes.TcSigInfo so that TcCompleteSig (describing a complete user-supplied signature) is its own data type. - Split TcIdSigInfo(CompleteSig, PartialSig) into TcCompleteSig(CSig) TcPartialSig(PSig) - Use TcCompleteSig in tcPolyCheck, CheckGen - Rename types and data constructors: TcIdSigInfo --> TcIdSig TcPatSynInfo(TPSI) --> TcPatSynSig(PatSig) - Shuffle around helper functions: tcSigInfoName (moved to GHC.Tc.Types.BasicTypes) completeSigPolyId_maybe (moved to GHC.Tc.Types.BasicTypes) tcIdSigName (inlined and removed) tcIdSigLoc (introduced) - Rearrange the pattern match in chooseInferredQuantifiers * Rename functions and types: tcMatchesCase --> tcCaseMatches tcMatchesFun --> tcFunBindMatches tcMatchLambda --> tcLambdaMatches tcPats --> tcMatchPats matchActualFunTysRho --> matchActualFunTys matchActualFunTySigma --> matchActualFunTy * Add HasDebugCallStack constraints to: mkBigCoreVarTupTy, mkBigCoreTupTy, boxTy, mkPiTy, mkPiTys, splitAppTys, splitTyConAppNoView_maybe * Use `penv` from the outer context in the inner loop of GHC.Tc.Gen.Pat.tcMultiple * Move tcMkVisFunTy, tcMkInvisFunTy, tcMkScaledFunTys down the file, factor out and export tcMkScaledFunTy. * Move isPatSigCtxt down the file. * Formatting and comments Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com> - - - - - f5d3e03c by Andrei Borzenkov at 2024-02-06T10:12:04-05:00 Lazy skolemisation for @a-binders (#17594) This patch is a preparation for @a-binders implementation. The main changes are: * Skolemisation is now prepared to deal with @binders. See Note [Skolemisation overview] in GHC.Tc.Utils.Unify. Most of the action is in - Utils.Unify.matchExpectedFunTys - Gen.Pat.tcMatchPats - Gen.Expr.tcPolyExprCheck - Gen.Binds.tcPolyCheck Some accompanying refactoring: * I found that funTyConAppTy_maybe was doing a lot of allocation, and rejigged userTypeError_maybe to avoid calling it. - - - - - 532993c8 by Zubin Duggal at 2024-02-06T10:12:41-05:00 driver: Really don't lose track of nodes when we fail to resolve cycles This fixes a bug in 8db8d2fd1c881032b1b360c032b6d9d072c11723, where we could lose track of acyclic components at the start of an unresolved cycle. We now ensure we never loose track of any of these components. As T24275 demonstrates, a "cyclic" SCC might not really be a true SCC: When viewed without boot files, we have a single SCC ``` [REC main:T24275B [main:T24275B {-# SOURCE #-}, main:T24275A {-# SOURCE #-}] main:T24275A [main:T24275A {-# SOURCE #-}]] ``` But with boot files this turns into ``` [NONREC main:T24275B {-# SOURCE #-} [], REC main:T24275B [main:T24275B {-# SOURCE #-}, main:T24275A {-# SOURCE #-}] main:T24275A {-# SOURCE #-} [main:T24275B], NONREC main:T24275A [main:T24275A {-# SOURCE #-}]] ``` Note that this is truly not an SCC, as no nodes are reachable from T24275B.hs-boot. However, we treat this entire group as a single "SCC" because it seems so when we analyse the graph without taking boot files into account. Indeed, we must return a single ResolvedCycle element in the BuildPlan for this as described in Note [Upsweep]. However, since after resolving this is not a true SCC anymore, `findCycle` fails to find a cycle and we have a sub-optimal error message as a result. To handle this, I extended `findCycle` to not assume its input is an SCC, and to try harder to find cycles in its input. Fixes #24275 - - - - - b35dd613 by Zubin Duggal at 2024-02-06T10:13:17-05:00 GHCi: Lookup breakpoint CCs in the correct module We need to look up breakpoint CCs in the module that the breakpoint points to, and not the current module. Fixes #24327 - - - - - b09e6958 by Zubin Duggal at 2024-02-06T10:13:17-05:00 testsuite: Add test for #24327 - - - - - 569b4c10 by doyougnu at 2024-02-07T03:06:26-05:00 ts: add compile_artifact, ignore_extension flag In b521354216f2821e00d75f088d74081d8b236810 the testsuite gained the capability to collect generic metrics. But this assumed that the test was not linking and producing artifacts and we only wanted to track object files, interface files, or build artifacts from the compiler build. However, some backends, such as the JS backend, produce artifacts when compiling, such as the jsexe directory which we want to track. This patch: - tweaks the testsuite to collect generic metrics on any build artifact in the test directory. - expands the exe_extension function to consider windows and adds the ignore_extension flag. - Modifies certain tests to add the ignore_extension flag. Tests such as heaprof002 expect a .ps file, but on windows without ignore_extensions the testsuite will look for foo.exe.ps. Hence the flag. - adds the size_hello_artifact test - - - - - 75a31379 by doyougnu at 2024-02-07T03:06:26-05:00 ts: add wasm_arch, heapprof002 wasm extension - - - - - c9731d6d by Rodrigo Mesquita at 2024-02-07T03:07:03-05:00 Synchronize bindist configure for #24324 In cdddeb0f1280b40cc194028bbaef36e127175c4c, we set up a workaround for #24324 in the in-tree configure script, but forgot to update the bindist configure script accordingly. This updates it. - - - - - d309f4e7 by Matthew Pickering at 2024-02-07T03:07:38-05:00 distrib/configure: Fix typo in CONF_GCC_LINKER_OPTS_STAGE2 variable Instead we were setting CONF_GCC_LINK_OPTS_STAGE2 which meant that we were missing passing `--target` when invoking the linker. Fixes #24414 - - - - - 77db84ab by Ben Gamari at 2024-02-08T00:35:22-05:00 llvmGen: Adapt to allow use of new pass manager. We now must use `-passes` in place of `-O<n>` due to #21936. Closes #21936. - - - - - 3c9ddf97 by Matthew Pickering at 2024-02-08T00:35:59-05:00 testsuite: Mark length001 as fragile on javascript Modifying the timeout multiplier is not a robust way to get this test to reliably fail. Therefore we mark it as fragile until/if javascript ever supports the stack limit. - - - - - 20b702b5 by Matthew Pickering at 2024-02-08T00:35:59-05:00 Javascript: Don't filter out rtsDeps list This logic appears to be incorrect as it would drop any dependency which was not in a direct dependency of the package being linked. In the ghc-internals split this started to cause errors because `ghc-internal` is not a direct dependency of most packages, and hence important symbols to keep which are hard coded into the js runtime were getting dropped. - - - - - 2df96366 by Ben Gamari at 2024-02-08T00:35:59-05:00 base: Cleanup whitespace in cbits - - - - - 44f6557a by Ben Gamari at 2024-02-08T00:35:59-05:00 Move `base` to `ghc-internal` Here we move a good deal of the implementation of `base` into a new package, `ghc-internal` such that it can be evolved independently from the user-visible interfaces of `base`. While we want to isolate implementation from interfaces, naturally, we would like to avoid turning `base` into a mere set of module re-exports. However, this is a non-trivial undertaking for a variety of reasons: * `base` contains numerous known-key and wired-in things, requiring corresponding changes in the compiler * `base` contains a significant amount of C code and corresponding autoconf logic, which is very fragile and difficult to break apart * `base` has numerous import cycles, which are currently dealt with via carefully balanced `hs-boot` files * We must not break existing users To accomplish this migration, I tried the following approaches: * [Split-GHC.Base]: Break apart the GHC.Base knot to allow incremental migration of modules into ghc-internal: this knot is simply too intertwined to be easily pulled apart, especially given the rather tricky import cycles that it contains) * [Move-Core]: Moving the "core" connected component of base (roughly 150 modules) into ghc-internal. While the Haskell side of this seems tractable, the C dependencies are very subtle to break apart. * [Move-Incrementally]: 1. Move all of base into ghc-internal 2. Examine the module structure and begin moving obvious modules (e.g. leaves of the import graph) back into base 3. Examine the modules remaining in ghc-internal, refactor as necessary to facilitate further moves 4. Go to (2) iterate until the cost/benefit of further moves is insufficient to justify continuing 5. Rename the modules moved into ghc-internal to ensure that they don't overlap with those in base 6. For each module moved into ghc-internal, add a shim module to base with the declarations which should be exposed and any requisite Haddocks (thus guaranteeing that base will be insulated from changes in the export lists of modules in ghc-internal Here I am using the [Move-Incrementally] approach, which is empirically the least painful of the unpleasant options above Bumps haddock submodule. Metric Decrease: haddock.Cabal haddock.base Metric Increase: MultiComponentModulesRecomp T16875 size_hello_artifact - - - - - e8fb2451 by Vladislav Zavialov at 2024-02-08T00:36:36-05:00 Haddock comments on infix constructors (#24221) Rewrite the `HasHaddock` instance for `ConDecl GhcPs` to account for infix constructors. This change fixes a Haddock regression (introduced in 19e80b9af252) that affected leading comments on infix data constructor declarations: -- | Docs for infix constructor | Int :* Bool The comment should be associated with the data constructor (:*), not with its left-hand side Int. - - - - - 9060d55b by Ben Gamari at 2024-02-08T00:37:13-05:00 Add os-string as a boot package Introduces `os-string` submodule. This will be necessary for `filepath-1.5`. - - - - - 9d65235a by Ben Gamari at 2024-02-08T00:37:13-05:00 gitignore: Ignore .hadrian_ghci_multi/ - - - - - d7ee12ea by Ben Gamari at 2024-02-08T00:37:13-05:00 hadrian: Set -this-package-name When constructing the GHC flags for a package Hadrian must take care to set `-this-package-name` in addition to `-this-unit-id`. This hasn't broken until now as we have not had any uses of qualified package imports. However, this will change with `filepath-1.5` and the corresponding `unix` bump, breaking `hadrian/multi-ghci`. - - - - - f2dffd2e by Ben Gamari at 2024-02-08T00:37:13-05:00 Bump filepath to 1.5.0.0 Required bumps of the following submodules: * `directory` * `filepath` * `haskeline` * `process` * `unix` * `hsc2hs` * `Win32` * `semaphore-compat` and the addition of `os-string` as a boot package. - - - - - ab533e71 by Matthew Pickering at 2024-02-08T00:37:50-05:00 Use specific clang assembler when compiling with -fllvm There are situations where LLVM will produce assembly which older gcc toolchains can't handle. For example on Deb10, it seems that LLVM >= 13 produces assembly which the default gcc doesn't support. A more robust solution in the long term is to require a specific LLVM compatible assembler when using -fllvm. Fixes #16354 - - - - - c32b6426 by Matthew Pickering at 2024-02-08T00:37:50-05:00 Update CI images with LLVM 15, ghc-9.6.4 and cabal-install-3.10.2.0 - - - - - 5fcd58be by Matthew Pickering at 2024-02-08T00:37:50-05:00 Update bootstrap plans for 9.4.8 and 9.6.4 - - - - - 707a32f5 by Matthew Pickering at 2024-02-08T00:37:50-05:00 Add alpine 3_18 release job This is mainly experimental and future proofing to enable a smooth transition to newer alpine releases once 3_12 is too old. - - - - - c37931b3 by John Ericson at 2024-02-08T06:39:05-05:00 Generate LLVM min/max bound policy via Hadrian Per #23966, I want the top-level configure to only generate configuration data for Hadrian, not do any "real" tasks on its own. This is part of that effort --- one less file generated by it. (It is still done with a `.in` file, so in a future world non-Hadrian also can easily create this file.) Split modules: - GHC.CmmToLlvm.Config - GHC.CmmToLlvm.Version - GHC.CmmToLlvm.Version.Bounds - GHC.CmmToLlvm.Version.Type This also means we can get rid of the silly `unused.h` introduced in !6803 / 7dfcab2f4bcb7206174ea48857df1883d05e97a2 as temporary kludge. Part of #23966 - - - - - 9f987235 by Apoorv Ingle at 2024-02-08T06:39:42-05:00 Enable mdo statements to use HsExpansions Fixes: #24411 Added test T24411 for regression - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 762b2120 by Jade at 2024-02-08T15:17:15+00:00 Improve Monad, Functor & Applicative docs This patch aims to improve the documentation of Functor, Applicative, Monad and related symbols. The main goal is to make it more consistent and make accessible. See also: !10979 (closed) and !10985 (closed) Ticket #17929 Updates haddock submodule - - - - - 151770ca by Josh Meredith at 2024-02-10T14:28:15-05:00 JavaScript codegen: Use GHC's tag inference where JS backend-specific evaluation inference was previously used (#24309) - - - - - 2e880635 by Zubin Duggal at 2024-02-10T14:28:51-05:00 ci: Allow release-hackage-lint to fail Otherwise it blocks the ghcup metadata pipeline from running. - - - - - b0293f78 by Matthew Pickering at 2024-02-10T14:29:28-05:00 rts: eras profiling mode The eras profiling mode is useful for tracking the life-time of closures. When a closure is written, the current era is recorded in the profiling header. This records the era in which the closure was created. * Enable with -he * User mode: Use functions ghc-experimental module GHC.Profiling.Eras to modify the era * Automatically: --automatic-era-increment, increases the user era on major collections * The first era is era 1 * -he<era> can be used with other profiling modes to select a specific era If you just want to record the era but not to perform heap profiling you can use `-he --no-automatic-heap-samples`. https://well-typed.com/blog/2024/01/ghc-eras-profiling/ Fixes #24332 - - - - - be674a2c by Jade at 2024-02-10T14:30:04-05:00 Adjust error message for trailing whitespace in as-pattern. Fixes #22524 - - - - - 53ef83f9 by doyougnu at 2024-02-10T14:30:47-05:00 gitlab: js: add codeowners Fixes: - #24409 Follow on from: - #21078 and MR !9133 - When we added the JS backend this was forgotten. This patch adds the rightful codeowners. - - - - - 8bbe12f2 by Matthew Pickering at 2024-02-10T14:31:23-05:00 Bump CI images so that alpine3_18 image includes clang15 The only changes here are that clang15 is now installed on the alpine-3_18 image. - - - - - df9fd9f7 by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: handle stored null StablePtr Some Haskell codes unsafely cast StablePtr into ptr to compare against NULL. E.g. in direct-sqlite: if castStablePtrToPtr aggStPtr /= nullPtr then where `aggStPtr` is read (`peek`) from zeroed memory initially. We fix this by giving these StablePtr the same representation as other null pointers. It's safe because StablePtr at offset 0 is unused (for this exact reason). - - - - - 55346ede by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: disable MergeObjsMode test This isn't implemented for JS backend objects. - - - - - aef587f6 by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: add support for linking C sources Support linking C sources with JS output of the JavaScript backend. See the added documentation in the users guide. The implementation simply extends the JS linker to use the objects (.o) that were already produced by the emcc compiler and which were filtered out previously. I've also added some options to control the link with C functions (see the documentation about pragmas). With this change I've successfully compiled the direct-sqlite package which embeds the sqlite.c database code. Some wrappers are still required (see the documentation about wrappers) but everything generic enough to be reused for other libraries have been integrated into rts/js/mem.js. - - - - - b71b392f by Sylvain Henry at 2024-02-12T12:18:42-05:00 JS: avoid EMCC logging spurious failure emcc would sometime output messages like: cache:INFO: generating system asset: symbol_lists/424b44514e43d789148e69e4e7d1c7fdc0350b79.json... (this will be cached in "/emsdk/upstream/emscripten/cache/symbol_lists/424b44514e43d789148e69e4e7d1c7fdc0350b79.json" for subsequent builds) cache:INFO: - ok Cf https://github.com/emscripten-core/emscripten/issues/18607 This breaks our tests matching the stderr output. We avoid this by setting EMCC_LOGGING=0 - - - - - ff2c0cc9 by Simon Peyton Jones at 2024-02-12T12:19:17-05:00 Remove a dead comment Just remove an out of date block of commented-out code, and tidy up the relevant Notes. See #8317. - - - - - bedb4f0d by Teo Camarasu at 2024-02-12T18:50:33-05:00 nonmoving: Add support for heap profiling Add support for heap profiling while using the nonmoving collector. We greatly simply the implementation by disabling concurrent collection for GCs when heap profiling is enabled. This entails that the marked objects on the nonmoving heap are exactly the live objects. Note that we match the behaviour for live bytes accounting by taking the size of objects on the nonmoving heap to be that of the segment's block rather than the object itself. Resolves #22221 - - - - - d0d5acb5 by Teo Camarasu at 2024-02-12T18:51:09-05:00 doc: Add requires prof annotation to options that require it Resolves #24421 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 57bb8c92 by Cheng Shao at 2024-02-13T14:07:49-05:00 deriveConstants: add needed constants for wasm backend This commit adds needed constants to deriveConstants. They are used by RTS code in the wasm backend to support the JSFFI logic. - - - - - 615eb855 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms The pure Haskell implementation causes i386 regression in unrelated work that can be fixed by using C-based atomic increment, see added comment for details. - - - - - a9918891 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: allow JSFFI for wasm32 This commit allows the javascript calling convention to be used when the target platform is wasm32. - - - - - 8771a53b by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: allow boxed JSVal as a foreign type This commit allows the boxed JSVal type to be used as a foreign argument/result type. - - - - - 053c92b3 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: ensure ctors have the right priority on wasm32 This commit fixes the priorities of ctors generated by GHC codegen on wasm32, see the referred note for details. - - - - - b7942e0a by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: add JSFFI desugar logic for wasm32 This commit adds JSFFI desugar logic for the wasm backend. - - - - - 2c1dca76 by Cheng Shao at 2024-02-13T14:07:49-05:00 compiler: add JavaScriptFFI to supported extension list on wasm32 This commit adds JavaScriptFFI as a supported extension when the target platform is wasm32. - - - - - 9ad0e2b4 by Cheng Shao at 2024-02-13T14:07:49-05:00 rts/ghc-internal: add JSFFI support logic for wasm32 This commit adds rts/ghc-internal logic to support the wasm backend's JSFFI functionality. - - - - - e9ebea66 by Cheng Shao at 2024-02-13T14:07:49-05:00 ghc-internal: fix threadDelay for wasm in browsers This commit fixes broken threadDelay for wasm when it runs in browsers, see added note for detailed explanation. - - - - - f85f3fdb by Cheng Shao at 2024-02-13T14:07:49-05:00 utils: add JSFFI utility code This commit adds JavaScript util code to utils to support the wasm backend's JSFFI functionality: - jsffi/post-link.mjs, a post-linker to process the linked wasm module and emit a small complement JavaScript ESM module to be used with it at runtime - jsffi/prelude.js, a tiny bit of prelude code as the JavaScript side of runtime logic - jsffi/test-runner.mjs, run the jsffi test cases Co-authored-by: amesgen <amesgen at amesgen.de> - - - - - 77e91500 by Cheng Shao at 2024-02-13T14:07:49-05:00 hadrian: distribute jsbits needed for wasm backend's JSFFI support The post-linker.mjs/prelude.js files are now distributed in the bindist libdir, so when using the wasm backend's JSFFI feature, the user wouldn't need to fetch them from a ghc checkout manually. - - - - - c47ba1c3 by Cheng Shao at 2024-02-13T14:07:49-05:00 testsuite: add opts.target_wrapper This commit adds opts.target_wrapper which allows overriding the target wrapper on a per test case basis when testing a cross target. This is used when testing the wasm backend's JSFFI functionality; the rest of the cases are tested using wasmtime, though the jsffi cases are tested using the node.js based test runner. - - - - - 8e048675 by Cheng Shao at 2024-02-13T14:07:49-05:00 testsuite: T22774 should work for wasm JSFFI T22774 works since the wasm backend now supports the JSFFI feature. - - - - - 1d07f9a6 by Cheng Shao at 2024-02-13T14:07:49-05:00 testsuite: add JSFFI test cases for wasm backend This commit adds a few test cases for the wasm backend's JSFFI functionality, as well as a simple README to instruct future contributors to add new test cases. - - - - - b8997080 by Cheng Shao at 2024-02-13T14:07:49-05:00 docs: add documentation for wasm backend JSFFI This commit adds changelog and user facing documentation for the wasm backend's JSFFI feature. - - - - - ffeb000d by David Binder at 2024-02-13T14:08:30-05:00 Add tests from libraries/process/tests and libraries/Win32/tests to GHC These tests were previously part of the libraries, which themselves are submodules of the GHC repository. This commit moves the tests directly to the GHC repository. - - - - - 5a932cf2 by David Binder at 2024-02-13T14:08:30-05:00 Do not execute win32 tests on non-windows runners - - - - - 500d8cb8 by Jade at 2024-02-13T14:09:07-05:00 prevent GHCi (and runghc) from suggesting other symbols when not finding main Fixes: #23996 - - - - - b19ec331 by Cheng Shao at 2024-02-13T14:09:46-05:00 rts: update xxHash to v0.8.2 - - - - - 4a97bdb8 by Cheng Shao at 2024-02-13T14:09:46-05:00 rts: use XXH3_64bits hash on all 64-bit platforms This commit enables XXH3_64bits hash to be used on all 64-bit platforms. Previously it was only enabled on x86_64, so platforms like aarch64 silently falls back to using XXH32 which degrades the hashing function quality. - - - - - ee01de7d by Cheng Shao at 2024-02-13T14:09:46-05:00 rts: define XXH_INLINE_ALL This commit cleans up how we include the xxhash.h header and only define XXH_INLINE_ALL, which is sufficient to inline the xxHash functions without symbol collision. - - - - - 0e01e1db by Alan Zimmerman at 2024-02-14T02:13:22-05:00 EPA: Move EpAnn out of extension points Leaving a few that are too tricky, maybe some other time. Also - remove some unneeded helpers from Parser.y - reduce allocations with strictness annotations Updates haddock submodule Metric Decrease: parsing001 - - - - - de589554 by Andreas Klebinger at 2024-02-14T02:13:59-05:00 Fix ffi callbacks with >6 args and non-64bit args. Check for ptr/int arguments rather than 64-bit width arguments when counting integer register arguments. The old approach broke when we stopped using exclusively W64-sized types to represent sub-word sized integers. Fixes #24314 - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 325b7613 by Ben Gamari at 2024-02-14T14:27:45-05:00 rts/EventLog: Place eliminate duplicate strlens Previously many of the `post*` implementations would first compute the length of the event's strings in order to determine the event length. Later we would then end up computing the length yet again in `postString`. Now we instead pass the string length to `postStringLen`, avoiding the repeated work. - - - - - 8aafa51c by Ben Gamari at 2024-02-14T14:27:46-05:00 rts/eventlog: Place upper bound on IPE string field lengths The strings in IPE events may be of unbounded length. Limit the lengths of these fields to 64k characters to ensure that we don't exceed the maximum event length. - - - - - 0e60d52c by Zubin Duggal at 2024-02-14T14:27:46-05:00 rts: drop unused postString function - - - - - d8d1333a by Cheng Shao at 2024-02-14T14:28:23-05:00 compiler/rts: fix wasm unreg regression This commit fixes two wasm unreg regressions caught by a nightly pipeline: - Unknown stg_scheduler_loopzh symbol when compiling scheduler.cmm - Invalid _hs_constructor(101) function name when handling ctor - - - - - 264a4fa9 by Owen Shepherd at 2024-02-15T09:41:06-05:00 feat: Add sortOn to Data.List.NonEmpty Adds `sortOn` to `Data.List.NonEmpty`, and adds comments describing when to use it, compared to `sortWith` or `sortBy . comparing`. The aim is to smooth out the API between `Data.List`, and `Data.List.NonEmpty`. This change has been discussed in the [clc issue](https://github.com/haskell/core-libraries-committee/issues/227). - - - - - b57200de by Fendor at 2024-02-15T09:41:47-05:00 Prefer RdrName over OccName for looking up locations in doc renaming step Looking up by OccName only does not take into account when functions are only imported in a qualified way. Fixes issue #24294 Bump haddock submodule to include regression test - - - - - 8ad02724 by Luite Stegeman at 2024-02-15T17:33:32-05:00 JS: add simple optimizer The simple optimizer reduces the size of the code generated by the JavaScript backend without the complexity and performance penalty of the optimizer in GHCJS. Also see #22736 Metric Decrease: libdir size_hello_artifact - - - - - 20769b36 by Matthew Pickering at 2024-02-15T17:34:07-05:00 base: Expose `--no-automatic-time-samples` in `GHC.RTS.Flags` API This patch builds on 5077416e12cf480fb2048928aa51fa4c8fc22cf1 and modifies the base API to reflect the new RTS flag. CLC proposal #243 - https://github.com/haskell/core-libraries-committee/issues/243 Fixes #24337 - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 08031ada by Teo Camarasu at 2024-02-16T13:37:00-05:00 base: export System.Mem.performBlockingMajorGC The corresponding C function was introduced in ba73a807edbb444c49e0cf21ab2ce89226a77f2e. As part of #22264. Resolves #24228 The CLC proposal was disccused at: https://github.com/haskell/core-libraries-committee/issues/230 Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 1f534c2e by Florian Weimer at 2024-02-16T13:37:42-05:00 Fix C output for modern C initiative GCC 14 on aarch64 rejects the C code written by GHC with this kind of error: error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion] 68 | *(ffi_arg*)resp = cret; | ^ Add the correct cast. For more information on this see: https://fedoraproject.org/wiki/Changes/PortingToModernC Tested-by: Richard W.M. Jones <rjones at redhat.com> - - - - - 5d3f7862 by Matthew Craven at 2024-02-16T13:38:18-05:00 Bump bytestring submodule to 0.12.1.0 - - - - - 902ebcc2 by Ian-Woo Kim at 2024-02-17T06:01:01-05:00 Add missing BCO handling in scavenge_one. - - - - - 97d26206 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Make cast between words and floats real primops (#24331) First step towards fixing #24331. Replace foreign prim imports with real primops. - - - - - a40e4781 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: add constant folding for bitcast between float and word (#24331) - - - - - 5fd2c00f by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: replace stack checks with assertions in casting primops There are RESERVED_STACK_WORDS free words (currently 21) on the stack, so omit the checks. Suggested by Cheng Shao. - - - - - 401dfe7b by Sylvain Henry at 2024-02-17T06:01:44-05:00 Reexport primops from GHC.Float + add deprecation - - - - - 4ab48edb by Ben Gamari at 2024-02-17T06:02:21-05:00 rts/Hash: Don't iterate over chunks if we don't need to free data When freeing a `HashTable` there is no reason to walk over the hash list before freeing it if the user has not given us a `dataFreeFun`. Noticed while looking at #24410. - - - - - bd5a1f91 by Cheng Shao at 2024-02-17T06:03:00-05:00 compiler: add SEQ_CST fence support 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 - - - - - 2ce2a493 by Cheng Shao at 2024-02-17T06:03:38-05:00 testsuite: fix hs_try_putmvar002 for targets without pthread.h 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. - - - - - 1fb3974e by Cheng Shao at 2024-02-17T06:03:38-05:00 ci: bump ci-images to use updated wasm image This commit bumps our ci-images revision to use updated wasm image. - - - - - 56e3f097 by Andrew Lelechenko at 2024-02-17T06:04:13-05:00 Bump submodule text to 2.1.1 T17123 allocates less because of improvements to Data.Text.concat in 1a6a06a. Metric Decrease: T17123 - - - - - a7569495 by Cheng Shao at 2024-02-17T06:04:51-05:00 rts: remove redundant rCCCS initialization 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. - - - - - 7a0293cc by Ben Gamari at 2024-02-19T07:11:00-05:00 Drop dependence on `touch` 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 - - - - - 0dbd729e by Andrei Borzenkov at 2024-02-19T07:11:37-05:00 Parser, renamer, type checker for @a-binders (#17594) 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 2afbddb0f24, 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 f5d3e03c56f. 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 - - - - - 486979b0 by Jade at 2024-02-19T07:12:13-05:00 Add specialized sconcat implementation for Data.Monoid.First and Data.Semigroup.First Approved CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/246 Fixes: #24346 - - - - - 17e309d2 by John Ericson at 2024-02-19T07:12:49-05:00 Fix reST in users guide It appears that aef587f65de642142c1dcba0335a301711aab951 wasn't valid syntax. - - - - - 35b0ad90 by Brandon Chinn at 2024-02-19T07:13:25-05:00 Fix searching for errors in sphinx build - - - - - 4696b966 by Cheng Shao at 2024-02-19T07:14:02-05:00 hadrian: fix wasm backend post linker script permissions The post-link.mjs script was incorrectly copied and installed as a regular data file without executable permission, this commit fixes it. - - - - - a6142e0c by Cheng Shao at 2024-02-19T07:14:40-05:00 testsuite: mark T23540 as fragile on i386 See #24449 for details. - - - - - 249caf0d by Matthew Craven at 2024-02-19T20:36:09-05:00 Add @since annotation to Data.Data.mkConstrTag - - - - - cdd939e7 by Jade at 2024-02-19T20:36:46-05:00 Enhance documentation of Data.Complex - - - - - d04f384f by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian/bindist: Ensure that phony rules are marked as such Otherwise make may not run the rule if file with the same name as the rule happens to exist. - - - - - efcbad2d by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian: Generate HSC2HS_EXTRAS variable in bindist installation We must generate the hsc2hs wrapper at bindist installation time since it must contain `--lflag` and `--cflag` arguments which depend upon the installation path. The solution here is to substitute these variables in the configure script (see mk/hsc2hs.in). This is then copied over a dummy wrapper in the install rules. Fixes #24050. - - - - - c540559c by Matthew Pickering at 2024-02-21T04:59:23-05:00 ci: Show --info for installed compiler - - - - - ab9281a2 by Matthew Pickering at 2024-02-21T04:59:23-05:00 configure: Correctly set --target flag for linker opts Previously we were trying to use the FP_CC_SUPPORTS_TARGET with 4 arguments, when it only takes 3 arguments. Instead we need to use the `FP_PROG_CC_LINKER_TARGET` function in order to set the linker flags. Actually fixes #24414 - - - - - 9460d504 by Rodrigo Mesquita at 2024-02-21T04:59:59-05:00 configure: Do not override existing linker flags in FP_LD_NO_FIXUP_CHAINS - - - - - 77629e76 by Andrei Borzenkov at 2024-02-21T05:00:35-05:00 Namespacing for fixity signatures (#14032) Namespace specifiers were added to syntax of fixity signatures: - sigdecl ::= infix prec ops | ... + sigdecl ::= infix prec namespace_spec ops | ... To preserve namespace during renaming MiniFixityEnv type now has separate FastStringEnv fields for names that should be on the term level and for name that should be on the type level. makeMiniFixityEnv function was changed to fill MiniFixityEnv in the right way: - signatures without namespace specifiers fill both fields - signatures with 'data' specifier fill data field only - signatures with 'type' specifier fill type field only Was added helper function lookupMiniFixityEnv that takes care about looking for a name in an appropriate namespace. Updates haddock submodule. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 84357d11 by Teo Camarasu at 2024-02-21T05:01:11-05:00 rts: only collect live words in nonmoving census when non-concurrent This avoids segfaults when the mutator modifies closures as we examine them. Resolves #24393 - - - - - 9ca56dd3 by Ian-Woo Kim at 2024-02-21T05:01:53-05:00 mutex wrap in refreshProfilingCCSs - - - - - 1387966a by Cheng Shao at 2024-02-21T05:02:32-05:00 rts: remove unused HAVE_C11_ATOMICS macro This commit removes the unused HAVE_C11_ATOMICS macro. We used to have a few places that have fallback paths when HAVE_C11_ATOMICS is not defined, but that is completely redundant, since the FP_CC_SUPPORTS__ATOMICS configure check will fail when the C compiler doesn't support C11 style atomics. There are also many places (e.g. in unreg backend, SMP.h, library cbits, etc) where we unconditionally use C11 style atomics anyway which work in even CentOS 7 (gcc 4.8), the oldest distro we test in our CI, so there's no value in keeping HAVE_C11_ATOMICS. - - - - - 0f40d68f by Andreas Klebinger at 2024-02-21T05:03:09-05:00 RTS: -Ds - make sure incall is non-zero before dereferencing it. Fixes #24445 - - - - - e5886de5 by Ben Gamari at 2024-02-21T05:03:44-05:00 rts/AdjustorPool: Use ExecPage abstraction This is just a minor cleanup I found while reviewing the implementation. - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 09941666 by Adam Gundry at 2024-02-21T13:53:12+00:00 Define GHC2024 language edition (#24320) See https://github.com/ghc-proposals/ghc-proposals/pull/613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail at joachim-breitner.de> - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 5121a4ed by Ben Gamari at 2024-02-23T06:40:55-05:00 Allow docstrings after exports 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. - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 0eb2265d by Hécate Moonlight at 2024-02-24T16:02:16-05:00 Improve the synopsis and description of base - - - - - 2e36f5d2 by Jade at 2024-02-24T16:02:51-05:00 Error Messages: Properly align cyclic module error Fixes: #24476 - - - - - bbfb051c by Ben Gamari at 2024-02-24T19:10:23-05:00 Allow docstrings after exports 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. - - - - - d8d6ad8c by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Move modules into GHC.Internal.* namespace Bumps haddock submodule due to testsuite output changes. - - - - - a82af7cd by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Rewrite `@since ` to `@since base-` These will be incrementally moved to the export sites in `base` where possible. - - - - - ca3836e1 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Migrate Haddock `not-home` pragmas from `ghc-internal` This ensures that we do not use `base` stub modules as declarations' homes when not appropriate. - - - - - c8cf3e26 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Partially freeze exports of GHC.Base Sadly there are still a few module reexports. However, at least we have decoupled from the exports of `GHC.Internal.Base`. - - - - - 272573c6 by Ben Gamari at 2024-02-24T19:10:23-05:00 Move Haddock named chunks - - - - - 2d8a881d by Ben Gamari at 2024-02-24T19:10:23-05:00 Drop GHC.Internal.Data.Int - - - - - 55c4c385 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler: Fix mention to `GHC....` modules in wasm desugaring Really, these references should be via known-key names anyways. I have fixed the proximate issue here but have opened #24472 to track the additional needed refactoring. - - - - - 64150911 by Ben Gamari at 2024-02-24T19:10:23-05:00 Accept performance shifts from ghc-internal restructure As expected, Haddock now does more work. Less expected is that some other testcases actually get faster, presumably due to less interface file loading. As well, the size_hello_artifact test regressed a bit when debug information is enabled due to debug information for the new stub symbols. Metric Decrease: T12227 T13056 Metric Increase: haddock.Cabal haddock.base MultiLayerModulesTH_OneShot size_hello_artifact - - - - - 317a915b by Ben Gamari at 2024-02-24T19:10:23-05:00 Expose GHC.Wasm.Prim from ghc-experimental Previously this was only exposed from `ghc-internal` which violates our agreement that users shall not rely on things exposed from that package. Fixes #24479. - - - - - 3bbd2bf2 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Small optimisation of evCallStack Don't lookupIds unless we actually need them. - - - - - 3e5c9e3c by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Use toException instead of SomeException - - - - - 125714a6 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Factor out errorBelch This was useful when debugging - - - - - 3d6aae7c by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Clean up imports of GHC.Stack.CloneStack - - - - - 6900306e by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move PrimMVar to GHC.Internal.MVar - - - - - 28f8a148 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move prettyCallStack to GHC.Internal.Stack - - - - - 4892de47 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Explicit dependency to workaround #24436 Currently `ghc -M` fails to account for `.hs-boot` files correctly, leading to issues with cross-package one-shot builds failing. This currently manifests in `GHC.Exception` due to the boot file for `GHC.Internal.Stack`. Work around this by adding an explicit `import`, ensuring that `GHC.Internal.Stack` is built before `GHC.Exception`. See #24436. - - - - - 294c93a5 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Use displayException in top-level exception handler Happily this also allows us to eliminate a special case for Deadlock exceptions. Implements [CLC #198](https://github.com/haskell/core-libraries-committee/issues/198). - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - cf756a25 by Ben Gamari at 2024-02-24T22:11:53-05:00 rts: Fix symbol references in Wasm RTS - - - - - 4e4d47a0 by Jade at 2024-02-26T15:17:20-05:00 GHCi: Improve response to unloading, loading and reloading modules Fixes #13869 - - - - - f3de8a3c by Zubin Duggal at 2024-02-26T15:17:57-05:00 rel-eng/fetch-gitlab.py: Fix name of aarch64 alpine 3_18 release job - - - - - c71bfdff by Cheng Shao at 2024-02-26T15:18:35-05:00 hadrian/hie-bios: pass -j to hadrian This commit passes -j to hadrian in the hadrian/hie-bios scripts. When the user starts HLS in a fresh clone that has just been configured, it takes quite a while for hie-bios to pick up the ghc flags and start actual indexing, due to the fact that the hadrian build step defaulted to -j1, so -j speeds things up and improve HLS user experience in GHC. Also add -j flag to .ghcid to speed up ghcid, and sets the Windows build root to .hie-bios which also works and unifies with other platforms, the previous build root _hie-bios was missing from .gitignore anyway. - - - - - 50bfdb46 by Cheng Shao at 2024-02-26T15:18:35-05:00 ci: enable parallelism in hadrian/ghci scripts This commit enables parallelism when the hadrian/ghci scripts are called in CI. The time bottleneck is in the hadrian build step, but previously the build step wasn't parallelized. - - - - - 61a78231 by Felix Yan at 2024-02-26T15:19:14-05:00 m4: Correctly detect GCC version When calling as `cc`, GCC does not outputs lowercased "gcc" at least in 13.2.1 version here. ``` $ cc --version cc (GCC) 13.2.1 20230801 ... ``` This fails the check and outputs the confusing message: `configure: $CC is not gcc; assuming it's a reasonably new C compiler` This patch makes it check for upper-cased "GCC" too so that it works correctly: ``` checking version of gcc... 13.2.1 ``` - - - - - 001aa539 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Fix formatting in whereFrom docstring Previously it used markdown syntax rather than Haddock syntax for code quotes - - - - - e8034d15 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Move ClosureType type to ghc-internal - Use ClosureType for InfoProv.ipDesc. - Use ClosureType for CloneStack.closureType. - Now ghc-heap re-exports this type from ghc-internal. See the accompanying CLC proposal: https://github.com/haskell/core-libraries-committee/issues/210 Resolves #22600 - - - - - 3da0a551 by Matthew Craven at 2024-02-27T13:27:22-05:00 StgToJS: Simplify ExprInline constructor of ExprResult Its payload was used only for a small optimization in genAlts, avoiding a few assignments for programs of this form: case NormalDataCon arg1 arg2 of x { NormalDataCon x1 x2 -> ... ; } But when compiling with optimizations, this sort of code is generally eliminated by case-of-known-constructor in Core-to-Core. So it doesn't seem worth tracking and cleaning up again in StgToJS. - - - - - 61bc92cc by Cheng Shao at 2024-02-27T16:58:42-05:00 rts: add missing ccs_mutex guard to internal_dlopen See added comment for details. Closes #24423. - - - - - dd29d3b2 by doyougnu at 2024-02-27T16:59:23-05:00 cg: Remove GHC.Cmm.DataFlow.Collections In pursuit of #15560 and #17957 and generally removing redundancy. - - - - - d3a050d2 by Cheng Shao at 2024-02-27T17:00:00-05:00 utils: remove unused lndir from tree Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 74b24a9b by Teo Camarasu at 2024-02-28T16:32:58+00:00 rts: avoid checking bdescr of value outside of Haskell heap In nonmovingTidyWeaks we want to check if the key of a weak pointer lives in the non-moving heap. We do this by checking the flags of the block the key lives in. But we need to be careful with values that live outside the Haskell heap, since they will lack a block descriptor and looking for one may lead to a segfault. In this case we should just accept that it isn't on the non-moving heap. Resolves #24492 - - - - - b4cae4ec by Simon Peyton Jones at 2024-02-29T02:10:08-05:00 In mkDataConRep, ensure the in-scope set is right A small change that fixes #24489 - - - - - 3836a110 by Cheng Shao at 2024-02-29T21:25:45-05:00 testsuite: fix T23540 fragility on 32-bit platforms T23540 is fragile on 32-bit platforms. The root cause is usage of `getEvidenceTreesAtPoint`, which internally relies on `Name`'s `Ord` instance, which is indeterministic. The solution is adding a deterministic `Ord` instance for `EvidenceInfo` and sorting the evidence trees before pretty printing. Fixes #24449. - - - - - 960c8d47 by Teo Camarasu at 2024-02-29T21:26:20-05:00 Reduce AtomicModifyIORef increment count This test leads to a lot of contention when N>2 and becomes very slow. Let's reduce the amount of work we do to compensate. Resolves #24490 - - - - - 2e46c8ad by Matthew Pickering at 2024-03-01T05:48:06-05:00 hadrian: Improve parallelism in binary-dist-dir rule I noticed that the "docs" target was needed after the libraries and executables were built. We can improve the parallelism by needing everything at once so that documentation can be built immediately after a library is built for example. - - - - - cb6c11fe by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Bump windows and freebsd boot compilers to 9.6.4 We have previously bumped the docker images to use 9.6.4, but neglected to bump the windows images until now. - - - - - 30f06996 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: darwin: Update to 9.6.2 for boot compiler 9.6.4 is currently broken due to #24050 Also update to use LLVM-15 rather than LLVM-11, which is out of date. - - - - - d9d69e12 by Matthew Pickering at 2024-03-01T05:48:07-05:00 Bump minimum bootstrap version to 9.6 - - - - - 67ace1c5 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Enable more documentation building Here we enable documentation building on 1. Darwin: The sphinx toolchain was already installed so we enable html and manpages. 2. Rocky8: Full documentation (toolchain already installed) 3. Alpine: Full documetnation (toolchain already installed) 4. Windows: HTML and manpages (toolchain already installed) Fixes #24465 - - - - - 39583c39 by Matthew Pickering at 2024-03-01T05:48:42-05:00 ci: Bump ci-images to allow updated aarch64-alpine image with llvm15 and clang15 - - - - - d91d00fc by Torsten Schmits at 2024-03-01T15:01:50-05:00 Introduce ListTuplePuns extension 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: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8820 Tracking ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/21294 - - - - - bbdb6286 by Sylvain Henry at 2024-03-01T15:01:50-05:00 JS linker: filter unboxed tuples - - - - - dec6d8d3 by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Improve error messages coming from non-linear patterns 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). - - - - - 6612388e by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Adjust documentation of linear lets according to committee decision - - - - - 1c064ef1 by Cheng Shao at 2024-03-02T17:11:19-05:00 compiler: start deprecating cmmToRawCmmHook cmmToRawCmmHook was added 4 years ago in d561c8f6244f8280a2483e8753c38e39d34c1f01. Its only user is the Asterius project, which has been archived and deprecated in favor of the ghc wasm backend. This patch starts deprecating cmmToRawCmmHook by placing a DEPRECATED pragma, and actual removal shall happen in a future GHC major release if no issue to oppose the deprecation has been raised in the meantime. - - - - - 9b74845f by Andrew Lelechenko at 2024-03-02T17:11:55-05:00 Data.List.NonEmpty.unzip: use WARNING with category instead of DEPRECATED CLC proposal: https://github.com/haskell/core-libraries-committee/issues/258 - - - - - 61bb5ff6 by Finley McIlwaine at 2024-03-04T09:01:40-08:00 add -fprof-late-overloaded and -fprof-late-overloaded-calls * Refactor late cost centre insertion for extensibility * Add two more late cost centre insertion methods that add SCCs to overloaded top level bindings and call sites with dictionary arguments. * Some tests for the basic functionality of the new insertion methods Resolves: #24500 - - - - - 82ccb801 by Andreas Klebinger at 2024-03-04T19:59:14-05:00 x86-ncg: Fix fma codegen when arguments are globals Fix a bug in the x86 ncg where results would be wrong when the desired output register and one of the input registers were the same global. Also adds a tiny optimization to make use of the memory addressing support when convenient. Fixes #24496 - - - - - 18ad1077 by Matthew Pickering at 2024-03-05T14:22:31-05:00 rel_eng: Update hackage docs upload scripts This adds the upload of ghc-internal and ghc-experimental to our scripts which upload packages to hackage. - - - - - bf47c9ba by Matthew Pickering at 2024-03-05T14:22:31-05:00 docs: Remove stray module comment from GHC.Profiling.Eras - - - - - 37d9b340 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix ghc-internal cabal file The file mentioned some artifacts relating to the base library. I have renamed these to the new ghc-internal variants. - - - - - 23f2a478 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix haddock source links and hyperlinked source There were a few issues with the hackage links: 1. We were using the package id rather than the package name for the package links. This is fixed by now allowing the template to mention %pkg% or %pkgid% and substituing both appropiatly. 2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage` as the new base link works on a local or remote hackage server. 3. The "src" path including too much stuff, so cross-package source links were broken as the template was getting double expanded. Fixes #24086 - - - - - 2fa336a9 by Ben Gamari at 2024-03-05T14:23:07-05:00 filepath: Bump submodule to 1.5.2.0 - - - - - 31217944 by Ben Gamari at 2024-03-05T14:23:07-05:00 os-string: Bump submodule to 2.0.2 - - - - - 4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00 base: Reflect new era profiling RTS flags in GHC.RTS.Flags * -he profiling mode * -he profiling selector * --automatic-era-increment CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254 - - - - - a8c0e31b by Sylvain Henry at 2024-03-05T21:45:14-05:00 JS: faster implementation for some numeric primitives (#23597) Use faster implementations for the following primitives in the JS backend by not using JavaScript's BigInt: - plusInt64 - minusInt64 - minusWord64 - timesWord64 - timesInt64 Co-authored-by: Josh Meredith <joshmeredith2008 at gmail.com> - - - - - 21e3f325 by Cheng Shao at 2024-03-05T21:45:52-05:00 rts: add -xr option to control two step allocator reserved space size This patch adds a -xr RTS option to control the size of virtual memory address space reserved by the two step allocator on a 64-bit platform, see added documentation for explanation. Closes #24498. - - - - - dedcf102 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: expose HeapAlloc.h as public header This commit exposes HeapAlloc.h as a public header. The intention is to expose HEAP_ALLOCED/HEAP_ALLOCED_GC, so they can be used in assertions in other public headers, and they may also be useful for user code. - - - - - d19441d7 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: assert pointer is indeed heap allocated in Bdescr() This commit adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs that attempt to access non-existent block descriptor of a static closure, #24492 being one such example. - - - - - 9a656a04 by Ben Gamari at 2024-03-06T13:39:39-05:00 ghc-experimental: Add dummy dependencies to work around #23942 This is a temporary measure to improve CI reliability until a proper solution is developed. Works around #23942. - - - - - 1e84b924 by Simon Peyton Jones at 2024-03-06T13:39:39-05:00 Three compile perf improvements with deep nesting These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425 - - - - - c4b13113 by Hécate Moonlight at 2024-03-06T13:40:17-05:00 Use "module" instead of "library" when applicable in base haddocks - - - - - 9cd9efb4 by Vladislav Zavialov at 2024-03-07T13:01:54+03:00 Rephrase error message to say "visible arguments" (#24318) * 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. - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - d523a6a7 by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump array submodule - - - - - 7e55003c by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump stm submodule - - - - - 32d337ef by Ben Gamari at 2024-03-07T19:40:45-05:00 Introduce exception context Here we introduce the `ExceptionContext` type and `ExceptionAnnotation` class, allowing dynamically-typed user-defined annotations to be attached to exceptions. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 - - - - - 39f3d922 by Ben Gamari at 2024-03-07T19:40:46-05:00 testsuite/interface-stability: Update documentation - - - - - fdea7ada by Ben Gamari at 2024-03-07T19:40:46-05:00 ghc-internal: comment formatting - - - - - 4fba42ef by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Default and warn ExceptionContext constraints - - - - - 3886a205 by Ben Gamari at 2024-03-07T19:40:46-05:00 base: Introduce exception backtraces Here we introduce the `Backtraces` type and associated machinery for attaching these via `ExceptionContext`. These has a few compile-time regressions (`T15703` and `T9872d`) due to the additional dependencies in the exception machinery. As well, there is a surprisingly large regression in the `size_hello_artifact` test. This appears to be due to various `Integer` and `Read` bits now being reachable at link-time. I believe it should be possible to avoid this but I have accepted the change for now to get the feature merged. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 Metric Increase: T15703 T9872d size_hello_artifact - - - - - 18c5409f by Ben Gamari at 2024-03-07T19:40:46-05:00 users guide: Release notes for exception backtrace work - - - - - f849c5fc by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Don't show ExceptionContext of GhcExceptions Most GhcExceptions are user-facing errors and therefore the ExceptionContext has little value. Ideally we would enable it in the DEBUG compiler but I am leaving this for future work. - - - - - dc646e6f by Sylvain Henry at 2024-03-07T19:40:46-05:00 Disable T9930fail for the JS target (cf #19174) - - - - - bfc09760 by Alan Zimmerman at 2024-03-07T19:41:22-05:00 Update showAstData to honour blanking of AnnParen Also tweak rendering of SrcSpan to remove extra blank line. - - - - - 50454a29 by Ben Gamari at 2024-03-08T03:32:42-05:00 ghc-internal: Eliminate GHC.Internal.Data.Kind This was simply reexporting things from `ghc-prim`. Instead reexport these directly from `Data.Kind`. Also add build ordering dependency to work around #23942. - - - - - 38a4b6ab by Ben Gamari at 2024-03-08T03:33:18-05:00 rts: Fix SET_HDR initialization of retainer set This fixes a regression in retainer set profiling introduced by b0293f78cb6acf2540389e22bdda420d0ab874da. Prior to that commit the heap traversal word would be initialized by `SET_HDR` using `LDV_RECORD_CREATE`. However, the commit added a `doingLDVProfiling` check in `LDV_RECORD_CREATE`, meaning that this initialization no longer happened. Given that this initialization was awkwardly indirectly anyways, I have fixed this by explicitly initializating the heap traversal word to `NULL` in `SET_PROF_HDR`. This is equivalent to the previous behavior, but much more direct. Fixes #24513. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 2859a637 by Ben Gamari at 2024-03-08T18:26:47-05:00 base: Use strerror_r instead of strerror As noted by #24344, `strerror` is not necessarily thread-safe. Thankfully, POSIX.1-2001 has long offered `strerror_r`, which is safe to use. Fixes #24344. CLC discussion: https://github.com/haskell/core-libraries-committee/issues/249 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - edb9bf77 by Jade at 2024-03-09T03:39:38-05:00 Error messages: Improve Error messages for Data constructors in type signatures. This patch improves the error messages from invalid type signatures by trying to guess what the user did and suggesting an appropriate fix. Partially fixes: #17879 - - - - - cfb197e3 by Patrick at 2024-03-09T03:40:15-05:00 HieAst: add module name #24493 The main purpose of this is to tuck the module name `xxx` in `module xxx where` into the hieAst. It should fix #24493. The following have been done: 1. Renamed and update the `tcg_doc_hdr :: Maybe (LHsDoc GhcRn)` to `tcg_hdr_info :: (Maybe (LHsDoc GhcRn), Maybe (XRec GhcRn ModuleName))` To store the located module name information. 2. update the `RenamedSource` and `RenamedStuff` with extra `Maybe (XRec GhcRn ModuleName)` located module name information. 3. add test `testsuite/tests/hiefile/should_compile/T24493.hs` to ensure the module name is added and update several relevent tests. 4. accompanied submodule haddoc test update MR in https://gitlab.haskell.org/ghc/haddock/-/merge_requests/53 - - - - - 2341d81e by Vaibhav Sagar at 2024-03-09T03:40:54-05:00 GHC.Utils.Binary: fix a couple of typos - - - - - 5580e1bd by Ben Gamari at 2024-03-09T03:41:30-05:00 rts: Drop .wasm suffix from .prof file names This replicates the behavior on Windows, where `Hi.exe` will produce profiling output named `Hi.prof` instead of `Hi.exe.prof`. While in the area I also fixed the extension-stripping logic, which incorrectly rewrote `Hi.exefoo` to `Hi.foo`. Closes #24515. - - - - - 259495ee by Cheng Shao at 2024-03-09T03:41:30-05:00 testsuite: drop exe extension from .hp & .prof filenames See #24515 for details. - - - - - c477a8d2 by Ben Gamari at 2024-03-09T03:42:05-05:00 rts/linker: Enable GOT support on all platforms There is nothing platform-dependent about our GOT implementation and GOT support is needed by `T24171` on i386. - - - - - 2e592857 by Vladislav Zavialov at 2024-03-09T03:42:41-05:00 Drop outdated comment on TcRnIllformedTypePattern This should have been done in 0f0c53a501b but I missed it. - - - - - c554b4da by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Bounds check array write - - - - - 15c590a5 by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Don't expose helper functions in header - - - - - e831ce31 by Ben Gamari at 2024-03-09T09:39:20-05:00 base: Move internals of GHC.InfoProv into GHC.InfoProv.Types Such that we can add new helpers into GHC.InfoProv.Types without breakage. - - - - - 6948e24d by Ben Gamari at 2024-03-09T09:39:20-05:00 rts: Lazily decode IPE tables Previously we would eagerly allocate `InfoTableEnt`s for each info table registered in the info table provenance map. However, this costs considerable memory and initialization time. Instead we now lazily decode these tables. This allows us to use one-third the memory *and* opens the door to taking advantage of sharing opportunities within a module. This required considerable reworking since lookupIPE now must be passed its result buffer. - - - - - 9204a04e by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Don't expose helper in header - - - - - 308926ff by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Share module_name within a Node This allows us to shave a 64-bit word off of the packed IPE entry size. - - - - - bebdea05 by Ben Gamari at 2024-03-09T09:39:20-05:00 IPE: Expose unit ID in InfoTableProv Here we add the unit ID to the info table provenance structure. - - - - - 6519c9ad by Ben Gamari at 2024-03-09T09:39:35-05:00 rts: Refactor GHC.Stack.CloneStack.decode Don't allocate a Ptr constructor per frame. - - - - - ed0b69dc by Ben Gamari at 2024-03-09T09:39:35-05:00 base: Do not expose whereFrom# from GHC.Exts - - - - - 2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00 docs: Update info on TypeAbstractions * Mention TypeAbstractions in 9.10.1-notes.rst * Set the status to "Experimental". * Add a "Since: GHC 9.x" comment to each section. - - - - - f8b88918 by Ben Gamari at 2024-03-09T21:21:46-05:00 ci-images: Bump Alpine image to bootstrap with 9.8.2 - - - - - 705e6927 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark T24171 as fragile due to #24512 I will fix this but not in time for 9.10.1-alpha1 - - - - - c74196e1 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark linker_unload_native as fragile In particular this fails on platforms without `dlinfo`. I plan to address this but not before 9.10.1-alpha1. - - - - - f4d87f7a by Ben Gamari at 2024-03-09T21:21:46-05:00 configure: Bump version to 9.10 - - - - - 88df9a5f by Ben Gamari at 2024-03-09T21:21:46-05:00 Bump transformers submodule to 0.6.1.1 - - - - - 8176d5e8 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Increase ulimit for T18623 1 MByte was just too tight and failed intermittently on some platforms (e.g. CentOS 7). Bumping the limit to 8 MByte should provide sufficient headroom. Fixes #23139. - - - - - c74b38a3 by Ben Gamari at 2024-03-09T21:21:46-05:00 base: Bump version to 4.20.0.0 - - - - - b2937fc3 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-internal: Set initial version at 9.1001.0 This provides PVP compliance while maintaining a clear correspondence between GHC releases and `ghc-internal` versions. - - - - - 4ae7d868 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-prim: Bump version to 0.11.0 - - - - - 50798dc6 by Ben Gamari at 2024-03-09T21:21:46-05:00 template-haskell: Bump version to 2.22.0.0 - - - - - 8564f976 by Ben Gamari at 2024-03-09T21:21:46-05:00 base-exports: Accommodate spurious whitespace changes in 32-bit output It appears that this was - - - - - 9d4f0e98 by Ben Gamari at 2024-03-09T21:21:46-05:00 users-guide: Move exception backtrace relnotes to 9.10 This was previously mistakenly added to the GHC 9.8 release notes. - - - - - 145eae60 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix name of Rocky8 artifact - - - - - 39c2a630 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix path of generate_jobs_metadata - - - - - aed034de by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/upload: Rework recompression The old `combine` approach was quite fragile due to use of filename globbing. Moreover, it didn't parallelize well. This refactoring makes the goal more obvious, parallelizes better, and is more robust. - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - dc207d06 by Ben Gamari at 2024-03-10T08:56:08-04:00 configure: Bump GHC version to 9.11 Bumps haddock submodule. - - - - - 8b2513e8 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload code when profiling is enabled The heap census may contain references (e.g. `Counter.identity`) to static data which must be available when the census is reported at the end of execution. Fixes #24512. - - - - - 7810b4c3 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload native objects when dlinfo isn't available To do so is unsafe as we have no way of identifying references to symbols provided by the object. Fixes #24513. Fixes #23993. - - - - - 0590764c by Ben Gamari at 2024-03-11T01:20:39-04:00 rel_eng/upload: Purge both $rel_name/ and $ver/ This is necessary for prereleases, where GHCup accesses the release via `$ver/` - - - - - b85a4631 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Remove duplicate code normalising slashes - - - - - c91946f9 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Simplify regexes with raw strings - - - - - 1a5f53c6 by Brandon Chinn at 2024-03-12T19:25:57-04:00 Don't normalize backslashes in characters - - - - - 7ea971d3 by Andrei Borzenkov at 2024-03-12T19:26:32-04:00 Fix compiler crash caused by implicit RHS quantification in type synonyms (#24470) - - - - - 39f3ac3e by Cheng Shao at 2024-03-12T19:27:11-04:00 Revert "compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms" This reverts commit 615eb855416ce536e02ed935ecc5a6f25519ae16. It was originally intended to fix #24449, but it was merely sweeping the bug under the rug. 3836a110577b5c9343915fd96c1b2c64217e0082 has properly fixed the fragile test, and we no longer need the C version of genSym. Furthermore, the C implementation causes trouble when compiling with clang that targets i386 due to alignment warning and libatomic linking issue, so it makes sense to revert it. - - - - - e6bfb85c by Cheng Shao at 2024-03-12T19:27:11-04:00 compiler: fix out-of-bound memory access of genSym on 32-bit This commit fixes an unnoticed out-of-bound memory access of genSym on 32-bit. ghc_unique_inc is 32-bit sized/aligned on 32-bit platforms, but we mistakenly treat it as a Word64 pointer in genSym, and therefore will accidentally load 2 garbage higher bytes, or with a small but non-zero chance, overwrite something else in the data section depends on how the linker places the data segments. This regression was introduced in !11802 and fixed here. - - - - - 77171cd1 by Ben Orchard at 2024-03-14T09:00:40-04:00 Note mutability of array and address access primops Without an understanding of immutable vs. mutable memory, the index primop family have a potentially non-intuitive type signature: indexOffAddr :: Addr# -> Int# -> a readOffAddr :: Addr# -> Int# -> State# d -> (# State# d, a #) indexOffAddr# might seem like a free generality improvement, which it certainly is not! This change adds a brief note on mutability expectations for most index/read/write access primops. - - - - - 7da7f8f6 by Alan Zimmerman at 2024-03-14T09:01:15-04:00 EPA: Fix regression discarding comments in contexts Closes #24533 - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file 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. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals 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 - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) 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. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation 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] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects 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. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface 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 https://gitlab.haskell.org/ghc/ghc/-/issues/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 ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` 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. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig 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.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) 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) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 72b54c07 by Rodrigo Mesquita at 2024-08-01T00:47:29-04:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - bfe4b3d3 by doyougnu at 2024-08-01T00:48:06-04:00 Rts linker: add case for pc-rel 64 relocation part of the upstream haskell.nix patches - - - - - 5843c7e3 by doyougnu at 2024-08-01T00:48:42-04:00 RTS linker: aarch64: better debug information Dump better debugging information when a symbol address is null. Part of the haskell.nix patches upstream project Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - c2e9c581 by Rodrigo Mesquita at 2024-08-01T00:49:18-04:00 base: Add haddocks to HasExceptionContext Fixes #25091 - - - - - f954f428 by Sylvain Henry at 2024-08-01T00:49:59-04:00 Only lookup ghcversion.h file in the RTS include-dirs by default. The code was introduced in 3549c952b535803270872adaf87262f2df0295a4. It used `getPackageIncludePath` which name doesn't convey that it looks into all include paths of the preload units too. So this behavior is probably unintentional and it should be ok to change it. Fix #25106 - - - - - 951ce3d5 by Matthew Pickering at 2024-08-01T00:50:35-04:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - bae1fea4 by sheaf at 2024-08-01T00:51:15-04:00 PMC: suggest in-scope COMPLETE sets when possible This commit modifies GHC.HsToCore.Pmc.Solver.generateInhabitingPatterns to prioritise reporting COMPLETE sets in which all of the ConLikes are in scope. This avoids suggesting out of scope constructors when displaying an incomplete pattern match warning, e.g. in baz :: Ordering -> Int baz = \case EQ -> 5 we prefer: Patterns of type 'Ordering' not matched: LT GT over: Patterns of type 'Ordering' not matched: OutOfScope Fixes #25115 - - - - - ff158fcd by Tommy Bidne at 2024-08-02T01:14:32+12:00 Print exception metadata in default handler CLC proposals 231 and 261: - Add exception type metadata to SomeException's displayException. - Add "Exception" header to default exception handler. See: https://github.com/haskell/core-libraries-committee/issues/231 https://github.com/haskell/core-libraries-committee/issues/261 Update stm submodule for test fixes. - - - - - 8b2f70a2 by Andrei Borzenkov at 2024-08-01T23:00:46-04:00 Type syntax in expressions (#24159, #24572, #24226) This patch extends the grammar of expressions with syntax that is typically found only in types: * function types (a -> b), (a ->. b), (a %m -> b) * constrained types (ctx => t) * forall-quantification (forall tvs. t) The new forms are guarded behind the RequiredTypeArguments extension, as specified in GHC Proposal #281. Examples: {-# LANGUAGE RequiredTypeArguments #-} e1 = f (Int -> String) -- function type e2 = f (Int %1 -> String) -- linear function type e3 = f (forall a. Bounded a => a) -- forall type, constraint The GHC AST and the TH AST have been extended as follows: syntax | HsExpr | TH.Exp ---------------+----------+-------------- a -> b | HsFunArr | ConE (->) a %m -> b | HsFunArr | ConE FUN ctx => t | HsQual | ConstrainedE forall a. t | HsForAll | ForallE forall a -> t | HsForAll | ForallVisE Additionally, a new warning flag -Wview-pattern-signatures has been introduced to aid with migration to the new precedence of (e -> p :: t). Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com> - - - - - 66e7f57d by Brandon Chinn at 2024-08-01T21:50:58-07:00 Implement MultilineStrings (#24390) This commit adds support for multiline strings, proposed at https://github.com/ghc-proposals/ghc-proposals/pull/569. Multiline strings can now be written as: myString = """ this is a multiline string """ The multiline string will have leading indentation stripped away. Full details of this post-processing may be found at the new GHC.Parser.String module. In order to cleanly implement this and maximize reusability, I broke out the lexing logic for strings out of Lexer.x into a new GHC.Parser.String module, which lexes strings with any provided "get next character" function. This also gave us the opportunity to clean up this logic, and even optimize it a bit. With this change, parsing string literals now takes 25% less time and 25% less space. - - - - - cf47b96f by Rodrigo Mesquita at 2024-08-03T05:59:40-04:00 hi: Stable sort avails Sorting the Avails in DocStructures is required to produce fully deterministic interface files in presence of re-exported modules. Fixes #25104 - - - - - af2ae742 by M. Taimoor Zaeem at 2024-08-03T18:52:50+05:00 haddock: decrease margin on top of small headings - - - - - a1e42e7a by Rodrigo Mesquita at 2024-08-05T21:03:04-04:00 hi: Deterministic ImportedMods in Usages The `mi_usages` field of the interface files must use a deterministic list of `Usage`s to guarantee a deterministic interface. However, this list was, in its origins, constructed from a `ModuleEnv` which uses a non-deterministic ordering that was leaking into the interface. Specifically, ImportedMods = ModuleEnv ... would get converted to a list and then passed to `mkUsageInfo` to construct the Usages. The solution is simple. Back `ImportedMods` with a deterministic map. `Map Module ...` is enough, since the Ord instance for `Module` already uses a stable, deterministic, comparison. Fixes #25131 - - - - - eb1cb536 by Serge S. Gulin at 2024-08-06T08:54:55+00:00 testsuite: extend size performance tests with gzip (fixes #25046) The main purpose is to create tests for minimal app (hello world and its variations, i.e. unicode used) distribution size metric. Many platforms support distribution in compressed form via gzip. It would be nice to collect information on how much size is taken by the executional bundle for each platform at minimal edge case. 2 groups of tests are added: 1. We extend javascript backend size tests with gzip-enabled versions for all cases where an optimizing compiler is used (for now it is google closure compiler). 2. We add trivial hello world tests with gzip-enabled versions for all other platforms at CI pipeline where no external optimizing compiler is used. - - - - - d94410f8 by Rodrigo Mesquita at 2024-08-07T11:49:19-04:00 ghc-internal: @since for backtraceDesired Fixes point 1 in #25052 - - - - - bfe600f5 by Rodrigo Mesquita at 2024-08-07T11:49:19-04:00 ghc-internal: No trailing whitespace in exceptions Fixes #25052 - - - - - 62650d9f by Andreas Klebinger at 2024-08-07T11:49:54-04:00 Add since annotation for -fkeep-auto-rules. This partially addresses #25082. - - - - - 5f0e23fd by Andreas Klebinger at 2024-08-07T11:49:54-04:00 Mention `-fkeep-auto-rules` in release notes. It was added earlier but hadn't appeared in any release notes yet. Partially addresses #25082. - - - - - 7446a09a by Sylvain Henry at 2024-08-07T11:50:35-04:00 Cmm: don't perform unsound optimizations on 32-bit compiler hosts - beef61351b240967b49169d27a9a19565cf3c4af enabled the use of MO_Add/MO_Sub for 64-bit operations in the C and LLVM backends - 6755d833af8c21bbad6585144b10e20ac4a0a1ab did the same for the x86 NCG backend However we store some literal values as `Int` in the compiler. As a result, some Cmm optimizations transformed target 64-bit literals into compiler `Int`. If the compiler is 32-bit, this leads to computing with wrong literals (see #24893 and #24700). This patch disables these Cmm optimizations for 32-bit compilers. This is unsatisfying (optimizations shouldn't be compiler-word-size dependent) but it fixes the bug and it makes the patch easy to backport. A proper fix would be much more invasive but it shall be implemented in the future. Co-authored-by: amesgen <amesgen at amesgen.de> - - - - - d59faaf2 by Vladislav Zavialov at 2024-08-07T11:51:11-04:00 docs: Update info on RequiredTypeArguments Add a section on "types in terms" that were implemented in 8b2f70a202 and remove the now outdated suggestion of using `type` for them. - - - - - 39fd6714 by Sylvain Henry at 2024-08-07T11:51:52-04:00 JS: fix minor typo in base's jsbits - - - - - e7764575 by Sylvain Henry at 2024-08-07T11:51:52-04:00 RTS: remove hack to force old cabal to build a library with only JS sources Need to extend JSC externs with Emscripten RTS definitions to avoid JSC_UNDEFINED_VARIABLE errors when linking without the emcc rts. Fix #25138 Some recompilation avoidance tests now fail. This is tracked with the other instances of this failure in #23013. My hunch is that they were working by chance when we used the emcc linker. Metric Decrease: T24602_perf_size - - - - - d1a40233 by Brandon Chinn at 2024-08-07T11:53:08-04:00 Support multiline strings in type literals (#25132) - - - - - 610840eb by Sylvain Henry at 2024-08-07T11:53:50-04:00 JS: fix callback documentation (#24377) Fix #24377 - - - - - 6ae4b76a by Zubin Duggal at 2024-08-13T13:36:57-04:00 haddock: Build haddock-api and haddock-library using hadrian We build these two packages as regular boot library dependencies rather than using the `in-ghc-tree` flag to include the source files into the haddock executable. The `in-ghc-tree` flag is moved into haddock-api to ensure that haddock built from hackage can still find the location of the GHC bindist using `ghc-paths`. Addresses #24834 This causes a metric decrease under non-release flavours because under these flavours libraries are compiled with optimisation but executables are not. Since we move the bulk of the code from the haddock executable to the haddock-api library, we see a metric decrease on the validate flavours. Metric Decrease: haddock.Cabal haddock.base haddock.compiler - - - - - 51ffba5d by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Add an extension field to HsRecFields This is the Right Thing to Do™. And it prepares for storing a multiplicity coercion there. First step of the plan outlined here and below https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12947#note_573091 - - - - - 4d2faeeb by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Add test for #24961 - - - - - 623b4337 by Arnaud Spiwack at 2024-08-13T13:37:50-04:00 Ensures that omitted record fields in pattern have multiplicity Many Omitted fields were simply ignored in the type checker and produced incorrect Core code. Fixes #24961 Metric Increase: RecordUpdPerf - - - - - c749bdfd by Sylvain Henry at 2024-08-13T13:38:41-04:00 AARCH64 linker: skip NONE relocations This patch is part of the patches upstreamed from haskell.nix. See https://github.com/input-output-hk/haskell.nix/pull/1960 for the original report/patch. - - - - - 682a6a41 by Brandon Chinn at 2024-08-13T13:39:17-04:00 Support multiline strings in TH - - - - - ee0a9c18 by Matthew Pickering at 2024-08-14T14:27:39-04:00 Extend -reexported-module flag to support module renaming The -reexported-module flag now supports renaming -rexported-modules. ``` -rexported-module "A as B" ``` This feature is only relevant to multi-component sessions. Fixes #25139 - - - - - e9496000 by Arnaud Spiwack at 2024-08-14T14:28:20-04:00 Don't restrict eta-reduction of linear functions This commit simply removes code. All the supporting implementation has been done as part of !12883. Closes #25129 - - - - - 2bb4156e by sheaf at 2024-08-14T14:28:56-04:00 Allow @ character in C labels Generated symbol names can include the '@' character, for example when using `__attribute__((vectorcall))`. - - - - - 7602ca23 by Sylvain Henry at 2024-08-14T14:29:36-04:00 Linker: replace blind tuple with a datatype + docs - - - - - bdd77b9e by sheaf at 2024-08-16T12:47:11-04:00 isIrrefutableHsPat: look up ConLikes in the HscEnv At GhcRn stage, in isIrrefutableHsPat we only looked up data constructors in the RdrEnv, which meant that we lacked fallibility information for out-of-scope constructors (which can arise from Template Haskell splices). Instead, we use 'lookupGREInfo', which looks up the information in the type environment. This was the correct function to call all along, but was not used in 572fbc44 due to import cycle reasons. The appropriate functions, 'irrefutableConLike{Rn,Tc}' have been moved to 'GHC.Rename.Env', which avoids import cycles. Fixes #25164 - - - - - 4bee377c by Sylvain Henry at 2024-08-16T12:47:53-04:00 Linker: some refactoring to prepare for #24886 - Rename LoadedBCOs into LazyBCOs - Bundle SptEntries with CompiledByteCode and removed [SptEntry] field from the BCOs constructor - Rename Linkable's LM constructor into Linkable: in the past we had LM and LP for Module and Package, now we only have the former. - Rename Unlinked into LinkablePart (and linkableUnlinked into linkableParts) - Use NonEmpty to encode invariant in Linkable's linkableParts type - Add helpers: linkableLibs, linkableBCOs, etc. - Add documentation - Remove partial nameOfObject - Rename nameOfObject_maybe into linkablePartPath - Rename byteCodeOfObject into linkablePartAllBCOs. - Refactor linkablePartAllBCOs to avoid a panic if a LazyBCO has a C stub. Document the fact that LazyBCOs are returned in this case (contrary to linkableBCOs which only returns non-lazy ones) Refactoring done while trying to understand how to adapt the linker code to support the JS backend too (cf #24886). - - - - - fa0dbaca by Mario Blažević at 2024-08-17T03:31:32+00:00 Implements the Exportable Named Default proposal (#24305) This squashed commit adds support for exportable named defaults, the accepted GHC proposal at https://github.com/ghc-proposals/ghc-proposals/pull/409 The proposal extends the Haskell '98 declarations default (Int, Double) which were implicitly always applying to Num class alone, to allow specifying an arbitrary single-parameter class: default IsString (Text, String) The effect of this declaration would be to eliminate the ambiguous type errors around string literals when OverloadedStrings extension is active. The declaration by itself has effect only in its module, so the proposal also adds the ability to export class defaults: module MyModule (default IsIstring) Once the language extension is published and established, we can consider using it in base and other libraries. See Note [Named default declarations] in GHC.Tc.Gen.Default for implementation details. - - - - - 1deba6b2 by Simon Peyton Jones at 2024-08-17T13:58:13-04:00 Make kick-out more selective This MR revised the crucial kick-out criteria in the constraint solver. Ticket #24984 showed an example in which * We were kicking out unnecessarily * That gave rise to extra work, of course * But it /also/ led to exponentially-sized coercions due to lack of sharing in coercions (something we want to fix separately #20264) This MR sharpens up the kick-out criteria; specifially in (KK2) we look only under type family applications if (fs>=fw). This forced me to understand the existing kick-out story, and I ended up rewriting many of the careful Notes in GHC.Tc.Solver.InertSet. Especially look at the new `Note [The KickOut Criteria]` The proof of termination is not air-tight, but it is better than before, and both Richard and I think it's correct :-). - - - - - 88488847 by Cheng Shao at 2024-08-18T04:44:01+02:00 testsuite: remove undesired -fasm flag from test ways This patch removes the -fasm flag from test ways, except ways like optasm that explicitly state they are meant to be compiled with NCG backend. Most test ways should use the default codegen backend, and the precense of -fasm can cause stderr mismatches like this when GHC is configured with the unregisterised backend: ``` --- /dev/null +++ /tmp/ghctest-3hydwldj/test spaces/testsuite/tests/profiling/should_compile/prof-late-cc.run/prof-late-cc.comp.stderr.normalised @@ -0,0 +1,2 @@ +when making flags consistent: warning: [GHC-74335] [-Winconsistent-flags (in -Wdefault)] + Target platform uses unregisterised ABI, so compiling via C *** unexpected failure for prof-late-cc(prof_no_auto) ``` This has been breaking the wasm unreg nightly job since !12595 landed. - - - - - 3a145315 by Cheng Shao at 2024-08-18T13:05:45-04:00 ghci: fix isMinTTY.h casing for Windows targets This commit fixes isMinTTY.h casing in isMinTTY.c that's compiled for Windows targets. While this looks harmless given Windows filesystems are case-insensitive by default, it does cause a compilation warning with recent versions of clang, so we might as well fix the casing: ``` driver\ghci\isMinTTY.c:10:10: error: warning: non-portable path to file '"isMinTTY.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] | 10 | #include "isMINTTY.h" | ^ #include "isMINTTY.h" ^~~~~~~~~~~~ "isMinTTY.h" 1 warning generated. ``` - - - - - 5f972bfb by Zubin Duggal at 2024-08-21T03:18:15-04:00 compiler: Fix pretty printing of ticked prefix constructors (#24237) - - - - - ef0a08e7 by Mike Pilgrem at 2024-08-21T03:18:57-04:00 Fix #15773 Clarify further -rtsopts 'defaults' in docs - - - - - 05a4be58 by Sebastian Graf at 2024-08-21T03:19:33-04:00 Improve efficiency of `assertError` (#24625) ... by moving `lazy` to the exception-throwing branch. It's all documented in `Note [Strictness of assertError]`. - - - - - c29b2b5a by sheaf at 2024-08-21T13:11:30-04:00 GHCi debugger: drop record name spaces for Ids When binding new local variables at a breakpoint, we should create Ids with variable namespace, and not record field namespace. Otherwise the rest of the compiler falls over because the IdDetails are wrong. Fixes #25109 - - - - - bd82ac9f by Hécate Kleidukos at 2024-08-21T13:12:12-04:00 base: Final deprecation of GHC.Pack The timeline mandated by #21461 has come to its term and after two years and four minor releases, we are finally removing GHC.Pack from base. Closes #21536 - - - - - 5092dbff by Sylvain Henry at 2024-08-21T13:12:54-04:00 JS: support rubbish static literals (#25177) Support for rubbish dynamic literals was added in #24664. This patch does the same for static literals. Fix #25177 - - - - - b5a2c061 by Phil de Joux at 2024-08-21T13:13:33-04:00 haddock docs: prefix comes before, postfix comes after - - - - - 6fde3685 by Marcin Szamotulski at 2024-08-21T23:15:39-04:00 haddock: include package info with --show-interface - - - - - 7e02111b by Andreas Klebinger at 2024-08-21T23:16:15-04:00 Document the (x86) SIMD macros. Fixes #25021. - - - - - 05116c83 by Rodrigo Mesquita at 2024-08-22T10:37:44-04:00 ghc-internal: Derive version from ghc's version Fixes #25005 - - - - - 73f5897d by Ben Gamari at 2024-08-22T10:37:44-04:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.14. - - - - - 821d0a9a by Cheng Shao at 2024-08-22T10:38:22-04:00 compiler: Store ForeignStubs and foreign C files in interfaces This data is used alongside Core bindings to reconstruct intermediate build products when linking Template Haskell splices with bytecode. Since foreign stubs and files are generated in the pipeline, they were lost with only Core bindings stored in interfaces. The interface codec type `IfaceForeign` contains a simplified representation of `ForeignStubs` and the set of foreign sources that were manually added by the user. When the backend phase writes an interface, `mkFullIface` calls `encodeIfaceForeign` to read foreign source file contents and assemble `IfaceForeign`. After the recompilation status check of an upstream module, `initWholeCoreBindings` calls `decodeIfaceForeign` to restore `ForeignStubs` and write the contents of foreign sources to the file system as temporary files. The restored foreign inputs are then processed by `hscInteractive` in the same manner as in a regular pipeline. When linking the stub objects for splices, they are excluded from suffix adjustment for the interpreter way through a new flag in `Unlinked`. For details about these processes, please consult Note [Foreign stubs and TH bytecode linking]. Metric Decrease: T13701 - - - - - f0408eeb by Cheng Shao at 2024-08-23T10:37:10-04:00 git: remove a.out and include it in .gitignore a.out is a configure script byproduct. It was mistakenly checked into the tree in !13118. This patch removes it, and include it in .gitignore to prevent a similar error in the future. - - - - - 1f95c5e4 by Matthew Pickering at 2024-08-23T10:37:46-04:00 docs: Fix code-block syntax on old sphinx version This code-block directive breaks the deb9 sphinx build. Fixes #25201 - - - - - 27dceb42 by Sylvain Henry at 2024-08-26T11:05:11-04:00 JS: add basic support for POSIX *at functions (#25190) openat/fstatat/unlinkat/dup are now used in the recent release of the `directory` and `file-io` packages. As such, these functions are (indirectly) used in the following tests one we'll bump the `directory` submodule (see !13122): - openFile008 - jsOptimizer - T20509 - bkpcabal02 - bkpcabal03 - bkpcabal04 - - - - - c68be356 by Matthew Pickering at 2024-08-26T11:05:11-04:00 Update directory submodule to latest master The primary reason for this bump is to fix the warning from `ghc-pkg check`: ``` Warning: include-dirs: /data/home/ubuntu/.ghcup/ghc/9.6.2/lib/ghc-9.6.2/lib/../lib/aarch64-linux-ghc-9.6.2/directory-1.3.8.1/include doesn't exist or isn't a directory ``` This also requires adding the `file-io` package as a boot library (which is discussed in #25145) Fixes #23594 #25145 - - - - - 4ee094d4 by Matthew Pickering at 2024-08-26T11:05:47-04:00 Fix aarch64-alpine target platform description We are producing bindists where the target triple is aarch64-alpine-linux when it should be aarch64-unknown-linux This is because the bootstrapped compiler originally set the target triple to `aarch64-alpine-linux` which is when propagated forwards by setting `bootstrap_target` from the bootstrap compiler target. In order to break this chain we explicitly specify build/host/target for aarch64-alpine. This requires a new configure flag `--enable-ignore-` which just switches off a validation check that the target platform of the bootstrap compiler is the same as the build platform. It is the same, but the name is just wrong. These commits can be removed when the bootstrap compiler has the correct target triple (I looked into patching this on ci-images, but it looked hard to do correctly as the build/host platform is not in the settings file). Fixes #25200 - - - - - e0e0f2b2 by Matthew Pickering at 2024-08-26T11:05:47-04:00 Bump nixpkgs commit for gen_ci script - - - - - 63a27091 by doyougnu at 2024-08-26T20:39:30-04:00 rts: win32: emit additional debugging information -- migration from haskell.nix - - - - - aaab3d10 by Vladislav Zavialov at 2024-08-26T20:40:06-04:00 Only export defaults when NamedDefaults are enabled (#25206) This is a reinterpretation of GHC Proposal #409 that avoids a breaking change introduced in fa0dbaca6c "Implements the Exportable Named Default proposal" Consider a module M that has no explicit export list: module M where default (Rational) Should it export the default (Rational)? The proposal says "yes", and there's a test case for that: default/DefaultImport04.hs However, as it turns out, this change in behavior breaks existing programs, e.g. the colour-2.3.6 package can no longer be compiled, as reported in #25206. In this patch, we make implicit exports of defaults conditional on the NamedDefaults extension. This fix is unintrusive and compliant with the existing proposal text (i.e. it does not require a proposal amendment). Should the proposal be amended, we can go for a simpler solution, such as requiring all defaults to be exported explicitly. Test case: testsuite/tests/default/T25206.hs - - - - - 3a5bebf8 by Matthew Pickering at 2024-08-28T14:16:42-04:00 simplifier: Fix space leak during demand analysis The lazy structure (a list) in a strict field in `DmdType` is not fully forced which leads to a very large thunk build-up. It seems there is likely still more work to be done here as it seems we may be trading space usage for work done. For now, this is the right choice as rather than using all the memory on my computer, compilation just takes a little bit longer. See #25196 - - - - - c2525e9e by Ryan Scott at 2024-08-28T14:17:17-04:00 Add missing parenthesizeHsType in cvtp's InvisP case We need to ensure that when we convert an `InvisP` (invisible type pattern) to a `Pat`, we parenthesize it (at precedence `appPrec`) so that patterns such as `@(a :: k)` will parse correctly when roundtripped back through the parser. Fixes #25209. - - - - - 1499764f by Sjoerd Visscher at 2024-08-29T16:52:56+02:00 Haddock: Add no-compilation flag This flag makes sure to avoid recompilation of the code when generating documentation by only reading the .hi and .hie files, and throw an error if it can't find them. - - - - - 768fe644 by Andreas Klebinger at 2024-09-03T13:15:20-04:00 Add functions to check for weakly pinned arrays. This commit adds `isByteArrayWeaklyPinned#` and `isMutableByteArrayWeaklyPinned#` primops. These check if a bytearray is *weakly* pinned. Which means it can still be explicitly moved by the user via compaction but won't be moved by the RTS. This moves us one more stop closer to nailing down #22255. - - - - - b16605e7 by Arsen Arsenović at 2024-09-03T13:16:05-04:00 ghc-toolchain: Don't leave stranded a.outs when testing for -g0 This happened because, when ghc-toolchain tests for -g0, it does so by compiling an empty program. This compilation creates an a.out. Since we create a temporary directory, lets place the test program compilation in it also, so that it gets cleaned up. Fixes: 25b0b40467d0a12601497117c0ad14e1fcab0b74 Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/25203 - - - - - 83e70b14 by Torsten Schmits at 2024-09-03T13:16:41-04:00 Build foreign objects for TH with interpreter's way when loading from iface Fixes #25211 When linking bytecode for TH from interface core bindings with `-fprefer-byte-code`, foreign sources are loaded from the interface as well and compiled to object code in an ad-hoc manner. The results are then loaded by the interpreter, whose way may differ from the current build's target way. This patch ensures that foreign objects are compiled with the interpreter's way. - - - - - 0d3bc2fa by Cheng Shao at 2024-09-04T07:20:06-04:00 rts: fix checkClosure error message This patch fixes an error message in checkClosure() when the closure has already been evacuated. The previous logic was meant to print the evacuated closure's type in the error message, but it was completely wrong, given info was not really an info table, but a tagged pointer that points to the closure's new address. - - - - - fb0a4e5c by Sven Tennie at 2024-09-04T07:20:43-04:00 MO_AcquireFence: Less restrictive barrier GCC and CLang translate the built-in `atomic_thread_fence(memory_order_acquire)` to `dmb ishld`, which is a bit less restrictive than `dmb ish` (which also implies stores.) - - - - - a45f1488 by Fendor at 2024-09-04T20:22:00-04:00 testsuite: Add support to capture performance metrics via 'perf' Performance metrics collected via 'perf' can be more accurate for run-time performance than GHC's rts, due to the usage of hardware counters. We allow performance tests to also record PMU events according to 'perf list'. - - - - - ce61fca5 by Fendor at 2024-09-04T20:22:00-04:00 gitlab-ci: Add nightly job for running the testsuite with perf profiling support - - - - - 6dfb9471 by Fendor at 2024-09-04T20:22:00-04:00 Enable perf profiling for compiler performance tests - - - - - da306610 by sheaf at 2024-09-04T20:22:41-04:00 RecordCon lookup: don't allow a TyCon This commit adds extra logic when looking up a record constructor. If GHC.Rename.Env.lookupOccRnConstr returns a TyCon (as it may, due to the logic explained in Note [Pattern to type (P2T) conversion]), we emit an error saying that the data constructor is not in scope. This avoids the compiler falling over shortly thereafter, in the call to 'lookupConstructorInfo' inside 'GHC.Rename.Env.lookupRecFieldOcc', because the record constructor would not have been a ConLike. Fixes #25056 - - - - - 9c354beb by Matthew Pickering at 2024-09-04T20:23:16-04:00 Use deterministic names for temporary files When there are multiple threads they can race to create a temporary file, in some situations the thread will create ghc_1.c and in some it will create ghc_2.c. This filename ends up in the debug info for object files after compiling a C file, therefore contributes to object nondeterminism. In order to fix this we store a prefix in `TmpFs` which serves to namespace temporary files. The prefix is populated from the counter in TmpFs when the TmpFs is forked. Therefore the TmpFs must be forked outside the thread which consumes it, in a deterministic order, so each thread always receives a TmpFs with the same prefix. This assumes that after the initial TmpFs is created, all other TmpFs are created from forking the original TmpFs. Which should have been try anyway as otherwise there would be file collisions and non-determinism. Fixes #25224 - - - - - 59906975 by Hécate Kleidukos at 2024-09-05T10:57:15-04:00 Silence x-partial in Haddock.Backends.Xhtml This is an unfortunate consequence of two mechanisms: * GHC provides (possibly-empty) lists of names * The functions that retrieve those names are not equipped to do error reporting, and thus accept these lists at face value. They will have to be attached an effect for error reporting in a later refactoring - - - - - 8afbab62 by Hécate Kleidukos at 2024-09-05T10:57:15-04:00 hadrian: Support loading haddock in ghci There is one tricky aspect with wired-in packages where the boot package is built with `-this-unit-id ghc` but the dependency is reported as `-package-id ghc-9.6...`. This has never been fixed in GHC as the situation of loading wired-in packages into the multi-repl seems like quite a niche feature that is always just easier to workaround. - - - - - 6cac9eb8 by Matthew Pickering at 2024-09-05T10:57:15-04:00 hadrian/multi: Load all targets when ./hadrian/ghci-multi is called This seems to make a bit more sense than just loading `ghc` component (and dependencies). - - - - - 7d84df86 by Matthew Pickering at 2024-09-05T10:57:51-04:00 ci: Beef up determinism interface test There have recently been some determinism issues with the simplifier and documentation. We enable more things to test in the ABI test to check that we produce interface files deterministically. - - - - - 5456e02e by Sylvain Henry at 2024-09-06T11:57:01+02:00 Transform some StgRhsClosure into StgRhsCon after unarisation (#25166) Before unarisation we may have code like: Test.foo :: Test.D [GblId, Unf=OtherCon []] = \u [] case (# |_| #) [GHC.Types.(##)] of sat_sAw [Occ=Once1] { __DEFAULT -> Test.D [GHC.Types.True sat_sAw]; }; After unarisation we get: Test.foo :: Test.D [GblId, Unf=OtherCon []] = {} \u [] Test.D [GHC.Types.True 2#]; Notice that it's still an Updatable closure for no reason anymore. This patch transforms appropriate StgRhsClosures into StgRhsCons after unarisation, allowing these closures to be statically allocated. Now we get the expected: Test.foo :: Test.D [GblId, Unf=OtherCon []] = Test.D! [GHC.Types.True 2#]; Fix #25166 To avoid duplicating code, this patch refactors the mk(Top)StgRhs functions and put them in a GHC.Stg.Make module alongside the new mk(Top)StgRhsCon_maybe functions. - - - - - 958b4518 by Hécate Kleidukos at 2024-09-06T16:40:56-04:00 haddock: Add missing requirements.txt for the online manual - - - - - 573f9833 by Sven Tennie at 2024-09-08T09:58:21+00:00 AArch64: Implement takeRegRegMoveInstr This has likely been forgotten. - - - - - 20b0de7d by Hécate Kleidukos at 2024-09-08T14:19:28-04:00 haddock: Configuration fix for ReadTheDocs - - - - - 03055c71 by Sylvain Henry at 2024-09-09T14:58:15-04:00 JS: fake support for native adjustors (#25159) The JS backend doesn't support adjustors (I believe) and in any case if it ever supports them it will be a native support, not one via libffi. - - - - - 5bf0e6bc by Sylvain Henry at 2024-09-09T14:58:56-04:00 JS: remove redundant h$lstat It was introduced a second time by mistake in 27dceb42376c34b99a38e36a33b2abc346ed390f (cf #25190) - - - - - ffbc2ab0 by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Refactor only newSysLocalDs * Change newSysLocalDs to take a scaled type * Add newSysLocalMDs that takes a type and makes a ManyTy local Lots of files touched, nothing deep. - - - - - 7124e4ad by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Don't introduce 'nospec' on the LHS of a RULE This patch address #25160. The main payload is: * When desugaring the LHS of a RULE, do not introduce the `nospec` call for non-canonical evidence. See GHC.Core.InstEnv Note [Coherence and specialisation: overview] The `nospec` call usually introdued in `dsHsWrapper`, but we don't want it on the LHS of a RULE (that's what caused #25160). So now `dsHsWrapper` takes a flag to say if it's on the LHS of a RULE. See wrinkle (NC1) in `Note [Desugaring non-canonical evidence]` in GHC.HsToCore.Binds. But I think this flag will go away again when I have finished with my (entirely separate) speciaise-on-values patch (#24359). All this meant I had to re-understand the `nospec` stuff and coherence, and that in turn made me do some refactoring, and add a lot of new documentation The big change is that in GHC.Core.InstEnv, I changed the /type synonym/ `Canonical` into a /data type/ `CanonicalEvidence` and documented it a lot better. That in turn made me realise that CalLStacks were being treated with a bit of a hack, which I documented in `Note [CallStack and ExecptionContext hack]`. - - - - - 663daf8d by Simon Peyton Jones at 2024-09-10T00:40:37-04:00 Add defaulting of equalities This MR adds one new defaulting strategy to the top-level defaulting story: see Note [Defaulting equalities] in GHC.Tc.Solver. This resolves #25029 and #25125, which showed that users were accidentally relying on a GHC bug, which was fixed by commit 04f5bb85c8109843b9ac2af2a3e26544d05e02f4 Author: Simon Peyton Jones <simon.peytonjones at gmail.com> Date: Wed Jun 12 17:44:59 2024 +0100 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. This fix gave rise to a number of user complaints; but the improved defaulting story of this MR largely resolves them. On the way I did a bit of refactoring, of course * Completely restructure the extremely messy top-level defaulting code. The new code is in GHC.Tc.Solver.tryDefaulting, and is much, much, much esaier to grok. - - - - - e28cd021 by Andrzej Rybczak at 2024-09-10T00:41:18-04:00 Don't name a binding pattern It's a keyword when PatternSynonyms are set. - - - - - b09571e2 by Simon Peyton Jones at 2024-09-10T00:41:54-04:00 Do not use an error thunk for an absent dictionary In worker/wrapper we were using an error thunk for an absent dictionary, but that works very badly for -XDictsStrict, or even (as #24934 showed) in some complicated cases involving strictness analysis and unfoldings. This MR just uses RubbishLit for dictionaries. Simple. No test case, sadly because our only repro case is rather complicated. - - - - - 8bc9f5f6 by Hécate Kleidukos at 2024-09-10T00:42:34-04:00 haddock: Remove support for applehelp format in the Manual - - - - - 9ca15506 by doyougnu at 2024-09-10T10:46:38-04:00 RTS linker: add support for hidden symbols (#25191) Add linker support for hidden symbols. We basically treat them as weak symbols. Patch upstreamed from haskell.nix Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 3b2dc826 by Sven Tennie at 2024-09-10T10:47:14-04:00 Fix C warnings (#25237) GCC 14 treats the fixed warnings as errors by default. I.e. we're gaining GCC 14 compatibility with these fixes. - - - - - 05715994 by Sylvain Henry at 2024-09-10T10:47:55-04:00 JS: fix codegen of static string data Before this patch, when string literals are made trivial, we would generate `h$("foo")` instead of `h$str("foo")`. This was introduced by mistake in 6bd850e887b82c5a28bdacf5870d3dc2fc0f5091. - - - - - 949ebced by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Re-organise cross-OS compatibility layer - - - - - 84ac9a99 by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Remove CPP for obsolete GHC and Cabal versions - - - - - 370d1599 by Hécate Kleidukos at 2024-09-10T19:19:40-04:00 haddock: Move the changelog file to the 'extra-doc-files' section in the cabal file - - - - - cfbff65a by Simon Peyton Jones at 2024-09-10T19:20:16-04:00 Add ZonkAny and document it This MR fixed #24817 by adding ZonkAny, which takes a Nat argument. See Note [Any types] in GHC.Builtin.Types, especially wrinkle (Any4). - - - - - 0167e472 by Matthew Pickering at 2024-09-11T02:41:42-04:00 hadrian: Make sure ffi headers are built before using a compiler When we are using ffi adjustors then we rely on `ffi.h` and `ffitarget.h` files during code generation when compiling stubs. Therefore we need to add this dependency to the build system (which this patch does). Reproducer, configure with `--enable-libffi-adjustors` and then build "_build/stage1/libraries/ghc-prim/build/GHC/Types.p_o". Observe that this fails before this patch and works afterwards. Fixes #24864 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 0f696958 by Rodrigo Mesquita at 2024-09-11T02:42:18-04:00 base: Deprecate BCO primops exports from GHC.Exts See https://github.com/haskell/core-libraries-committee/issues/212. These reexports will be removed in GHC 9.14. - - - - - cf0e7729 by Alan Zimmerman at 2024-09-11T02:42:54-04:00 EPA: Remove Anchor = EpaLocation synonym This just causes confusion. - - - - - 8e462f4d by Andrew Lelechenko at 2024-09-11T22:20:37-04:00 Bump submodule deepseq to 1.5.1.0 - - - - - aa4500ae by Sebastian Graf at 2024-09-11T22:21:13-04:00 User's guide: Fix the "no-backtracking" example of -XOrPatterns (#25250) Fixes #25250. - - - - - 1c479c01 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add Native Code Generator (NCG) This architecture wasn't supported before. Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 51b678e1 by Sven Tennie at 2024-09-12T10:39:38+00:00 Adjust test timings for slower computers Increase the delays a bit to be able to run these tests on slower computers. The reference was a Lichee Pi 4a RISCV64 machine. - - - - - a0e41741 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add RTS linker This architecture wasn't supported before. Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - d365b1d4 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Ignore divbyzero test The architecture's behaviour differs from the test's expectations. See comment in code why this is okay. - - - - - abf3d699 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Enable MulMayOflo_full test It works and thus can be tested. - - - - - 38c7ea8c by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: LibffiAdjustor: Ensure code caches are flushed RISCV64 needs a specific code flushing sequence (involving fence.i) when new code is created/loaded. - - - - - 7edc6965 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add additional linker symbols for builtins We're relying on some GCC/Clang builtins. These need to be visible to the linker (and not be stripped away.) - - - - - 92ad3d42 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Add GHCi support As we got a RTS linker for this architecture now, we can enable GHCi for it. - - - - - a145f701 by Sven Tennie at 2024-09-12T10:39:38+00:00 RISCV64: Set codeowners of the NCG - - - - - 8e6d58cf by Sven Tennie at 2024-09-12T10:39:38+00:00 Add test for C calling convention Ensure that parameters and return values are correctly processed. A dedicated test (like this) helps to get the subtleties of calling conventions easily right. The test is failing for WASM32 and marked as fragile to not forget to investigate this (#25249). - - - - - fff55592 by Torsten Schmits at 2024-09-12T21:50:34-04:00 finder: Add `IsBootInterface` to finder cache keys - - - - - cdf530df by Alan Zimmerman at 2024-09-12T21:51:10-04:00 EPA: Sync ghc-exactprint to GHC - - - - - 1374349b by Sebastian Graf at 2024-09-13T07:52:11-04:00 DmdAnal: Fast path for `multDmdType` (#25196) This is in order to counter a regression exposed by SpecConstr. Fixes #25196. - - - - - 80769bc9 by Andrew Lelechenko at 2024-09-13T07:52:47-04:00 Bump submodule array to 0.5.8.0 - - - - - 49ac3fb8 by Sylvain Henry at 2024-09-16T10:33:01-04:00 Linker: add support for extra built-in symbols (#25155) See added Note [Extra RTS symbols] and new user guide entry. Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie at gmail.com> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 3939a8bf by Samuel Thibault at 2024-09-16T10:33:44-04:00 GNU/Hurd: Add getExecutablePath support GNU/Hurd exposes it as /proc/self/exe just like on Linux. - - - - - d3b19851 by Sylvain Henry at 2024-09-17T11:03:28-04:00 RTS: expose closure_sizeW_ (#25252) C code using the closure_sizeW macro can't be linked with the RTS linker without this patch. It fails with: ghc-9.11.20240911: Failed to lookup symbol: closure_sizeW_ Fix #25252 Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie at gmail.com> Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com> - - - - - 137bf74d by Sebastian Graf at 2024-09-17T11:04:05-04:00 HsExpr: Inline `HsWrap` into `WrapExpr` This nice refactoring was suggested by Simon during review: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13261#note_583374 Fixes #25264. - - - - - 7fd9e5e2 by Sebastian Graf at 2024-09-17T11:04:05-04:00 Pmc: Improve Desugaring of overloaded list patterns (#25257) This actually makes things simpler. Fixes #25257. - - - - - e4169ba9 by Ben Gamari at 2024-09-18T07:55:28-04:00 configure: Correctly report when subsections-via-symbols is disabled As noted in #24962, currently subsections-via-symbols is disabled on AArch64/Darwin due to alleged breakage. However, `configure` reports to the user that it is enabled. Fix this. - - - - - 9d20a787 by Mario Blažević at 2024-09-18T07:56:08-04:00 Modified the default export implementation to match the amended spec - - - - - 35eb4f42 by Sylvain Henry at 2024-09-18T07:57:00-04:00 FFI: don't ppr Id/Var symbols with debug info (#25255) Even if `-dpp-debug` is enabled we should still generate valid C code. So we disable debug info printing when rendering with Code style. - - - - - 9e96dad8 by Sebastian Graf at 2024-09-21T17:47:59-04:00 Demand: Combine examples into Note (#25107) Just a leftover from !13060. Fixes #25107. - - - - - 21aaa34b by sheaf at 2024-09-21T17:48:36-04:00 Use x86_64-unknown-windows-gnu target for LLVM on Windows - - - - - 992a7624 by sheaf at 2024-09-21T17:48:36-04:00 LLVM: use -relocation-model=pic on Windows This is necessary to avoid the segfaults reported in #22487. Fixes #22487 - - - - - c50d29be by Ryan Hendrickson at 2024-09-21T17:49:15-04:00 compiler: Use type abstractions when deriving For deriving newtype and deriving via, in order to bring type variables needed for the coercions into scope, GHC generates type signatures for derived class methods. As a simplification, drop the type signatures and instead use type abstractions to bring method type variables into scope. - - - - - f04fd0ae by Zubin Duggal at 2024-09-21T17:49:51-04:00 driver: Ensure we run driverPlugin for staticPlugins (#25217) driverPlugins are only run when the plugin state changes. This meant they were never run for static plugins, as their state never changes. We need to keep track of whether a static plugin has been initialised to ensure we run static driver plugins at least once. This necessitates an additional field in the `StaticPlugin` constructor as this state has to be bundled with the plugin itself, as static plugins have no name/identifier we can use to otherwise reference them - - - - - 620becd7 by Andreas Klebinger at 2024-09-21T17:50:27-04:00 Allow unknown fd device types for setNonBlockingMode. This allows fds with a unknown device type to have blocking mode set. This happens for example for fds from the inotify subsystem. Fixes #25199. - - - - - c76e25b3 by Hécate Kleidukos at 2024-09-21T17:51:07-04:00 Use Hackage version of Cabal 3.14.0.0 for Hadrian. We remove the vendored Cabal submodule. Also update the bootstrap plans Fixes #25086 - - - - - 6c83fd7f by Zubin Duggal at 2024-09-21T17:51:07-04:00 ci: Ensure we source ci.sh in any jobs that run commands outside of ci.sh ci.sh sets up the toolchain environment, including paths for the cabal directory, the toolchain binaries etc. If we run any commands outside of ci.sh, unless we source ci.sh we will use the wrong values for these environment variables. In particular, I ran into an issue where the cabal invocation `hadrian/ghci` was using an old index state despite `ci.sh setup` updating and setting the correct index state. This is because `ci.sh` sets the `CABAL_DIR` to a different place, which is where the index was downloaded to, but we were using the default cabal directory outside ci.sh The solution is to source the correct environment `ci.sh` using `. ci.sh setup` - - - - - 9586998d by Sven Tennie at 2024-09-21T17:51:43-04:00 ghc-toolchain: Set -fuse-ld even for ld.bfd This reflects the behaviour of the autoconf scripts. - - - - - d7016e0d by Sylvain Henry at 2024-09-21T17:52:24-04:00 Parser: be more careful when lexing extended literals (#25258) Previously we would lex invalid prefixes like "8#Int3" as [8#Int, 3]. A side-effect of this patch is that we now allow negative unsigned extended literals. They trigger an overflow warning later anyway. - - - - - ca67d7cb by Zubin Duggal at 2024-09-22T02:34:06-04:00 rts: Ensure we dump new Cost Centres added by freshly loaded objects to the eventlog. To do this, we keep track of the ID of the last cost centre we dumped in DUMPED_CC_ID, and call dumpCostCentresToEventLog from refreshProfilingCCSs, which will dump all the new cost centres up to the one we already dumped in DUMPED_CC_ID. Fixes #24148 - - - - - c0df5aa9 by Alan Zimmerman at 2024-09-22T02:34:42-04:00 EPA: Replace AnnsModule am_main with EpTokens Working towards removing `AddEpAnn` - - - - - 2a551cd5 by Matthew Pickering at 2024-09-24T16:33:50+05:30 ci: Run abi-test on test-abi label - - - - - ab4039ac by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 testsuite: Add a test for object determinism Extends the abi_test with an object determinism check Also includes a standalone test to be run by developers manually when debugging issues with determinism. - - - - - d62c18d8 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Sampling uniques in the CG To achieve object determinism, the passes processing Cmm and the rest of the code generation pipeline musn't create new uniques which are non-deterministic. This commit changes occurrences of non-deterministic unique sampling within these code generation passes by a deterministic unique sampling strategy by propagating and threading through a deterministic incrementing counter in them. The threading is done implicitly with `UniqDSM` and `UniqDSMT`. Secondly, the `DUniqSupply` used to run a `UniqDSM` must be threaded through all passes to guarantee uniques in different passes are unique amongst them altogether. Specifically, the same `DUniqSupply` must be threaded through the CG Streaming pipeline, starting with Driver.Main calling `StgToCmm.codeGen`, `cmmPipeline`, `cmmToRawCmm`, and `codeOutput` in sequence. To thread resources through the `Stream` abstraction, we use the `UniqDSMT` transformer on top of `IO` as the Monad underlying the Stream. `UniqDSMT` will thread the `DUniqSupply` through every pass applied to the `Stream`, for every element. We use @type CgStream = Stream (UniqDSMT IO)@ for the Stream used in code generation which that carries through the deterministic unique supply. See Note [Deterministic Uniques in the CG] - - - - - 3bbe4af4 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Cmm unique renaming pass To achieve object determinism, we need to prevent the non-deterministic uniques from leaking into the object code. We can do this by deterministically renaming the non-external uniques in the Cmm groups that are yielded right after StgToCmm. The key to deterministic renaming is observing that the order of declarations, instructions, and data in the Cmm groups are already deterministic (modulo other determinism bugs), regardless of the uniques. We traverse the Cmm AST in this deterministic order and rename the uniques, incrementally, in the order they are found, thus making them deterministic. This renaming is guarded by -fobject-determinism which is disabled by default for now. This is one of the key passes for object determinism. Read about the overview of object determinism and a more detailed explanation of this pass in: * Note [Object determinism] * Note [Renaming uniques deterministically] Significantly closes the gap to #12935 - - - - - 8357ed50 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: DCmmGroup vs CmmGroup Part of our strategy in producing deterministic objects, namely, renaming all Cmm uniques in order, depend on the object code produced having a deterministic order (say, A_closure always comes before B_closure). However, the use of LabelMaps in the Cmm representation invalidated this requirement because the LabelMaps elements would already be in a non-deterministic order (due to the original uniques), and the renaming in sequence wouldn't work because of that non-deterministic order. Therefore, we now start off with lists in CmmGroup (which preserve the original order), and convert them into LabelMaps (for performance in the code generator) after the uniques of the list elements have been renamed. See Note [DCmmGroup vs CmmGroup or: Deterministic Info Tables] and #12935. Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 0e675fb8 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: Don't print unique in pprFullName This unique was leaking as part of the profiling description in info tables when profiling was enabled, despite not providing information relevant to the profile. - - - - - 340f58b0 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: UDFM for distinct-constructor-tables In order to produce deterministic objects when compiling with -distinct-constructor-tables, we also have to update the data constructor map to be backed by a deterministic unique map (UDFM) rather than a non-deterministic one (UniqMap). - - - - - 282f37a0 by Rodrigo Mesquita at 2024-09-24T16:33:50+05:30 determinism: InfoTableMap uniques in generateCgIPEStub Fixes object determinism when using -finfo-table-map Make sure to also deterministically rename the IPE map (as per Note [Renaming uniques deterministically]), and to use a deterministic unique supply when creating new labels for the IPE information to guarantee deterministic objects when IPE information is requested. Note that the Cmm group produced in generateCgIPEStub must /not/ be renamed because renaming uniques is not idempotent, and the references to the previously renamed code in the IPE Cmm group would be renamed twice and become invalid references to non-existent symbols. We do need to det-rename the InfoTableMap that is created in the conversion from Core to Stg. This is not a problem since that map won't refer any already renamed names (since it was created before the renaming). - - - - - 7b37afc9 by Zubin Duggal at 2024-09-24T16:33:50+05:30 ci: Allow abi-test to fail. We are not fully deterministic yet, see #12935 for work that remains to be done. - - - - - a63ee33a by Simon Peyton Jones at 2024-09-25T17:08:24-04:00 Add Given injectivity for built-in type families Ticket #24845 asks (reasonably enough) that if we have [G] a+b ~ 0 then we also know [G] a ~ 0, b ~ 0 and similar injectivity-like facts for other built-in type families. The status quo was that we never generate evidence for injectivity among Givens -- but it is quite reasonnable to do so. All we need is to have /evidence/ for the new constraints This MR implements that goal. I also took the opportunity to * Address #24978: refactoring UnivCo * Fix #25248, which was a consequences of the previous formulation of UnivCo As a result this MR touches a lot of code. The big things are: * Coercion constructor UnivCo now takes a [Coercion] as argument to express the coercions on which the UnivCo depends. A nice consequence is that UnivCoProvenance now has no free variables, simpler in a number of places. * Coercion constructors AxiomInstCo and AxiomRuleCo are combined into AxiomCo. The new AxiomCo, carries a (slightly oddly named) CoAxiomRule, which itself is a sum type of the various forms of built-in axiom. See Note [CoAxiomRule] in GHC.Core.Coercion.Axiom A merit of this is that we can separate the case of open and closed type families, and eliminate the redundant `BranchIndex` in the former case. * Much better representation for data BuiltInSynFamily, which means we no longer need to enumerate built-in axioms as well as built-in tycons. * There is a massive refactor in GHC.Builtin.Types.Literals, which contains all the built-in axioms for type-level operations (arithmetic, append, cons etc). A big change is that instead of redundantly having (a) a hand-written matcher, and (b) a template-based "proves" function, which were hard to keep in sync, the two are derive from one set of human-supplied info. See GHC.Builtin.Types.Literals.mkRewriteAxiom, and friends. * Significant changes in GHC.Tc.Solver.Equality to account for the new opportunity for Given/Given equalities. Smaller things * Improve pretty-printing to avoid parens around atomic coercions. * Do proper eqType in findMatchingIrreds, not `eqTypeNoKindCheck`. Looks like a bug, Richard agrees. * coercionLKind and coercionRKind are hot functions. I refactored the implementation (which I had to change anyway) to increase sharing. See Note [coercionKind performance] in GHC.Core.Coercion * I wrote a new Note [Finding orphan names] in GHC.Core.FVs about orphan names * I improved the `is_concrete` flag in GHC.Core.Type.buildSynTyCon, to avoid calling tyConsOfType. I forget exactly why I did this, but it's definitely better now. * I moved some code from GHC.Tc.Types.Constraint into GHC.Tc.Types.CtLocEnv and I renamed the module GHC.Tc.Types.CtLocEnv to GHC.Tc.Types.CtLoc - - - - - dd8ef342 by Ryan Scott at 2024-09-25T17:09:01-04:00 Resolve ambiguous method-bound type variables in vanilla defaults and GND When defining an instance of a class with a "vanilla" default, such as in the following example (from #14266): ```hs class A t where f :: forall x m. Monoid x => t m -> m f = <blah> instance A [] ``` We have to reckon with the fact that the type of `x` (bound by the type signature for the `f` method) is ambiguous. If we don't deal with the ambiguity somehow, then when we generate the following code: ```hs instance A [] where f = $dmf @[] -- NB: the type of `x` is still ambiguous ``` Then the generated code will not typecheck. (Issue #25148 is a more recent example of the same problem.) To fix this, we bind the type variables from the method's original type signature using `TypeAbstractions` and instantiate `$dmf` with them using `TypeApplications`: ```hs instance A [] where f @x @m = $dmf @[] @x @m -- `x` is no longer ambiguous ``` Note that we only do this for vanilla defaults and not for generic defaults (i.e., defaults using `DefaultSignatures`). For the full details, see `Note [Default methods in instances] (Wrinkle: Ambiguous types from vanilla method type signatures)`. The same problem arose in the code generated by `GeneralizedNewtypeDeriving`, as we also fix it here using the same technique. This time, we can take advantage of the fact that `GeneralizedNewtypeDeriving`-generated code _already_ brings method-bound type variables into scope via `TypeAbstractions` (after !13190), so it is very straightforward to visibly apply the type variables on the right-hand sides of equations. See `Note [GND and ambiguity]`. Fixes #14266. Fixes #25148. - - - - - 0a4da5d2 by ARATA Mizuki at 2024-09-25T17:09:41-04:00 Document primitive string literals and desugaring of string literals Fixes #17474 and #17974 Co-authored-by: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - ad0731ad by Zubin Duggal at 2024-09-25T17:10:18-04:00 rts: Fix segfault when using non-moving GC with profiling `nonMovingCollect()` swaps out the `static_flag` value used as a sentinel for `gct->scavenged_static_objects`, but the subsequent call `resetStaticObjectForProfiling()` sees the old value of `static_flag` used as the sentinel and segfaults. So we must call `resetStaticObjectForProfiling()` before calling `nonMovingCollect()` as otherwise it looks for the incorrect sentinel value Fixes #25232 and #23958 Also teach the testsuite driver about nonmoving profiling ways and stop disabling metric collection when nonmoving GC is enabled. - - - - - e7a26d7a by Sylvain Henry at 2024-09-25T17:11:00-04:00 Fix interaction between fork and kqueue (#24672) A kqueue file descriptor isn't inherited by a child created with fork. As such we mustn't try to close this file descriptor as we would close a random one, e.g. the one used by timerfd. Fix #24672 - - - - - 6863503c by Simon Peyton Jones at 2024-09-25T17:11:37-04:00 Improve GHC.Tc.Solver.defaultEquality This MR improves GHC.Tc.Solver.defaultEquality to solve #25251. The main change is to use checkTyEqRhs to check the equality, so that we do promotion properly. But within that we needed a small enhancement to LC_Promote. See Note [Defaulting equalites] (DE4) and (DE5) The tricky case is (alas) hard to trigger, so I have not added a regression test. - - - - - 97a6c6c3 by Sylvain Henry at 2024-09-25T17:12:18-04:00 JS: fix h$withCStringOnHeap helper (#25288) strlen returns the length of the string without the \0 terminating byte, hence CString weren't properly allocated on the heap (ending \0 byte was missing). - - - - - 5f7c20bc by Ben Gamari at 2024-09-26T04:14:05-04:00 base: Propagate `error` CallStack to thrown exception Previously `errorCallWithCallStackException` failed to propagate its `CallStack` argument, which represents the call-chain of the preceding `error` call, to the exception that it returned. Consequently, the call-stack of `error` calls were quite useless. Unfortunately, this is the second time that I have fixed this but it seems the first must have been lost in rebasing. Fixes a bug in the implementation of CLC proposal 164 <https://github.com/haskell/core-libraries-committee/issues/164> Fixes #24807. - - - - - c20d5186 by Matthew Pickering at 2024-09-26T04:14:42-04:00 driver: Fix -working-dir for foreign files -working-dir definitely needs more serious testing, there are some easy ways to test this. * Modify Cabal to call ghc using -working-dir rather than changing directory. * Modify the testsuite to run ghc using `-working-dir` rather than running GHC with cwd = temporary directory. However this will have to wait until after 9.12. Fixes #25150 - - - - - 88eaa7ac by Sylvain Henry at 2024-09-26T04:15:24-04:00 Enum deriving: reuse predError, succError, toEnumError Reuse predError, succError, and toEnumError when deriving Enum instances to avoid generating different error strings per instance. E.g. before this patch for every instance for a type FOO we would generate a string: "pred{FOO}: tried to take `pred' of first tag in enumeration"# - - - - - e9fa1163 by Sylvain Henry at 2024-09-26T04:15:24-04:00 Enum deriving: generate better code (#16364) Generate better code for Enum.toEnum: check both the lower and the upper bounds at once with an unsigned comparison. Initially I've used a type ascription with a call to 'fromIntegral', hence the slight refactoring of nlAscribe. Using 'fromIntegral' was problematic (too low in the module hierarchy) so 'enumIntToWord' was introduced instead. Combined with the previous commit, T21839c ghc/alloc decrease by 5% Metric Decrease: T21839c - - - - - 383af074 by Sylvain Henry at 2024-09-26T04:16:06-04:00 Core: add absorb rules for binary or/and (#16351) Rules: x or (x and y) ==> x x and (x or y) ==> x - - - - - 783c8b29 by Matthew Pickering at 2024-09-26T12:07:44-04:00 Don't compile `asBox` with -fprof-late The `asBox` function is intended to store exactly the closure which the user passes to it. Placing a cost centre on asBox introduces a thunk, which violates this expectation and can change the result of using asBox when profiling is enabled. See #25212 for more details and ample opportunity to discuss if this is a bug or not. - - - - - 0967dcc7 by Matthew Pickering at 2024-09-26T12:07:44-04:00 Fix normalisation of .prof files Fix 1: If a cost centre contained CAF then the normalisation was corrupted, now only check if CAF is at the start of a line. Fix 2: "no location info" contain a space, which messed up the next normalisation logic which assumed that columns didn't have spaced in. - - - - - 9eda1cb9 by Matthew Pickering at 2024-09-26T12:07:44-04:00 testsuite: Fix normalisation of prof_files removing newlines These normalisation steps were collapsing lines together, which made subsequent normalisation steps fail. ``` foo x y z CAF x y z qux x y z ``` was getting normalised to ``` foo x y z qux x y z ``` which means that subsequent line based filters would not work correctly. - - - - - 2b25f9e2 by Matthew Pickering at 2024-09-26T12:07:44-04:00 packaging: Enable late-ccs for release flavour This enables late cost centres when building profiled libraries and subsequently greatly improves the resolution of cost centre stacks when profiling. This patch also introduces the `grep_prof` test modifier which is used to apply a further filter to the .prof file before they are compared. Fixes #21732 ------------------------- Metric Increase: libdir ------------------------- - - - - - bb030d0d by Brandon Chinn at 2024-09-26T12:08:21-04:00 Replace manual string lexing (#25158) Metric Increase: MultilineStringsPerf This commit replaces the manual string lexing logic with native Alex lexing syntax. This aligns the lexer much closer to the Haskell Report, making it easier to see how the implementation and spec relate. This slightly increases memory usage when compiling multiline strings because we now have two distinct phases: lexing the multiline string with Alex and post-processing the string afterwards. Before, these were done at the same time, but separating them allows us to push as much logic into normal Alex lexing as possible. Since multiline strings are a new feature, this regression shouldn't be too noticeable. We can optimize this over time. - - - - - 16742987 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Revert !4655: Stop 'import "base" Prelude' removing implicit Prelude import This behaviour is problematic for the principle reason that `import Prelude` may not refer to the `base` package, and in which case importing an entirely unrelated module causing your implicit prelude to leave the scope is extremely surprising. See the added test for this example. Discussion on #17045. The secondary reason for reverting this patch is that "base" can't be a wired in package any more (see #24903), so we have to remove special logic which singles out base from the compiler. The rule for implicit shadowing is now simply: * If you write import Prelude (..) then you don't get an implicit prelude import * If you write import "foobar" Prelude (..) for all pkgs foobar, you get an implicit import of prelude. If you want to write a package import of Prelude, then you can enable `NoImplicitPrelude` for the module in question to recover the behaviour of ghc-9.2-9.10. Fixes #17045 - - - - - 57c50f41 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Rename COMPILING_BASE_PACKAGE to COMPILING_GHC_INTERNAL_PACKAGE The COMPILING_BASE_PACKAGE macro is concerned with issues defining symbols and using symbols in the same compilation unit. However, these symbols now exist in ghc-internal rather than base, so we should rename the macro accordingly. The code is guards is likely never used as we never produce windows DLLs but it is simpler to just perform the renaming for now. These days there is little doubt that this macro defined in this ad-hoc manner would be permitted to exist, but these days are not those days. Fixes #25221 - - - - - 70764243 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Preload ghc-internal rather than base This occurence of baseUnitId was missed when moving the bulk of internal definitions into `ghc-internal`. We need to remove this preloading of `base` now because `base` should not be wired in. Towards #24903 - - - - - 12915609 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Remove Data.List compat warning There is currently a warning implemented in -Wcompat which warns you when importing Data.List in a non-qualified manner. ``` A.hs:3:8: warning: [-Wcompat-unqualified-imports] To ensure compatibility with future core libraries changes imports to Data.List should be either qualified or have an explicit import list. | 3 | import Data.List | ^^^^^^^^^ Ok, one module loaded. ``` GHC ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/17244 CLC discussion: https://groups.google.com/g/haskell-core-libraries/c/q3zHLmzBa5E This warning was implemented as part of the migration to making Data.List monomorphic again (and to be used like Data.Set, Data.Map etc). That doesn't seem like it happened, and I imagine that the current CLC would require a new proposal anyway in order to do that now. It's not clear in any case what "future core libraries changes" we are waiting to happen before this warning can be removed. Given the first phase of the proposal has lasted 5 years it doesn't seem that anyone is motivated to carry the proposal to completion. It does seem a bit unnecessary to include a warning in the compiler about "future changes to the module" when there's no timeline or volunteer to implement these changes. The removal of this warning was discussed again at: https://github.com/haskell/core-libraries-committee/issues/269 During the discussion there was no new enthusiasm to move onto the next stages of the proposal so we are removing the warning to unblock the reinstallable "base" project (#24903) Fixes #24904 - - - - - d4e4d498 by Matthew Pickering at 2024-09-26T12:08:57-04:00 Move Control.Monad.Zip into ghc-internal mzip is wired in and therefore needs to be in ghc-internal. Fixes #25222 Towards #24903 - - - - - d3dacdfb by Matthew Pickering at 2024-09-26T12:08:57-04:00 Unwire the base package This patch just removes all the functions related to wiring-in the base package and the `-this-unit-id=base` flag from the cabal file. After this commit "base" becomes just like any other package and the door is opened to moving base into an external repo and releasing base on a separate schedule to the rest of ghc. Closes #24903 - - - - - 1b39363b by Patrick at 2024-09-27T06:10:19-04:00 Add entity information to HieFile #24544 Enhanced HieFile to capture entity information for identifiers, enabling better support for language tools and protocols. See issue #24544 for more details. Work have been done: * Introduction of new data type `EntityInfo` in `GHC.Iface.Ext.Types`. * Add extra field `hie_entity_infos :: NameEntityInfo` to `HieFile` to store the mapping from entity name to corresponding entity infos in `GHC.Iface.Ext.Types`. * Compute `EntityInfo` for each entity name in the HieAst from `TyThing, Id, OccName` when generating the `HieFile` in `GHC.Iface.Ext.Ast`. * Add test T24544 to test the generation of `EntityInfo`. - - - - - 4f3618d8 by sheaf at 2024-09-27T06:10:57-04:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 10e431ef by sheaf at 2024-09-27T06:10:57-04:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 8238fb2d by sheaf at 2024-09-27T06:10:57-04:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 2cb7b748 by sheaf at 2024-09-27T06:10:57-04:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 0d2428d6 by sheaf at 2024-09-27T06:10:57-04:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - e6c19a41 by sheaf at 2024-09-27T06:10:57-04:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - f496ff7f by sheaf at 2024-09-27T06:10:57-04:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 5dd2a423 by sheaf at 2024-09-27T06:10:57-04:00 Add test for C calls & SIMD vectors - - - - - f824e1ee by sheaf at 2024-09-27T06:10:58-04:00 Add test for #25169 - - - - - d54db7f3 by sheaf at 2024-09-27T06:10:58-04:00 Fix #25169 using Plan A from the ticket We now compile certain low-level Cmm functions in the RTS multiple times, with different levels of vector support. We then dispatch at runtime in the RTS, based on what instructions are supported. See Note [realArgRegsCover] in GHC.Cmm.CallConv. Fixes #25169 ------------------------- Metric Increase: T10421 T12425 T18730 T1969 T9198 ------------------------- - - - - - d5f8778a by sheaf at 2024-09-27T06:10:58-04:00 Fix C calls with SIMD vectors This commit fixes the code generation for C calls, to take into account the calling convention. This is particularly tricky on Windows, where all vectors are expected to be passed by reference. See Note [The Windows X64 C calling convention] in GHC.CmmToAsm.X86.CodeGen. - - - - - f64bd564 by sheaf at 2024-09-27T06:10:58-04:00 X86 CodeGen: refactor getRegister CmmLit This refactors the code dealing with loading literals into registers, removing duplication and putting all the code in a single place. It also changes which XOR instruction is used to place a zero value into a register, so that we use VPXOR for a 128-bit integer vector when AVX is supported. - - - - - ab12de6b by sheaf at 2024-09-27T06:10:58-04:00 X86 genCCall: promote arg before calling evalArgs The job of evalArgs is to ensure each argument is put into a temporary register, so that it can then be loaded directly into one of the argument registers for the C call, without the generated code clobbering any other register used for argument passing. However, if we promote arguments after calling evalArgs, there is the possibility that the code used for the promotion will clobber a register, defeating the work of evalArgs. To avoid this, we first promote arguments, and only then call evalArgs. - - - - - 8fd12429 by sheaf at 2024-09-27T06:10:58-04:00 X86 genCCall64: simplify loadArg code This commit simplifies the argument loading code by making the assumption that it is safe to directly load the argument into register, because doing so will not clobber any previous assignments. This assumption is borne from the use of 'evalArgs', which evaluates any arguments which might necessitate non-trivial code generation into separate temporary registers. - - - - - 12504a9f by sheaf at 2024-09-27T06:10:58-04:00 LLVM: propagate GlobalRegUse information This commit ensures we keep track of how any particular global register is being used in the LLVM backend. This informs the LLVM type annotations, and avoids type mismatches of the following form: argument is not of expected type '<2 x double>' call ccc <2 x double> (<2 x double>) (<4 x i32> arg) - - - - - 2bb1e8df by Cheng Shao at 2024-09-27T06:11:35-04:00 Link bytecode from interface-stored core bindings in oneshot mode !13042 Part of #T25090 If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use Core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). When an interface is loaded into the EPS in `loadInterface` that has dehydrated Core bindings, an entry is added to the new field `eps_iface_bytecode`, containing an IO action that produces a bytecode `Linkable`, lazily processing the `mi_extra_decls` by calling `loadIfaceByteCode`. When Template Haskell dependencies are resolved in `getLinkDeps`, this action is looked up after loading a module's interface. If it exists, the action is evaluated and the bytecode is added to the set of `Linkable`s used for execution of the splice; otherwise it falls back on the traditional object file. Metric Decrease: MultiLayerModules T13701 - - - - - 7cb7172e by Matthew Pickering at 2024-09-27T06:12:12-04:00 ci: Fix variable inheritence for ghcup-metadata testing job Downstream in ghcup-ci we use the CONFIGURE_ARGS variable to determine how to setup all the different jobs. On the downstream trigger this was being inherited from the default setting in .gitlab.yml file. Therefore this led to job failures as the necessary CONFIGURE_ARGS were not being passed to the configure script when installing the bindist. See docs: * https://docs.gitlab.com/ee/ci/yaml/#inherit * https://docs.gitlab.com/ee/ci/yaml/#triggerforward 1. inherit:variables:fals - This stops the global variables being inherited into the job and hence forwarded onto the downstream job. 2. trigger:forward:* - yaml_variables: true (default) pass yaml variables to downstream, this is important to pass the upstream pipeline id to downstream. - pipeline_variables: false (default) but don't pass pipeline variables (normal environment variables). Fixes #25294 - - - - - 9ffd6163 by Leo at 2024-09-27T16:26:01+05:30 Fix typo in Prelude doc for (>>=) Fix a minor typo ("equivialent" instead of "equivalent") in the documentation for (>>=) in the prelude. - - - - - 5745dbd3 by Vladislav Zavialov at 2024-09-27T16:26:52+05:30 Wildcard binders in type declarations (#23501) Add support for wildcard binders in type declarations: type Const a b = a -- BEFORE: the `b` had to be named -- even if unused on the RHS type Const a _ = a -- AFTER: the compiler accepts -- a wildcard binder `_` The new feature is part of GHC Proposal #425 "Invisible binders in type declarations", and more specifically its amendment #641. Just like a named binder, a wildcard binder `_` may be: * plain: _ * kinded: (_ :: k -> Type) * invisible, plain: @_ * invisible, kinded: @(_ :: k -> Type) Those new forms of binders are allowed to occur on the LHSs of data, newtype, type, class, and type/data family declarations: data D _ = ... newtype N _ = ... type T _ = ... class C _ where ... type family F _ data family DF _ (Test case: testsuite/tests/typecheck/should_compile/T23501a.hs) However, we choose to reject them in forall telescopes and type family result variable binders (the latter being part of the TypeFamilyDependencies extension): type family Fd a = _ -- disallowed (WildcardBndrInTyFamResultVar) fn :: forall _. Int -- disallowed (WildcardBndrInForallTelescope) (Test case: testsuite/tests/rename/should_fail/T23501_fail.hs) See the new Notes: * Note [Type variable binders] * Note [Wildcard binders in disallowed contexts] To accommodate the new forms of binders, HsTyVarBndr was changed as follows (demonstrated without x-fields for clarity) -- BEFORE (ignoring x-fields and locations) data HsTyVarBndr flag = UserTyVar flag Name | KindedTyVar flag Name HsKind -- AFTER (ignoring x-fields and locations) data HsTyVarBndr flag = HsTvb flag HsBndrVar HsBndrKind data HsBndrVar = HsBndrVar Name | HsBndrWildCard data HsBndrKind = HsBndrNoKind | HsBndrKind LHsKind The rest of the patch is downstream from this change. To avoid a breaking change to the TH AST, we generate fresh names to replace wildcard binders instead of adding a dedicated representation for them (as discussed in #641). And to put a cherry on top of the cake, we now allow wildcards in kind-polymorphic type variable binders in constructor patterns, see Note [Type patterns: binders and unifiers] and the tyPatToBndr function in GHC.Tc.Gen.HsType; example: fn (MkT @(_ :: forall k. k -> Type) _ _) = ... (Test case: testsuite/tests/typecheck/should_compile/T23501b.hs) - - - - - ff2bdca2 by Matthew Pickering at 2024-09-27T16:27:08+05:30 ci: Push perf notes from wasm jobs It was observed in #25299 that we were failing to push performance numbers from the wasm jobs. In future we might want to remove this ad-hoc check but for now it's easier to add another special case. Towards #25299 - - - - - 4c76f75c by Zubin Duggal at 2024-09-27T16:44:00+05:30 Bump GHC version to 9.12 - - - - - e4ac1b0d by Zubin Duggal at 2024-09-27T19:12:24+05:30 Bump GHC version to 9.13 - - - - - da20cac1 by Andreas Klebinger at 2024-10-02T22:18:48-04:00 SpecConstr: Introduce a separate argument limit for forced specs. We used to put no limit at all on specializations forced via the SPEC argument. This isn't always reasonable so we introduce a very high limit that applies to forced specializations, a flag to control it, and we now emit a warning if we fail a specialization because we exceed the warning. Fixes #25197 - - - - - 39497eed by Andreas Klebinger at 2024-10-02T22:19:24-04:00 ghc-experimental: Expose primops and ghc extensions via GHC.PrimOps This will be the new place for functions that would have gone into GHC.Exts in the past but are not stable enough to do so now. Addresses #25242 - - - - - e9dc2690 by Sylvain Henry at 2024-10-02T22:20:06-04:00 RTS: cleanup timerfd file descriptors after a fork (#25280) When we init a timerfd-based ticker, we should be careful to cleanup the old file descriptors (e.g. after a fork). - - - - - 64e876bc by Rodrigo Mesquita at 2024-10-02T22:20:43-04:00 determinism: Deterministic MonadGetUnique LlvmM Update LlvmM to thread a unique deterministic supply (using UniqDSMT), and use it in the MonadGetUnique instance. This makes uniques sampled from LlvmM deterministic, which guarantees object determinism with -fllvm. Fixes #25274 - - - - - 36bbb167 by Matthew Pickering at 2024-10-02T22:21:18-04:00 Bump LLVM upper bound to allow LLVM 19 Also bumps the ci-images commit so that the deb12 images uses LLVM 19 for testing. ------------------------- Metric Decrease: size_hello_artifact_gzip size_hello_unicode_gzip ------------------------- Fixes #25295 - - - - - 0029ca91 by Matthew Pickering at 2024-10-02T22:21:54-04:00 configure: Allow happy-2.0.2 happy-2.0.2 can be used to compile GHC. happy-2.0 and 2.0.1 have bugs which make it unsuitable to use. The version bound is now == 1.20.* || >= 2.0.2 && < 2.1 Fixes #25276 - - - - - 92976985 by ARATA Mizuki at 2024-10-02T22:22:35-04:00 Use bundled llc/opt on Windows (#22438) - - - - - af59749a by Matthew Pickering at 2024-10-02T22:23:11-04:00 Fix registerArch for riscv64 The register allocator doesn't support vector registers on riscv64, therefore advertise as NoVectors. Fixes #25314 - - - - - a49e66fc by Matthew Pickering at 2024-10-02T22:23:11-04:00 riscv: Avoid using csrr instruction to test for vector registers The csrr instruction isn't allowed in qemu user-mode, and raises an illegal instruction error when it is encountered. Therefore for now, we just hard-code that there is no support for vector registers since the rest of the compiler doesn't support vector registers for riscv. Fixes #25312 - - - - - 115a30e9 by Andreas Klebinger at 2024-10-02T22:23:11-04:00 Add support for fp min/max to riscv Fixes #25313 - - - - - f28b5992 by Ben Gamari at 2024-10-02T22:23:47-04:00 testsuite/perf: Report better error message on malformed note Previously a malformed perf note resulted in very poor errors. Here we slight improve this situation. - - - - - 51377508 by Ben Gamari at 2024-10-02T22:23:47-04:00 testsuite: Handle division-by-zero more gracefully Previously we would fail with an ZeroDivisionError. Fixes #25321 - - - - - 50490075 by Matthew Pickering at 2024-10-03T05:55:13-04:00 ci: Add nightly & release ubuntu-22.04 jobs This adds build of bindists on ubuntu-22.04 on nightly and release pipelines. We also update ghcup-metadata to provide ubuntu-22.04 bindists on ubuntu-22.04. Fixes #25317 - - - - - 9cf1cef5 by Zubin Duggal at 2024-10-03T05:55:49-04:00 haddock: Bump binary interface version to 46. This allows haddock to give good error messages when being used on mismatched interface files. We bump to 46 since GHC 9.12 uses version 45: https://gitlab.haskell.org/ghc/ghc/-/commit/362afd632032ee8f174690c3ffe0015076b83ce6 This should have been done in e4ac1b0d281b85a0144d1ef6f84a1df00e236052 but was overlooked. - - - - - 2293c0b7 by Andreas Klebinger at 2024-10-03T05:56:25-04:00 Change versionig of ghc-experimental to follow ghc versions. Just like ghc-internal it will now use the @ProjectVersionForLib@ macro for versioning. This means for ghc=9.10.1, ghc-experimental's version will be 9.1001.0 and so on. This fixes #25289 - - - - - 876d6e0e by Ben Gamari at 2024-10-04T15:07:53+01:00 base: Add `HasCallStack` constraint to `ioError` As proposed in core-libraries-committee#275. - - - - - 9bfd9fd0 by Matthew Pickering at 2024-10-04T15:08:03+01:00 Fix toException method for ExceptionWithContext Fixes #25235 - - - - - ac004028 by Matthew Pickering at 2024-10-04T15:09:07+01:00 Exception rethrowing Basic changes: * Change `catch` function to propagate exceptions using the WhileHandling mechanism. * Introduce `catchNoPropagate`, which does the same as before, but passes an exception which can be rethrown. * Introduce `rethrowIO` combinator, which rethrows an exception with a context and doesn't add a new backtrace. * Introduce `tryWithContext` for a variant of `try` which can rethrow the exception with it's original context. * onException is modified to rethrow the original error rather than creating a new callstack. * Functions which rethrow in GHC.Internal.IO.Handle.FD, GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and GHC.Internal.System.IO.Error are modified to not add a new callstack. Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202> - - - - - bcb293f2 by Cheng Shao at 2024-10-04T17:59:28-04:00 testsuite: remove accidentally checked in debug print logic - - - - - 68e2da5a by Rodrigo Mesquita at 2024-10-05T10:36:15-04:00 Deprecation for WarnCompatUnqualifiedImports Fixes #25330 - - - - - 4327f0e8 by Andrew Lelechenko at 2024-10-05T10:36:52-04:00 Restrict Data.List.NonEmpty.unzip to NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) Implementing the final phase of CLC proposal https://github.com/haskell/core-libraries-committee/issues/86 - - - - - ceca9efb by Cheng Shao at 2024-10-06T02:18:31+00:00 driver: fix runWorkerLimit on wasm This commit fixes link-time unresolved symbol errors for sem_open etc on wasm, by making runWorkerLimit always behave single-threaded. This avoids introducing the jobserver logic into the final wasm module and thus avoids referencing the posix semaphore symbols. - - - - - 135fd1ac by Torsten Schmits at 2024-10-06T02:18:31+00:00 Parallelize getRootSummary computations in dep analysis downsweep This reuses the upsweep step's infrastructure to process batches of modules in parallel. I benchmarked this by running `ghc -M` on two sets of 10,000 modules; one with a linear dependency chain and the other with a binary tree. Comparing different values for the number of modules per thread suggested an optimum at `length targets `div` (n_cap * 2)`, with results similar to this one (6 cores, 12 threads): ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 1.775 s ± 0.026 s [User: 1.377 s, System: 0.399 s] Range (min … max): 1.757 s … 1.793 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 876.2 ms ± 20.9 ms [User: 1833.2 ms, System: 518.6 ms] Range (min … max): 856.2 ms … 898.0 ms 3 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 793.5 ms ± 23.2 ms [User: 2318.9 ms, System: 718.6 ms] Range (min … max): 771.9 ms … 818.0 ms 3 runs ``` Results don't differ much when the batch size is reduced to a quarter of that, but there's significant thread scheduling overhead for a size of 1: ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 2.611 s ± 0.029 s [User: 2.851 s, System: 0.783 s] Range (min … max): 2.591 s … 2.632 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 1.189 s ± 0.007 s [User: 2.707 s, System: 1.103 s] Range (min … max): 1.184 s … 1.194 s 2 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 1.097 s ± 0.006 s [User: 2.938 s, System: 1.300 s] Range (min … max): 1.093 s … 1.101 s 2 runs ``` Larger batches also slightly worsen performance. - - - - - 535a2117 by Daniel Díaz at 2024-10-06T09:51:46-04:00 Clarify the meaning of "exactly once" in LinearTypes Solves documentaion issue #25084. - - - - - 92f8939a by Krzysztof Gogolewski at 2024-10-06T09:52:22-04:00 Only allow (a => b) :: Constraint rather than CONSTRAINT rep Fixes #25243 - - - - - 4a2f0f13 by Alan Zimmerman at 2024-10-07T05:16:54-04:00 EPA: Remove unused hsCaseAnnsRest We never populate it, so remove it. - - - - - 5099057b by John Paul Adrian Glaubitz at 2024-10-07T05:17:40-04:00 rts: Fix invocation of __ieee_set_fp_control() on alpha-linux Fixes the following error when building GHC on alpha-linux: rts/posix/Signals.c: In function ‘initDefaultHandlers’: rts/posix/Signals.c:709:5: error: error: implicit declaration of function ‘ieee_set_fp_control’ [-Wimplicit-function-declaration] 709 | ieee_set_fp_control(0); | ^~~~~~~~~~~~~~~~~~~ | 709 | ieee_set_fp_control(0); | - - - - - c9590ba0 by Teo Camarasu at 2024-10-07T05:18:17-04:00 Add changelog entries for !12479 - - - - - bf9c9566 by Matthew Pickering at 2024-10-07T13:19:30-04:00 javascript: Read fields of ObjectBlock lazily When linking a module with a large dependency footprint too much of the object files were forced during linking. This lead to a large amount of memory taken up by thunks which would never be forced On the PartialDownsweep test this halves the memory required (from 25G to 13G). Towards #25324 ------------------------- Metric Increase: size_hello_obj ------------------------- - - - - - 571329df by Matthew Pickering at 2024-10-07T13:20:06-04:00 ci: Run the i386 validation job when i386 label is set This is helpful when making changes to base and must update the javascript and i386 base exports files. - - - - - e68f9aaf by Matthew Pickering at 2024-10-07T13:20:42-04:00 Rewrite partitionByWorkerSize to avoid pattern match checker bug With `-g3` the pattern match checker would warn about these incomplete patterns. This affects the debug_info builds on CI. ``` Pattern match(es) are non-exhaustive In an equation for ‘go’: Patterns of type ‘[a]’, ‘[a]’, ‘[SpecFailWarning]’ not matched: (_:_) _ _ | 2514 | go [] small warnings = (small, warnings) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ``` Workaround for #25338 - - - - - d915dc8b by Arnaud Spiwack at 2024-10-07T19:23:00-04:00 Remove the wrapper/coercion-passing logic for submultiplicity checks Instead, we use a dedicated DelayedError, which is emitted systematically on submultiplicity checks, but is suppressed if we can indeed solve the submultiplicity constraint with a reflexivity coercion. This way, we don't have to return anything from `tcSubMult`, which now looks like a regular constraint check, the rest is implementation detail. This removes all of the strange boilerplate that I'd been struggling with under the previous implementation. Even if submultiplicity checks are not properly constraints, this way it's contained entirely within a `WantedConstraint`. Much more pleasant. Closes #25128. - - - - - 1d226116 by Sven Tennie at 2024-10-07T19:23:37-04:00 AArch64: Implement switch/jump tables (#19912) This improves the performance of Cmm switch statements (compared to a chain of if statements.) - - - - - 3fe621dd by Mario Blažević at 2024-10-07T19:24:18-04:00 Fixes #25256, missing parens inside TH-printed pattern type signature - - - - - ea4b4391 by ARATA Mizuki at 2024-10-07T19:24:59-04:00 Better documentation for floatRange function Closes #16479 - - - - - ff09205c by Andreas Klebinger at 2024-10-07T19:25:35-04:00 Adjust progress message for hadrian to include cwd. Fixes #25335 - - - - - 5fd320da by Sven Tennie at 2024-10-07T19:26:12-04:00 CCallConv test: Align argument types The C calling convention / standard requires that arguments and their values are of the same type. - - - - - c6e5fd3d by Cheng Shao at 2024-10-07T19:26:47-04:00 hadrian: remove unused ghciWithDebugger field from flavour config This patch removes the ghciWithDebugger field from flavour config since it's actually not used anywhere. - - - - - 9c9c790d by sheaf at 2024-10-07T19:27:23-04:00 user's guide: update docs for X86 CPU flags This commit updates the section of the user's guide pertaining to X86 feature flags with the following changes: - the NCG backend now supports SIMD, so remove all text that says the contrary, - the LLVM backend does not "automatically detect" features, so remove any text that makes that claim. - - - - - a1ecc826 by Sven Tennie at 2024-10-08T13:36:03-04:00 ci: RISCV64 cross-compile testing This adds a validation job which tests that we can build a riscv64 cross compiler and build a simple program using it. We do not currently run the whole testsuite. Towards #25254 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - d5c2577f by Arnaud Spiwack at 2024-10-08T13:36:44-04:00 Remove unused accumulators in partition_errors - - - - - 55609880 by Andrzej Rybczak at 2024-10-09T16:41:46-04:00 Fix typo in the @since annotation of annotateIO - - - - - ef481813 by Alan Zimmerman at 2024-10-09T16:42:23-04:00 EPA: Remove [AddEpAnn] from (most of) HsExpr EPA: introduce EpAnnLam for lambda annotationsi, and remove `glAA` from `Parser.y`, it is the same as `glR` EPA: Remove unused annotation from XOpApp EPA: Use EpToken for XNPat and XNegApp EPA: specific anns for XExplicitTuple / XTuplePat / sumPatParens. EPA: Use specific annotation for MultiIf EPA: Move annotations into FunRhs EPA: Remove [AddEpAnn] from SigPat and ExprWithTySig EPA: Remove [AddEpAnn] from ArithSeq EPA: Remove [AddEpAnn] from HsProc EPA: Remove [AddEpAnn] from HsStatic EPA: Remove [AddEpAnn] from BindStmt EPA: Remove [AddEpAnn] from TransStmt EPA: Remove [AddEpAnn] from HsTypedSplice EPA: Remove [AddEpAnn] from HsUntypedSpliceExpr - - - - - 69960230 by Fabian Thorand at 2024-10-10T19:03:59+00:00 Handle exceptions from IO manager backend If an IO manager backend throws, it will not actually have registered the file descriptor. However, at that point, the IO manager state was already updated to assume the file descriptor is being tracked, leading to errors and an eventual deadlock down the line as documented in the issue #21969. The fix for this is to undo the IO manager state change in case the backend throws (just as we already do when the backend signals that the file type is not supported). The exception then bubbles up to user code. That way we make sure that 1. the bookkeeping state of the IO manager is consistent with the actions taken by the backend, even in the presence of unexpected failures, and 2. the error is not silent and visible to user code, making failures easier to debug. - - - - - 1587cccf by Hassan Al-Awwadi at 2024-10-11T03:52:36-04:00 Put RdrName in the foExt field of FieldOcc The main purpose of this commit is to rip RdrName out of FieldOcc, in accordance with #21592, and as a side note it has simplified the method we use to deal with ambiguity somewhat. To do the first, we make FieldOccs store (LIdP p) instead of always storing Located RdrName, and moved the readername to the extension points where necessary. For the second, well, we just turn an ambiguous RdrName into a unbound Name through mkUnboundName. Later during disambiguateRecordBinds of the type checking phase, we will try and do type-directed disambiguation based on the rdrName field (for now), so this hack works out fine. See Note [Ambiguous FieldOcc in record updates] for more details. There are two additional minor changes in this commit: * The HsRecSel constructor of HsExpr has been moved to the extension constuctors, since its really GHC specific. * HsProjection no longer has a Located DotFieldOcc as a field, but just a regular DotFieldOcc, since DotFieldOcc already wraps a located FieldLabelString co-authored by: @Jade <Jade512 at proton.me> @alt-romes <rodrigo.m.mesquita at gmail.com> - - - - - 2338a971 by Cheng Shao at 2024-10-11T03:53:13-04:00 driver: bail out when -fllvm is passed to GHC not configured with LLVM This patch makes GHC bail out with an proper error message when it's not configured with LLVM but users attempt to pass -fllvm, see #25011 and added comment for details. Fixes #25011 Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - 78ad81ec by Cristiano Moraes at 2024-10-11T03:53:55-04:00 configure: Find C++ probing when GCC version is the latest but G++ is old #23118 - - - - - 083703a1 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Consider Wanteds with rewriters as insoluble This MR fixes #25325 See GHC.Tc.Types.Constraint, Note [Insoluble Wanteds], especially (IW2) There is a small change in the error message for T14172, but it looks entirely acceptable to me. - - - - - 0dfaeb66 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Wibbles - - - - - 09d24d82 by Simon Peyton Jones at 2024-10-11T03:54:32-04:00 Spelling errors - - - - - 694489ed by sheaf at 2024-10-11T03:55:14-04:00 LLVM: use sse4.2 instead of sse42 LLVM expects the former instead of the latter since version 3.4. Fixes #25019 - - - - - 06ae8507 by sheaf at 2024-10-11T03:55:14-04:00 LLVM: make SSE4.2 imply +popcnt For consistency with the NCG as well as with Clang and GCC, we make the SSE4.2 feature flag imply +popcnt when using the LLVM backend. Fixes #25353 - - - - - 3fe843c7 by Cheng Shao at 2024-10-11T03:55:50-04:00 Drop obsolete libffi Makefile This patch drops obsolete libffi Makefile from the tree, given it's completely unused since removal of make build system in !7094. - - - - - df70405c by Ben Gamari at 2024-10-11T03:56:26-04:00 ghc-internal: Fix incomplete matches on IOError As noted in #25362, these incomplete matches were previously not being warned about. They were easily addressed by use of `GHC.Internal.Event.Windows.withException`. Closes #25362. - - - - - 8584504b by Matthew Pickering at 2024-10-11T03:57:02-04:00 compiler: Fix orientation of GHC.Hs.Doc boot file We should be free to import things from Language.Haskell.Syntax in GHC modules. Therefore the the boot file for the loop between ImpExp and GHC.Hs.Doc was in the wrong place. Issue #21592 - - - - - d029f170 by Ben Gamari at 2024-10-11T23:43:17-04:00 testsuite: Normalise trailing digits from hole fits output The type variables in the holes fit output from `abstract_refinement_hole_fits` is quite sensitive to compiler configuration. Specifically, a slight change in the inlining behavior of `throw` changes type variable naming in `(>>=)` and a few others. Ideally we would make hole fits output more deterministic but in the meantime we simply normalise this difference away as it not relevant to the test's goal. - - - - - da5d7d0d by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Add test for #25066 - - - - - eb7ddae1 by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Fix #25066 As noted in #25066, the exception backtrace proposal introduced a rather subtle performance regression due to simplification producing Core which the demand analyser concludes may diverge with a precise exception. The nature of the problem is more completely described in the new Note [Hiding precise exception signature in throw]. The (rather hacky) solution we use here hides the problematic optimisation through judicious use of `noinline`. Ultimately however we will want a more principled solution (e.g. #23847). Fixes #255066 CLC proposal: https://github.com/haskell/core-libraries-committee/issues/290 Metric Decrease: T9872d - - - - - 0060ece7 by Ben Gamari at 2024-10-11T23:43:17-04:00 base: Improve documentation of Control.Exception.Backtrace - - - - - 18f532f3 by Ben Gamari at 2024-10-11T23:43:53-04:00 Bump process submodule to v1.6.25.0 - - - - - a9a3badf by Hassan Al-Awwadi at 2024-10-11T23:44:29-04:00 Move HsInteger and HsRat to an extension constructor These constructors were only used during the TC stage, or during template haskell. It seemed clear that it was independent of the source syntax represented in L.H.S, and thus we removed it according to #21592. - - - - - 4dd30cba by Artem Pelenitsyn at 2024-10-11T23:45:09-04:00 Docs: Linear types: link Strict Patterns subsection Also, fix a bug in RST with missing newline before a listing. Co-authored-by: Arnaud Spiwack <arnaud at spiwack.net> - - - - - adca5f2b by Ben Gamari at 2024-10-11T23:45:45-04:00 users guide: Address remaining TODOs in eventlog format docs Closes #25296. - - - - - 9291c125 by Sylvain Henry at 2024-10-11T23:46:26-04:00 Fix z-encoding of tuples (#25364) Tuples with prefix/suffix strings weren't always properly encoded with their shortcut notations. Fix this. - - - - - c08b68bc by Sven Tennie at 2024-10-11T23:47:01-04:00 Delete constants that can be deduced There are macros in MachRegs.h to figure those out. - - - - - 8b402da2 by Zubin Duggal at 2024-10-12T20:36:57+00:00 hadrian: Handle broken symlinks properly when creating source dist directories If we have a broken symlink in the repository, don't try to `need` the symlink or the target of the symlink. Attempting to do so has `shake` attempt to read the target to compute its hash, which fails because the target doesn't exist. - - - - - 16f97667 by Zubin Duggal at 2024-10-12T20:36:57+00:00 hadrian: exclude cabal.project.symlink.broken from source archives Cabal 3.14 introduced a broken symlink in its testsuite. Unfortunately, this broke our source distribution as we use use `tar --dereference` to avoid issues with symlink compatibility on windows, and `tar --dereference` chokes when it encounters any broken symlinks. We can't get rid of `--dereference` because symlinks are generally broken on windows, so the only option is to exclude this file from source archives. see also https://github.com/haskell/cabal/issues/10442 - - - - - f1a2c9fc by Zubin Duggal at 2024-10-12T20:36:57+00:00 Bump Cabal submodule to 3.14 Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: haddock.Cabal - - - - - 745dd590 by Ben Gamari at 2024-10-14T09:13:12-04:00 users-guide: Document GHCi :where command Resolve #24509. - - - - - e9cc4699 by Alan Zimmerman at 2024-10-14T09:13:48-04:00 EPA: Remove [AddEpAnn] from IE, Pat and some Tys EPA: Remove [AddEpAnn] from LazyPat EPA: Remove [AddEpAnn] from RecordCon/RecordUpd/ConPat EPA: Remove [AddEpAnn] from HsFieldBind EPA: Remove [AddEpAnn] from PatSynBind EPA: Remove [AddEpAnn] from IPBind EPA: Remove [AddEpAnn] from FixSig EPA: Remove [AddEpAnn] from activation rules EPA: Remove [AddEpann] from SpecInstSig EPA: Remove [AddEpAnn] from MinimalSig EPA: Remove [AddEpAnn] from SCCFunSig EPA: Remove [AddEpAnn] from CompleteMatchSig EPA: Remove [AddEpAnn] from AnnSig, as used in PatSynSig, ClassOpSig, TypeSig EPA: Remove [AddEpAnn] from IEThingAbs EPA: Remove [AddEpAnn] from IEThingAll / IEThingWith EPA: Remove [AddEpAnn] from IEModuleContents EPA: Remove [AddEpAnn] from HsOpTy EPA: Remove [AddEpAnn] for various binders EPA: Remove [AddEpAnn] for HsIParamTy - - - - - 81a570bf by Sebastian Graf at 2024-10-14T22:15:31-04:00 Desugaring, plus -Wincomplete-record-selectors This commit does several related things: * Major refactor of the handling of applications in the desugarer. Now all applications are handled in `dsApp`, `ds_app` and related functions. This dramatically simplifies the code and removes complicated cruft that had accumulated. Hooray. Fixes #25281. * Improve the handling of -Wincomplete-record-selectors. We now incorporate the result type of unsaturated record selector applications as well as consider long-distance information in getField applications. Plus, the implmentation now builds the improved `dsApp` stuff above, so it is much easier to understand. Plus, incorporates improved error message wording suggested by Adam Gundry in !12685. Fixes #24824, #24891 See the long Note [Detecting incomplete record selectors] * Add -Wincomplete-record-selectors to -Wall, as specified in GHC Proposal 516. To do this, I also had to add -Wno-incomplete-record-selectors to the build flags for Cabal in GHC's CI. See hadrian/src/Settings/Warnings.hs. We can remove this when Cabal is updated so that it doesn't trigger the warning: https://github.com/haskell/cabal/issues/10402 2.6% decrease in compile time allocation in RecordUpPerf Metric Decrease: RecordUpdPerf - - - - - ae7bc08e by Simon Peyton Jones at 2024-10-14T22:15:31-04:00 Elmininate incomplete record selectors This patch is a pure refactor of GHC's source code, to avoid the use of partial record selectors. It was provoked by adding -Wincomplete-record-selectors to -Wall (as the GHC Proposal specified), which in turn showed up lots of places where GHC was using incomplete record selectors. This patch does mostly-simple refactoring to make it clear to the pattern match checker that there is in fact no partiality. There is one externally-visible change: I changed the data type HoleFit to split out the two cases data HoleFit = TcHoleFit TcHoleFit | RawHoleFit SDoc data TcHoleFit = HoleFit { ...lots of fields } There are large swathes of code that just deal with `TcHoleFit`, and having it as a separate data types makes it apparent that `RawHoleFit` can't occur. This makes it much better -- but the change is visible in the HolePlugin interface. I decided that there are so few clients of this API that it's worth the change. I moved several functions from Language.Haskell.Syntax to GHC.Hs. Reason, when instantiated at (GhcPass _), the extension data construtcor is guaranteed unused, and that justifies omitted patterns in these functions. By putting them in GHC.Hs.X I can specialise the type for (GhcPass _) and thereby make the function total. An interesting side-light is that there were a few local function definitions without a type signature, like this one in GHC.Parser.Header convImport (L _ i) = (ideclPkgQual i, reLoc $ ideclName i) This is fully closed, and so is generalised; but that generalises it to any old pass, not (GhcPass _), so GHC rightly complains about the use of the selector `ideclPkgQual`. I added a type signature to `i`, thus convImport (L _ (i::ImportDecl GhcPs)) = (ideclPkgQual i, reLoc $ ideclName i) which specialised the function enough to make the record selector complete. Quite a surprising consequence of local let-generalisation! - - - - - 6a067226 by Simon Peyton Jones at 2024-10-14T22:15:31-04:00 Add -Werror=-Wno-error=incomplete-record-selectors to hadrian-multi In the main MR, -Wall now includes -Wincomplete-record-selectors. However `hadrian-multi` has many, many warnings about incomplete record selectors, so this patch stops those warnings being treated as errors. (See discussion on !13308.) A better fix would be to remove the use of incomplete record selectors, since each of them represents a potential crash. - - - - - edeafc14 by Ben Gamari at 2024-10-14T22:16:08-04:00 users-guide: Document field coalescence - - - - - 55b83587 by ARATA Mizuki at 2024-10-14T22:16:49-04:00 LLVM backend: Use correct rounding for Float literals Fixes #22033 - - - - - e59fe5c6 by Hassan Al-Awwadi at 2024-10-15T08:25:33+00:00 Changed import from Ghc. module to L.H.S module Progresses #21592 For some reason we still imported GHC.Types.Fixity when the definitino of Fixity and LexicalFixity have already been moved to Language.Haskell.Syntax.Basic. This fixes that for - - - - - ab1767d5 by Simon Peyton Jones at 2024-10-15T23:45:04-04:00 Add a release-notes entry for -Wincomplete-record-selectors - - - - - 6f0a62db by ur4t at 2024-10-16T15:33:43+00:00 GHCi: fix improper location of ghci_history file Fixes #24266 - - - - - 5f67db48 by Alan Zimmerman at 2024-10-17T05:18:43-04:00 EPA: Remove [AddEpAnn] commit 3 EPA: Remove [AddEpAnn] from HsDocTy EPA: Remove [AddEpAnn] from HsBangTy EPA: Remove [AddEpAnn] from HsExplicitListTy EPA: Remove [AddEpAnn] from HsExplicitTupleTy EPA: Remove [AddEpAnn] from HsTypedBracket EPA: Remove [AddEpAnn] from HsUntypedBracket EPA: Remove [AddEpAnn] from PatBuilderOpApp EPA: break out 'EpToken "|"' from ClassDecl anns EPA: Remove [AddEpAnn] from ClassDecl EPA: Remove [AddEpAnn] from SynDecl - - - - - fbbbd010 by Daan Rijks at 2024-10-17T05:19:19-04:00 Expand the haddocks for Control.Category - - - - - 076c1a10 by Andrew Lelechenko at 2024-10-17T05:19:19-04:00 documentation: more examples for Control.Category - - - - - 90891962 by Cheng Shao at 2024-10-17T16:41:18+00:00 ghci: mitigate host/target word size mismatch in BCOByteArray serialization This patch mitigates a severe host/target word size mismatch issue in BCOByteArray serialization logic introduced since !12142, see added note for detailed explanation. - - - - - 839ac52e by Cheng Shao at 2024-10-17T16:41:18+00:00 ghci: use plain malloc for mkConInfoTable on non-TNTC platforms This patch avoids using mmap() to allocate executable memory for mkConInfoTable on platforms without tables-next-to-code, see added comment for explanation. - - - - - a998f69d by Cheng Shao at 2024-10-17T16:41:18+00:00 ghc-internal: add missing CPPs for wasm This patch adds some missing CPP guards to ghc-internal, given those functions are non existent on wasm and would cause linking issues. - - - - - 71a471e7 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: rename prelude.js to prelude.mjs This commit renames prelude.js to prelude.mjs for wasm backend rts jsbits, and slightly adjusts the jsbits contents. This is for preparing the implementation of dyld.mjs that contains wasm dynamic linker logic, which needs to import prelude.mjs as a proper ESM module. - - - - - 33d9db17 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: add __wrapped_freeJSVal This commit wraps imported freeJSVal in a __wrapped_freeJSVal C function for wasm backend RTS. In general, wasm imports are only supposed to be directly called by C; they shouldn't be used as function pointers, which confuses wasm-ld at link-time when generating shared libraries. - - - - - 0d0a16a8 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: correct stale link in comment - - - - - 90a35c41 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: drop interpretBCO support from non-dyn ways on wasm This commit drops interpretBCO support from non dynamic rts ways on wasm. The bytecode interpreter is only useful when the RTS linker also works, and on wasm it only works for dynamic ways anyway. An additional benefit of dropping interpretBCO is reduction in code size of linked wasm modules, especially since interpretBCO references ffi_call which is an auto-generated large function in libffi-wasm and unused by most user applications. - - - - - 98a32ec5 by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: don't build predefined GloblRegs for wasm PIC mode This commit wraps the predefined GlobalRegs in Wasm.S under a CPP guard to prevent building for PIC mode. When building dynamic ways of RTS, the wasm globals that represent STG GlobalRegs will be created and supplied by dyld.mjs. The current wasm dylink convention doesn't properly support exporting relocatable wasm globals at all, any wasm global exported by a .so is assumed to be a GOT.mem entry. - - - - - bef94bde by Cheng Shao at 2024-10-17T16:41:18+00:00 rts: fix conflicting StgRun definitions on wasm This commit fixes conflicting StgRun definition when building dynamic ways of RTS for wasm in unregisterised mode. - - - - - a6a82cdb by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: use targetSupportsRPaths predicate This commit changes the hostSupportsRPaths predicate to targetSupportsRPaths and use that to decide whether to pass RPATH-related link-time options. It's not applied to stage0, we should just use the default link-time options of stageBoot ghc. - - - - - f232c872 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: disable internal-interpreter of ghc library when cross compiling This commit disable the internal-interpreter flag of ghc library when cross compiling, only external interpreter works in such cases. - - - - - 577c1819 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: enable internal-interpreter for ghc-bin stage0 This commit enables internal-interpreter flag for ghc-bin even when compiling stage0, as long as target supports ghci. It enables ghci functionality for cross targets that support ghci, since cross ghc-bin is really stage0. - - - - - c247f2ee by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: fix CFLAGS for gmp shared objs on wasm This commit adds -fvisibility=default to CFLAGS of gmp when building for wasm. This is required to generate the ghc-bignum shared library without linking errors. Clang defaults to -fvisibility=hidden for wasm targets, which will cause issues when a symbol is expected to be exported in a shared library but without explicit visibility attribute annotation. - - - - - 775410fd by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: re-enable PIC for gmp on wasm This commit re-enables --with-pic=yes configuration option of gmp when building for wasm, given we're about to include support for shared libraries, TH and ghci. - - - - - b45080a3 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian: add the host_fully_static flavour transformer This commit adds the host_fully_static flavour transformer to hadrian, which ensures stage0 is fully statically linked while still permitting stage1 libdir to contain shared libraries. This is intended to be used by the wasm backend to build portable linux bindists that contain wasm shared libraries. - - - - - 5043507c by Cheng Shao at 2024-10-17T16:41:18+00:00 ci: update wasm jobs configuration This commit bumps ci-image revision to use updated wasm toolchain, and use host_fully_static instead of fully_static for wasm jobs so to ensure wasm shared libraries can be properly built. - - - - - 2956a3f7 by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian/testsuite: implement config.cross logic This commit implements the config.cross field in the testsuite driver. It comes from the "cross compiling" ghc info field for both in-tree/out-of-tree GHC, and is an accurate predicate of whether we're cross-compiling or not (compared to the precense of target emulator), and is useful to implement predicates to assert the precense of internal interpreter (only available on non-cross GHC) for tests that do require it (e.g. plugins). - - - - - 8c74a0ed by Cheng Shao at 2024-10-17T16:41:18+00:00 hadrian/compiler: implement targetRTSLinkerOnlySupportsSharedLibs This patch implements the targetRTSLinkerOnlySupportsSharedLibs predicate in hadrian. Its definition in hadrian is the single source of truth, and the information propagates to ghc settings file, ghc driver and testsuite driver. It is used in various places to ensure dynamic dependency is selected when the target RTS linker only supports loading dynamic code. - - - - - b4c3c340 by Cheng Shao at 2024-10-17T16:41:18+00:00 testsuite: don't use host cpu features when testing cross ghc This patch disables CPU feature detection logic when testing cross GHC, since those features don't make sense for the target anyway. - - - - - 3c21b696 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: implement & use req_plugins predicate This commit implements req_plugins predicate to indicate that the test requires plugin functionality. Currently this means cross GHC is disabled since internal-interpreter doesn't work in cross GHC yet. - - - - - 93b8af80 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: make use of config.interp_force_dyn This commit takes config.interp_force_dyn into consideration when setting up TH/ghci way flags. - - - - - 94673d41 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: bump T17572 timeout - - - - - 2b5efc2d by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: bump T22744 pre_cmd timeout - - - - - 45102e2a by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip terminfo_so for cross ghc - - - - - 05e40406 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: fix shared library size tests for cross ghc This commit fixes shared library size tests (e.g. array_so in testsuite/tests/perf/size/all.T) when testing cross ghc. Previously, if shared library file extension of host and target differs, those tests will fail with framework errors due to not finding the right files. - - - - - fa68f833 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip ghc api tests that attempt to spawn processes inside wasm This commit skips a few ghc api tests on wasm, since they would attempt to spawn processes inside wasm, which is not supported at all. - - - - - 1241c04e by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: skip T22840 due to broken -dtag-inference-checks on wasm - - - - - 78c8b900 by Cheng Shao at 2024-10-17T16:41:19+00:00 testsuite: ensure $(ghciWayFlags) can be overridden This commit revises boilerplate.mk in testsuite as well as a few other places, to ensure the tests that do make use of $(ghciWayFlags) can receive the right $(ghciWayFlags) from testsuite driver config. - - - - - 47989ecc by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: skip rdynamic on wasm - - - - - fefb4ea1 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: skip T2615 on wasm This commit marks T2615 as skip on wasm, given LD_* environment variables aren't supported on wasm anyway. - - - - - 77c79762 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: mark MultiLayerModulesTH_Make/MultiLayerModulesTH_OneShot as fragile on wasm - - - - - 69bb4745 by Cheng Shao at 2024-10-17T16:41:24+00:00 testsuite: fix T16180 on wasm This commit fixes T16180 on wasm once TH support is flipped on. The fix is simply adding right asm code for wasm. - - - - - 621c753d by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: fix -fexternal-interpreter flag for JS backend Previously, -fexternal-interpreter is broken for JS backend, since GHC would attempt to launch a non-existent ghc-iserv* executable. This commit fixes it by adjusting pattern matching order in setTopSessionDynFlags. - - - - - 80aa8983 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: use interpreterDynamic predicate in preloadLib This commit use the interpreterDynamic predicate in preloadLib to decide if we should do dynLoadObjs instead of loadObj. Previously we used hostIsDynamic which was only written with non-cross internal interpreter in mind. The testsuite is also adjusted to remove hard-wired -fPIC flag for cbits (doesn't work in i386 RTS linker in vanilla way, #25260) and properly pass ghc_th_way_flags to ghc. - - - - - 74411461 by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix Cmm dynamic CLabels for wasm This commit fixes the handling of dynamic CLabels for the wasm backend. Just do the simplest handling: preserve the original CLabel, both unreg/NCG backends can handle them properly without issue. - - - - - f6abaf13 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: add necessary compile-time flags for wasm PIC mode This commit adds necessary compile-time flags when compiling for wasm PIC mode, see added comment for detailed explanation. - - - - - 9745fcfb by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: add necessary link-time flags for wasm shared libs This commit adds necessary link-time flags for wasm shared libs, see added comments for detailed explanation. - - - - - 649aae00 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: enforce -fno-use-rpaths for wasm This commit ensures the GHC driver never passes any RPATH-related link-time flags on wasm, which is not supported at all. - - - - - 47baa904 by Cheng Shao at 2024-10-17T16:41:24+00:00 driver: ensure static archives are picked when linking static .wasm modules This commit ensures static archives are picked when linking .wasm modules which are supposed to be fully static, even when ghc may be invoked with -dynamic, see added comment for explanation. - - - - - fc3a5591 by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix dynamic_too_enable for targets that require dynamic libraries This commit fixes dynamic_too_enable for targets whose RTS linker can only load dynamic code. - - - - - 94ef949e by Cheng Shao at 2024-10-17T16:41:24+00:00 compiler: fix checkNonStdWay for targets that require dynamic libraries This commit fixes checkNonStdWay to ensure that for targets whose RTS linker can only load dynamic code, the dynamic way of object is selected. - - - - - 88e99248 by Cheng Shao at 2024-10-17T16:41:24+00:00 ghc-bin: enforce dynamic way when the target requires so This commit makes ghc-bin use dynamic way when it is doing interactive stuff on certain targets whose RTS linker can only handle dynamic code. - - - - - 549582ef by Cheng Shao at 2024-10-17T16:41:24+00:00 hadrian/ghci: add wasm dyld This commit adds the wasm dynamic linker implementation, as well as ghci logic to call it and hadrian logic to install it to the correct location. See the top-level note in utils/jsffi/dyld.mjs for more details. - - - - - b562e3a6 by Cheng Shao at 2024-10-17T16:41:29+00:00 driver: fix getGccSearchDirectory for wasm target This commit fixes getGccSearchDirectory logic for wasm target, ensures the correct search directory containing libc.so etc can be found by GHC. getGccSearchDirectory is also exported so it can be used elsewhere to obtain the wasi-sdk libdir and pass to the dyld script. - - - - - 2d6107dc by Cheng Shao at 2024-10-17T16:41:29+00:00 driver: add wasm backend iserv logic This commit adds wasm backend iserv logic to the driver, see added comments for explanation. - - - - - 61f5baa5 by Cheng Shao at 2024-10-17T16:41:29+00:00 compiler: add PIC support to wasm backend NCG This commit adds support for generating PIC to the wasm backend NCG. - - - - - 652e7239 by Cheng Shao at 2024-10-17T16:41:29+00:00 hadrian/compiler: flip on support for shared libs & ghci for wasm This commit flips on the support for shared libs and ghci for the wasm target, given all required support logic has been added in previous commits. - - - - - 74a1f681 by Cheng Shao at 2024-10-17T16:41:29+00:00 testsuite: flip on support for shared libs, TH & ghci for wasm This commit flips on support for shared libs, TH & ghci for wasm in the testsuite, given support has been landed in previous commits. - - - - - 525d451e by Cheng Shao at 2024-10-17T23:03:34-04:00 Revert "compiler: start deprecating cmmToRawCmmHook" This reverts commit 1c064ef1f3e1aa2afc996e962ad53effa99ec5f4. Turns out the GHC-WPC project does use it to observe Cmm in the pipeline, see #25363. - - - - - 5bcfefd5 by Cheng Shao at 2024-10-17T23:04:09-04:00 rts: fix pointer overflow undefined behavior in bytecode interpreter This patch fixes an unnoticed undefined behavior in the bytecode interpreter. It can be caught by building `rts/Interpreter.c` with `-fsanitize=pointer-overflow`, the warning message is something like: ``` rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13 rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13 rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13 ``` Whenever we do something like `SpW(-1)`, the negative argument is implicitly converted to an unsigned integer type and causes pointer arithmetic overflow. It happens to be harmless for most targets since overflowing would wrap the result to desired value, but it's still coincidental and undefined behavior. Furthermore, it causes real damage to the wasm backend, given clang-20 will emit invalid wasm code that crashes at run-time for this kind of C code! (see https://github.com/llvm/llvm-project/issues/108770) The fix here is adding some explicit casts to ensure we always use the signed `ptrdiff_t` type as right hand operand of pointer arithmetic. - - - - - eb67875f by Matthew Craven at 2024-10-18T12:18:35+00:00 Bump transformers submodule The svg image files mentioned in transformers.cabal were previously not checked in, which broke sdist generation. - - - - - 366a1109 by Matthew Craven at 2024-10-18T12:18:35+00:00 Remove reference to non-existent file in haddock.cabal - - - - - 826852e9 by Matthew Craven at 2024-10-18T12:18:35+00:00 Move tests T11462 and T11525 into tests/tcplugins - - - - - dbe27152 by Matthew Craven at 2024-10-18T12:18:35+00:00 Repair the 'build-cabal' hadrian target Fixes #23117. Fixes #23281. Fixes #23490. This required: * Updating the bit-rotted compiler/Setup.hs and its setup-depends * Listing a few recently-added libraries and utilities in cabal.project-reinstall * Setting allow-boot-library-installs to 'True' since Cabal now considers the 'ghc' package itself a boot library for the purposes of this flag Additionally, the allow-newer block in cabal.project-reinstall was removed. This block was probably added because when the libraries/Cabal submodule is too new relative to the cabal-install executable, solving the setup-depends for any package with a custom setup requires building an old Cabal (from Hackage) against the in-tree version of base, and this can fail un-necessarily due to tight version bounds on base. However, the blind allow-newer can also cause the solver to go berserk and choose a stupid build plan that has no business succeeding, and the failures when this happens are dreadfully confusing. (See #23281 and #24363.) Why does setup-depends solving insist on an old version of Cabal? See: https://github.com/haskell/cabal/blob/0a0b33983b0f022b9697f7df3a69358ee9061a89/cabal-install/src/Distribution/Client/ProjectPlanning.hs#L1393-L1410 The right solution here is probably to use the in-tree cabal-install from libraries/Cabal/cabal-install with the build-cabal target rather than whatever the environment happens to provide. But this is left for future work. - - - - - b3c00c62 by Matthew Craven at 2024-10-18T12:18:35+00:00 Revert "CI: Disable the test-cabal-reinstall job" This reverts commit 38c3afb64d3ffc42f12163c6f0f0d5c414aa8255. - - - - - a04959b8 by Daneel Yaitskov at 2024-10-19T09:34:15-04:00 base: speed up traceEventIO and friends when eventlogging is turned off #17949 Check the RTS flag before doing any work with the given lazy string. Fix #17949 Co-authored-by: Michael Peyton Jones <me at michaelpj.com> Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - eff16c22 by Matthew Pickering at 2024-10-19T21:55:55-04:00 ci: Add support for ONLY_JOBS variable to trigger any validation pipeline By setting the ONLY_JOBS variable to the name of the job (or multiple jobs), the resulting pipeline will include a validation job for that pipeline. For example - if you set ONLY_JOBS="x86_64-linux-ubuntu22_04-validate" then a ubuntu22_04 job will be included in the validation pipeline. This is useful for testing specific jobs. Fixes #25332 - - - - - 280b6278 by Zubin Duggal at 2024-10-19T21:56:31-04:00 rel-eng: ghcup metadata generation: generated yaml anchors with meaningful names (cherry picked from commit d83f5bd730a8aef37d8a38b3560590d9798f8e45) - - - - - 25edf849 by Alan Zimmerman at 2024-10-19T21:57:08-04:00 EPA: Remove [AddEpAnn] Commit 4 EPA: Remove [AddEpAnn] from DataDecl This is quite a big change. The most important part is moving the annotations into HsDataDefn, using a specific annotation data type. It has a knock-on to everything that uses HsDataDefn EPA: Remove [AddEpAnn] for FunDep EPA: Remove [AddEpann] from FamilyDecl EPA: Remove [AddEpAnn] From InjectivityAnn EPA: Remove [AddEpAnn] from DefaultDecl EPA: Remove [AddEpAnn] from RuleDecls EPA: Remove [AddEpAnn] from Warnings - - - - - d5f42045 by Luite Stegeman at 2024-10-20T16:34:47-04:00 Interpreter: Add locking for communication with external interpreter This adds locking to communication with the external interpreter to prevent concurrent tasks interfering with each other. This fixes Template Haskell with the external interpreter in parallel (-j) builds. Fixes #25083 - - - - - d6bfea76 by Matthew James Kraai at 2024-10-20T16:35:29-04:00 Use monospace font for "Either a b" in fmap docs The documentation for fmap shows "`Either a b`" in the default font instead of showing "Either a b" in a monospace font. - - - - - 4bc7f9c8 by Luite Stegeman at 2024-10-20T16:36:15-04:00 Parser: remove non-ASCII characters from Parser.y Non-ASCII characters in the source causes a problem with the default Haskell Language Server setup in VSCode. Two characters seems to have been left in by accident. Workaround for #25396 - - - - - 7f61ed4e by Alan Zimmerman at 2024-10-21T06:39:45-04:00 EPA: Remove [AddEpAnn] Commit 5 EPA: Remove [AddEpAnn] from AnnPragma EPA: Remove [AddEpAnn] From ForeignDecl EPA: Remove [AddEpAnn] from RoleAnnotDecl EPA: Remove [AddEpAnn] from StandaloneKindSig EPA: Remove [AddEpAnn] From HsDeriving EPA: Remove [AddEpAnn] from ConDeclField EPA: Remove [AddEpAnn] from ConDeclGADT EPA: Remove [AddEpAnn] from ConDeclH98 EPA: Remove [AddEpAnn] from ClsInstDecl - - - - - f8694fe7 by Cheng Shao at 2024-10-21T06:40:21-04:00 wasm: bump dyld v8 heap size limit This patch adds `--max-old-space-size=8192` to wasm dyld shebang arguments to bump V8 heap size limit. The default limit (`heap_size_limit` returned by `v8.getHeapStatistics()`) is dynamically determined and a bit too low under certain workloads, and V8 would waste too much CPU time to garbage collect old generation heap more aggressively. Bumping the limit to 8G doesn't imply dyld would really take that much memory at run-time, but it lessens V8 heap stress significantly. - - - - - d328d173 by Luite Stegeman at 2024-10-21T12:39:18+00:00 Add requestTickyCounterSamples to GHC.Internal.Profiling This allows the user to request ticky counters to be written to the eventlog at specific times. See #24645 - - - - - 71765b1d by Simon Peyton Jones at 2024-10-21T20:55:00-04:00 Move defaulting code into a new module GHC.Tc.Solver had reached 4,000 lines -- although quite a lot of them are comments. This MR * Adds the new module GHC.Tc.Solver.Default, which has all the complex, but well modularised, defaulting code * Moves a bit of code from GHC.Tc.Solver into the existing GHC.Tc.Solver.Solve. Notably solveWanteds and simplifyWantedsTcM, which are called from GHC.Tc.Solver.Default It's a pure refactor. No code changes. - - - - - a398227b by Simon Peyton Jones at 2024-10-21T20:55:00-04:00 Improve the generalisation code in Solver.simplifyInfer The code in `decideQuantification` has become quite complicated. This MR straightens it out, adds a new Note, and on the way fixes #25266. See especially Note [decideAndPromoteTyVars] which is is where all the action happens in this MR. - - - - - 148059fe by Andrzej Rybczak at 2024-10-21T20:55:40-04:00 Adjust catches to properly rethrow exceptions https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13302 implemented exception rethrowing proposal, but it didn't adjust `catches`. This fixes it. - - - - - 25121dbc by doyougnu at 2024-10-22T09:38:18-04:00 linker: add --optimistic-linking flag This patch adds: - the --optimistic-linking flag which binds unknown symbols in the runtime linker to 0xDEADBEEF instead of exiting with failure - The test T25240 which tests these flags using dead code in the FFI system. - closes #25240 This patch is part of the upstreaming haskell.nix patches project. - - - - - f19e076d by doyougnu at 2024-10-22T09:38:18-04:00 ghc-internal: hide linkerOptimistic in MiscFlags - - - - - edc02197 by Cheng Shao at 2024-10-22T09:38:54-04:00 hadrian: fix bindist executable wrapper logic for cross targets This commit fixes an oversight of hadrian wrapper generation logic: when doing cross compilation, `wrapper` is called on executable names with cross prefix, therefore we must use `isSuffixOf` when matching to take the cross prefix into account. Also add missing cross prefix to ghci wrapper content and fix hsc2hs wrapper logic. - - - - - edf3bdf5 by Andreas Klebinger at 2024-10-22T16:30:42-04:00 mkTick: Push ticks through unsafeCoerce#. unsafeCoerce# doesn't exist at runtime so we should treat it like a Cast for the purpose of mkTick. This means if we have `{-# SCC foo #-} (unsafeCoerce# trivial_expr))` we now push the scope part of the cost centre up to `trivial_expr` at which point we can discard it completely if the expression is trivial enough. This fixes #25212. - - - - - 1bdb1317 by Cheng Shao at 2024-10-22T16:31:17-04:00 hadrian: enable late-CCS for perf flavour as well This patch enables late-CCS for perf flavour so that the testsuite can pass for perf as well. Fixes #25308. - - - - - fde12aba by Cheng Shao at 2024-10-22T16:31:54-04:00 hadrian: make sure ghc-bin internal-interpreter is disabled for stage0 when not cross compiling This patch disables internal-interpreter flag for stage0 ghc-bin when not cross compiling, see added comment for explanation. Fixes #25406. - - - - - 6ab8d751 by ignatiusm at 2024-10-24T01:23:35-04:00 Improve heap overflow exception message (#25198) Catch heap overflow exceptions and suggest using `+RTS -M<size>`. Fix #25198 - - - - - b3f7fb80 by Rodrigo Mesquita at 2024-10-24T01:24:12-04:00 determinism: Interface re-export list det In 'DocStructureItem' we want to make sure the 'Avails' are sorted, for interface file determinism. This commit introduces 'DetOrdAvails', a newtype that should only be constructed by sorting Avails with 'sortAvails' unless the avails are known to be deterministically ordered. This newtype is used by 'DocStructureItem' where 'Avails' was previously used to ensure the list of avails is deterministically sorted by construction. Note: Even though we order the constructors and avails in the interface file, the order of constructors in the haddock output is still determined from the order of declaration in the source. This was also true before, when the list of constructors in the interface file <docs> section was non-deterministic. Some haddock tests such as "ConstructorArgs" observe this (check the order of constructors in out/ConstructorArgs.html vs src/ConstructorArgs.hs vs its interface file) The updated tests are caused by haddock corners where the order in the source is not preserved (and was non-deterministic before this PR): * Module header in the latex backend * Re-export of pattern synonyms associated to a datatype (#25342) Fixes #25304 - - - - - e39c8c99 by Rodrigo Mesquita at 2024-10-24T01:24:12-04:00 Revert "ci: Allow abi-test to fail." After #25304, the abi-test with interface and object determinism succeeds. This reverts commit 7b37afc9f3e79559055488998ee73187886a0e00. - - - - - 7b1b0c6d by Alan Zimmerman at 2024-10-24T13:07:02-04:00 EPA: reduce [AddEpann] in AnnList Remove it from the `al_rest` field, and make `AnnList` parameterized on a type to be used in `al_rest`, for the various use cases. - - - - - 4a00731e by Rodrigo Mesquita at 2024-10-24T13:07:38-04:00 Fix -fobject-determinism flag definition The flag should be defined as an fflag to make sure the -fno-object-determinism flag is also an available option. Fixes #25397 - - - - - 55e4b9f2 by Sebastian Graf at 2024-10-25T07:01:54-04:00 CorePrep: Attach evaldUnfolding to floats to detect more values See `Note [Pin evaluatedness on floats]`. - - - - - 9f57c96d by Sebastian Graf at 2024-10-25T07:01:54-04:00 Make DataCon workers strict in strict fields (#20749) This patch tweaks `exprIsConApp_maybe`, `exprIsHNF` and friends, and Demand Analysis so that they exploit and maintain strictness of DataCon workers. See `Note [Strict fields in Core]` for details. Very little needed to change, and it puts field seq insertion done by Tag Inference into a new perspective: That of *implementing* strict field semantics. Before Tag Inference, DataCon workers are strict. Afterwards they are effectively lazy and field seqs happen around use sites. History has shown that there is no other way to guarantee taggedness and thus the STG Strict Field Invariant. Knock-on changes: * I reworked the whole narrative around "Tag inference". It's now called "EPT enforcement" and I recycyled the different overview Notes into `Note [EPT enforcement]`. * `exprIsHNF` previously used `exprOkForSpeculation` on unlifted arguments instead of recursing into `exprIsHNF`. That regressed the termination analysis in CPR analysis (which simply calls out to `exprIsHNF`), so I made it call `exprOkForSpeculation`, too. * There's a small regression in Demand Analysis, visible in the changed test output of T16859: Previously, a field seq on a variable would give that variable a "used exactly once" demand, now it's "used at least once", because `dmdTransformDataConSig` accounts for future uses of the field that actually all go through the case binder (and hence won't re-enter the potential thunk). The difference should hardly be observable. * The Simplifier's fast path for data constructors only applies to lazy data constructors now. I observed regressions involving Data.Binary.Put's `Pair` data type. * Unfortunately, T21392 does no longer reproduce after this patch, so I marked it as "not broken" in order to track whether we regress again in the future. Fixes #20749, the satisfying conclusion of an annoying saga (cf. the ideas in #21497 and #22475). Compiler perf generally improves, sometimes drastically: Baseline Test Metric value New value Change -------------------------------------------------------------------------------- ManyConstructors(normal) ghc/alloc 3,629,760,116 3,711,852,800 +2.3% BAD MultiLayerModulesTH_OneShot(normal) ghc/alloc 2,502,735,440 2,565,282,888 +2.5% BAD T12707(normal) ghc/alloc 804,399,798 791,807,320 -1.6% GOOD T17516(normal) ghc/alloc 964,987,744 1,008,383,520 +4.5% T18140(normal) ghc/alloc 75,381,152 49,860,560 -33.9% GOOD T18698b(normal) ghc/alloc 232,614,457 184,262,736 -20.8% GOOD T18923(normal) ghc/alloc 62,002,368 58,301,408 -6.0% GOOD T20049(normal) ghc/alloc 75,719,168 70,494,368 -6.9% GOOD T3294(normal) ghc/alloc 1,237,925,833 1,157,638,992 -6.5% GOOD T9233(normal) ghc/alloc 686,490,105 635,166,688 -7.5% GOOD geo. mean -0.7% minimum -33.9% maximum +4.5% I looked at T17516. It seems we do a few more simplifier iterations and end up with a larger program. It seems that some things inline more, while other things inline less. I don't see low-hanging fruit. I also looked at MultiLayerModulesTH_OneShot. It appears we generate a strange join point in the `getUnique` method of `Uniquable GHC.Unit.Types.Module` that should better call-site inline, but does not. Perhaps with !11492. NoFib does not seem affected much either: +-------------------------------++--+------------+-----------+---------------+-----------+ | || | base/ | std. err. | T20749/ (rel) | std. err. | +===============================++==+============+===========+===============+===========+ | spectral/last-piece || | 7.263e8 | 0.0% | +0.62% | 0.0% | +===============================++==+============+===========+===============+===========+ | geom mean || | +0.00% | | | | +-------------------------------++--+------------+-----------+---------------+-----------+ I had a look at last-piece. Nothing changes in stg-final, but there is a bit of ... movement around Data.Map.insert's use of GHC.Exts.lazy that is gone in stg-final. Co-Authored-By: Jaro Reinders <jaro.reinders at gmail.com> Metric Decrease: T12707 T18140 T18698b T18923 T19695 T20049 T3294 T9233 T21839c Metric Increase: ManyConstructors MultiLayerModulesTH_OneShot - - - - - 0225249a by Simon Peyton Jones at 2024-10-25T07:02:32-04:00 Some renaming This is a pure refactor, tidying up some inconsistent naming: isEqPred --> isEqClassPred isEqPrimPred --> isEqPred isReprEqPrimPred --> isReprEqPred mkPrimEqPred --> mkNomEqPred mkReprPrimEqPred --> mkReprEqPred mkPrimEqPredRold --> mkEqPredRole Plus I moved mkNomEqPred, mkReprEqPred, mkEqPredRolek from GHC.Core.Coercion to GHC.Core.Predicate where they belong. That means that Coercion imports Predicate rather than vice versa -- better. - - - - - 15a3456b by Ryan Hendrickson at 2024-10-25T07:02:32-04:00 compiler: Fix deriving with method constraints See Note [Inferred contexts from method constraints] Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com> - - - - - dbc77ce8 by Alan Zimmerman at 2024-10-25T18:20:13+01:00 EPA: Remove AddEpann commit 7 EPA: Remove [AddEpAnn] from HYPHEN in Parser.y The return value is never used, as it is part of the backpack configuration parsing. EPA: Remove last [AddEpAnn] usages Remove residual usage in GHC. It is still used - In haddock TTG extension point definitions (to be removed) - Some check-exact residual, to be removed - Comments around DisambECP in PostProcess EPA: Clean up [AddEpAnn] from check-exact There is one left, to be cleaned up when we remove AddEpann itself EPA: Remove [AddEpAnn] from haddock The TTG extension points need a value, it is not critical what that value is, in most cases. EPA: Remove AddEpAnn from HsRuleAnn EPA: Remove AddEpAnn from HsCmdArrApp - - - - - 23ddcc01 by Simon Peyton Jones at 2024-10-26T12:44:34-04:00 Fix optimisation of InstCo It turned out (#25387) that the fix to #15725 was not quite right: commit 48efbc04bd45d806c52376641e1a7ed7278d1ec7 Date: Mon Oct 15 10:25:02 2018 +0200 Fix #15725 with an extra Sym Optimising InstCo is quite subtle, and the invariants surrounding the LiftingContext in the coercion optimiser were not stated explicitly. This patch refactors the InstCo optimisation, and documents these invariants. See * Note [Optimising InstCo] * Note [The LiftingContext in optCoercion] I also did some refactoring of course: * Instead of a Bool swap-flag, I am not using GHC.Types.Basic.SwapFlag * I added some invariant-checking the coercion-construction functions in GHC.Core.Coercion.Opt. (Sadly these invariants don't hold during typechecking, becuase the types are un-zonked, so I can't put these checks in GHC.Core.Coercion.) - - - - - 589fea7f by Cheng Shao at 2024-10-27T05:36:38-04:00 ghcid: use multi repl for ghcid - - - - - d52a0475 by Andrew Lelechenko at 2024-10-27T05:37:13-04:00 documentation: add motivating section to Control.Monad.Fix - - - - - 301c3b54 by Cheng Shao at 2024-10-27T05:37:49-04:00 wasm: fix safari console error message related to import("node:timers") This patch fixes the wasm backend JSFFI prelude script to avoid calling `import("node:timers")` on non-deno hosts. Safari doesn't like it and would print an error message to the console. Fixes https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/issues/13. - - - - - 9f02dfb5 by Simon Peyton Jones at 2024-10-27T15:10:08-04:00 Add a missing tidy in UnivCo We were failing to tidy the argument coercions of a UnivCo, which led directly to #25391. The fix is, happily, trivial. I don't have a small repro case (it came up when building horde-ad, which uses typechecker plugins). It should be possible to make a repro case, by using a plugin (which builds a UnivCo) but I decided it was not worth the bother. The bug is egregious and easily fixed. - - - - - 853050c3 by Andrew Lelechenko at 2024-10-27T15:10:44-04:00 Bump text submodule to 2.1.2 - - - - - 90746a59 by Andrew Lelechenko at 2024-10-27T15:10:44-04:00 hadrian: allow -Wunused-imports for text package - - - - - 8a6691c3 by Alan Zimmerman at 2024-10-27T19:44:48+00:00 EPA: Remove AddEpAnn Commit 8/final EPA: Remove AddEpAnn from AnnList EPA: Remove AddEpAnn from GrhsAnn This is the last actual use EPA: Remove NameAdornment from NameAnn Also rework AnnContext to use EpToken, and AnnParen EPA: Remove AddEpAnn. Final removal There are now none left, except for in a large note/comment in PostProcess, describing the historical transition to the disambiguation infrastructure - - - - - d5e7990c by Alan Zimmerman at 2024-10-28T21:41:05+00:00 EPA: Remove AnnKeywordId. This was used as part of AddEpAnn, and is no longer needed. Also remove all the haddock comments about which of are attached to the various parts of the AST. This is now clearly captured in the appropriate TTG extension points, and the `ExactPrint.hs` file. - - - - - e08b8370 by Serge S. Gulin at 2024-10-29T23:17:01-04:00 JS: Re-add optimization for literal strings in genApp (fixes #23479) Based on https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10588/ Co-authored-by: Sylvain Henry <sylvain at haskus.fr> Co-authored-by: Andrei Borzenkov <root at sandwitch.dev> Co-authored-by: Danil Berestov <goosedb at yandex.ru> ------------------------- Metric Decrease: T25046_perf_size_gzip size_hello_artifact size_hello_artifact_gzip size_hello_unicode size_hello_unicode_gzip ------------------------- - - - - - e3496ef6 by Cheng Shao at 2024-10-29T23:17:37-04:00 compiler: remove unused hscDecls/hscDeclsWithLocation This patch removes unused `hscDecls`/`hscDeclsWithLocation` functions from the compiler, to reduce maintenance burden when doing refactorings related to ghci. - - - - - b1eed26f by Cheng Shao at 2024-10-29T23:18:13-04:00 testsuite: add T25414 test case marked as broken This commit adds T25414 test case to demonstrate #25414. It is marked as broken and will be fixed by the next commit. - - - - - e70009bc by Cheng Shao at 2024-10-29T23:18:13-04:00 driver: fix foreign stub handling logic in hscParsedDecls This patch fixes foreign stub handling logic in `hscParsedDecls`. Previously foreign stubs were simply ignored here, so any feature that involve foreign stubs would not work in ghci (e.g. CApiFFI). The patch reuses `generateByteCode` logic and eliminates a large chunk of duplicate logic that implements Core to bytecode generation pipeline here. Fixes #25414. - - - - - 1d7cd7fe by Andreas Klebinger at 2024-10-30T19:14:28-04:00 Add since tag for -fwrite-if-compression in user guide. Partial fix for #25395 - - - - - b349fd1b by Alan Zimmerman at 2024-10-30T19:15:04-04:00 EPA: Remove some unused functions - - - - - f859d61c by Alan Zimmerman at 2024-10-30T19:15:04-04:00 EPA: use explicit vertical bar token for ExplicitSum / SumPat - - - - - 721ac00d by Ben Gamari at 2024-10-31T08:37:38-04:00 rts/Disassembler: Fix encoding of BRK_FUN instruction The offset of the CC field was not updated after the encoding change in b85b11994e0130ff2401dd4bbdf52330e0bcf776. Fix this. Fixes #25374. - - - - - 0bc94360 by Alan Zimmerman at 2024-10-31T08:38:15-04:00 EPA: Bring in last EpToken usages For import declarations, NameAnnCommas and NPlusKPat. And remove anchor, it is the same as epaLocationRealSrcSpan. - - - - - 0b11cdc0 by sheaf at 2024-10-31T08:38:55-04:00 Assert that ctEvCoercion is called on an equality Calling 'ctEvCoercion' on non-equality constraints is always incorrect. We add an assertion to this function to detect such cases; for example a type-checking plugin might erroneously do this. - - - - - ea458779 by doyougnu at 2024-11-01T18:11:33-04:00 ghc-internal: strict, unboxed src loc ranges - closes: #20449 - See CLC proposal: #55 - - - - - 778ac793 by Kazuki Okamoto at 2024-11-01T18:12:13-04:00 No haddock markup in doctest line - - - - - cf0deeaf by Andreas Klebinger at 2024-11-02T17:54:52-04:00 Reword -fexpose-overloaded-unfoldings docs. This should make them slightly clearer. Fixes #24844 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 1c21e7d4 by Andreas Klebinger at 2024-11-02T17:55:29-04:00 Compile T25062 simd tests even if we can't run them. Helps avoid them being utterly broken. Fixes #25341 - - - - - 573cad4b by Cheng Shao at 2024-11-02T17:56:04-04:00 Remove unused USE_REPORT_PRELUDE code paths from the tree This patch removes unused `USE_REPORT_PRELUDE` code paths from the tree. They have been present since the first git revision 4fb94ae5e5d632748fa2e6c35e259eccc5a1a3f4, and might have been useful for debugging purposes many years ago, but these code paths are never actually built. Removing these ease maintenance of relevant modules in the future, and also allows us to get rid of `CPP` extension in those modules as a nice byproduct. - - - - - 97f600c6 by Hassan Al-Awwadi at 2024-11-04T15:52:12+00:00 Refactored BooleanFormula to be in line with TTG (#21592) There are two parts to this commit. * We moved the definition of BooleanFormula over to L.H.S.BooleanFormula * We parameterized the BooleanFormula over the pass The GHC specific details of BooleanFormula remain in Ghc.Data.BooleanFormula. Because its parameterized over the pass its no longer a functor or traversable, but we defined bfMap and bfTraverse for the cases where we needed fmap and traverse originally. Most other changes are just churn. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - d4fd3580 by Andreas Klebinger at 2024-11-05T07:36:16-05:00 ghc-heap: Fix incomplete selector warnings. Use utility functions instead of selectors to read partial attributes. Part of fixing #25380. - - - - - fdd9f62a by Peter Trommler at 2024-11-05T07:36:51-05:00 PPC NCG: Implement fmin and fmax - - - - - 8e217256 by Mike Pilgrem at 2024-11-07T04:34:20-05:00 Re CLC #293 - Don't specify Data.List.NonEmpty in terms of partial See https://github.com/haskell/core-libraries-committee/issues/293 `List.init` had already been driven out of `tails1` by 21fc180bec93d964a7f4ffdf2429ef6f74b49ab6 but this specification also avoided partial `fromList`, so I preferred it. The `changelog.md` for `base` is updated, with an entry added under `base-4.22.0.0`. - - - - - 346e4cd1 by Zubin Duggal at 2024-11-07T04:34:57-05:00 release: copy zip files into the correct directory Fixes #25446 - - - - - bbdbe225 by Zubin Duggal at 2024-11-07T04:34:57-05:00 release: Sign .gz bindists too Fixes #25447 - - - - - 0c722e14 by Hécate Kleidukos at 2024-11-07T04:35:37-05:00 hadrian: Enforce the usage of GHC >=9.8.1 for ghci-multi GHC 9.6 no good when it comes to multi-repl stuff, despite being well within the range of n-2 releases for bootstrapping, when the script was adapted to load haddock, in !12851 - - - - - d8f8a1c3 by Sylvain Henry at 2024-11-07T19:27:46-05:00 Handle the special ghc-prim:GHC.Prim module in the compiler Before this patch, some custom hacks were necessary in ghc-prim's Setup.hs to register the GHC.Prim (virtual) module and in Hadrian to generate haddocks properly. In this patch we special-case this module in the compiler itself instead (which it already is, see ghcPrimIface in GHC.Iface.Load). From Cabal/Hadrian's perspective GHC.Prim is now just a normal autogenerated module. This simplification is worthwhile on its own. It was found while looking into the work needed for #24453 which aims to merge ghc-prim, ghc-bignum, and ghc-internal. It's also one step closer to remove ghc-prim's custom setup. - - - - - a55adc8e by Cheng Shao at 2024-11-07T19:28:22-05:00 Clean up obsolete CPP guarded code paths from the tree This patch cleans up obsolete CPP guarded code paths from the tree. The minimum supported boot GHC version is 9.6, and all the pre-9.6 era code paths can be removed. - - - - - 9ede97f3 by Cheng Shao at 2024-11-07T19:28:58-05:00 Remove obsolete executable wrappers from the tree The executable wrappers are handled by hadrian and bindist Makefile. The various .wrapper scripts in the tree are unused since removal of Make build system, so this patch removes them all. - - - - - 7d42b2df by tristian at 2024-11-07T19:29:40-05:00 TcRnDuplicateDecls now suggests to use the DuplicateRecordFields extension. Fixes: !24627 - - - - - e56ed179 by Zubin Duggal at 2024-11-11T15:16:35+05:30 testsuite: normalise some versions in callstacks (cherry picked from commit f230e29f30d0c1c566d4dd251807fcab76a2710e) - - - - - a28fc903 by Zubin Duggal at 2024-11-11T15:16:35+05:30 testsuite: use -fhide-source-paths to normalise some backpack tests (cherry picked from commit b19de476bc5ce5c7792e8af1354b94a4286a1a13) - - - - - ed16d303 by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite/haddock: strip version identifiers and unit hashes from html tests (cherry picked from commit fbf0889eadc410d43dd5c1657e320634b6738fa5) - - - - - e45e5836 by Zubin Duggal at 2024-11-11T15:16:36+05:30 haddock: oneshot tests can drop files if they share modtimes. Stop this by including the filename in the key. Ideally we would use `ghc -M` output to do a proper toposort Partially addresses #25372 (cherry picked from commit e78c7ef96e395f1ef41f04790aebecd0409b92b9) - - - - - 9104e6eb by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite: fix normalisation of T9930fail so that it doesn't get tripped up by ghc executable (ARGV[0]) differences (cherry picked from commit a79a587e025d42d34bb30e115fc5c7cab6c1e030) - - - - - 2c31264a by Zubin Duggal at 2024-11-11T15:16:36+05:30 testsuite: normalise windows file seperators (cherry picked from commit f858875e03b9609656b542aaaaff85ad0a83878a) - - - - - 2807f91b by Zubin Duggal at 2024-11-11T15:21:30+05:30 testsuite: Also match <VERSION> placeholders when normalising callsites - - - - - c02add17 by Ben Gamari at 2024-11-12T01:22:11-05:00 configure: Check version number validity Here we verify the previously informal invariant that stable release version numbers must have three components, preventing costly failed releases. Specifically, the check fails in the following scenarios: * `version=9.13` while `RELEASE=YES` since this would imply a release made from an unstable branch * `version=9.13.0` since unstable versions should only have two components * `version=9.12` since this has the wrong number of version components for a stable branch Fixes #25390. - - - - - 747fd322 by Teo Camarasu at 2024-11-12T01:22:49-05:00 docs: link to #14474 in the template-haskell docs - - - - - 6d96bb62 by Zubin Duggal at 2024-11-12T01:23:25-05:00 testsuite: normalise execvp vs exec differences in process tests Fixes #25431 - - - - - 502e6711 by Torsten Schmits at 2024-11-12T01:24:01-05:00 fix test lint that accumulated while the checks were broken I didn't fix the issues flagged by the #ifdef linter because it were so many that it seemed like the rule has become obsolete. - - - - - 223a4cb5 by Torsten Schmits at 2024-11-12T01:24:02-05:00 test driver: fix file collection for regex linters When a testsuite linter is executed with the `tracked` strategy, the driver runs `git ls-tree` to collect eligible files. This appears to have ceased producing any paths – `ls-tree` restricts its results to the current working directory, which is `testsuite/tests/linters` in this case. As a quick fix, this patch changes the working directory to match expectations. - - - - - 9ad9ac63 by Alan Zimmerman at 2024-11-12T01:24:39-05:00 EPA: Capture location of '_' for wild card type binder And keep track of promotion status in HsExplicitTupleTy, so the round-trip ppr test works for it. Updates Haddock output too, using the PromotionFlag in HsExplicitTupleTy. Closes #25454 - - - - - c37b96fa by Cheng Shao at 2024-11-12T01:25:15-05:00 wasm: fix setImmediate() implementation for Cloudflare Workers This patch fixes setImmediate() implementation for Cloudflare Workers in the wasm backend's js prelude script. Cloudflare Workers doesn't support the MessageChannel API, and we use a setTimeout() based fallback implementation in this case. - - - - - bea8ea4c by Cheng Shao at 2024-11-12T01:25:15-05:00 wasm: fix FinalizationRegistry logic for Cloudflare Workers This patch fixes FinalizationRegistry related logic for Cloudflare Workers in wasm backend js post linker. Cloudflare Workers doesn't support FinalizationRegistry, in this case we use a dummy implementation that doesn't do anything. - - - - - 00d551bf by Cheng Shao at 2024-11-13T08:48:21-05:00 Remove obsolete cross-port script This patch removes the obsolete cross-port script in the tree. The script was based on the legacy Make build system which has been pruned from the tree long ago. For hadrian, proper support for two-stage bootstrapping onto a new unsupported platform is a work in progress in !11444. - - - - - 75a2eae4 by Cheng Shao at 2024-11-13T08:48:58-05:00 hadrian: fix bindist makefile for wasm32-wasi target This patch fixes one incoherent place between bindist makefile and hadrian logic: I forgot to include wasi/wasm32 in OsSupportsGHCi/ArchSupportsGHCi as well. And this results in incorrect settings file generated after installing the bindist, and "Use interpreter"/"Have interpreter" fields incorrectly have "NO" values where they should be "YES" like --info output of in-tree version. - - - - - 0614abef by Alan Zimmerman at 2024-11-13T08:49:34-05:00 EPA: Correctly capture leading semis in decl list Closes #25467 - - - - - 00d58ae1 by Sebastian Graf at 2024-11-13T15:21:23-05:00 DmdAnal: Make `prompt#` lazy (#25439) This applies the same treatment to `prompt#` as for `catch#`. See `Note [Strictness for mask/unmask/catch/prompt]`. Fixes #25439. - - - - - 93233a66 by Ben Gamari at 2024-11-13T15:21:59-05:00 boot: Do not attempt to update config.sub While Apple ARM hardware was new we found that the autoconf scripts included in some boot packages were too old. As a mitigation for this, we introduced logic in the `boot` script to update the `config.sub` with that from the GHC tree. However, this causes submodules which have `config.sub` committted to appear to be dirty. This is a considerable headache. Now since `config.sub` with full platform support is more common we can remove `boot`'s `config.sub` logic. Fixes #19574. - - - - - fa66fa64 by Ryan Scott at 2024-11-14T19:05:00-05:00 Add regression test for #16234 Issue #16234 was likely fixed by !9765. This adds a regression test to ensure that it remains fixed. Fixes #16234. - - - - - bfe64df8 by Matthew Pickering at 2024-11-14T19:05:36-05:00 ghc-internal: Update to Unicode 16 This patch updates the automatically generated code for querying unicode properties to unicode 16. Fixes #25402 - - - - - 1fd83f86 by Ben Gamari at 2024-11-14T19:06:13-05:00 configure: Accept happy-2.1.2 happy-2.1 was released in late Oct 2024. I have confirmed that master bootstraps with it. Here we teach configure to accept this tool. Fixes #25438. - - - - - aa58fc5b by Ben Gamari at 2024-11-14T19:06:49-05:00 rts: Tighten up invariants of PACK - - - - - 8aa4c10a by Ben Gamari at 2024-11-14T19:06:49-05:00 testsuite: Fix badly escaped literals Use raw string literals to ensure that `\s` is correctly interpreted as a character class. - - - - - 0e084029 by Ben Gamari at 2024-11-14T19:06:49-05:00 rts: Improve documentation of SLIDE bytecode instruction - - - - - 9bf3663b by Ben Gamari at 2024-11-14T19:06:49-05:00 rts/Interpreter: Assert that TEST*_P discriminators are valid - - - - - 1f668511 by Ben Gamari at 2024-11-14T19:06:49-05:00 rts/Interpreter: Improve documentation of TEST*_P instructions - - - - - 59e0a770 by Cheng Shao at 2024-11-14T19:07:25-05:00 misc: improve clangd compile_flags.txt flags This patch improves the compile_flags.txt config used to power clangd for the rts C codebase. The flags in the file are sampled & deduped from a real stage1 build with clang-19 and vastly improves the IDE accuracy when hacking the rts. For maximum code coverage under the default settings, compile_flags.txt defaults to threaded+profiled+dynamic+debug way. This does not mean profdyn needs to be actually built in _build/stage1 for IDE to work. To activate IDE for other RTS ways, simply remove one of the -D flags at the end of compile_flags.txt and restart clangd. - - - - - c2c562e0 by Ben Gamari at 2024-11-14T19:08:01-05:00 testsuite: Don't consider untracked files in dirtiness check Considering trees containing untracked files as dirty is a bridge too far. The chance of an untracked file significantly affecting measured performanced metrics is quite small whereas not collecting measurements is quite inconvenient for some workflows. We now ignore untracked files in the dirtiness check. Fixes #25471. - - - - - ed2ed6c5 by Cheng Shao at 2024-11-14T19:08:37-05:00 testsuite: add regression test T25473 This commit adds regression test T25473 marked as broken due to #25473. It will be fixed in the subsequent commit. - - - - - bd0a8b7e by Cheng Shao at 2024-11-14T19:08:37-05:00 wasm: fix foreign import javascript "wrapper" in TH/ghci This patch fixes foreign import javascript "wrapper" in wasm backend's TH/ghci by fixing the handling of dyld/finalization_registry magic variables. Fixes T25473 and closes #25473. - - - - - f1b0bc32 by Ben Gamari at 2024-11-14T19:09:13-05:00 rts/linker: Make FreeBSD declarations proper prototypes The iconv declarations for FreeBSD were previously not prototypes, leading to warnings. - - - - - 086cbbc1 by Ben Gamari at 2024-11-14T19:09:13-05:00 base: Drop redundant import in FreeBSD ExecutablePath implementation - - - - - 79ecd199 by Ben Gamari at 2024-11-14T19:09:13-05:00 compiler: Fix partial selector warnings in GHC.Runtime.Heap.Inspect - - - - - 1acb73bf by Andrew Lelechenko at 2024-11-15T06:10:47-05:00 gitlab: mention CLC in MR template - - - - - 8f2e0832 by Ben Gamari at 2024-11-15T06:11:24-05:00 rts: Allow use of GNU-stack notes on FreeBSD Previously we gated use of GNU-style non-executable stack notes to only apply on Linux. However, these are also supported by FreeBSD, which also uses ELF. Fix this. Fixes #25475. - - - - - 2c427cb0 by Ben Gamari at 2024-11-16T05:27:40-05:00 rts: Fix EINTR check in timerfd ticker When `poll` failed we previously checked that `errno == -EINTR` to silence the failure warning. However, this is wrong as `errno` values are generally not negated error codes (in contrast to many system call results, which is likely what the original author had in mind). Fixes #25477. - - - - - a0fa4941 by Ben Gamari at 2024-11-16T05:28:16-05:00 rts: Increase gen_workspace alignment to 128 bytes on AArch64 Increase to match the 128-byte cache-line size of Apple's ARMv8 implementation. Closes #25459. - - - - - 142d8afa by Ben Gamari at 2024-11-16T16:20:47-05:00 rts/RtsFlags: Refactor size parsing This makes a number of improvements mentioned in #20201: * fail if the argument cannot be parsed as a number (`-Mturtles`) * fail if an unrecognized unit is given (e.g. `-M1x`) - - - - - b7a146e5 by Ben Gamari at 2024-11-16T16:20:47-05:00 testsuite: Add tests for RTS flag parsing error handling See #20201. - - - - - ddb7afa6 by Ben Gamari at 2024-11-16T16:21:23-05:00 users guide: Mention language extensions in equality constraints discussion As suggested in #24127, mention the language extensions necessary for usage of equality constriants in their documentation. Closes #24127. - - - - - 36133dac by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide/9.14.1-notes: Fix list syntax - - - - - 888de658 by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide/debug-info: Fix duplicate flag descriptions - - - - - f120e427 by Ben Gamari at 2024-11-16T16:21:23-05:00 users-guide: Fix reference to 9.14.1 release notes - - - - - 8e975032 by Ben Gamari at 2024-11-16T16:21:59-05:00 Introduce GHC.Tc.Plugin.lookupTHName This makes it significantly more convenient (and less GHC-version-dependent) to resolve a template-haskell name into a GHC Name. As proposed in #24741. - - - - - a0e168ec by ARATA Mizuki at 2024-11-16T16:22:40-05:00 x86 NCG SIMD: Lower packFloatX4#, insertFloatX4# and broadcastFloatX4# to SSE1 instructions Fixes #25441 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 3936bf1b by sheaf at 2024-11-16T16:23:22-05:00 X86 NCG: allow VXOR at scalar floating-point types The NCG can emit VXOR instructions at scalar floating-point types, but the pretty-printer would panic instead of emitting the appropriate VXORPS/VXORPD instructions. This patch rectifies that oversight. Fixes #25455 - - - - - d9dff93a by Ben Gamari at 2024-11-16T16:23:58-05:00 rts: Fix platform-dependent pointer casts Previously we had unnecessary (and incorrect) platform-dependent casts to turn `OSThreadIds`s into a integer. We now just uniformly cast first to a `uintptr_t` (which is always safe, regardless of whether `OSThreadId` is a pointer), and then cast to the desired integral type. This fixes a warning on musl platforms. - - - - - 6d95cdb8 by Ben Gamari at 2024-11-16T16:24:34-05:00 testsuite: Mark encoding004 as broken on FreeBSD Due to #22003, CP936 fails to roundtrip: ```diff == CP936 +Failed to roundtrip given mutant byte at index 891 (251 /= 123 at index 891) +Failed to roundtrip given mutant byte at index 1605 (197 /= 69 at index 1605) +Failed to roundtrip given mutant byte at index 2411 (235 /= 107 at index 2411) +Failed to roundtrip given mutant byte at index 6480 (208 /= 80 at index 6480) +Failed to roundtrip given mutant byte at index 6482 (210 /= 82 at index 6482) +Failed to roundtrip given mutant byte at index 6484 (212 /= 84 at index 6484) +Failed to roundtrip given mutant byte at index 6496 (224 /= 96 at index 6496) +Failed to roundtrip given mutant byte at index 7243 (203 /= 75 at index 7243) +Failed to roundtrip given mutant byte at index 7277 (237 /= 109 at index 7277) +Failed to roundtrip given mutant byte at index 8027 (219 /= 91 at index 8027) +Failed to roundtrip given mutant byte at index 8801 (225 /= 97 at index 8801) ``` - - - - - 26e86984 by Ben Gamari at 2024-11-18T04:05:31-05:00 hadrian: Allow haddock options to be passed via key-value settings - - - - - 6e68b117 by Matthew Pickering at 2024-11-18T04:06:07-05:00 Exception rethrowing Basic changes: * Change `catch` function to propagate exceptions using the WhileHandling mechanism. * Introduce `catchNoPropagate`, which does the same as before, but passes an exception which can be rethrown. * Introduce `rethrowIO` combinator, which rethrows an exception with a context and doesn't add a new backtrace. * Introduce `tryWithContext` for a variant of `try` which can rethrow the exception with it's original context. * onException is modified to rethrow the original error rather than creating a new callstack. * Functions which rethrow in GHC.Internal.IO.Handle.FD, GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and GHC.Internal.System.IO.Error are modified to not add a new callstack. Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202> - - - - - a4e0d235 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00 exceptions: Improve the message layout as per #285 This commit fixes the layout of the additional information included when displaying an exception, namely the type of the exception. It also fixes the default handler's heading message to work well together with the improved display message of SomeException. CLC proposal#285 - - - - - 284ffab3 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00 Display type and callstack of exception on handler This commit changes the Exception instance of SomeException to *simply* display the underlying exception in `displayException`. The augmented exception message that included the type and backtrace of the exception are now only printed on a call to `displayExceptionWithInfo`. At a surface level, existing programs should behave the same since the `uncaughtExceptionHandler`, which is responsible for printing out uncaught exceptions to the user, will use `displayExceptionWithInfo` by default. However, unlike the instance's `displayException` method, the `uncaughtExceptionHandler` can be overriden with `setUncaughtExceptionHandler`. This makes the extra information opt-in without fixing it the instance, which can be valuable if your program wants to display uncaught exceptions to users in a user-facing way (ie without backtraces). This is what was originally agreed for CLC#231 or CLC#261 with regard to the type of the exception information. The call stack also becoming part of the default handler rather than the Exception instance is an ammendment to CLC#164. Discussion of the ammendment is part of CLC#285. - - - - - 36cddd2c by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Remove redundant CallStack from exceptions Before the exception backtraces proposal was implemented, ErrorCall accumulated its own callstack via HasCallStack constraints, but ExceptionContext is now accumulated automatically. The original ErrorCall mechanism is now redundant and we get a duplicate CallStack Updates Cabal submodule to fix their usage of ErrorCallWithLocation to ErrorCall CLC proposal#285 Fixes #25283 - - - - - 7a74330b by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Freeze call stack in error throwing functions CLC proposal#285 - - - - - 3abf31a4 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 De-duplicate displayContext and displayExceptionContext The former was unused except for one module where it was essentially re-defining displayExceptionContext. Moreover, this commit extends the fix from bfe600f5bb3ecd2c8fa71c536c63d3c46984e3f8 to displayExceptionContext too, which was missing. - - - - - c0d783f8 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Re-export NoBacktrace from Control.Exception This was originally proposed and accepted in section "2.7 Capturing Backtraces on Exceptions" of the CLC proposal for exception backtraces. However, the implementation missed this re-export, which this commit now fixes. - - - - - 802b5c3e by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Fix exception backtraces from GHCi When running the program with `runhaskell`/`runghc` the backtrace should match the backtrace one would get by compiling and running the program. But currently, an exception thrown in a program interpreted with `runhaskell` will: * Not include the original exception backtrace at all * Include the backtrace from the internal GHCi/ghc rethrowing of the original exception This commit fixes this divergence by not annotating the ghc(i) backtrace (with NoBacktrace) and making sure that the backtrace of the original exception is serialized across the boundary and rethrown with the appropriate context. Fixes #25116 The !13301 MR (not this commit in particular) improves performance of MultiLayerModules. Unfortunately, T3294 regresses on aarch64-linux-deb12 by 1% allocations. Since this patch must be merged for 9.12 ASAP, we will not be able to investigate the slight regression on this platform in time. ------------------------- Metric Decrease: MultiLayerModulesRecomp MultiLayerModulesTH_OneShot Metric Increase: T3294 ------------------------- - - - - - 3e89eb65 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 base: Add to changelog.md CLC #285 - - - - - d9326a48 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00 Bump array and stm submodules for testsuite The testsuites of array and stm had to be updated according to !13301. Updates submodule array and stm. - - - - - 325fcb5d by Ben Gamari at 2024-11-18T04:06:45-05:00 rts/adjustor: Clean up code style of Nativei386 adjustor - - - - - 39bb6e58 by Ben Gamari at 2024-11-18T04:06:45-05:00 rts/adjustor: Fix stack overrun error in Nativei386 adjustor We were reserving the wrong kind of adjustor context (the generic `AdjustorContext` used by other adjustor implementations, rather than the i386-specific `CCallContext`) to return the adjustor context while freeing, resulting in #25485. Fixes #25485. - - - - - 831aab22 by sheaf at 2024-11-18T21:22:36-05:00 Include diagnostic reason in -fdiagnostics-as-json This commit ensures that the -fdiagnostics-as-json output includes the diagnostic reason. This allows the full error message produced by GHC to be re-constructed from the JSON output. Fixes #25403 - - - - - 3e5bfdd3 by Ben Gamari at 2024-11-18T21:23:12-05:00 rts: Introduce printIPE This is a convenience utility for use in GDB. - - - - - 44d909a3 by Sjoerd Visscher at 2024-11-19T14:38:24-05:00 Don't store boot locations in finder cache Partially reverts commit fff55592a7b Amends add(Home)ModuleToFinder so that locations for boot files are not stored in the finder cache. Removes InstalledModule field from InstalledFound constructor since it's the same as the key that was searched for. - - - - - 64c95292 by Sjoerd Visscher at 2024-11-19T14:38:24-05:00 Concentrate boot extension logic in Finder With new mkHomeModLocation that takes an extra HscSource to add boot extensions if required. - - - - - 11bad98d by ARATA Mizuki at 2024-11-19T14:39:08-05:00 Better documentation for floating-point min/max and SIMD primitives See #25350 for floating-point min/max Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 791a47b2 by Arnaud Spiwack at 2024-11-20T14:00:05+00:00 Add test for #25185 - - - - - 374e18e5 by Arnaud Spiwack at 2024-11-20T14:09:30+00:00 Quick look: emit the multiplicity of app heads in tcValArgs Otherwise it's not scaled properly by the context, allowing unsound expressions. Fixes #25185. - - - - - 1fc02399 by sheaf at 2024-11-20T18:11:03-05:00 x86 NCG: fix regUsageOfInstr for VMOVU & friends This commit fixes the implementation of 'regUsageOfInstr' for vector operations that take an 'Operand' as the destination, by ensuring that when the destination is an address then the address should be *READ*, and not *WRITTEN*. Getting this wrong is a disaster, as it means the register allocator has incorrect information, which can lead to it discard stores to registers, segfaults ensuing. Fixes #25486 - - - - - 7bd407a6 by Brandon Chinn at 2024-11-21T14:08:15-05:00 Fix CRLF in multiline strings (#25375) - - - - - 7575709b by Rodrigo Mesquita at 2024-11-21T14:08:52-05:00 Improve reachability queries on ModuleGraph Introduces `ReachabilityIndex`, an index constructed from a `GHC.Data.Graph.Directed` `Graph` that supports fast reachability queries (in $O(1)$). This abstract data structure is exposed from `GHC.Data.Graph.Directed.Reachability`. This index is constructed from the module graph nodes and cached in `ModuleGraph`, enabling efficient reachability queries on the module graph. Previously, we'd construct a Map of Set of ModuleGraph nodes which used a lot of memory (`O(n^2)` in the number of nodes) and cache that in the `ModuleGraph`. By using the reachability index we get rid of this space leak in the module graph -- even though the index is still quadratic in the number of modules, it is much, much more space efficient due to its representation using an IntMap of IntSet as opposed to the transitive closure we previously cached. In a memory profile of MultiLayerModules with 100x100 modules, memory usage improved from 6GB residency to 2.8GB, out of which roughly 1.8GB are caused by a second space leak related to ModuleGraph. On the same program, it brings compile time from 7.5s to 5.5s. Note how we simplify `checkHomeUnitsClosed` in terms of `isReachableMany` and by avoiding constructing a second graph with the full transitive closure -- it suffices to answer the reachability query on the full graph without collapsing the transitive closure completely into nodes. Unfortunately, solving this leak means we have to do a little bit more work since we can no longer cache the result of turning vertex indices into nodes. This results in a slight regression in MultiLayerModulesTH_Make, but results in large performance and memory wins when compiling large amounts of modules. ------------------------- Metric Decrease: mhu-perf Metric Increase: MultiLayerModulesTH_Make ------------------------- - - - - - bcbcdaaf by Cheng Shao at 2024-11-21T14:09:28-05:00 driver: fix hpc undefined symbol issue in TH with -fprefer-byte-code This commit fixes an undefined symbol error in RTS linker when attempting to compile home modules with -fhpc and -fbyte-code-and-object-code/-fprefer-byte-code, see #25510 for detailed description and analysis of the bug. Also adds T25510/T25510c regression tests to test make mode/oneshot mode of the bug. - - - - - 970ada5a by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Bump ci-images For introduction of Alpine/i386 image. Thanks to Julian for the base image. Co-Authored-By: Julian Ospald <hasufell at hasufell.de> - - - - - 8115abc2 by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Add release job for i386/Alpine As requested by Mikolaj and started by Julian. Co-Authored-By: Julian Ospald <hasufell at hasufell.de> - - - - - 639f0149 by Ben Gamari at 2024-11-22T23:32:06-05:00 rts/linker/Elf: Resolve _GLOBAL_OFFSET_TABLE_ - - - - - 490d4d0a by Ben Gamari at 2024-11-22T23:32:06-05:00 gitlab-ci: Mark i386 Alpine test breakages Marks the following tests as broken on i386/Alpine: * T22033 due to #25497 * simd009, T25062_V16, T25169, T22187_run due to #25498 - - - - - 536cdf09 by Cheng Shao at 2024-11-22T23:32:42-05:00 compiler: remove unused GHC.Linker.Loader.loadExpr This patch removes the unused `GHC.Linker.Loader.loadExpr` function. It was moved from `GHC.Runtime.Linker.linkExpr` in `ghc-9.0` to `GHC.Linker.Loader.loadExpr` in `ghc-9.2`, and remain completely unused and untested ever since. There's also no third party user of this function to my best knowledge, so let's remove this. Anyone who wants to write their own GHC API function to load bytecode can consult the source code in older release branches. - - - - - 6ee35024 by Drew Fenwick at 2024-11-22T23:33:26-05:00 Fix a non-compiling example in the type abstractions docs This patch adds a missing Show constraint to a code example in the User Guide's type abstractions docs to fix issue #25422. - - - - - d1172e20 by Rodrigo Mesquita at 2024-11-22T23:34:02-05:00 Re-introduce ErrorCallWithLocation with a deprecation pragma With the removal of the duplicate backtrace, part of CLC proposal #285, the constructor `ErrorCallWithLocation` was removed from base. This commit re-introduces it with a deprecation. - - - - - 1187a60a by Ben Gamari at 2024-11-22T23:34:39-05:00 testsuite: Skip tests requiring Hadrian deps in out-of-tree testsuite runs Some testsuite tests require specific tools (e.g. `check-ppr` and `check-exact`) beyond those shipped in the binary distribution. Skip these tests. Fixes #13897. - - - - - c37d7a2e by Ben Gamari at 2024-11-22T23:34:39-05:00 testsuite: Declare exactprint tests' dependency on check-exact - - - - - 454ce957 by Ben Gamari at 2024-11-22T23:35:15-05:00 ghc-internal: Fix a few cases of missing Haddock markup - - - - - a249649b by Ben Gamari at 2024-11-22T23:35:51-05:00 testsuite/GHCiPrimCall : Add missing Makefile includes - - - - - a021a493 by Ben Gamari at 2024-11-22T23:35:51-05:00 testsuite/IpeStats: Use Make rather than shell interpolation - - - - - 6e1fbda7 by Ben Gamari at 2024-11-25T03:55:44-05:00 hadrian-ghci-multi: Pass -this-package-name in unit response files As noted in #25509, the `-this-package-name` must be passed for each package to ensure that GHC can response references to the packages' exposed modules via package-qualified imports. Fix this. Closes #25509. - - - - - a05e4a9b by Simon Hengel at 2024-11-25T03:56:33-05:00 Refactoring: Use `OnOff` more consistently for `Extension` - - - - - 7536181d by Matthew Pickering at 2024-11-25T14:00:07-05:00 driver: Always link against "base" package when one shot linking The default value for base-unit-id is stored in the settings file. At install time, this can be set by using the BASE_UNIT_ID environment variable. At runtime, the value can be set by `-base-unit-id` flag. For whether all this is a good idea, see #25382 Fixes #25382 - - - - - 7f90f319 by Andreas Klebinger at 2024-11-25T14:00:44-05:00 Compacting GC: Handle black holes in large objects. As #14497 showed black holes can appear inside large objects when we capture a computation and later blackhole it like we do for AP_STACK closures. Fixes #24791 - - - - - 291388e1 by Cheng Shao at 2024-11-25T14:01:19-05:00 ci: minor nix-in-docker improvements This patch makes some minor improvements re nix-in-docker logic in the ci configuration: - Update `nixos/nix` to the latest version - Apply $CPUS to `cores`/`max-jobs` to avoid oversubscribing while allowing a reasonable degree of parallelism - Remove redundant `--extra-experimental-features nix-command` in later `nix shell` invocations, it's already configured in `/etc/nix/nix.conf` - - - - - e684c406 by Cheng Shao at 2024-11-25T14:01:57-05:00 ci: avoid depending on stack job for test-bootstrap jobs This patch makes test-bootstrap related ci jobs only depend on hadrian-ghc-in-ghci job to finish, consistent with other jobs in the full-build stage generated by gen_ci.hs. This allows the jobs to be spawned earlier and improve overall pipeline parallelism. - - - - - caaf5388 by Simon Hengel at 2024-11-25T14:02:41-05:00 Refactoring: Remove `pSupportedExts` from `ParserOpts` This is never used for lexing / parsing. It is only used by `GHC.Parser.Header.getOptions`. - - - - - 41f8365c by Arnaud Spiwack at 2024-11-25T14:03:23-05:00 Add test for #25515 - - - - - 9279619f by Arnaud Spiwack at 2024-11-25T14:03:23-05:00 Desugar record notation with correct multiplicities Simply uses the multiplicity as stored in the field. As I'm writing this commit, the only possible multiplicity is 1, but !13525 is changing this. It's actually easier to take !13525 into account. Fixes #25515. - - - - - fcc3ae6e by Andreas Klebinger at 2024-11-26T08:24:58-05:00 Clarify INLINE unfolding optimization docs. Fixes #24660 - - - - - 88c4fe1d by Cheng Shao at 2024-11-26T08:25:34-05:00 rts: remove -Wl,-U,___darwin_check_fd_set_overflow hack This patch bumps macOS minimum SDK version to 11.0 for x86_64-darwin to align it with aarch64-darwin. This allows us to get rid of the horrible -Wl,-U,___darwin_check_fd_set_overflow hack, which is causing linker warnings and testsuite failures on macOS 15. Fixes #25504. - - - - - 53f978c0 by doyougnu at 2024-11-26T16:07:26-05:00 ghc-experimental: expose GHC.RTS.Flags, GHC.Stats See this CLC proposal: - https://github.com/haskell/core-libraries-committee/issues/289 and this CLC proposal for background: - https://github.com/haskell/core-libraries-committee/issues/288 Metric Decrease: MultiLayerModulesTH_OneShot - - - - - e70d4140 by Wang Xin at 2024-11-26T16:08:10-05:00 Add -mcmodel=medium moduleflag to generated LLVM IR on LoongArch platform With the Medium code model, the jump range of the generated jump instruction is larger than that of the Small code model. It's a temporary fix of the problem descriped in https://gitlab.haskell .org/ghc/ghc/-/issues/25495. This commit requires that the LLVM used contains the code of commit 9dd1d451d9719aa91b3bdd59c0c6679 83e1baf05, i.e., version 8.0 and later. Actually we should not rely on LLVM, so the only way to solve this problem is to implement the LoongArch backend. Add new type for codemodel - - - - - df42ba16 by Andreas Klebinger at 2024-11-27T11:40:49-05:00 Cmm constant folding: Narrow results to operations bitwidth. When constant folding ensure the result is still within bounds for the given type by explicitly narrowing the results. Not doing so results in a lot of spurious assembler warnings especially when testing primops. - - - - - bf3db97e by Ben Gamari at 2024-11-27T11:41:26-05:00 ghc-toolchain: Introduce basic flag validation We verify that required flags (currently `--output` and `--triple`) are provided. The implementation is truly awful, but so is getopt. Begins to address #25500. - - - - - a104508d by Ben Gamari at 2024-11-27T11:42:03-05:00 rts: Allow ExecPage to allocate anywhere in address space Currently the ExecPage facility has two users: * GHCi, for constructing info tables, and * the adjustor allocation path Despite neither of these have any spatial locality constraints ExecPage was using the linker's `mmapAnonForLinker`, which tries hard to ensure that mappings end up nearby the executable image. This makes adjustor allocation needlessly subject to fragmentation concerns. We now instead return less constrained mappings, improving the robustness of the mechanism. Addresses #25503. - - - - - c3fc9b86 by Ben Gamari at 2024-11-27T11:42:39-05:00 base: Fix incorrect mentions of GHC.Internal.Numeric These were incorrectly changed by the automated refactoring of the `ghc-internal` migration. Fixes #25521. - - - - - a362b943 by sheaf at 2024-11-27T23:44:28-05:00 Add checkExact to toolTargets This change means that the Hadrian multi target will include exactprint. In particular, this means that HLS will work on exactprint inside the GHC tree. - - - - - e6c957e4 by Arnaud Spiwack at 2024-11-27T23:45:09-05:00 Add test for #25428 - - - - - 52d97f4e by Arnaud Spiwack at 2024-11-27T23:45:09-05:00 Don't bypass MonoLocalBind in empty patterns Fixes #25428 - - - - - 7890f2d8 by Ben Gamari at 2024-11-28T10:26:46-05:00 hadrian: Bump directory bound to >=1.3.9 Earlier versions of `directory` are racy on Windows due to #24382. Also includes necessary Hadrian bootstrap plan bump. Fixes #24382. - - - - - 0fd43ea6 by Adam Sandberg Ericsson at 2024-11-28T10:27:22-05:00 mention -Iw in +RTS -? - - - - - 6cf579b9 by Ben Gamari at 2024-11-28T10:27:59-05:00 gitlab-ci: Set GIT_SUBMODULE_FORCE_HTTPS GitLab recommends using `https://` to clone submodules and provides the `GIT_SUBMODULE_FORCE_HTTPS` variable to force this. Fixes #25528. - - - - - 5b4774f9 by sheaf at 2024-12-03T15:22:07+01:00 Remove TcRnDeprecatedInvisTyArgInConPat mechanism The combination of ScopedTypeVariables + TypeApplications now no longer enables the use of type applications in constructor patterns, as per GHC proposal #448. This completes the deprecation that begun with GHC 9.8. We also remove the -Wdeprecated-type-abstractions flag, which was introduced in GHC 9.10. - - - - - f813c8d7 by sheaf at 2024-12-03T17:10:15-05:00 Hadrian: use / when making filepaths absolute In Hadrian, we are careful to use -/- rather than </>, in order to use / instead of \ in filepaths. However, this gets ruined by the use of makeAbsolute from System.Directory, which, on Windows, changes back forward slashes to backslashes. - - - - - 292ed74e by Ben Gamari at 2024-12-03T17:10:52-05:00 rts/linker: Fix out-of-bounds mapping logic Previously the structure of `mmapInRegion` concealed a subtle bug concerning handling of `mmap` returning mappings below the beginning of the desired region. Specifically, we would reset `p = result + bytes` and then again reset `p = region->start` before looping around for another iteration. This resulted in an infinite loop on FreeBSD. Fixes #25492. - - - - - 20912f5b by Ben Gamari at 2024-12-03T17:10:52-05:00 rts/linker: Clarify debug output - - - - - f98b3ac0 by Simon Hengel at 2024-12-03T17:11:30-05:00 SysTools: Avoid race conditions when processing output (fixes #16450) - - - - - 03851b64 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 mg: Drop unnecessary HasCallStack This HasCallStack was a debugging artifact from a previous commit. - - - - - 01d213b5 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 Improve haddock of graphReachabilityCyclic - - - - - f7cbffe2 by Rodrigo Mesquita at 2024-12-03T17:12:06-05:00 Refactor ModuleGraph interface The 'ModuleGraph' abstraction represents the relationship and strucutre of the modules being compiled. This structure is meant to be constructed once at the start of compilation, and never changed again. However, it's exposed interface was confusing and exposed too many footguns which led to inneficient usages of the ModuleGraph. This commit improves significantly the exported interface of ModuleGraph, taking into consideration the recent improvements around reachability queries. Since the ModuleGraph graphs and related structures (HPT, EPS) are performance critical in the sense that somewhat simple mistakes can cause bad leaks and non-linear memory usage, we want to have proper APIs that guide efficient usage. This is a good step in that direction. - - - - - b69a7f3c by David Binder at 2024-12-04T18:37:42-05:00 Use consistent capitalization for "GHC Proposal" in user guide - - - - - 18d9500d by David Binder at 2024-12-04T18:37:42-05:00 Fix reference to GHC proposal 193 in user guide - - - - - dd959406 by Ben Gamari at 2024-12-04T18:38:18-05:00 Revert "rts/Interpreter: Assert that TEST*_P discriminators are valid" This assertion was based on the misconception that `GET_TAG` was returning the pointer tag whereas it is actually returning the constructor tag. This reverts commit 9bf3663b9970851e7b5701d68147450272823197. Fixes #25527. - - - - - cad6fede by Ben Gamari at 2024-12-04T18:38:54-05:00 rts/IOManager: Drop dead code This assignment is dead code as it occurs after all branches have returned. Moreover, it can't possibly be relevant since the "available" branch already sets `flag`. Potentially fixes #25542. - - - - - 55d8304e by Ben Gamari at 2024-12-06T16:56:00-05:00 ghc-internal: Drop GHC.Internal.Data.Enum This module consists only of reexports and consequently there is no reason for it to exist. - - - - - 56b9f484 by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Introduce Data.Bounded As proposed in [CLC#208] but unfortunately `Data.Enum` was already incorrectly introduced in the `ghc-internal` refactor. [CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208 - - - - - 336d392e by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Deprecate export of Bounded from Data.Enum This begins the process of bringing us into compliance with [CLC#208]. [CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208 - - - - - dd7ca939 by Ben Gamari at 2024-12-06T16:56:00-05:00 base: Mention incorrect Data.Enum addition in changelog - - - - - dfd1db48 by Ben Gamari at 2024-12-06T16:56:36-05:00 base: Reintroduce {Show,Enum} IoSubSystem These instances were dropped in !9676 but not approved by the CLC. Addresses #25549. - - - - - 090fc7c1 by Peter Trommler at 2024-12-07T03:41:21-05:00 Fix requirements on T25240 T25240 doesn't need RTS linker, GHCi is sufficient and GHCi can also be dynamically linked. - - - - - 3fb5d399 by Peter Trommler at 2024-12-07T03:41:21-05:00 Fix requirements for T25155 Loading C objects requires RTS linker. - - - - - 4c58bdf6 by Leary at 2024-12-07T03:42:07-05:00 TH: Add typed variants of dataToExpQ and liftData This commit introduces to template-haskell (via ghc-internal) two functions `dataToCodeQ` and `liftDataTyped`, typed variants of `dataToExpQ` and `liftData` respectively. Tested in: `dataToCodeQUnit`. - - - - - 63027593 by Serge S. Gulin at 2024-12-08T13:52:05+03:00 JS: Basic cleanup for unused stuff to simplify things. 1. Make `staticInitStat`, `staticDeclStat`, `allocUnboxedConStatic`, `allocateStaticList`, `jsStaticArg` local to modules. 2. Remove unused `hdRawStr`, `hdStrStr` from Haskell and JavaScript (`h$pstr`, `h$rstr`, `h$str`). 3. Introduce a special type `StaticAppKind` enumeration and `StaticApp` to represent boxed scalar static applications. Originally, StaticThunk supported to pass Maybe when it became Nothing for initializied thunks in an alternatie way but it is not used anymore. - - - - - a9f8f1fb by Serge S. Gulin at 2024-12-08T14:10:45+03:00 JS: Add trivial optimizations for `unpackCString` and `unpackCStringUtf8`. It became possible due of introduction strings unfloating at Sinker pass (#13185). Earns few more bytes at optimizations. - - - - - b519c06b by Serge S. Gulin at 2024-12-08T15:50:26+03:00 JS: Specialize unpackCString# CAFs (fixes #24744) Code analysis shown that such optimization would be possible out of the box if `cachedIdentForId` allowed to do that for Haskell `Id`s which are represented by few JavaScript `Ident`s. It is a usual for strings which are represented at JavaScript as a pair of 2 values: the string content and the offset where to start reading actual string from the full content. Usually offset is 0 but technically we need to allow such complex structures to be treated as "global". Enabling it there shown that `genToplevelRhs` and `globalOccs` had inaccuracies in their implementations: 1. `globalOccs` operated over JavaScript's `Ident`s but for complex structures it didn't pay attention to the fact that different Idents actually could be pointed to same Id. Now the algo is changed to calculate occurencies for Ids. 2. `genToplevelRhs` didn't assume that different Idents pointed to same Id can have mixed order of occurence. But actually the order is important. Strings are encoded into 2 variables where first is content and second is offset and their order are not interchangeable. It is fixed by regeneration Idents from collected Ids which is fine because all Idents generation is passed through the Cache and they are quasi-stable. - - - - - a8ceccf3 by Brandon Chinn at 2024-12-09T16:25:43-05:00 Fix panic in multiline string with unterminated gap (#25530) - - - - - 9e464ad0 by Brandon Chinn at 2024-12-09T16:25:43-05:00 Add test case for unterminated multiline string - - - - - ed1ed5c6 by Rodrigo Mesquita at 2024-12-09T16:26:19-05:00 Revert mapMG renaming We had previously renamed this function for consistency, but that caused unnecessary breakage - - - - - 158261f7 by Sylvain Henry at 2024-12-09T16:27:01-05:00 RTS: make Cabal flags manual Cabal shouldn't automatically try to set them. We set them explicitly. - - - - - a83b7ed6 by Matthew Stephenson at 2024-12-10T14:01:22-05:00 Add missing @since documentation for (!?) function - - - - - e745e3a3 by Ben Gamari at 2024-12-10T14:01:59-05:00 compiler: Don't attempt to TSAN-instrument SIMD operations TSAN only provides instrumentation for 8, 16, 32, and 64-bit memory loads/stores. Don't attempt to instrument wider operations. Fixes #25563. - - - - - 684c0018 by Ben Gamari at 2024-12-10T14:02:35-05:00 gitlab/ci: Don't clobber RUNTEST_ARGS Previously the logic handling `IGNORE_PERF_FAILURES` clobbered the user's `RUNTEST_ARGS`. Fix this. - - - - - 41dae5b8 by Ben Gamari at 2024-12-10T14:03:11-05:00 hadrian: Mitigate mktexfmt race At least some versions of Texlive's `mktexfmt` utility cannot be invoked concurrently in their initial run since they fail to handle failure of `mkdir` due to racing. Specifically, we see ``` | Run Xelatex: users_guide.tex => /tmp/extra-dir-9616886274866 | Run Xelatex: Haddock.tex => /tmp/extra-dir-9616886274869 This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex) restricted \write18 enabled. kpathsea: Running mktexfmt xelatex.fmt mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order): mktexfmt: /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes: mktexfmt: /builds/ghc/ghc/tmp-home/.texlive2020/texmf-config/web2c/fmtutil.cnf /usr/bin/mktexfmt: mkdir(/builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c/) failed for tree /builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c: File exists at /usr/share/texlive/tlpkg/TeXLive/TLUtils.pm line 937. I can't find the format file `xelatex.fmt'! ``` That is two `mktexfmt` invocations (for the user's guide and haddock builds) attempted to create `$HOME/texlive2020/texmf-var/web2c` and raced. One of the two `mkdir`'s consequently failed, bringing down the entire build. We avoid this by ensuring that the first `xelatex` invocation is always performed serially. Fixes #25564. - - - - - 9efbc51f by Ben Gamari at 2024-12-10T14:03:48-05:00 rts/CheckUnload: Reset old_objects if unload is skipped Previously `checkUnload` failed to reset `old_objects` when it decided not to unload (e.g. due to heap profiling being enabled). Fixes #24935. - - - - - 5192a75f by Ben Gamari at 2024-12-11T04:28:11-05:00 rts: Annotate BCOs with their Name This introduces a new bytecode instruction, `BCO_NAME`, to aid in debugging bytecode execution. This instruction is injected by `mkProtoBCO` and captures the Haskell name of the BCO. It is then printed by the disassembler, allowing ready correlation with STG dumps. - - - - - 99225996 by Ben Gamari at 2024-12-11T04:28:48-05:00 configure: Implement ld override whitelist Bring `configure` into alignment with `ghc-toolchain`, ensuring that the ld-override logic will only take effect on Linux and Windows. Fixes #25501. - - - - - 4a8fc928 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Unmark T14028 as broken on FreeBSD This now appears to pass on FreeBSD 14. Closes #19723. - - - - - d7c0eb5a by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Migrate FreeBSD runner tag to FreeBSD 14 - - - - - 7246dacc by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Reintroduce FreeBSD 14 job - - - - - 4af936da by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Allow use of newer cabal-install bindists Newer cabal-install bindists have internal directory structure. Here we detect and account for the presence of such structure. - - - - - cbf38c1b by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Enable documentation build on FreeBSD 14 - - - - - d68107fb by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Use system libffi on FreeBSD - - - - - fea3b590 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark linker_unload as broken on FreeeBSD Due to #25491. - - - - - ccf171ee by Ben Gamari at 2024-12-11T12:33:42+00:00 gitlab-ci: Prefer system toolchain on FreeBSD It's not uncommon to find machines with gcc installed via ports. We should be using the system's default clang-based toolchain instead. - - - - - cfb34738 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark T21969 as broken on FreeBSD Due to #25512. - - - - - 0b64e37c by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark RestartEventLogging as broken on FreeBSD I am seeing this fail quite reproducibly. Due to #19724. - - - - - 3b412019 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Mark T16180 as "broken" on FreeBSD Sadly we in fact need to skip it as it merely times out during compilation. See #14012. - - - - - 57e3cab5 by Ben Gamari at 2024-12-11T12:33:42+00:00 testsuite: Skip T16992 unless in slow speed This test has extraordinary memory requirements and tests a rather niche aspect of the compact region mechanism. It has been suggested multiple times that we shouldn't run it in the default testsuite configuration. Finally implement this. See #21890. See #21892. - - - - - f08a72eb by Ben Gamari at 2024-12-11T19:30:54-05:00 rts(setNumCapabilities): Assert that n_caps < MAX_N_CAPS It was noticed in #25560 that this would previously be allowed, resulting in a segfault. I will add a proper exception in `base` in a future commit. - - - - - e10d31ad by Ben Gamari at 2024-12-11T19:30:55-05:00 ghc-internal: Fix inconsistent FFI import types The foreign imports of `enabled_capabilities` and `getNumberOfProcessors` were declared as `CInt` whereas they are defined as `uint32_t`. - - - - - 06265655 by Ben Gamari at 2024-12-11T19:30:55-05:00 rts: Mention maximum capability count in users guide Addresses #25560. - - - - - d488470b by Ben Gamari at 2024-12-11T19:30:55-05:00 rts/Capability: Move induction variable declaration into `for`s Just a stylistic change. - - - - - 71f050b7 by Ben Gamari at 2024-12-11T19:30:55-05:00 rts: Determine max_n_capabilities at RTS startup Previously the maximum number of capabilities supported by the RTS was statically capped at 256. However, this bound is uncomfortably low given the size of today's machine. While supporting unbounded, fully-dynamic adjustment would be nice, it is complex and so instead we do something simpler: Probe the logical core count at RTS startup and use this as the static bound for the rest of our execution. This should avoid users running into the capability limit on large machines while avoiding wasting memory on a large capabilities array for most users and keeping complexity at bay. Addresses #25560. - - - - - 1e84b411 by Ben Gamari at 2024-12-11T19:30:55-05:00 testsuite: Introduce req_c_rts As suggested by @hsyl20, this is intended to mark tests that rely on the behavior of the C RTS. - - - - - 683115a4 by Ben Gamari at 2024-12-11T19:30:55-05:00 testsuite: Add test for #25560 - - - - - ef2052a8 by Ben Gamari at 2024-12-12T04:42:32-05:00 testsuite: Only run T14497_compact in normal way This test targets the compacting GC so it makes little sense to run it across all ways. Moreover, it outright conflicts with the `nonmoving` way. - - - - - 34d3e8e6 by Ben Gamari at 2024-12-12T04:43:08-05:00 rts/CheckUnload: Don't prepare to unload if we can't unload Previously `prepareUnloadCheck` would move the `objects` list to `old_objects` even when profiling (where we cannot unload). This caused us to vacate the `objects` list during major GCs, losing track of loaded objects. Fix this by ensuring that `prepareUnloadCheck` and `checkUnload` both use the same short-cutting logic. - - - - - 9c53489d by Andrei Borzenkov at 2024-12-12T15:06:42-05:00 Update GHCi :info type declaration printing (#24459) - Do not print result's kind in type families because we have full kind in SAKS and we display invisible arity using @-binders - Do not suppress significant invisible binders An invisible binder is considered significant when it meets at least one of the following two criteria: - It visibly occurs in the declaration's body - It is followed by a significant binder, so it affects positioning For non-generative type declarations (type synonyms and type families) there is one additional criterion: - It is not followed by a visible binder, so it affects the arity of a type synonym See Note [Print invisible binders in interface declarations] for more information about what is "visibly occurs" - - - - - 13fe48d4 by Matthew Pickering at 2024-12-12T15:07:19-05:00 typechecker: Perform type family consistency checks in topological order Consider a module M importing modules A, B and C. We can waste a lot of work depending on the order that the modules are checked for family consistency. Consider that C imports A and B. When compiling C we must have already checked A and B for consistency, therefore if C is processed first then A and B will not need to be checked for consistency again. If A and B are compared first, then the consistency checks will be performed against (wasted as we already performed them for C). At the moment the order which modules are checked is non-deterministic. Clearly we should engineer that C is checked before B and A, but by what scheme? A simple one is to observe that if a module M is in the transitive closure of X then the size of the consistent family set of M is less than or equal to size of the consistent family set of X. Therefore by sorting the imports by the size of the consistent family set and processing the largest first, you make sure to process modules in topological order. In practice we have observed that this strategy has reduced the amount of consistency checks performed. One solution to #25554 - - - - - 62a2b25f by Sylvain Henry at 2024-12-14T04:31:09-05:00 TNTC: set CmmProc entry_label properly (#25565) Before this patch we were renaming the entry label of a CmmProc late in the CmmToAsm pass. It led to inconsistencies and to some labels being used in info tables but not being emitted (#25565). Now we set the CmmProc entry label earlier in the StgToCmm monad and we don't renamed it afterwards. - - - - - b339e7c3 by Simon Hengel at 2024-12-14T04:31:47-05:00 Make filter functionality for system tools line-based This is more efficient as: - All existing filter functions were line-based anyway. They broke up the input into lines and then joined it back together. - We already break up the output from system tools into lines when processing it. Splitting up the output of system tools once and then filtering and processing it reduces both code and runtime complexity. - - - - - 39669077 by Simon Hengel at 2024-12-14T04:31:47-05:00 Refactoring: Don't use a `Chan` when parsing SysTools output - - - - - 64756530 by Simon Peyton Jones at 2024-12-14T22:28:04-05:00 Tidy up the handling of `assert` Fixes #25493 - - - - - 8658fbc1 by Rodrigo Mesquita at 2024-12-14T22:28:41-05:00 base: displayException for SomeAsyncException Provide a better implementation of `SomeException` for `SomeAsyncException`. The previous, implicit, implementation, would not use the `displayException` of the exception wrapped by `SomeAsyncException`. Implements CLC-Proposal#309 Closes #25513 - - - - - 2d3a0a70 by ARATA Mizuki at 2024-12-15T18:35:30-05:00 LLVM: When emitting a vector literal with ppTypeLit, include the type information Fixes #25561 - - - - - bfacc086 by Simon Peyton Jones at 2024-12-15T18:36:05-05:00 Fix signature lookup in instance declarations This fixes a bug introduced by the fix to #16610 - - - - - 80f0e02d by Simon Peyton Jones at 2024-12-16T17:13:52+00:00 Improve GHC build times Two small changes * In GHC.Data.Unboxed, never omit interface pragmas. In "fast builds" one might omit them generally, but doing so gives very bad performance for code that imports this module. * In GHC.Hs.Dump don't do type-class specialisation. For some reason it goes mad and generates vast amounts of useless code. See #25463. - - - - - 175a1355 by Simon Peyton Jones at 2024-12-16T17:13:52+00:00 Refactor Lint Refactor Lint for two reasons: * To improve performance * To prepare for type-lets The big changes are all in GHC.Core.Lint: * Change the main APIs: * `lintType` returns nothing rather than returning a `LintedType`; * `lintCoercion` return nothing rather than returning a `LintedCoercion` Reason: these functions did a lot of allocation to return a substituted type/coercion that was often discarded, or used only to extract its kind. Instead we now return nothing, and, when needed, extract the kind and substitute. * Applications are treated as a whole, by `lintApp`. By treating multiple arguments all at once we avoid performing multiple substitutions, each substituting a single type variable. This can make an absolutely huge difference. Overall this led to a pretty massive rewrite of Lint, with many smaller changes. Smaller chnages elsewhere * Rename `GHC.Core.TyCo.Subst.getSubstInScope` to `substInScopeSet` for consistency * Define and use `GHC.Core.Type.liftedTypeOrConstraintKind` Performance. This MR someimtes gives gives a very large improvement in compile time, when Lint is on. here is a selection of changes over 5% in perf/compiler (with -dcore-lint) T25196 -97.0% T14766 -89.7% T14683 -74.4% T5631 -60.9% T20261 -56.7% T18923 -17.6% T13035 -15.8% T6048 -15.8% CoOpt_Read -14.4% T9630 -10.9% T5642 -7.3% Eliminating the egregious offenders is a big win. However, in some cases the compiler allocation /increases/. Here ae the changes over 1%: T9961 1.5% T8095 2.8% T14052 3.9% T12545 4.5% T14052Type 5.5% T5030 8.0% T5321Fun 8.3% T3064 12.7% CoOpt_Singletons 15.6% T9198 16.0% LargeRecord 18.1% I looked at the two biggest increases in compile-time bytes allocated. Interestingly, they both show substantial *decreases* in actual compile time, due to much smaller GC times. I'm honestly not sure either why the allocation increases, or why the GC time decreases; but I'm going to take the win! T9198 Baseline With patch No Lint Alloc 44.6M 44.6M Mut time 0.23s 0.22s GC time 0.21s 0.21s With Lint Alloc 309M 360M Mut time 1.51s 0.85s GC time 2.97s 0.25s ------------------- LargeRecord Baseline With patch No Lint Alloc 1.37G 1.37G Mut time 2.33s 2.33s GC time 2.40s 2.42s With Lint Alloc 3.4G 4.0G Mut time 6.02s 5.68s GC time 3.67s 3.03s IMPORTANT NOTE: These changes don't show up in CI because in CI the tests in perf/compiler are all run with -dcore-lint switched off. I gathered this data with some manual runs. - - - - - 8ef2dad6 by Simon Peyton Jones at 2024-12-17T02:48:09-05:00 Add Note [Typechecking overloaded literals] See #25494. - - - - - e86b1b20 by Ben Gamari at 2024-12-17T13:51:39-05:00 testsuite: Use math.inf instead of division-by-zero This both more directly captures the intent and also fixes #25580. - - - - - 430d965a by Ben Gamari at 2024-12-17T13:52:15-05:00 rts: Fix incorrect format specifiers in era profiling Fixes #25581. - - - - - 267098ad by Andreas Klebinger at 2024-12-18T23:43:13-05:00 Document `-prof` and non `-prof` code being incompatible. Fixes #25518. - - - - - 04433916 by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metadata: output metadata fragment in CI (cherry picked from commit 52b58a660e735b20961d792d8fa9267f01247a50) - - - - - 7c78804e by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metatdata: use fedora33 for redhat Redhat 9 doesn't have libtinfo.so.5 anymore (cherry picked from commit dc86785eb43afd1bd292287c064fb5ad94fe8c7f) - - - - - 1d72cfb2 by Zubin Duggal at 2024-12-18T23:43:50-05:00 ghcup metadata: still use centos for redhat <9 - - - - - 3f7ebc58 by Sylvain Henry at 2024-12-19T20:40:14-05:00 Merge ghc-bignum into ghc-internal (#24453) First step towards merging ghc-bignum and ghc-prim into ghc-internal. After this patch, ghc-bignum is deprecated and is just a shallow package reexporting modules from ghc-internal and base. Use those directly instead. Move `gmp` submodule into ghc-internal directory. - - - - - ee0150c2 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00 Improve performance of deriving Show Significantly improves performance of deriving Show instances by avoiding using the very polymorphic `.` operator in favour of inlining its definition. We were generating tons of applications of it, each which had 3 type arguments! Improves on #9557 ------------------------- Metric Decrease: InstanceMatching T12707 T3294 ------------------------ - - - - - 8b266671 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00 Don't eta expand cons when deriving Data This eta expansion was introduced with the initial commit for Linear types. I believe this isn't needed any longer. My guess is it is an artifact from the initial linear types implementation: data constructors are linear, but they shouldn't need to be eta expanded to be used as higher order functions. I suppose in the early days this wasn't true. For instance, this works now: data T x = T x f = \(x :: forall y. y -> T y) -> x True f T -- ok! T is linear, but can be passed where an unrestricted higher order function is expected. I recall there being some magic around to make this work for data constructors... Since this works, there's no need to eta_expand the data constructors in the derived Data instances. - - - - - 1f67ad21 by Andrei Borzenkov at 2024-12-25T01:42:31-05:00 Flip the order of arguments of setField (#24668) GHC Proposal 583 "HasField redesign" specifies the following order of a setField function arguments as this: setField :: forall fld a b. SetField fld a b. b -> a -> a This patch flips the application order to match the spec. - - - - - 3e0c948d by Ben Gamari at 2024-12-25T01:43:08-05:00 rel-eng/upload: Add set_symlink mode This slightly eases updating of the `latest` symlinks. - - - - - 63d63f9d by Simon Peyton Jones at 2024-12-25T01:43:45-05:00 Preserve orientation when unifying kinds This MR fixes yet another manifestation of the trickiness caused by Note [Fundeps with instances, and equality orientation]. I wish there was a more robust way to do this, but this fix is a definite improvement. Fixes #25597 - - - - - 94ba9a6a by ARATA Mizuki at 2024-12-26T10:47:57-05:00 x86 NCG SIMD: Support pack/insert/broadcast/unpack of 128-bit integer vectors - - - - - 6bf0d587 by Andrew Lelechenko at 2024-12-26T10:48:33-05:00 docs: fix haddock formatting in Control.Monad.Fix - - - - - feb14af1 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Remove unnecessary irrefutable patterns from NonEmpty functions Implementation of https://github.com/haskell/core-libraries-committee/issues/107 - - - - - 6a0d91b4 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Make cons, Semigroup, IsList, and Monad instances stricter - - - - - 1249e597 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00 Restore some laziness in <| and Semigroup instance, improve Monad instance The Monad instance shouldn't produce the outer :| unless f a reduces to WHNF. (Notice that the b :| bs match is implicitly lazy.) - - - - - 8699d826 by Sergey Vinokurov at 2024-12-27T15:12:30+00:00 Add comment outlining Data.List.NonEmpty implementation guiding principles - - - - - 7febe00e by Sergey Vinokurov at 2024-12-27T22:24:43+00:00 Fix tests since location of ‘>>=’ changed - - - - - a928c326 by ARATA Mizuki at 2024-12-28T03:06:14-05:00 Fix LLVM version detection With a recent LLVM, `llc -version` emits the version on the first line if the vendor is set. It emits the version on the second line otherwise. Therefore, we need to check the both lines to detect the version. GHC now emits a warning if it fails to detect the LLVM version, so we can notice if the output of `llc -version` changes in the future. Also, the warning for using LLVM < 10 on s390x is removed, because we assume LLVM >= 13 now. This fixes the definition of __GLASGOW_HASKELL_LLVM__ macro. Fixes #25606 - - - - - 7f79257a by Zubin Duggal at 2024-12-29T13:04:35+00:00 Bump base, ghc-prim and template-haskell versions for 9.12 Also bump various submodules. (cherry picked from commit 6fc1fa3bdc8f53acdb19e47145789274060e498f) Bump base bound to 4.21 for GHC 9.12 (cherry picked from commit 473a201c6b55aea5bf9c9db0836a66ea1b657e04) Bump binary submodule to 0.8.9.2 (cherry picked from commit 7199869a52ab45e8856658248bf807954d58cc20) (cherry picked from commit ec2f40b45c1a3d82d17a2fc07e9ddb9218bc3940) Bump exceptions submodule to 0.10.9 (cherry picked from commit f5b5d1dc2d326368e5b173d622630d77f019b629) Bump file-io submodule to 0.1.4 (cherry picked from commit ba786681de6ac5fa49938e2cd71a5988f0f40d1f) bump os-string submodule to 2.0.6 (cherry picked from commit 3a7ffdbb832c045a55fd1ef24f546abdd9d9e30f) bump transformers submodule to 0.6.1.2 (cherry picked from commit 53b46fd437421b9e5a001edc6d1c427439d7714f) Bump directory submodule to v1.3.9.0 (cherry picked from commit 27dc2664c5404bb462092bb216c2c37b418fd1f8) Bump Win32 submodule to v2.14.1.0 (cherry picked from commit 80df88086180f5e39212b2feacf70a9d2b263c6c) Bump filepath submodule to 1.5.3.0 (cherry picked from commit 29bfae2c58a7303a081a6e7956b9f55e5faf3eeb) Bump file-io submodule to avoid usage of QuasiQuotes (cherry picked from commit 97b0dff223a6c4cc003adec448104c277f214645) Bump unix submodule to 2.8.6.0 (cherry picked from commit a1f56d6d6a99c100f88ef0a8b4d51298cf24a42d) Bump os-string submodule to 2.0.8 (cherry picked from commit 0121b76fd52ea0c0ce5d07085bc195666b63c625) Bump file-io submodule to avoid usage of QuasiQuotes (cherry picked from commit 962ceb50c8a6fc370e1c0a267f5cd5562a8cf759) Bump filepath submodule to 1.5.4.0 (cherry picked from commit 7bc6877fd5d41c6d5900678ad5e73ed30f366569) Bump file-io submodule to 0.1.5 (cherry picked from commit 9478b5aefe2877d58baf527edcf936dddbb955b7) Bump Cabal submodule to 3.14.1.0 (cherry picked from commit 5c9c3e3f79a79bb6d9a77a17c716dc3a0bcbd2aa) Bump directory submodule to 0.12.2.0 (cherry picked from commit 897906265db37af34ae2aaa016cec417f263407b) Bump array submodule for base bump Bump stm submodule for base bump Bump process submodule for base bump - - - - - f6079408 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Fix ghc-e005 after HasCallstack changes (cherry picked from commit 77f340a24561cea8a6f2ada296b3ea356ab1823c) - - - - - 3e10fa75 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Add haskeline to stage0Packages Otherwise we link against boot inplace and boot unix as boot haskeline depends on boot unix. (cherry picked from commit 90b493769ebdf3cd7be404d18462dc20ac1044df) - - - - - 4ad6aec4 by Zubin Duggal at 2024-12-29T13:04:35+00:00 Fix TH changelog - - - - - ea3f7fd5 by Zubin Duggal at 2024-12-29T13:04:35+00:00 release: copy index.html from correct directory (cherry picked from commit cbfd0829cd61928976c9eb17ba4af18272466063) - - - - - fafb70db by Zubin Duggal at 2024-12-29T13:04:35+00:00 hadrian-multi: warn on unused imports os-string has redundant imports (cherry picked from commit dde3796be689ea57543936e22aa5ea4ef7ed995e) - - - - - c02b1e46 by Simon Peyton Jones at 2024-12-29T17:04:30-05:00 Fix in-scope set for CSE Ticket #25468 showed an assertion failure in CSE because a top-level Id was being used before it was defined. Reason: Note [Glomming] in GHC.Core.Opt.OccurAnal. Solution (used in many places): just put all the top-level bindings in scope at the beginning of CSE. Compile-time allocation wobbles up and down a tiny bit; geo mean is zero. But MultiLayerModulesTH_OneShot and hard_hole_fits increase (on some architectures only) by a bit oever 2% . I think these are just a random fluctuations. Metric Increase: MultiLayerModulesTH_OneShot hard_hole_fits - - - - - 559d4f84 by Krzysztof Gogolewski at 2024-12-30T11:53:19-05:00 Add tests for #23883 The issue has been fixed by commit f5d3e03c56ffc63. Only T23883a is the actual regression test, the remaining ones are tricky cases found during development of an independent fix !11313. - - - - - 278a53ee by Sergey Vinokurov at 2024-12-30T11:53:59-05:00 Update changelog for CLC proposal #107 (NonEmpty laziness) - - - - - f56558be by Matthew Pickering at 2025-01-07T13:53:03-05:00 warnings: Find out if a qualified name is in the interactive scope directly There were two ad-hoc mechanisms used to determine which modules were in the interactive scope. 1. Look at everything in the GRE, to see what is imported qualified. 2. Look at the last loaded module in the HPT. (1) Is very inefficient, GlobalRdrEnvs can be very big. (2) is incorrect, there is no reason to assume the "last" thing added to the HPT has any relevance to module loading order. Happily, the same checks can be implemented directly by looking at the interactive imports from the interactive context. This mirrors what happens for normal imports. Arguably, the error reporting code shouldn't be doing this kind of processing and it should be an option is set when rendering the error message. However, this just improves the situation and doesn't block progress on that front in future. See #14225 and #15611 Fixes #25600 - - - - - 84155cdb by Simon Peyton Jones at 2025-01-07T13:53:40-05:00 Tidy up kcConDecls Addresses #25630 In particular, * Introduce ConArgKind and use it. * Make kcConDecls and tcConDecls work the same way concerning the kind of argument types - - - - - 6c12b6cf by Bryan Richter at 2025-01-07T18:15:02-05:00 Remove tmp files after toolchain check Fixes #25620 - - - - - 42826a89 by Cheng Shao at 2025-01-07T18:15:39-05:00 xxhash: bump to v0.8.3 - - - - - 185f17e4 by sheaf at 2025-01-07T18:16:15-05:00 Fix typo in GHC.Tc.Solver.Solve.runTcPluginsWanted - - - - - 23099752 by Luite Stegeman at 2025-01-08T00:33:33+01:00 Add flags for switching off speculative evaluation. We found that speculative evaluation can increase the amount of allocations in some circumstances. This patch adds new flags for selectively disabling speculative evaluation, allowing us to test the effect of the optimization. The new flags are: -fspec-eval globally enable speculative evaluation -fspec-eval-dictfun enable speculative evaluation for dictionary functions (no effect if speculative evaluation is globally disabled) The new flags are on by default for all optimisation levels. See #25284 - - - - - 0161badc by Ben Gamari at 2025-01-09T17:30:05-05:00 rts/printClosure: Print IPE information for thunks and functions This makes it considerably easier to grok the structure of the heap when IPE information is available. - - - - - 023f36f5 by Rodrigo Mesquita at 2025-01-10T14:57:48-05:00 user_guide: Note -pgmP/-optP are for /Haskell/-CPP Fixes #25574 - - - - - e1c133f2 by Ben Gamari at 2025-01-10T14:58:25-05:00 dump-decls: Suppress unit-ids While the testsuite driver already normalizes these away, they are nevertheless a severe nuisance when diffing outside of the testsuite. Intriguingly, this doesn't completely eliminate the unit IDs; some wired-in names are still printed. However, this is a cheap and helpful improvement over the status quo so I am simply going to accept this. Fixes #25334. - - - - - 2e7bf446 by sheaf at 2025-01-13T10:55:26+01:00 Remove SDocs from ErrCtxt & ErrInfo This commit: - turns the SDoc used in ErrCtxt into a proper error datatype, ErrCtxtMsg, which contains all the different error contexts that can be added, - replaces ErrInfo with [ErrCtxt]. ErrInfo used to contain two SDocs; the first is replaced with [ErrCtxt], and the second is removed, with the relevant information being put in the appropriate error message constructors. Fixes #23436 - - - - - 2d62b970 by Mike Pilgrem at 2025-01-13T12:59:10-05:00 Re CLC #300 - Specify fmap for NonEmpty as map See: * https://github.com/haskell/core-libraries-committee/issues/300 Seeks to: * move existing instances for NonEmpty (except of Eq and Ord) out of GHC.Internal.Base into new GHC.Internal.Data.NonEmpty (to avoid otherwise unavoidable cycles in the module graph); * move map out of Data.List.NonEmpty (base package) into GHC.Internal.Data.NonEmpty; * define fmap as map for NonEmpty instance of Functor, avoiding code duplication; * re-export map from existing GHC.Internal.Data.List.NonEmpty; and * re-export map from Data.List.NonEmpty (base package); without breaking anything in the GHC repository. Various tests *.stdout and *.stderr files are amended also. - - - - - ab3ab3e3 by Luite Stegeman at 2025-01-13T12:59:58-05:00 compiler/coreprep: Turn off dictionary speculation by default Speculative evaluation can cause performance regressions, therefore we turn it off by default. It can be enabled again with the -fspec-eval-dictfun flag See #25284 - - - - - 3d9cacd5 by Patrick at 2025-01-14T02:34:46+08:00 Enhance kind inference for data family instances This commit improves kind inference for data family instances by kind-checking the constructors, for H98 and newtype declarations (ONLY), as well as kind-checking the result kind signature (when using GADT syntax). This fixes #25611. Typechecker changes: In `tcDataFamInstHeader`, we now kind-check the constructors using `kcConDecls`, for H98-style decls and newtype decls ONLY. See Note [Kind inference for data family instances]. Testsuite changes: - The T25611{a,b,c,d} tests test the new kind inference implementation. - a,b: infer result kind from constructors (H98 case) - c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail, which now passes - d: GADT case, checking that we don't infer overly rigid kinds when kind-checking the constructors in data family instances. - DataInstanceKindsDefaults tests defaulting data instance kinds without UnliftedNewtypes or UnliftedDatatypes, as outlined in Note [Defaulting result kind of newtype/data family instance]. Also a few notes are updated to reflect the changes. Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones at gmail.com> - - - - - f6493dbc by amesgen at 2025-01-15T18:47:23-05:00 wasm: prevent bundlers from resolving import("node:timers") This fixes the following esbuild error: ✘ [ERROR] Could not resolve "node:timers" www/ghc_wasm_jsffi.js:66:25: 66 │ return (await import("node:timers")).setImmediate; ╵ ~~~~~~~~~~~~~ The package "node:timers" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "--platform=node" to do that, which will remove this error. Previously (i.e. after !13503), one had to work around this by passing `--external:node:timers`. - - - - - 87e82e2e by sheaf at 2025-01-16T14:51:45+01:00 Use checkTyEqRhs to make types concrete This commit refactors makeTypeConcrete to call checkTyEqRhs with the appropriate parameters. This avoids duplicating subtle logic in two places in the compiler. Changes: 1. Refactor of 'TyEqFlags'. Now 'TyEqFlags' stores a 'TEFTask', which is a description of which of the following checks we want to perform in 'checkTyEqRhs': - occurs check - level check - concreteness check In the process, the 'AreUnifying' datatype has been removed, as it is no longer needed. 2. Refactor of 'checkTyVar': a. Make use of the new 'TEFTask' data type to decide which checks to perform. In particular, this ensures that we perform **both** a concreteness check and a level check when both are required; previously we only did a concreteness check (that was a bug!). b. Recursively call 'checkTyVar' on the kind of unfilled metavariables. This deals with a bug in which we failed to uphold the invariant that the kind of a concrete type must itself be concrete. See test cases T23051, T23176. 3. Re-write of 'makeTypeConcrete', which now simply calls 'checkTyEqRhs' with appropriate 'TyEqFlags'/'TEFTask'. This gets rid of code duplication and risk for the two code paths going out-of-sync. Fixes #25616. See also #23883. - - - - - 5a8f35bd by ARATA Mizuki at 2025-01-17T11:17:49-05:00 x86 NCG: Use correct format for MOVD in the implementation of unpackInt64X2# MOVD takes the input format. Fixes #25658 - - - - - 14f8a7ec by Mateusz Goślinowski at 2025-01-17T22:49:09+00:00 Allow multiline strings in JS FFI (#25633) - - - - - 854c2f75 by Simon Peyton Jones at 2025-01-18T02:54:08-05:00 Fix a buglet in tcSplitForAllTyVarsReqTVBindersN The problem was that an equation in `split` had two guards (one about visiblity and one about `n_req`). So it fell thorugh if /either/ was False. But the next equation then assumed an invisible binder. Simple bug, easily fixed. Fixes #25661. - - - - - 264a1186 by sheaf at 2025-01-18T10:05:56+00:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - bf4f5ad3 by Jade at 2025-01-18T10:05:56+00:00 Add structured errors to GHCi (#23338) This patch creates the 'GhciCommandErrorMessage' data type which implents the 'Diagnostic' class and also provides error code for these error conditions. - - - - - b6f54188 by Ben Gamari at 2025-01-18T12:38:46-05:00 Revert "Division by constants optimization" This appears to be responsible for the regression described in #25653. This reverts commit daff1e30219d136977c71f42e82ccc58c9013cfb. - - - - - 0fd90de8 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Introduce div2 test This is a useful test from !8392 which is worth keeping around. - - - - - 32680979 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Test shift correctness in mul2 test - - - - - 163aa50a by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Add regression test for #25653 - - - - - 44778963 by Matthew Pickering at 2025-01-20T11:23:08+00:00 driver: Store an ExternalModuleGraph in the EPS We now store an ExternalModuleGraph in the EPS. When an new interface is loaded, the module graph is extended with a node for the loaded interface. The result is a partial module graph. If you want to run a transitive closure query on the graph you must first force the transitive closure to be loaded by using `loadExternalGraphBelow`. The primary advantage (for now) is that the transitive dependency calculation does not have to be repeated in getLinkDeps. If your module had many dependencies and many splices, performing this calculation at every splice site took a significant amount of time. We might also want to use this module graph in future for considering questions such as reachability of rules or accessibilty of instance imported by levelled imported. This patch removes another place in the compiler where transitive dependency is calculated in an ad-hoc manner. In general, the transitive dependency calculation should be cached and computed using a ModuleGraph abstraction. The transitive dependency query required by getLinkDeps operates on a graph without hs-boot nodes. If a linkable from a module in a loop is needed, then all modules in the loop are necessary to be available to execute that module. Therefore there is a query in `ModuleGraph` and `ExternalModuleGraph` which allows a transitive closure query to be performed on a graph without loops. Fixes #25634 ------------------------- Metric Decrease: MultiLayerModulesTH_Make MultiLayerModulesTH_OneShot Metric Increase: mhu-perf ------------------------- Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com> - - - - - b3c0acfc by Cheng Shao at 2025-01-20T11:53:10-05:00 hie: fix hie.yaml to use default hie-bios script !13778 accidentally changed hie.yaml to use hie-bios.bat as the default hie-bios script, which completely breaks hie support on non-Windows platforms. This patch reverts that change. - - - - - 595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. - - - - - 09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00 Fix :info pretty-printing of UNPACKed fields This patch: * Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int` as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the `:info` command. * Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one unpacks a newtype) from being printed in `:info` output unless `-dppr-debug` is enabled. Fixes #25651. - - - - - 6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00 driver: Store the HomePackageTable in a mutable reference This commit refactors the HomePackageTable and HomeUnitGraph: (1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511) (2) And it reworks these structures into their own modules to simplify the driver. The refactor is driven by the introduction of IO in the HPT interface, but is a bit more aggressive in simplifying the interfaces to enforce correct usage (ie to avoid performance pitfalls). Specifically: - The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph` - The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable` - The HPT now stores an `IORef` with the table of loaded home package modules. - The interface to the HPT now requires IO - The interface now enforces that the HPT is a datastructure that only grows - This is not enforced in the interface, but, clients of the HPT should never care about there being more or less entries in the HPT when these additional entries are not relevant to their result. - The exception to the invariant that the HPT is monotonically increasing is `restrictHpt`, a function which is called at a "barrier point" (during which there are no other threads inspecting or inserting in the HPT). The invariant can be temporarily broken at this point (currently, after upsweep). This is safe because a single thread holds control over the structure (thus the invariant being broken is never observed). The hug_var and associated structures in the driver, which aimed to improve memory usage in the driver by updating in place a HUG during upsweep, are no longer required as the HPT entries in the HUG are now themselves mutable by construction. This was previously explained in Note [ModuleNameSet, efficiency and space leaks], which is no longer relevant and was deleted. Fixes #25511 Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> ------------------------- Metric Decrease: MultiComponentModulesRecomp MultiLayerModulesRecomp ------------------------- - - - - - f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 Fix build with gcc-15 which defaults to C23 standard (-std=gnu23) Fixes #25662 ``` utils/hp2ps/Utilities.c:6:14: error: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c:5:1: error: note: ‘malloc’ is declared in header ‘<stdlib.h>’ 4 | #include "Error.h" +++ |+#include <stdlib.h> 5 | | 5 | | ^ utils/hp2ps/Utilities.c: In function ‘xmalloc’: utils/hp2ps/Utilities.c:80:17: error: error: too many arguments to function ‘malloc’; expected 0, have 1 80 | r = (void*) malloc(n); | ^~~~~~ ~ | 80 | r = (void*) malloc(n); | ^ utils/hp2ps/Utilities.c:6:14: error: note: declared here 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c: In function ‘xrealloc’: utils/hp2ps/Utilities.c:92:18: error: warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:92:18: error: note: ‘realloc’ is declared in header ‘<stdlib.h>’ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:94:9: error: error: too many arguments to function ‘realloc’; expected 0, have 2 94 | r = realloc(p, n); | ^~~~~~~ ~ | 94 | r = realloc(p, n); | ^ utils/hp2ps/Utilities.c:92:18: error: note: declared here 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ ``` - - - - - 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg <rae at cs.brynmawr.edu> - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 58cf8bcc by Matthew Craven at 2025-02-06T21:36:14-05:00 WIP: Implement specially-solved TagToEnum class - - - - - 1c432154 by Matthew Craven at 2025-02-06T21:36:14-05:00 Move dataToTag# lint stuff into checkSpecialPrimOpTypeArgs (It remains commented out.) - - - - - 60b11e93 by Matthew Craven at 2025-02-06T21:36:14-05:00 Remove old tagToEnum# typechecker errors - - - - - 12 changed files: - .ghcid - + .git-blame-ignore-revs - .gitattributes - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/flake.lock - .gitlab/generate-ci/gen_ci.hs - .gitlab/hello.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ead57c6ab2ac4fdcc581bcd9ee5426cc3a055a25...60b11e934b354e5f584ff30d1c1496b3e7eb7b03 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ead57c6ab2ac4fdcc581bcd9ee5426cc3a055a25...60b11e934b354e5f584ff30d1c1496b3e7eb7b03 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 14:13:54 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Fri, 07 Feb 2025 09:13:54 -0500 Subject: [Git][ghc/ghc][wip/T25647] align wildcard with named typevar on wether it is skolem Message-ID: <67a615228774a_326d17eed874104033@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: a25221e6 by Patrick at 2025-02-07T22:13:34+08:00 align wildcard with named typevar on wether it is skolem - - - - - 6 changed files: - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - testsuite/tests/indexed-types/should_compile/T17536.hs - testsuite/tests/indexed-types/should_compile/T17536c.hs - testsuite/tests/typecheck/should_compile/T25647a.hs Changes: ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -777,17 +777,18 @@ There is also the possibility of mentioning a wildcard -} -tcFamTyPats :: TyCon +tcFamTyPats :: (Maybe SkolemInfo) + -> TyCon -> HsFamEqnPats GhcRn -- Patterns -> TcM (TcType, TcKind) -- (lhs_type, lhs_kind) -- Check the LHS of a type/data family instance -- e.g. type instance F ty1 .. tyn = ... -- Used for both type and data families -tcFamTyPats fam_tc hs_pats +tcFamTyPats skol_info fam_tc hs_pats = do { traceTc "tcFamTyPats {" $ vcat [ ppr fam_tc, text "arity:" <+> ppr fam_arity ] - ; mode <- mkHoleMode TypeLevel HM_FamPat + ; mode <- mkHoleMode TypeLevel (HM_FamPat skol_info) -- HM_FamPat: See Note [Wildcards in family instances] in -- GHC.Rename.Module ; let fun_ty = mkTyConApp fam_tc [] @@ -967,7 +968,7 @@ type HoleInfo = Maybe (TcLevel, HoleMode) -- HoleMode says how to treat the occurrences -- of anonymous wildcards; see tcAnonWildCardOcc data HoleMode = HM_Sig -- Partial type signatures: f :: _ -> Int - | HM_FamPat -- Family instances: F _ Int = Bool + | HM_FamPat (Maybe SkolemInfo) -- Family instances: F _ Int = Bool | HM_VTA -- Visible type and kind application: -- f @(Maybe _) -- Maybe @(_ -> _) @@ -990,10 +991,10 @@ mkHoleMode tyki hm , mode_holes = Just (lvl,hm) }) } instance Outputable HoleMode where - ppr HM_Sig = text "HM_Sig" - ppr HM_FamPat = text "HM_FamPat" - ppr HM_VTA = text "HM_VTA" - ppr HM_TyAppPat = text "HM_TyAppPat" + ppr HM_Sig = text "HM_Sig" + ppr (HM_FamPat _) = text "HM_FamPat" + ppr HM_VTA = text "HM_VTA" + ppr HM_TyAppPat = text "HM_TyAppPat" instance Outputable TcTyMode where ppr (TcTyMode { mode_tyki = tyki, mode_holes = hm }) @@ -2212,7 +2213,7 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- esp the bullet on nested forall types = do { kv_details <- newTauTvDetailsAtLevel hole_lvl ; kv_name <- newMetaTyVarName (fsLit "k") - ; wc_details <- newTauTvDetailsAtLevel hole_lvl + ; wc_details <- mk_wc_details ; wc_name <- newMetaTyVarName wc_nm ; let kv = mkTcTyVar kv_name liftedTypeKind kv_details wc_kind = mkTyVarTy kv @@ -2230,17 +2231,21 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- so we have to do it properly (T14140a) ; checkExpectedKind ty (mkTyVarTy wc_tv) wc_kind exp_kind } where + -- make sure we align with none-wild card type variables + mk_wc_details = case hole_mode of + HM_FamPat (Just skol_info) -> return $ SkolemTv skol_info hole_lvl False + _ -> newTauTvDetailsAtLevel hole_lvl -- See Note [Wildcard names] wc_nm = case hole_mode of HM_Sig -> fsLit "w" - HM_FamPat -> fsLit "_" + HM_FamPat _ -> fsLit "_" HM_VTA -> fsLit "w" HM_TyAppPat -> fsLit "_" emit_holes = case hole_mode of - HM_Sig -> True - HM_FamPat -> False - HM_VTA -> False + HM_Sig -> True + HM_FamPat _ -> False + HM_VTA -> False HM_TyAppPat -> False tcAnonWildCardOcc is_extra _ _ _ ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -3253,7 +3253,7 @@ kcTyFamInstEqn tc_fam_tc ; discardResult $ bindOuterFamEqnTKBndrs_Q_Tv outer_bndrs $ - do { (_fam_app, res_kind) <- tcFamTyPats tc_fam_tc hs_pats + do { (_fam_app, res_kind) <- tcFamTyPats Nothing tc_fam_tc hs_pats ; tcCheckLHsTypeInContext hs_rhs_ty (TheKind res_kind) } -- Why "_Tv" here? Consider (#14066) -- type family Bar x y where @@ -3275,7 +3275,7 @@ tcTyFamInstEqn fam_tc mb_clsinfo , feqn_rhs = hs_rhs_ty })) = setSrcSpanA loc $ do { traceTc "tcTyFamInstEqn" $ - vcat [ ppr loc, ppr fam_tc <+> ppr hs_pats + vcat [ ppr loc, ppr fam_tc <+> ppr hs_pats <+> ppr outer_bndrs , text "fam tc bndrs" <+> pprTyVars (tyConTyVars fam_tc) , case mb_clsinfo of NotAssociated {} -> empty @@ -3430,7 +3430,7 @@ tcTyFamInstEqnGuts fam_tc mb_clsinfo outer_hs_bndrs hs_pats hs_rhs_ty ; (tclvl, wanted, (outer_bndrs, (lhs_ty, rhs_ty))) <- pushLevelAndSolveEqualitiesX "tcTyFamInstEqnGuts" $ bindOuterFamEqnTKBndrs skol_info outer_hs_bndrs $ - do { (lhs_ty, rhs_kind) <- tcFamTyPats fam_tc hs_pats + do { (lhs_ty, rhs_kind) <- tcFamTyPats (Just skol_info) fam_tc hs_pats -- Ensure that the instance is consistent with its -- parent class (#16008) ; addConsistencyConstraints mb_clsinfo lhs_ty ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -933,7 +933,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity <- pushLevelAndSolveEqualitiesX "tcDataFamInstHeader" $ bindOuterFamEqnTKBndrs skol_info hs_outer_bndrs $ -- Binds skolem TcTyVars do { stupid_theta <- tcHsContext hs_ctxt - ; (lhs_ty, lhs_kind) <- tcFamTyPats fam_tc hs_pats + ; (lhs_ty, lhs_kind) <- tcFamTyPats (Just skol_info) fam_tc hs_pats ; (lhs_applied_ty, lhs_applied_kind) <- tcInstInvisibleTyBinders lhs_ty lhs_kind -- See Note [Data family/instance return kinds] ===================================== testsuite/tests/indexed-types/should_compile/T17536.hs ===================================== @@ -28,3 +28,27 @@ type family M m where g :: M One -> Int g x = x + + +-- make sure wildcard and non-wildcard type variables are treated the same + +type R1 :: RuntimeRep -> Type +type family R1 r where + R1 r = Int + +r1 :: R1 FloatRep -> Int +r1 x = x + +type L1 :: Levity -> Type +type family L1 l where + L1 l = Int + +l1 :: L1 Unlifted -> Int +l1 x = x + +type M1 :: Multiplicity -> Type +type family M1 m where + M1 m = Int + +g1 :: M1 One -> Int +g1 x = x ===================================== testsuite/tests/indexed-types/should_compile/T17536c.hs ===================================== @@ -11,7 +11,15 @@ import GHC.Exts type R :: forall (r :: RuntimeRep) -> TYPE r -> Type type family R r a where - R _ _ = Int + R r a = Int r :: R FloatRep Float# -> Int r x = x + +-- make sure wildcard and non-wildcard type variables are treated the same +type R1 :: forall (r :: RuntimeRep) -> TYPE r -> Type +type family R1 r a where + R1 r a = Int + +r1 :: R1 FloatRep Float# -> Int +r1 x = x ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -72,3 +72,11 @@ newtype instance Dix5 f = DIn5 (f (Dix5 f)) data family Dix7 :: (k -> TYPE 'IntRep) -> k newtype instance Dix7 f = DIn7 (f (Dix7 f)) + +-- user written wildcards +type Dix8 :: RuntimeRep -> Type +data family Dix8 r +newtype instance Dix8 _ = Dix8 Int + +dix8 :: Dix8 FloatRep -> Int +dix8 (Dix8 x) = x View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a25221e671c9e0d550d844ca843a23a7f08fb5dc -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a25221e671c9e0d550d844ca843a23a7f08fb5dc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 14:16:31 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Fri, 07 Feb 2025 09:16:31 -0500 Subject: [Git][ghc/ghc][wip/T25647] fix T17536c Message-ID: <67a615bf42de8_326d17113ede410626e@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 69aac392 by Patrick at 2025-02-07T22:16:22+08:00 fix T17536c - - - - - 1 changed file: - testsuite/tests/indexed-types/should_compile/T17536c.hs Changes: ===================================== testsuite/tests/indexed-types/should_compile/T17536c.hs ===================================== @@ -11,7 +11,7 @@ import GHC.Exts type R :: forall (r :: RuntimeRep) -> TYPE r -> Type type family R r a where - R r a = Int + R _ _ = Int r :: R FloatRep Float# -> Int r x = x View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/69aac3928c1720d0c6a3ca7b90710ff0fb3b0878 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/69aac3928c1720d0c6a3ca7b90710ff0fb3b0878 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 14:18:47 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Fri, 07 Feb 2025 09:18:47 -0500 Subject: [Git][ghc/ghc][wip/T25647] Fix T9357 Message-ID: <67a6164747660_326d1710a2b101069a2@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 695c17ae by Patrick at 2025-02-07T22:18:39+08:00 Fix T9357 - - - - - 1 changed file: - testsuite/tests/indexed-types/should_fail/T9357.stderr Changes: ===================================== testsuite/tests/indexed-types/should_fail/T9357.stderr ===================================== @@ -1,4 +1,4 @@ T9357.hs:12:15: error: [GHC-91510] - • Illegal polymorphic type: forall (a :: TYPE t). a -> a + Illegal polymorphic type: forall a. a -> a • In the type family instance declaration for ‘F’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/695c17ae7a600fab6b7aecf74c0c9ff1a7682cd7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/695c17ae7a600fab6b7aecf74c0c9ff1a7682cd7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 14:25:53 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 07 Feb 2025 09:25:53 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 10 commits: interpreter: Fix INTERP_STATS profiling code Message-ID: <67a617f17168f_34ce891010444192a@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 4bbdceb9 by Ben Gamari at 2025-02-07T09:25:03-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - aa387b37 by Ben Gamari at 2025-02-07T09:25:03-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - c4b4feea by Ben Gamari at 2025-02-07T09:25:03-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 695e7584 by Ben Gamari at 2025-02-07T09:25:03-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - e3ecf5a7 by Ben Gamari at 2025-02-07T09:25:03-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - d21db194 by Ben Gamari at 2025-02-07T09:25:04-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - 288178d3 by Ben Gamari at 2025-02-07T09:25:04-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - 50fdf33f by Ben Gamari at 2025-02-07T09:25:04-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 22 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/ghc.cabal.in - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -5,6 +5,12 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ViewPatterns #-} +{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} + +{-# HLINT ignore "Use newtype instead of data" #-} +{-# HLINT ignore "Use camelCase" #-} +{-# LANGUAGE DerivingStrategies #-} + import Data.Aeson as A import qualified Data.Map as Map import Data.Map (Map) @@ -199,7 +205,7 @@ data FlavourTrans = data BaseFlavour = Release | Validate | SlowValidate deriving Eq ----------------------------------------------------------------------------- --- Build Configs +-- Build Configurations ----------------------------------------------------------------------------- -- | A standard build config @@ -244,7 +250,7 @@ releaseConfig = vanilla { buildFlavour = Release } debug :: BuildConfig debug = vanilla { buildFlavour = SlowValidate , withAssertions = True - -- WithNuma so at least one job tests Numa + -- WithNuma so at least one job tests Numa , withNuma = True } @@ -280,21 +286,21 @@ usePerfProfilingTestsuite :: BuildConfig -> BuildConfig usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True } ----------------------------------------------------------------------------- --- Platform specific variables +-- Identifying Platforms ----------------------------------------------------------------------------- -- | These tags have to match what we call the runners on gitlab runnerTag :: Arch -> Opsys -> String runnerTag arch (Linux _) = case arch of - Amd64 -> "x86_64-linux" - AArch64 -> "aarch64-linux" - I386 -> "x86_64-linux" -runnerTag AArch64 Darwin = "aarch64-darwin" -runnerTag Amd64 Darwin = "x86_64-darwin-m1" -runnerTag Amd64 Windows = "new-x86_64-windows" + Amd64 -> "x86_64-linux" + AArch64 -> "aarch64-linux" + I386 -> "x86_64-linux" +runnerTag AArch64 Darwin = "aarch64-darwin" +runnerTag Amd64 Darwin = "x86_64-darwin-m1" +runnerTag Amd64 Windows = "new-x86_64-windows" runnerTag Amd64 FreeBSD14 = "x86_64-freebsd14" -runnerTag _ _ = error "Invalid arch/opsys" +runnerTag _ _ = error "Invalid arch/opsys" tags :: Arch -> Opsys -> BuildConfig -> [String] tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use @@ -305,34 +311,34 @@ runnerPerfTag arch sys = runnerTag arch sys ++ "-perf" -- These names are used to find the docker image so they have to match what is -- in the docker registry. distroName :: LinuxDistro -> String -distroName Debian12 = "deb12" -distroName Debian11 = "deb11" -distroName Debian11Js = "deb11-emsdk-closure" +distroName Debian12 = "deb12" +distroName Debian11 = "deb11" +distroName Debian11Js = "deb11-emsdk-closure" distroName Debian12Riscv = "deb12-riscv" -distroName Debian10 = "deb10" -distroName Debian9 = "deb9" -distroName Fedora33 = "fedora33" -distroName Fedora38 = "fedora38" -distroName Ubuntu1804 = "ubuntu18_04" -distroName Ubuntu2004 = "ubuntu20_04" -distroName Ubuntu2204 = "ubuntu22_04" -distroName Centos7 = "centos7" -distroName Alpine312 = "alpine3_12" -distroName Alpine318 = "alpine3_18" -distroName Alpine320 = "alpine3_20" -distroName AlpineWasm = "alpine3_20-wasm" -distroName Rocky8 = "rocky8" +distroName Debian10 = "deb10" +distroName Debian9 = "deb9" +distroName Fedora33 = "fedora33" +distroName Fedora38 = "fedora38" +distroName Ubuntu1804 = "ubuntu18_04" +distroName Ubuntu2004 = "ubuntu20_04" +distroName Ubuntu2204 = "ubuntu22_04" +distroName Centos7 = "centos7" +distroName Alpine312 = "alpine3_12" +distroName Alpine318 = "alpine3_18" +distroName Alpine320 = "alpine3_20" +distroName AlpineWasm = "alpine3_20-wasm" +distroName Rocky8 = "rocky8" opsysName :: Opsys -> String opsysName (Linux distro) = "linux-" ++ distroName distro -opsysName Darwin = "darwin" -opsysName FreeBSD14 = "freebsd14" -opsysName Windows = "windows" +opsysName Darwin = "darwin" +opsysName FreeBSD14 = "freebsd14" +opsysName Windows = "windows" archName :: Arch -> String -archName Amd64 = "x86_64" +archName Amd64 = "x86_64" archName AArch64 = "aarch64" -archName I386 = "i386" +archName I386 = "i386" binDistName :: Arch -> Opsys -> BuildConfig -> String binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc @@ -341,16 +347,18 @@ binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc -- Either the change is reflected by modifying the flavourString or directly (as is -- the case for settings which affect environment variables) testEnv :: Arch -> Opsys -> BuildConfig -> String -testEnv arch opsys bc = intercalate "-" $ - [ archName arch - , opsysName opsys ] - ++ ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] - ++ ["unreg" | unregisterised bc ] - ++ ["numa" | withNuma bc ] - ++ ["zstd" | withZstd bc ] - ++ ["no_tntc" | not (tablesNextToCode bc) ] - ++ ["cross_"++triple | Just triple <- pure $ crossTarget bc ] - ++ [flavourString (mkJobFlavour bc)] +testEnv arch opsys bc = + intercalate "-" $ concat + [ [ archName arch + , opsysName opsys ] + , ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] + , ["unreg" | unregisterised bc ] + , ["numa" | withNuma bc ] + , ["zstd" | withZstd bc ] + , ["no_tntc" | not (tablesNextToCode bc) ] + , ["cross_"++triple | Just triple <- pure $ crossTarget bc ] + , [flavourString (mkJobFlavour bc)] + ] -- | The hadrian flavour string we are going to use for this build flavourString :: Flavour -> String @@ -384,7 +392,7 @@ dockerImage arch (Linux distro) = dockerImage _ _ = Nothing ----------------------------------------------------------------------------- --- Platform specific variables +-- Platform-specific variables ----------------------------------------------------------------------------- -- The variables map is a monoidal map so that we don't ever accidentally lose @@ -438,35 +446,36 @@ opsysVariables _ FreeBSD14 = mconcat , "CABAL_INSTALL_VERSION" =: "3.10.3.0" ] opsysVariables arch (Linux distro) = distroVariables arch distro -opsysVariables AArch64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "aarch64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables Amd64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "x86_64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - -- "# Only Sierra and onwards supports clock_gettime. See #12858" - , "ac_cv_func_clock_gettime" =: "no" - -- # Only newer OS Xs support utimensat. See #17895 - , "ac_cv_func_utimensat" =: "no" - -- # Only newer OS Xs support futimens. See #22938 - , "ac_cv_func_futimens" =: "no" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" +opsysVariables AArch64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "aarch64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + ] +opsysVariables Amd64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "x86_64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + -- Only Sierra and onwards supports clock_gettime. See #12858 + , "ac_cv_func_clock_gettime" =: "no" + -- Only newer OS Xs support utimensat. See #17895 + , "ac_cv_func_utimensat" =: "no" + -- Only newer OS Xs support futimens. See #22938 + , "ac_cv_func_futimens" =: "no" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables _ (Windows {}) = - mconcat [ "MSYSTEM" =: "CLANG64" - , "LANG" =: "en_US.UTF-8" - , "CABAL_INSTALL_VERSION" =: "3.10.2.0" - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - , "GHC_VERSION" =: "9.6.4" ] + ] +opsysVariables _ (Windows {}) = mconcat + [ "MSYSTEM" =: "CLANG64" + , "LANG" =: "en_US.UTF-8" + , "CABAL_INSTALL_VERSION" =: "3.10.2.0" + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + , "GHC_VERSION" =: "9.6.4" + ] opsysVariables _ _ = mempty alpineVariables :: Arch -> Variables @@ -481,7 +490,7 @@ alpineVariables arch = mconcat $ | I386 <- [arch] ] ++ [ brokenTest "T22033" "#25497" | I386 <- [arch] ] ++ - [-- Bootstrap compiler has incorrectly configured target triple #25200 + [ -- Bootstrap compiler has incorrectly configured target triple #25200 "CONFIGURE_ARGS" =: "--enable-ignore-build-platform-mismatch --build=aarch64-unknown-linux --host=aarch64-unknown-linux --target=aarch64-unknown-linux" | AArch64 <- [arch] ] @@ -491,15 +500,14 @@ distroVariables :: Arch -> LinuxDistro -> Variables distroVariables arch Alpine312 = alpineVariables arch distroVariables arch Alpine318 = alpineVariables arch distroVariables arch Alpine320 = alpineVariables arch -distroVariables _ Centos7 = mconcat [ - "HADRIAN_ARGS" =: "--docs=no-sphinx" - , brokenTest "T22012" "#23979" - ] -distroVariables _ Fedora33 = mconcat +distroVariables _ Centos7 = mconcat [ "HADRIAN_ARGS" =: "--docs=no-sphinx" + , brokenTest "T22012" "#23979" + ] +distroVariables _ Fedora33 = mconcat -- LLC/OPT do not work for some reason in our fedora images -- These tests fail with this error: T11649 T5681 T7571 T8131b -- +/opt/llvm/bin/opt: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/opt) --- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) + -- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) [ "LLC" =: "/bin/false" , "OPT" =: "/bin/false" ] @@ -510,7 +518,7 @@ distroVariables _ _ = mempty ----------------------------------------------------------------------------- data Cache - = Cache { cacheKey :: String + = Cache { cacheKey :: String , cachePaths :: [String] } @@ -550,25 +558,27 @@ data ArtifactsWhen = ArtifactsOnSuccess | ArtifactsOnFailure | ArtifactsAlways instance ToJSON ArtifactsWhen where toJSON ArtifactsOnSuccess = "on_success" toJSON ArtifactsOnFailure = "on_failure" - toJSON ArtifactsAlways = "always" + toJSON ArtifactsAlways = "always" ------------------------------------------------------------------------------ +--------------------------------------------------------------------- -- Rules, when do we run a job ------------------------------------------------------------------------------ +--------------------------------------------------------------------- --- Data structure which records the condition when a job is run. -data OnOffRules = OnOffRules { rule_set :: Rule -- ^ The enabled rules - , when :: ManualFlag -- ^ The additional condition about when to run this job. - } +-- | Data structure which records the condition when a job is run. +data OnOffRules + = OnOffRules { rule_set :: Rule -- ^ The enabled rules + , when :: ManualFlag -- ^ The additional condition about when to run this job. + } -- The initial set of rules, which assumes a Validate pipeline which is run with FullCI. emptyRules :: String -> OnOffRules emptyRules jobName = OnOffRules (ValidateOnly jobName (S.fromList [FullCI])) OnSuccess -- When to run the job -data ManualFlag = Manual -- ^ Only run the job when explicitly triggered by a user - | OnSuccess -- ^ Always run it, if the rules pass (the default) - deriving Eq +data ManualFlag + = Manual -- ^ Only run the job when explicitly triggered by a user + | OnSuccess -- ^ Always run it, if the rules pass (the default) + deriving Eq setRule :: Rule -> OnOffRules -> OnOffRules setRule r (OnOffRules _ m) = OnOffRules r m @@ -595,18 +605,23 @@ manualRule rules = rules { when = Manual } enumRules :: OnOffRules -> [OnOffRule] enumRules (OnOffRules r _) = rulesList where - rulesList = case r of - ValidateOnly s rs -> [OnOffRule On (ValidateOnly s rs) - , OnOffRule Off ReleaseOnly - , OnOffRule Off Nightly ] - Nightly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule Off ReleaseOnly - , OnOffRule On Nightly ] - ReleaseOnly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule On ReleaseOnly - , OnOffRule Off Nightly ] - - + rulesList = + case r of + ValidateOnly s rs -> + [ OnOffRule On (ValidateOnly s rs) + , OnOffRule Off ReleaseOnly + , OnOffRule Off Nightly + ] + Nightly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule Off ReleaseOnly + , OnOffRule On Nightly + ] + ReleaseOnly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule On ReleaseOnly + , OnOffRule Off Nightly + ] data OnOffRule = OnOffRule OnOff Rule @@ -617,102 +632,135 @@ instance ToJSON ManualFlag where toJSON OnSuccess = "on_success" instance ToJSON OnOffRules where - toJSON rules = toJSON [object ([ - "if" A..= and_all (map one_rule (enumRules rules)) - , "when" A..= toJSON (when rules)] - -- Necessary to stop manual jobs stopping pipeline progress - -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure - ++ - ["allow_failure" A..= True | when rules == Manual ])] - + toJSON rules = toJSON + [object $ + [ "if" A..= and_all (map one_rule (enumRules rules)) + , "when" A..= toJSON (when rules) + ] ++ + -- Necessary to stop manual jobs stopping pipeline progress + -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure + [ "allow_failure" A..= True | when rules == Manual ] + ] where - one_rule (OnOffRule onoff r) = ruleString onoff r + one_rule (OnOffRule onoff r) = ruleToCond onoff r +--------------------------------------------------------------------- +-- Rule conditions +--------------------------------------------------------------------- -parens :: [Char] -> [Char] -parens s = "(" ++ s ++ ")" -and_all :: [[Char]] -> [Char] -and_all rs = intercalate " && " (map parens rs) -or_all :: [[Char]] -> [Char] -or_all rs = intercalate " || " (map parens rs) +-- | A predicate in GitLab's rules language. +newtype Cond = Cond { getCond :: String } + deriving newtype (ToJSON) --- | A Rule corresponds to some condition which must be satisifed in order to --- run the job. -data Rule = ReleaseOnly -- ^ Only run this job in a release pipeline - | Nightly -- ^ Only run this job in the nightly pipeline - | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. - deriving (Show, Ord, Eq) - -data ValidateRule = - FullCI -- ^ Run this job when the "full-ci" label is present. - | FastCI -- ^ Run this job on every validation pipeline - | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present - | JSBackend -- ^ Run this job when the "javascript" label is present - | RiscV -- ^ Run this job when the "RISC-V" label is present - | WasmBackend -- ^ Run this job when the "wasm" label is present - | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. - | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. - | IpeData -- ^ Run this job when the "IPE" label is set - | TestPrimops -- ^ Run this job when "test-primops" label is set - | I386Backend -- ^ Run this job when the "i386" label is set - deriving (Show, Ord, Eq) - --- A constant evaluating to True because gitlab doesn't support "true" in the +parens :: Cond -> Cond +parens (Cond s) = Cond $ "(" ++ s ++ ")" + +and_all :: [Cond] -> Cond +and_all = + Cond . intercalate " && " . map (getCond . parens) + +or_all :: [Cond] -> Cond +or_all = + Cond . intercalate " || " . map (getCond . parens) + +type Var = String + +varIsSet :: Var -> Cond +varIsSet var = + Cond $ "$" <> var + +-- | A constant evaluating to True because gitlab doesn't support "true" in the -- expression language. -true :: String -true = "\"true\" == \"true\"" --- A constant evaluating to False because gitlab doesn't support "true" in the +true :: Cond +true = Cond "\"true\" == \"true\"" + +-- | A constant evaluating to False because gitlab doesn't support "true" in the -- expression language. -_false :: String -_false = "\"disabled\" != \"disabled\"" - --- Convert the state of the rule into a string that gitlab understand. -ruleString :: OnOff -> Rule -> String -ruleString On (ValidateOnly only_job_name vs) = - let conds = S.toList vs - empty_only_job = envVarNull "ONLY_JOBS" - run_cond = case conds of - [] -> _false - cs -> or_all (map validateRuleString conds) - escape :: String -> String - escape = concatMap (\c -> if c == '+' then "\\+" else [c]) - - in - or_all [ - -- 1. Case when ONLY_JOBS is set - and_all [ "$ONLY_JOBS", "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" ] - -- 2. Case when ONLY_JOBS is null - , and_all [ empty_only_job, run_cond ] - ] -ruleString Off (ValidateOnly {}) = true -ruleString On ReleaseOnly = "$RELEASE_JOB == \"yes\"" -ruleString Off ReleaseOnly = "$RELEASE_JOB != \"yes\"" -ruleString On Nightly = "$NIGHTLY" -ruleString Off Nightly = envVarNull "NIGHTLY" +_false :: Cond +_false = Cond "\"disabled\" != \"disabled\"" + +labelString :: String -> Cond +labelString s = + Cond $ "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" -labelString :: String -> String -labelString s = "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" +branchStringExact :: String -> Cond +branchStringExact = + varEqString "CI_COMMIT_BRANCH" -branchStringExact :: String -> String -branchStringExact s = envVarString "CI_COMMIT_BRANCH" s +branchStringLike :: String -> Cond +branchStringLike s = + Cond $ "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" -branchStringLike :: String -> String -branchStringLike s = "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" +varEqString :: String -> String -> Cond +varEqString var s = + Cond $ "$" ++ var ++ " == \"" ++ s ++ "\"" -envVarString :: String -> String -> String -envVarString var s = "$" ++ var ++ " == \"" ++ s ++ "\"" +varNeString :: String -> String -> Cond +varNeString var s = + Cond $ "$" ++ var ++ " != \"" ++ s ++ "\"" -envVarNull :: String -> String -envVarNull var = "$" ++ var ++ " == null" +varIsNull :: String -> Cond +varIsNull var = + Cond $ "$" ++ var ++ " == null" +--------------------------------------------------------------------- +-- Our Rules +--------------------------------------------------------------------- -validateRuleString :: ValidateRule -> String -validateRuleString FullCI = or_all ([ labelString "full-ci" - , labelString "marge_bot_batch_merge_job" - , branchStringExact "master" - , branchStringLike "ghc-[0-9]+\\.[0-9]+" - ]) -validateRuleString FastCI = true +-- | A Rule corresponds to some condition which must be satisifed in order to +-- run the job. +data Rule + = ReleaseOnly -- ^ Only run this job in a release pipeline + | Nightly -- ^ Only run this job in the nightly pipeline + | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. + deriving (Show, Ord, Eq) + +data ValidateRule + = FullCI -- ^ Run this job when the "full-ci" label is present. + | FastCI -- ^ Run this job on every validation pipeline + | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present + | JSBackend -- ^ Run this job when the "javascript" label is present + | RiscV -- ^ Run this job when the "RISC-V" label is present + | WasmBackend -- ^ Run this job when the "wasm" label is present + | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. + | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. + | IpeData -- ^ Run this job when the "IPE" label is set + | TestPrimops -- ^ Run this job when "test-primops" label is set + | I386Backend -- ^ Run this job when the "i386" label is set + deriving (Show, Ord, Eq) + +-- | Convert the state of the rule into a string that gitlab understand. +ruleToCond :: OnOff -> Rule -> Cond +ruleToCond On (ValidateOnly only_job_name vs) = + or_all + [ -- 1. Case when ONLY_JOBS is set + and_all [ varIsSet "ONLY_JOBS" + , Cond $ "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" + ] + -- 2. Case when ONLY_JOBS is null + , and_all [ varIsNull "ONLY_JOBS" + , case S.toList vs of + [] -> _false + cs -> or_all (map validateRuleString cs) + ] + ] + where + escape :: String -> String + escape = concatMap (\c -> if c == '+' then "\\+" else [c]) +ruleToCond Off (ValidateOnly {}) = true +ruleToCond On ReleaseOnly = "RELEASE_JOB" `varEqString` "yes" +ruleToCond Off ReleaseOnly = "RELEASE_JOB" `varNeString` "yes" +ruleToCond On Nightly = varIsSet "NIGHTLY" +ruleToCond Off Nightly = varIsNull "NIGHTLY" + + +validateRuleString :: ValidateRule -> Cond +validateRuleString FullCI = or_all [ labelString "full-ci" + , labelString "marge_bot_batch_merge_job" + , branchStringExact "master" + , branchStringLike "ghc-[0-9]+\\.[0-9]+" + ] +validateRuleString FastCI = true validateRuleString LLVMBackend = labelString "LLVM backend" validateRuleString JSBackend = labelString "javascript" @@ -724,6 +772,10 @@ validateRuleString IpeData = labelString "IPE" validateRuleString TestPrimops = labelString "test-primops" validateRuleString I386Backend = labelString "i386" +--------------------------------------------------------------------- +-- The Job type +--------------------------------------------------------------------- + -- | A 'Job' is the description of a single job in a gitlab pipeline. The -- job contains all the information about how to do the build but can be further -- modified with information about when to run jobs, which variables to set for @@ -747,15 +799,15 @@ data Job instance ToJSON Job where toJSON Job{..} = object [ "stage" A..= jobStage - -- Convoluted to avoid download artifacts from ghci job - -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts + -- Convoluted to avoid download artifacts from ghci job + -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts , "needs" A..= map (\j -> object [ "job" A..= j, "artifacts" A..= False ]) jobNeeds , "dependencies" A..= jobDependencies , "image" A..= jobDockerImage , "tags" A..= jobTags , "allow_failure" A..= jobAllowFailure - -- Joining up variables like this may well be the wrong thing to do but - -- at least it doesn't lose information silently by overriding. + -- Joining up variables like this may well be the wrong thing to do but + -- at least it doesn't lose information silently by overriding. , "variables" A..= fmap unwords jobVariables , "artifacts" A..= jobArtifacts , "cache" A..= jobCache @@ -783,7 +835,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } = [ "bash .gitlab/ci.sh setup" , "bash .gitlab/ci.sh configure" , "bash .gitlab/ci.sh build_hadrian" - , "bash .gitlab/ci.sh test_hadrian" ] + , "bash .gitlab/ci.sh test_hadrian" + ] | otherwise = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++ [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++ @@ -803,7 +856,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } [ ".gitlab/ci.sh save_cache" , ".gitlab/ci.sh save_test_output" , ".gitlab/ci.sh clean" - , "cat ci_timings" ] + , "cat ci_timings" + ] jobFlavour = mkJobFlavour buildConfig @@ -819,9 +873,11 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig) , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig) , case crossEmulator buildConfig of - NoEmulator -> case crossTarget buildConfig of - Nothing -> mempty - Just _ -> "CROSS_EMULATOR" =: "NOT_SET" -- we need an emulator but it isn't set. Won't run the testsuite + NoEmulator + -- we need an emulator but it isn't set. Won't run the testsuite + | Just _ <- crossTarget buildConfig + -> "CROSS_EMULATOR" =: "NOT_SET" + | otherwise -> mempty Emulator s -> "CROSS_EMULATOR" =: s NoEmulatorNeeded -> mempty , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty @@ -901,8 +957,10 @@ setVariable k v j = j { jobVariables = MonoidalMap $ Map.insert k [v] $ unMonoid delVariable :: String -> Job -> Job delVariable k j = j { jobVariables = MonoidalMap $ Map.delete k $ unMonoidalMap $ jobVariables j } +--------------------------------------------------------------------- -- Building the standard jobs --- +--------------------------------------------------------------------- + -- | Make a normal validate CI job validate :: Arch -> Opsys -> BuildConfig -> NamedJob Job validate = job @@ -919,15 +977,27 @@ releaseRule = setJobRule ReleaseOnly nightly :: Arch -> Opsys -> BuildConfig -> NamedJob Job nightly arch opsys bc = let NamedJob n j = job arch opsys bc - in NamedJob { name = "nightly-" ++ n, jobInfo = nightlyRule . keepArtifacts "8 weeks" . highCompression $ j} + in NamedJob { name = "nightly-" ++ n + , jobInfo = nightlyRule + . keepArtifacts "8 weeks" + . highCompression $ j + } -- | Make a normal release CI job release :: Arch -> Opsys -> BuildConfig -> NamedJob Job release arch opsys bc = let NamedJob n j = job arch opsys (bc { buildFlavour = Release }) - in NamedJob { name = "release-" ++ n, jobInfo = releaseRule . keepArtifacts "1 year" . ignorePerfFailures . useHashUnitIds . highCompression $ j} + in NamedJob { name = "release-" ++ n + , jobInfo = releaseRule + . keepArtifacts "1 year" + . ignorePerfFailures + . useHashUnitIds + . highCompression $ j + } +--------------------------------------------------------------------- -- Specific job modification functions +--------------------------------------------------------------------- -- | Mark a job as requiring a manual trigger. manual :: Job -> Job @@ -984,6 +1054,10 @@ onlyRule t = modifyValidateJobs (onlyValidateJobRule t) disableValidate :: JobGroup Job -> JobGroup Job disableValidate = modifyValidateJobs (removeValidateJobRule FastCI . removeValidateJobRule FullCI) +--------------------------------------------------------------------- +-- NamedJob +--------------------------------------------------------------------- + data NamedJob a = NamedJob { name :: String, jobInfo :: a } deriving (Show, Functor) renameJob :: (String -> String) -> NamedJob a -> NamedJob a @@ -994,14 +1068,18 @@ instance ToJSON a => ToJSON (NamedJob a) where [ "name" A..= name nj , "jobInfo" A..= jobInfo nj ] - ---data NamedJobGroup a = NamedJobGroup { platform :: String, jg :: JobGroup a } +--------------------------------------------------------------------- +-- JobGroup +--------------------------------------------------------------------- -- Jobs are grouped into either triples or pairs depending on whether the -- job is just validate and nightly, or also release. -data JobGroup a = StandardTriple { v :: Maybe (NamedJob a) - , n :: Maybe (NamedJob a) - , r :: Maybe (NamedJob a) } deriving (Functor, Show) +data JobGroup a + = StandardTriple { v :: Maybe (NamedJob a) + , n :: Maybe (NamedJob a) + , r :: Maybe (NamedJob a) + } + deriving (Functor, Show) instance ToJSON a => ToJSON (JobGroup a) where toJSON StandardTriple{..} = object @@ -1039,16 +1117,19 @@ flattenJobGroup (StandardTriple a b c) = map flattenNamedJob (catMaybes [a,b,c]) flattenNamedJob :: NamedJob a -> (String, a) flattenNamedJob (NamedJob n i) = (n, i) - -- | Specification for all the jobs we want to build. jobs :: Map String Job -jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups +jobs = Map.fromList $ concatMap flattenJobGroup job_groups + +--------------------------------------------------------------------- +-- Job definitions +--------------------------------------------------------------------- debian_x86 :: [JobGroup Job] debian_x86 = [ -- Release configurations - -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 - -- not being at EOL until April 2023 and they still need tinfo5. + -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 + -- not being at EOL until April 2023 and they still need tinfo5. disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) , disableValidate (standardBuilds Amd64 (Linux Debian10)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) @@ -1056,15 +1137,15 @@ debian_x86 = , disableValidate (standardBuilds Amd64 (Linux Debian12)) - -- Validate only builds + -- Validate only builds , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) , validateBuilds Amd64 (Linux validate_debian) nativeInt , validateBuilds Amd64 (Linux validate_debian) unreg - -- More work is needed to address TSAN failures: #22520 + -- More work is needed to address TSAN failures: #22520 , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) , -- Nightly allowed to fail: #22343 modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) - -- Run the 'perf' profiling nightly job in the release config. + -- Run the 'perf' profiling nightly job in the release config. , perfProfilingJob Amd64 (Linux Debian12) releaseConfig , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) @@ -1095,7 +1176,7 @@ debian_aarch64 = [ disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) - -- LLVM backend bootstrap + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] @@ -1120,11 +1201,10 @@ rhel_x86 = fedora_x86 :: [JobGroup Job] fedora_x86 = - [ - -- Fedora33 job is always built with perf so there's one job in the normal - -- validate pipeline which is built with perf. + [ -- Fedora33 job is always built with perf so there's one job in the normal + -- validate pipeline which is built with perf. fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) - -- This job is only for generating head.hackage docs + -- This job is only for generating head.hackage docs , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) , disableValidate (standardBuilds Amd64 (Linux Fedora38)) @@ -1154,7 +1234,7 @@ alpine_x86 = [ -- Fully static build, in theory usable on any linux distribution. fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) - -- Dynamically linked build, suitable for building your own static executables on alpine + -- Dynamically linked build, suitable for building your own static executables on alpine , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) , allowFailureGroup (standardBuildsWithConfig I386 (Linux Alpine320) (splitSectionsBroken vanilla)) @@ -1173,16 +1253,16 @@ alpine_aarch64 = [ cross_jobs :: [JobGroup Job] cross_jobs = [ - -- x86 -> aarch64 + -- x86 -> aarch64 validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - -- x86_64 -> riscv + -- x86_64 -> riscv , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian12Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing)) - -- Javascript + -- Javascript , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) - -- Wasm + -- Wasm , make_wasm_jobs wasm_build_config , modifyValidateJobs manual $ make_wasm_jobs wasm_build_config {bignumBackend = Native} @@ -1203,10 +1283,9 @@ cross_jobs = [ wasm_build_config = (crossConfig "wasm32-wasi" NoEmulatorNeeded Nothing) - { - hostFullyStatic = True - , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet - , textWithSIMDUTF = True + { hostFullyStatic = True + , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet + , textWithSIMDUTF = True } job_groups :: [JobGroup Job] @@ -1224,6 +1303,9 @@ job_groups = ++ cross_jobs ++ freebsd_jobs +--------------------------------------------------------------------- +-- Platform mapping for GHCup metadata +--------------------------------------------------------------------- mkPlatform :: Arch -> Opsys -> String mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys @@ -1267,7 +1349,11 @@ platform_mapping = Map.map go combined_result , "release-x86_64-windows-release" ] - process sel = Map.fromListWith combine [ (uncurry mkPlatform (jobPlatform (jobInfo $ j)), j) | (sel -> Just j) <- job_groups ] + process sel = + Map.fromListWith combine + [ (uncurry mkPlatform (jobPlatform (jobInfo j)), j) + | (sel -> Just j) <- job_groups + ] vs = process v ns = process n @@ -1275,10 +1361,13 @@ platform_mapping = Map.map go combined_result all_platforms = Map.keysSet vs <> Map.keysSet ns <> Map.keysSet rs - combined_result = Map.fromList [ (p, StandardTriple { v = Map.lookup p vs - , n = Map.lookup p ns - , r = Map.lookup p rs }) - | p <- S.toList all_platforms ] + combined_result = + Map.fromList + [ (p, StandardTriple { v = Map.lookup p vs + , n = Map.lookup p ns + , r = Map.lookup p rs }) + | p <- S.toList all_platforms + ] combine a b | name a `elem` whitelist = a -- Explicitly selected @@ -1293,6 +1382,9 @@ data BindistInfo = BindistInfo { bindistName :: String } deriving Show instance ToJSON BindistInfo where toJSON (BindistInfo n) = object [ "bindistName" A..= n ] +--------------------------------------------------------------------- +-- Main entrypoint +--------------------------------------------------------------------- main :: IO () main = do ===================================== compiler/GHC.hs ===================================== @@ -420,7 +420,6 @@ import GHC.Types.Name.Ppr import GHC.Types.TypeEnv import GHC.Types.Breakpoint import GHC.Types.PkgQual -import GHC.Types.Unique.FM import GHC.Unit import GHC.Unit.Env as UnitEnv @@ -705,7 +704,7 @@ setTopSessionDynFlags :: GhcMonad m => DynFlags -> m () setTopSessionDynFlags dflags = do hsc_env <- getSession logger <- getLogger - lookup_cache <- liftIO $ newMVar emptyUFM + lookup_cache <- liftIO $ mkInterpSymbolCache -- Interpreter interp <- if ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -2,6 +2,7 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -12,7 +13,6 @@ module GHC.ByteCode.Linker ( linkBCO , lookupStaticPtr , lookupIE - , nameToCLabel , linkFail ) where @@ -26,7 +26,6 @@ import GHCi.ResolvedBCO import GHC.Builtin.PrimOps import GHC.Builtin.PrimOps.Ids -import GHC.Builtin.Names import GHC.Unit.Types @@ -43,8 +42,6 @@ import GHC.Types.Name.Env import qualified GHC.Types.Id as Id import GHC.Types.Unique.DFM -import Language.Haskell.Syntax.Module.Name - -- Standard libraries import Data.Array.Unboxed import Foreign.Ptr @@ -92,30 +89,30 @@ lookupLiteral interp pkgs_loaded le ptr = case ptr of lookupStaticPtr :: Interp -> FastString -> IO (Ptr ()) lookupStaticPtr interp addr_of_label_string = do - m <- lookupSymbol interp addr_of_label_string + m <- lookupSymbol interp (IFaststringSymbol addr_of_label_string) case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker: can't find label" - (unpackFS addr_of_label_string) + (ppr addr_of_label_string) lookupIE :: Interp -> PkgsLoaded -> ItblEnv -> Name -> IO (Ptr ()) lookupIE interp pkgs_loaded ie con_nm = case lookupNameEnv ie con_nm of Just (_, ItblPtr a) -> return (fromRemotePtr (castRemotePtr a)) Nothing -> do -- try looking up in the object files. - let sym_to_find1 = nameToCLabel con_nm "con_info" - m <- lookupHsSymbol interp pkgs_loaded con_nm "con_info" + let sym_to_find1 = IConInfoSymbol con_nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find1 case m of Just addr -> return addr Nothing -> do -- perhaps a nullary constructor? - let sym_to_find2 = nameToCLabel con_nm "static_info" - n <- lookupHsSymbol interp pkgs_loaded con_nm "static_info" + let sym_to_find2 = IStaticInfoSymbol con_nm + n <- lookupHsSymbol interp pkgs_loaded sym_to_find2 case n of Just addr -> return addr Nothing -> linkFail "GHC.ByteCode.Linker.lookupIE" - (unpackFS sym_to_find1 ++ " or " ++ - unpackFS sym_to_find2) + (ppr sym_to_find1 <> " or " <> + ppr sym_to_find2) -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode lookupAddr :: Interp -> PkgsLoaded -> AddrEnv -> Name -> IO (Ptr ()) @@ -123,21 +120,21 @@ lookupAddr interp pkgs_loaded ae addr_nm = do case lookupNameEnv ae addr_nm of Just (_, AddrPtr ptr) -> return (fromRemotePtr ptr) Nothing -> do -- try looking up in the object files. - let sym_to_find = nameToCLabel addr_nm "bytes" + let sym_to_find = IBytesSymbol addr_nm -- see Note [Bytes label] in GHC.Cmm.CLabel - m <- lookupHsSymbol interp pkgs_loaded addr_nm "bytes" + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker.lookupAddr" - (unpackFS sym_to_find) + (ppr sym_to_find) lookupPrimOp :: Interp -> PkgsLoaded -> PrimOp -> IO (RemotePtr ()) lookupPrimOp interp pkgs_loaded primop = do let sym_to_find = primopToCLabel primop "closure" - m <- lookupHsSymbol interp pkgs_loaded (Id.idName $ primOpId primop) "closure" + m <- lookupHsSymbol interp pkgs_loaded (IClosureSymbol (Id.idName $ primOpId primop)) case m of Just p -> return (toRemotePtr p) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" (text sym_to_find) resolvePtr :: Interp @@ -157,11 +154,11 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of | otherwise -> assertPpr (isExternalName nm) (ppr nm) $ do - let sym_to_find = nameToCLabel nm "closure" - m <- lookupHsSymbol interp pkgs_loaded nm "closure" + let sym_to_find = IClosureSymbol nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p)) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find) + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (ppr sym_to_find) BCOPtrPrimOp op -> ResolvedBCOStaticPtr <$> lookupPrimOp interp pkgs_loaded op @@ -176,11 +173,10 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of -- loaded units. -- -- See Note [Looking up symbols in the relevant objects]. -lookupHsSymbol :: Interp -> PkgsLoaded -> Name -> String -> IO (Maybe (Ptr ())) -lookupHsSymbol interp pkgs_loaded nm sym_suffix = do - massertPpr (isExternalName nm) (ppr nm) - let sym_to_find = nameToCLabel nm sym_suffix - pkg_id = moduleUnitId $ nameModule nm +lookupHsSymbol :: Interp -> PkgsLoaded -> InterpSymbol (Suffix s) -> IO (Maybe (Ptr ())) +lookupHsSymbol interp pkgs_loaded sym_to_find = do + massertPpr (isExternalName (interpSymbolName sym_to_find)) (ppr sym_to_find) + let pkg_id = moduleUnitId $ nameModule (interpSymbolName sym_to_find) loaded_dlls = maybe [] loaded_pkg_hs_dlls $ lookupUDFM pkgs_loaded pkg_id go (dll:dlls) = do @@ -194,12 +190,12 @@ lookupHsSymbol interp pkgs_loaded nm sym_suffix = do go loaded_dlls -linkFail :: String -> String -> IO a +linkFail :: String -> SDoc -> IO a linkFail who what = throwGhcExceptionIO (ProgramError $ unlines [ "",who , "During interactive linking, GHCi couldn't find the following symbol:" - , ' ' : ' ' : what + , ' ' : ' ' : showSDocUnsafe what , "This may be due to you not asking GHCi to load extra object files," , "archives or DLLs needed by your current session. Restart GHCi, specifying" , "the missing library using the -L/path/to/object/dir and -lmissinglibname" @@ -210,28 +206,8 @@ linkFail who what ]) -nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastStringByteString label - where - encodeZ = fastZStringToByteString . zEncodeFS - (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of - -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers - -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. - mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS - mod -> mod - packagePart = encodeZ (unitFS pkgKey) - modulePart = encodeZ (moduleNameFS modName) - occPart = encodeZ $ occNameMangledFS (nameOccName n) - - label = mconcat $ - [ packagePart `mappend` "_" | pkgKey /= mainUnit ] - ++ - [modulePart - , "_" - , occPart - , "_" - , fromString suffix - ] + + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2901,7 +2901,7 @@ jsCodeGen hsc_env srcspan i this_mod stg_binds_with_deps binding_id = do jsLinkObject logger tmpfs tmp_dir js_config unit_env inst out_obj roots -- look up "id_sym" closure and create a StablePtr (HValue) from it - href <- lookupClosure interp (unpackFS id_sym) >>= \case + href <- lookupClosure interp (IFaststringSymbol id_sym) >>= \case Nothing -> pprPanic "Couldn't find just linked TH closure" (ppr id_sym) Just r -> pure r ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -217,12 +217,12 @@ loadName interp hsc_env name = do case lookupNameEnv (closure_env (linker_env pls)) name of Just (_,aa) -> return (pls,(aa, links, pkgs)) Nothing -> assertPpr (isExternalName name) (ppr name) $ - do let sym_to_find = nameToCLabel name "closure" - m <- lookupClosure interp (unpackFS sym_to_find) + do let sym_to_find = IClosureSymbol name + m <- lookupClosure interp sym_to_find r <- case m of Just hvref -> mkFinalizedHValue interp hvref Nothing -> linkFail "GHC.Linker.Loader.loadName" - (unpackFS sym_to_find) + (ppr sym_to_find) return (pls,(r, links, pkgs)) loadDependencies @@ -909,7 +909,7 @@ dynLoadObjs interp hsc_env pls at LoaderState{..} objs = do m <- loadDLL interp soFile case m of Right _ -> return $! pls { temp_sos = (libPath, libName) : temp_sos } - Left err -> linkFail msg err + Left err -> linkFail msg (text err) where msg = "GHC.Linker.Loader.dynLoadObjs: Loading temp shared object failed" ===================================== compiler/GHC/Runtime/Interpreter.hs ===================================== @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} -- | Interacting with the iserv interpreter, whether it is running on an -- external process or in the current process. @@ -83,7 +84,6 @@ import GHC.Data.Maybe import GHC.Data.FastString import GHC.Types.SrcLoc -import GHC.Types.Unique.FM import GHC.Types.Basic import GHC.Utils.Panic @@ -116,6 +116,12 @@ import GHC.Stack.CCS (CostCentre,CostCentreStack) import System.Directory import System.Process +import GHC.Builtin.Names +import GHC.Types.Name + +-- Standard libraries +import GHC.Exts + {- Note [Remote GHCi] ~~~~~~~~~~~~~~~~~~ When the flag -fexternal-interpreter is given to GHC, interpreted code @@ -457,38 +463,65 @@ handleSeqHValueStatus interp unit_env eval_status = initObjLinker :: Interp -> IO () initObjLinker interp = interpCmd interp InitLinker -lookupSymbol :: Interp -> FastString -> IO (Maybe (Ptr ())) +lookupSymbol :: Interp -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbol interp str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) ExtWasm i -> withWasmInterp i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) -lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> FastString -> IO (Maybe (Ptr ())) +lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbolInDLL interp dll str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbolInDLL dll (unpackFS str)) + sendMessage inst (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) -- wasm dyld doesn't track which symbol comes from which .so ExtWasm {} -> lookupSymbol interp str -lookupClosure :: Interp -> String -> IO (Maybe HValueRef) +interpSymbolToCLabel :: forall s . InterpSymbol s -> FastString +interpSymbolToCLabel s = eliminateInterpSymbol s interpretedInterpSymbol $ \is -> + let + n = interpSymbolName is + suffix = interpSymbolSuffix is + + encodeZ = fastZStringToByteString . zEncodeFS + (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of + -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. + mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS + mod -> mod + packagePart = encodeZ (unitFS pkgKey) + modulePart = encodeZ (moduleNameFS modName) + occPart = encodeZ $ occNameMangledFS (nameOccName n) + + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix + ] + in mkFastStringByteString label + +lookupClosure :: Interp -> InterpSymbol s -> IO (Maybe HValueRef) lookupClosure interp str = - interpCmd interp (LookupClosure str) + interpCmd interp (LookupClosure (unpackFS (interpSymbolToCLabel str))) -- | 'withSymbolCache' tries to find a symbol in the 'interpLookupSymbolCache' -- which maps symbols to the address where they are loaded. @@ -496,7 +529,7 @@ lookupClosure interp str = -- a miss we run the action which determines the symbol's address and populate -- the cache with the answer. withSymbolCache :: Interp - -> FastString + -> InterpSymbol s -- ^ The symbol we are looking up in the cache -> IO (Maybe (Ptr ())) -- ^ An action which determines the address of the symbol we @@ -513,21 +546,19 @@ withSymbolCache interp str determine_addr = do -- The analysis in #23415 further showed this cache should also benefit the -- internal interpreter's loading times, and needn't be used by the external -- interpreter only. - cache <- readMVar (interpLookupSymbolCache interp) - case lookupUFM cache str of - Just p -> return (Just p) + cached_val <- lookupInterpSymbolCache str (interpSymbolCache interp) + case cached_val of + Just {} -> return cached_val Nothing -> do - maddr <- determine_addr case maddr of Nothing -> return Nothing Just p -> do - let upd_cache cache' = addToUFM cache' str p - modifyMVar_ (interpLookupSymbolCache interp) (pure . upd_cache) - return (Just p) + updateInterpSymbolCache str (interpSymbolCache interp) p + return maddr purgeLookupSymbolCache :: Interp -> IO () -purgeLookupSymbolCache interp = modifyMVar_ (interpLookupSymbolCache interp) (const (pure emptyUFM)) +purgeLookupSymbolCache interp = purgeInterpSymbolCache (interpSymbolCache interp) -- | loadDLL loads a dynamic library using the OS's native linker -- (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either ===================================== compiler/GHC/Runtime/Interpreter/Types.hs ===================================== @@ -1,4 +1,6 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} -- | Types used by the runtime interpreter module GHC.Runtime.Interpreter.Types @@ -10,6 +12,20 @@ module GHC.Runtime.Interpreter.Types , ExtInterpInstance (..) , ExtInterpState (..) , InterpStatus(..) + -- * InterpSymbolCache + , InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + + -- * IServ , IServ , IServConfig(..) @@ -30,9 +46,6 @@ import GHC.Linker.Types import GHCi.RemoteTypes import GHCi.Message ( Pipe ) -import GHC.Types.Unique.FM -import GHC.Data.FastString ( FastString ) -import Foreign import GHC.Platform import GHC.Utils.TmpFs @@ -42,6 +55,7 @@ import GHC.Unit.State import GHC.Unit.Types import GHC.StgToJS.Types import GHC.StgToJS.Linker.Types +import GHC.Runtime.Interpreter.Types.SymbolCache import Control.Concurrent import System.Process ( ProcessHandle, CreateProcess ) @@ -56,7 +70,7 @@ data Interp = Interp , interpLoader :: !Loader -- ^ Interpreter loader - , interpLookupSymbolCache :: !(MVar (UniqFM FastString (Ptr ()))) + , interpSymbolCache :: !InterpSymbolCache -- ^ LookupSymbol cache } ===================================== compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs ===================================== @@ -0,0 +1,142 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} + +-- | The SymbolCache is used to cache lookups for specific symbols when using +-- the interpreter. +module GHC.Runtime.Interpreter.Types.SymbolCache ( + InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + ) where + +import GHC.Prelude + +import GHC.Types.Unique.FM +import GHC.Types.Name +import GHC.Data.FastString +import Foreign + +import Control.Concurrent +import GHC.Utils.Outputable +import GHC.TypeLits + + +-- The symbols records the suffix which each cache deals with. +newtype SymbolCache (s :: Symbol) = SymbolCache { _getSymbolCache :: UniqFM Name (Ptr ()) } + +-- Each cache is keyed by Name, there is one cache for each type of symbol we will +-- potentially lookup. The caches are keyed by 'Name' so that it is not necessary to consult +-- a complicated `FastString` each time. +data InterpSymbolCache = InterpSymbolCache { + interpClosureCache :: MVar (SymbolCache "closure") + , interpConInfoCache :: MVar (SymbolCache "con_info") + , interpStaticInfoCache :: MVar (SymbolCache "static_info") + , interpBytesCache :: MVar (SymbolCache "bytes") + , interpFaststringCache :: MVar (UniqFM FastString (Ptr ())) + } + +data SuffixOrInterpreted = Suffix Symbol | Interpreted + +data InterpSymbol (s :: SuffixOrInterpreted) where + IClosureSymbol :: Name -> InterpSymbol (Suffix "closure") + IConInfoSymbol :: Name -> InterpSymbol (Suffix "con_info") + IStaticInfoSymbol :: Name -> InterpSymbol (Suffix "static_info") + IBytesSymbol :: Name -> InterpSymbol (Suffix "bytes") + IFaststringSymbol :: FastString -> InterpSymbol Interpreted + +instance Outputable (InterpSymbol s) where + ppr s = eliminateInterpSymbol s + (\(IFaststringSymbol s) -> text "interpreted:" <> ppr s) + (\s -> text (interpSymbolSuffix s) <> colon <> ppr (interpSymbolName s)) + +eliminateInterpSymbol :: InterpSymbol s -> (InterpSymbol Interpreted -> r) + -> (forall x . InterpSymbol (Suffix x) -> r) + -> r +eliminateInterpSymbol s k1 k2 = + case s of + IFaststringSymbol {} -> k1 s + IBytesSymbol {} -> k2 s + IStaticInfoSymbol {} -> k2 s + IConInfoSymbol {} -> k2 s + IClosureSymbol {} -> k2 s + + +interpSymbolName :: InterpSymbol (Suffix s) -> Name +interpSymbolName (IClosureSymbol n) = n +interpSymbolName (IConInfoSymbol n) = n +interpSymbolName (IStaticInfoSymbol n) = n +interpSymbolName (IBytesSymbol n) = n + +interpretedInterpSymbol :: InterpSymbol Interpreted -> FastString +interpretedInterpSymbol (IFaststringSymbol s) = s + +interpSymbolSuffix :: InterpSymbol (Suffix s) -> String +interpSymbolSuffix (IClosureSymbol {}) = "closure" +interpSymbolSuffix (IConInfoSymbol {}) = "con_info" +interpSymbolSuffix (IStaticInfoSymbol {}) = "static_info" +interpSymbolSuffix (IBytesSymbol {}) = "bytes" + +emptySymbolCache :: SymbolCache s +emptySymbolCache = SymbolCache emptyUFM + +lookupSymbolCache :: InterpSymbol (Suffix s) -> SymbolCache s -> Maybe (Ptr ()) +lookupSymbolCache s (SymbolCache cache) = lookupUFM cache (interpSymbolName s) + +insertSymbolCache :: InterpSymbol (Suffix s) -> Ptr () -> SymbolCache s -> SymbolCache s +insertSymbolCache s v (SymbolCache cache) = SymbolCache (addToUFM cache (interpSymbolName s) v) + +lookupInterpSymbolCache :: InterpSymbol s -> InterpSymbolCache -> IO (Maybe (Ptr ())) +lookupInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var -> (\cache -> lookupUFM cache f) <$> readMVar mvar_var) + (\s mvar_var -> lookupSymbolCache s <$> readMVar mvar_var) + + +updateInterpSymbolCache :: InterpSymbol s + -> InterpSymbolCache -> Ptr () -> IO () +updateInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ addToUFM cache f v)) + (\s mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ insertSymbolCache s v cache)) + +withInterpSymbolCache :: + (InterpSymbol Interpreted -> MVar (UniqFM FastString (Ptr ())) -> r) + -> (forall x . InterpSymbol (Suffix x) -> MVar (SymbolCache x) -> r) + -> InterpSymbol s + -> InterpSymbolCache + -> r +withInterpSymbolCache k1 k2 key InterpSymbolCache{..} = + case key of + IClosureSymbol {} -> k2 key interpClosureCache + IConInfoSymbol {} -> k2 key interpConInfoCache + IStaticInfoSymbol {} -> k2 key interpStaticInfoCache + IBytesSymbol {} -> k2 key interpBytesCache + IFaststringSymbol {} -> k1 key interpFaststringCache + +-- | Clear all symbol caches. +purgeInterpSymbolCache :: InterpSymbolCache -> IO () +purgeInterpSymbolCache (InterpSymbolCache a b c d e) = do + modifyMVar_ a (\_ -> do + modifyMVar_ b (\_ -> do + modifyMVar_ c (\_ -> do + modifyMVar_ d (\_ -> do + modifyMVar_ e (\_ -> pure emptyUFM) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + +mkInterpSymbolCache :: IO InterpSymbolCache +mkInterpSymbolCache = do + InterpSymbolCache <$> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptyUFM ===================================== compiler/ghc.cabal.in ===================================== @@ -699,6 +699,7 @@ Library GHC.Runtime.Interpreter.JS GHC.Runtime.Interpreter.Process GHC.Runtime.Interpreter.Types + GHC.Runtime.Interpreter.Types.SymbolCache GHC.Runtime.Interpreter.Wasm GHC.Runtime.Loader GHC.Runtime.Utils ===================================== libraries/base/changelog.md ===================================== @@ -10,6 +10,13 @@ * `Data.List.NonEmpty` functions now have the same laziness as their `Data.List` counterparts (i.e. make them more strict than they currently are) ([CLC proposal #107](https://github.com/haskell/core-libraries-committee/issues/107)) * `instance Functor NonEmpty` is now specified using `map` (rather than duplicating code). ([CLC proposal #300](https://github.com/haskell/core-libraries-committee/issues/300)) * The `Data.Enum.enumerate` function was introduced ([CLC #306](https://github.com/haskell/core-libraries-committee/issues/306)) + * Worker threads used by various `base` facilities are now labelled with descriptive thread labels ([CLC proposal #305](https://github.com/haskell/core-libraries-committee/issues/305), [GHC #25452](https://gitlab.haskell.org/ghc/ghc/-/issues/25452)). Specifically, these include: + * `Control.Concurrent.threadWaitRead` + * `Control.Concurrent.threadWaitWrite` + * `Control.Concurrent.threadWaitReadSTM` + * `Control.Concurrent.threadWaitWriteSTM` + * `System.Timeout.timeout` + * `GHC.Conc.Signal.runHandlers` ## 4.21.0.0 *TBA* * Change `SrcLoc` to be a strict and unboxed (finishing [CLC proposal #55](https://github.com/haskell/core-libraries-committee/issues/55)) ===================================== libraries/base/src/Control/Concurrent.hs ===================================== @@ -265,7 +265,7 @@ threadWaitRead fd -- fdReady does the right thing, but we have to call it in a -- separate thread, otherwise threadWaitRead won't be interruptible, -- and this only works with -threaded. - | threaded = withThread (waitFd fd False) + | threaded = withThread "threadWaitRead worker" (waitFd fd False) | otherwise = case fd of 0 -> do _ <- hWaitForInput stdin (-1) return () @@ -286,7 +286,7 @@ threadWaitRead fd threadWaitWrite :: Fd -> IO () threadWaitWrite fd #if defined(mingw32_HOST_OS) - | threaded = withThread (waitFd fd True) + | threaded = withThread "threadWaitWrite worker" (waitFd fd True) | otherwise = errorWithoutStackTrace "threadWaitWrite requires -threaded on Windows" #else = Conc.threadWaitWrite fd @@ -302,8 +302,11 @@ threadWaitReadSTM :: Fd -> IO (STM (), IO ()) threadWaitReadSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd False) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitReadSTM worker" + result <- try (waitFd fd False) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -326,8 +329,11 @@ threadWaitWriteSTM :: Fd -> IO (STM (), IO ()) threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd True) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitWriteSTM worker" + result <- try (waitFd fd True) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -343,10 +349,14 @@ threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool -withThread :: IO a -> IO a -withThread io = do +withThread :: String -> IO a -> IO a +withThread label io = do m <- newEmptyMVar - _ <- mask_ $ forkIO $ try io >>= putMVar m + _ <- mask_ $ forkIO $ do + tid <- myThreadId + labelThread tid label + result <- try io + putMVar m result x <- takeMVar m case x of Right a -> return a ===================================== libraries/base/src/System/Timeout.hs ===================================== @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE Safe #-} +{-# LANGUAGE Trustworthy #-} ------------------------------------------------------------------------------- -- | @@ -29,6 +29,7 @@ import GHC.Internal.Control.Exception (Exception(..), handleJust, bracket, asyncExceptionToException, asyncExceptionFromException) import GHC.Internal.Data.Unique (Unique, newUnique) +import GHC.Conc (labelThread) import Prelude -- $setup @@ -119,7 +120,9 @@ timeout n f let handleTimeout = do v <- isEmptyMVar lock when v $ void $ forkIOWithUnmask $ \unmask -> unmask $ do - v2 <- tryPutMVar lock =<< myThreadId + tid <- myThreadId + labelThread tid "timeout worker" + v2 <- tryPutMVar lock tid when v2 $ throwTo pid ex cleanupTimeout key = uninterruptibleMask_ $ do v <- tryPutMVar lock undefined @@ -136,7 +139,9 @@ timeout n f ex <- fmap Timeout newUnique handleJust (\e -> if e == ex then Just () else Nothing) (\_ -> return Nothing) - (bracket (forkIOWithUnmask $ \unmask -> + (bracket (forkIOWithUnmask $ \unmask -> do + tid <- myThreadId + labelThread tid "timeout worker" unmask $ threadDelay n >> throwTo pid ex) (uninterruptibleMask_ . killThread) (\_ -> fmap Just f)) ===================================== libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Internal.Foreign.Ptr (Ptr, castPtr) import GHC.Internal.Foreign.Marshal.Alloc (finalizerFree) import GHC.Internal.Arr (inRange) import GHC.Internal.Base -import GHC.Internal.Conc.Sync (forkIO) +import GHC.Internal.Conc.Sync (myThreadId, labelThread, forkIO) import GHC.Internal.IO (mask_, unsafePerformIO) import GHC.Internal.IOArray (IOArray, boundsIOArray, newIOArray, unsafeReadIOArray, unsafeWriteIOArray) @@ -69,7 +69,10 @@ runHandlers p_info sig = do else do handler <- unsafeReadIOArray arr int case handler of Nothing -> return () - Just (f,_) -> do _ <- forkIO (f p_info) + Just (f,_) -> do _ <- forkIO $ do + tid <- myThreadId + labelThread tid "signal handler" + f p_info return () -- It is our responsibility to free the memory buffer, so we create a ===================================== libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc ===================================== @@ -53,7 +53,10 @@ start_console_handler :: Word32 -> IO () start_console_handler r = case toWin32ConsoleEvent r of Just x -> withMVar win32ConsoleHandler $ \handler -> do - _ <- forkIO (handler x) + _ <- forkIO $ do + tid <- myThreadId + labelThread tid "console event handler" + handler x return () Nothing -> return () ===================================== libraries/ghci/GHCi/Run.hs ===================================== @@ -226,7 +226,10 @@ sandboxIO opts io = do let runIt = measureAlloc $ tryEval $ rethrow opts $ clearCCS io if useSandboxThread opts then do - tid <- forkIO $ do unsafeUnmask runIt >>= putMVar statusMVar + tid <- forkIO $ do + tid <- myThreadId + labelThread tid "GHCi sandbox" + unsafeUnmask runIt >>= putMVar statusMVar -- empty: can't block redirectInterrupts tid $ unsafeUnmask $ takeMVar statusMVar else ===================================== rts/Interpreter.c ===================================== @@ -182,6 +182,8 @@ int rts_stop_on_exception = 0; #if defined(INTERP_STATS) +#define N_CODES 128 + /* Hacky stats, for tuning the interpreter ... */ int it_unknown_entries[N_CLOSURE_TYPES]; int it_total_unknown_entries; @@ -195,8 +197,8 @@ int it_slides; int it_insns; int it_BCO_entries; -int it_ofreq[27]; -int it_oofreq[27][27]; +int it_ofreq[N_CODES]; +int it_oofreq[N_CODES][N_CODES]; int it_lastopc; @@ -210,9 +212,9 @@ void interp_startup ( void ) for (i = 0; i < N_CLOSURE_TYPES; i++) it_unknown_entries[i] = 0; it_slides = it_insns = it_BCO_entries = 0; - for (i = 0; i < 27; i++) it_ofreq[i] = 0; - for (i = 0; i < 27; i++) - for (j = 0; j < 27; j++) + for (i = 0; i < N_CODES; i++) it_ofreq[i] = 0; + for (i = 0; i < N_CODES; i++) + for (j = 0; j < N_CODES; j++) it_oofreq[i][j] = 0; it_lastopc = 0; } @@ -234,14 +236,14 @@ void interp_shutdown ( void ) } debugBelch("%d insns, %d slides, %d BCO_entries\n", it_insns, it_slides, it_BCO_entries); - for (i = 0; i < 27; i++) + for (i = 0; i < N_CODES; i++) debugBelch("opcode %2d got %d\n", i, it_ofreq[i] ); for (k = 1; k < 20; k++) { o_max = 0; i_max = j_max = 0; - for (i = 0; i < 27; i++) { - for (j = 0; j < 27; j++) { + for (i = 0; i < N_CODES; i++) { + for (j = 0; j < N_CODES; j++) { if (it_oofreq[i][j] > o_max) { o_max = it_oofreq[i][j]; i_max = i; j_max = j; @@ -259,6 +261,12 @@ void interp_shutdown ( void ) #else // !INTERP_STATS +void interp_startup( void ){ +} + +void interp_shutdown( void ){ +} + #define INTERP_TICK(n) /* nothing */ #endif @@ -419,7 +427,7 @@ eval: eval_obj: obj = UNTAG_CLOSURE(tagged_obj); - INTERP_TICK(it_total_evals); + INTERP_TICK(it_total_entries); IF_DEBUG(interpreter, debugBelch( @@ -1098,7 +1106,7 @@ run_BCO: INTERP_TICK(it_insns); #if defined(INTERP_STATS) - ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < 27 ); + ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < N_CODES ); it_ofreq[ (int)instrs[bciPtr] ] ++; it_oofreq[ it_lastopc ][ (int)instrs[bciPtr] ] ++; it_lastopc = (int)instrs[bciPtr]; ===================================== rts/Interpreter.h ===================================== @@ -9,3 +9,5 @@ #pragma once RTS_PRIVATE Capability *interpretBCO (Capability* cap); +void interp_startup ( void ); +void interp_shutdown ( void ); ===================================== rts/RtsMain.c ===================================== @@ -17,6 +17,7 @@ #include "Prelude.h" #include "Task.h" #include "Excn.h" +#include "Interpreter.h" #if defined(DEBUG) # include "Printer.h" /* for printing */ @@ -56,6 +57,8 @@ int hs_main ( int argc, char *argv[], // program args hs_init_ghc(&argc, &argv, rts_config); + interp_startup(); + BEGIN_WINDOWS_VEH_HANDLER // kick off the computation by creating the main thread with a pointer @@ -96,6 +99,8 @@ int hs_main ( int argc, char *argv[], // program args END_WINDOWS_VEH_HANDLER + interp_shutdown(); + shutdownHaskellAndExit(exit_status, 0 /* !fastExit */); // No code beyond this point. Dead code elimination will remove it } ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -13664,7 +13664,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -14770,7 +14770,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -15385,7 +15385,7 @@ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC. instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.JSException -- Defined in ‘GHC.Internal.JS.Prim’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.WouldBlockException -- Defined in ‘GHC.Internal.JS.Prim’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -16235,7 +16235,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -10881,7 +10881,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11992,7 +11992,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12608,7 +12608,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13476,7 +13476,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/27f2df7adfcd9ffbd04749d5aba962e84c39ff6b...50fdf33ff6c82c370659c8491457ca4ea05c8938 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/27f2df7adfcd9ffbd04749d5aba962e84c39ff6b...50fdf33ff6c82c370659c8491457ca4ea05c8938 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 15:29:26 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Fri, 07 Feb 2025 10:29:26 -0500 Subject: [Git][ghc/ghc][wip/T25693] 2 commits: hadrian: Drop uses of head/tail Message-ID: <67a626d6987d4_34ce89cf34745261@gitlab.mail> Ben Gamari pushed to branch wip/T25693 at Glasgow Haskell Compiler / GHC Commits: e7fc4a48 by Ben Gamari at 2025-02-07T10:11:38-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - becffc9c by Ben Gamari at 2025-02-07T10:11:53-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 3 changed files: - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs Changes: ===================================== hadrian/src/Hadrian/Utilities.hs ===================================== @@ -149,7 +149,10 @@ as /c/foo, while it occasionally falls over on paths of the form C:\foo. -- -- See Note [Absolute paths and MSYS]. (-/-) :: FilePath -> FilePath -> FilePath -_ -/- b | isAbsolute b && not (isAbsolute $ tail b) = b +_ -/- b + | isAbsolute b + , _:b' <- b + , not (isAbsolute b') = b "" -/- b = b a -/- b | last a == '/' = a ++ b @@ -636,7 +639,8 @@ renderLibrary name lib synopsis = renderBox $ -- | ipsum | -- \----------/ renderBox :: [String] -> String -renderBox ls = tail $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) +renderBox ls = + drop 1 $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) where -- Minimum total width of the box in characters minimumBoxWidth = 32 ===================================== hadrian/src/Oracles/ModuleFiles.hs ===================================== @@ -169,10 +169,12 @@ moduleFilesOracle = void $ do let pairs = sort $ mainpairs ++ [ (encodeModule d f, f) | (fs, d) <- result, f <- fs ] multi = [ (m, f1, f2) | (m, f1):(n, f2):_ <- tails pairs, m == n ] - unless (null multi) $ do - let (m, f1, f2) = head multi - error $ "Module " ++ m ++ " has more than one source file: " - ++ f1 ++ " and " ++ f2 ++ "." + + case multi of + [] -> return () + (m, f1, f2) : _ -> + fail $ "Module " ++ m ++ " has more than one source file: " + ++ f1 ++ " and " ++ f2 ++ "." return $ lookupAll modules pairs -- Optimisation: we discard Haskell files here, because they are never used ===================================== hadrian/src/Rules/Dependencies.hs ===================================== @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wno-deprecations #-} +{-# OPTIONS_GHC -Wno-x-data-list-nonempty-unzip #-} module Rules.Dependencies (buildPackageDependencies) where View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f6ccd3530954b9ae98361bd77a12c7a62b18edaa...becffc9cd840215cc94de44c77e60a3378278e58 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f6ccd3530954b9ae98361bd77a12c7a62b18edaa...becffc9cd840215cc94de44c77e60a3378278e58 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 17:35:27 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Fri, 07 Feb 2025 12:35:27 -0500 Subject: [Git][ghc/ghc][wip/T25647] remove wildcard usage Message-ID: <67a6445fbae80_387355b4f3fc969e4@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 602f6072 by Patrick at 2025-02-08T01:35:16+08:00 remove wildcard usage - - - - - 1 changed file: - compiler/GHC/Types/Error.hs Changes: ===================================== compiler/GHC/Types/Error.hs ===================================== @@ -298,8 +298,8 @@ data UnknownDiagnostic opts hint where type UnknownDiagnosticFor a = UnknownDiagnostic (DiagnosticOpts a) (DiagnosticHint a) instance (HasDefaultDiagnosticOpts opts, Outputable hint) => Diagnostic (UnknownDiagnostic opts hint) where - type DiagnosticOpts (UnknownDiagnostic opts _) = opts - type DiagnosticHint (UnknownDiagnostic _ hint) = hint + type DiagnosticOpts (UnknownDiagnostic opts hint) = opts + type DiagnosticHint (UnknownDiagnostic opts hint) = hint diagnosticMessage opts (UnknownDiagnostic f _ diag) = diagnosticMessage (f opts) diag diagnosticReason (UnknownDiagnostic _ _ diag) = diagnosticReason diag diagnosticHints (UnknownDiagnostic _ f diag) = map f (diagnosticHints diag) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/602f6072d5fd8039e918ab77b7adde54d5cd5312 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/602f6072d5fd8039e918ab77b7adde54d5cd5312 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 19:31:50 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Fri, 07 Feb 2025 14:31:50 -0500 Subject: [Git][ghc/ghc][wip/T25647] 20 commits: interpreter: Fix INTERP_STATS profiling code Message-ID: <67a65fa5d0b25_38735521138a0120142@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 7fe1142d by Simon Peyton Jones at 2025-02-07T19:31:30+00:00 WIP towards #25267 - - - - - c8a5cf38 by Simon Peyton Jones at 2025-02-07T19:31:30+00:00 Wibbles - - - - - ab03aaf1 by Simon Peyton Jones at 2025-02-07T19:31:30+00:00 Default tyvars in data/newtype insnstances This is what fixes #25647 - - - - - 18ccf05e by Simon Peyton Jones at 2025-02-07T19:31:30+00:00 wibbles Including fix for #25725 - - - - - 90b33ab9 by Simon Peyton Jones at 2025-02-07T19:31:30+00:00 Wibble - - - - - 8c7e9bc4 by Patrick at 2025-02-07T19:31:30+00:00 add more tests - - - - - d8596cd9 by Patrick at 2025-02-07T19:31:30+00:00 Fix up T25611d with explicit kind annotation - - - - - 3dfa302e by Patrick at 2025-02-07T19:31:30+00:00 fix up T25647_fail - - - - - 6b094553 by Patrick at 2025-02-07T19:31:30+00:00 cleanup whitespace - - - - - fd16cd6d by Patrick at 2025-02-07T19:31:30+00:00 fix up T23512a - - - - - bac3be92 by Patrick at 2025-02-07T19:31:30+00:00 add more examples to T25647b - - - - - 59ad7cac by Patrick at 2025-02-07T19:31:30+00:00 add Dix6 to T25647_fail - - - - - d5e7c229 by Patrick at 2025-02-07T19:31:30+00:00 add Dix7 for T25647a - - - - - cfcef23f by Patrick at 2025-02-07T19:31:30+00:00 change DefaultingStrategy of tcTyFamInstEqnGuts as well - - - - - d1f61858 by Patrick at 2025-02-07T19:31:30+00:00 align wildcard with named typevar on wether it is skolem - - - - - f37f1154 by Patrick at 2025-02-07T19:31:30+00:00 fix T17536c - - - - - 7de2ece0 by Patrick at 2025-02-07T19:31:30+00:00 Fix T9357 - - - - - ccc9152f by Patrick at 2025-02-07T19:31:30+00:00 remove wildcard usage - - - - - 28 changed files: - compiler/GHC.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Types/Error.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/ghc.cabal.in - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c - testsuite/tests/indexed-types/should_compile/T17536.hs - testsuite/tests/indexed-types/should_compile/T17536c.hs - testsuite/tests/indexed-types/should_compile/T25611d.hs - testsuite/tests/indexed-types/should_fail/T9357.stderr - testsuite/tests/rename/should_fail/T23512a.stderr - + testsuite/tests/typecheck/should_compile/T25647_fail.hs - + testsuite/tests/typecheck/should_compile/T25647_fail.stderr - + testsuite/tests/typecheck/should_compile/T25647a.hs - + testsuite/tests/typecheck/should_compile/T25647b.hs - + testsuite/tests/typecheck/should_compile/T25725.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC.hs ===================================== @@ -420,7 +420,6 @@ import GHC.Types.Name.Ppr import GHC.Types.TypeEnv import GHC.Types.Breakpoint import GHC.Types.PkgQual -import GHC.Types.Unique.FM import GHC.Unit import GHC.Unit.Env as UnitEnv @@ -705,7 +704,7 @@ setTopSessionDynFlags :: GhcMonad m => DynFlags -> m () setTopSessionDynFlags dflags = do hsc_env <- getSession logger <- getLogger - lookup_cache <- liftIO $ newMVar emptyUFM + lookup_cache <- liftIO $ mkInterpSymbolCache -- Interpreter interp <- if ===================================== compiler/GHC/ByteCode/Linker.hs ===================================== @@ -2,6 +2,7 @@ {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- -- (c) The University of Glasgow 2002-2006 @@ -12,7 +13,6 @@ module GHC.ByteCode.Linker ( linkBCO , lookupStaticPtr , lookupIE - , nameToCLabel , linkFail ) where @@ -26,7 +26,6 @@ import GHCi.ResolvedBCO import GHC.Builtin.PrimOps import GHC.Builtin.PrimOps.Ids -import GHC.Builtin.Names import GHC.Unit.Types @@ -43,8 +42,6 @@ import GHC.Types.Name.Env import qualified GHC.Types.Id as Id import GHC.Types.Unique.DFM -import Language.Haskell.Syntax.Module.Name - -- Standard libraries import Data.Array.Unboxed import Foreign.Ptr @@ -92,30 +89,30 @@ lookupLiteral interp pkgs_loaded le ptr = case ptr of lookupStaticPtr :: Interp -> FastString -> IO (Ptr ()) lookupStaticPtr interp addr_of_label_string = do - m <- lookupSymbol interp addr_of_label_string + m <- lookupSymbol interp (IFaststringSymbol addr_of_label_string) case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker: can't find label" - (unpackFS addr_of_label_string) + (ppr addr_of_label_string) lookupIE :: Interp -> PkgsLoaded -> ItblEnv -> Name -> IO (Ptr ()) lookupIE interp pkgs_loaded ie con_nm = case lookupNameEnv ie con_nm of Just (_, ItblPtr a) -> return (fromRemotePtr (castRemotePtr a)) Nothing -> do -- try looking up in the object files. - let sym_to_find1 = nameToCLabel con_nm "con_info" - m <- lookupHsSymbol interp pkgs_loaded con_nm "con_info" + let sym_to_find1 = IConInfoSymbol con_nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find1 case m of Just addr -> return addr Nothing -> do -- perhaps a nullary constructor? - let sym_to_find2 = nameToCLabel con_nm "static_info" - n <- lookupHsSymbol interp pkgs_loaded con_nm "static_info" + let sym_to_find2 = IStaticInfoSymbol con_nm + n <- lookupHsSymbol interp pkgs_loaded sym_to_find2 case n of Just addr -> return addr Nothing -> linkFail "GHC.ByteCode.Linker.lookupIE" - (unpackFS sym_to_find1 ++ " or " ++ - unpackFS sym_to_find2) + (ppr sym_to_find1 <> " or " <> + ppr sym_to_find2) -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode lookupAddr :: Interp -> PkgsLoaded -> AddrEnv -> Name -> IO (Ptr ()) @@ -123,21 +120,21 @@ lookupAddr interp pkgs_loaded ae addr_nm = do case lookupNameEnv ae addr_nm of Just (_, AddrPtr ptr) -> return (fromRemotePtr ptr) Nothing -> do -- try looking up in the object files. - let sym_to_find = nameToCLabel addr_nm "bytes" + let sym_to_find = IBytesSymbol addr_nm -- see Note [Bytes label] in GHC.Cmm.CLabel - m <- lookupHsSymbol interp pkgs_loaded addr_nm "bytes" + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just ptr -> return ptr Nothing -> linkFail "GHC.ByteCode.Linker.lookupAddr" - (unpackFS sym_to_find) + (ppr sym_to_find) lookupPrimOp :: Interp -> PkgsLoaded -> PrimOp -> IO (RemotePtr ()) lookupPrimOp interp pkgs_loaded primop = do let sym_to_find = primopToCLabel primop "closure" - m <- lookupHsSymbol interp pkgs_loaded (Id.idName $ primOpId primop) "closure" + m <- lookupHsSymbol interp pkgs_loaded (IClosureSymbol (Id.idName $ primOpId primop)) case m of Just p -> return (toRemotePtr p) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" (text sym_to_find) resolvePtr :: Interp @@ -157,11 +154,11 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of | otherwise -> assertPpr (isExternalName nm) (ppr nm) $ do - let sym_to_find = nameToCLabel nm "closure" - m <- lookupHsSymbol interp pkgs_loaded nm "closure" + let sym_to_find = IClosureSymbol nm + m <- lookupHsSymbol interp pkgs_loaded sym_to_find case m of Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p)) - Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find) + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (ppr sym_to_find) BCOPtrPrimOp op -> ResolvedBCOStaticPtr <$> lookupPrimOp interp pkgs_loaded op @@ -176,11 +173,10 @@ resolvePtr interp pkgs_loaded le bco_ix ptr = case ptr of -- loaded units. -- -- See Note [Looking up symbols in the relevant objects]. -lookupHsSymbol :: Interp -> PkgsLoaded -> Name -> String -> IO (Maybe (Ptr ())) -lookupHsSymbol interp pkgs_loaded nm sym_suffix = do - massertPpr (isExternalName nm) (ppr nm) - let sym_to_find = nameToCLabel nm sym_suffix - pkg_id = moduleUnitId $ nameModule nm +lookupHsSymbol :: Interp -> PkgsLoaded -> InterpSymbol (Suffix s) -> IO (Maybe (Ptr ())) +lookupHsSymbol interp pkgs_loaded sym_to_find = do + massertPpr (isExternalName (interpSymbolName sym_to_find)) (ppr sym_to_find) + let pkg_id = moduleUnitId $ nameModule (interpSymbolName sym_to_find) loaded_dlls = maybe [] loaded_pkg_hs_dlls $ lookupUDFM pkgs_loaded pkg_id go (dll:dlls) = do @@ -194,12 +190,12 @@ lookupHsSymbol interp pkgs_loaded nm sym_suffix = do go loaded_dlls -linkFail :: String -> String -> IO a +linkFail :: String -> SDoc -> IO a linkFail who what = throwGhcExceptionIO (ProgramError $ unlines [ "",who , "During interactive linking, GHCi couldn't find the following symbol:" - , ' ' : ' ' : what + , ' ' : ' ' : showSDocUnsafe what , "This may be due to you not asking GHCi to load extra object files," , "archives or DLLs needed by your current session. Restart GHCi, specifying" , "the missing library using the -L/path/to/object/dir and -lmissinglibname" @@ -210,28 +206,8 @@ linkFail who what ]) -nameToCLabel :: Name -> String -> FastString -nameToCLabel n suffix = mkFastStringByteString label - where - encodeZ = fastZStringToByteString . zEncodeFS - (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of - -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers - -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. - mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS - mod -> mod - packagePart = encodeZ (unitFS pkgKey) - modulePart = encodeZ (moduleNameFS modName) - occPart = encodeZ $ occNameMangledFS (nameOccName n) - - label = mconcat $ - [ packagePart `mappend` "_" | pkgKey /= mainUnit ] - ++ - [modulePart - , "_" - , occPart - , "_" - , fromString suffix - ] + + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2901,7 +2901,7 @@ jsCodeGen hsc_env srcspan i this_mod stg_binds_with_deps binding_id = do jsLinkObject logger tmpfs tmp_dir js_config unit_env inst out_obj roots -- look up "id_sym" closure and create a StablePtr (HValue) from it - href <- lookupClosure interp (unpackFS id_sym) >>= \case + href <- lookupClosure interp (IFaststringSymbol id_sym) >>= \case Nothing -> pprPanic "Couldn't find just linked TH closure" (ppr id_sym) Just r -> pure r ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -217,12 +217,12 @@ loadName interp hsc_env name = do case lookupNameEnv (closure_env (linker_env pls)) name of Just (_,aa) -> return (pls,(aa, links, pkgs)) Nothing -> assertPpr (isExternalName name) (ppr name) $ - do let sym_to_find = nameToCLabel name "closure" - m <- lookupClosure interp (unpackFS sym_to_find) + do let sym_to_find = IClosureSymbol name + m <- lookupClosure interp sym_to_find r <- case m of Just hvref -> mkFinalizedHValue interp hvref Nothing -> linkFail "GHC.Linker.Loader.loadName" - (unpackFS sym_to_find) + (ppr sym_to_find) return (pls,(r, links, pkgs)) loadDependencies @@ -909,7 +909,7 @@ dynLoadObjs interp hsc_env pls at LoaderState{..} objs = do m <- loadDLL interp soFile case m of Right _ -> return $! pls { temp_sos = (libPath, libName) : temp_sos } - Left err -> linkFail msg err + Left err -> linkFail msg (text err) where msg = "GHC.Linker.Loader.dynLoadObjs: Loading temp shared object failed" ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -659,6 +659,7 @@ rnClsInstDecl (ClsInstDecl { cid_ext = (inst_warn_ps, _, _) rnFamEqn :: HsDocContext -> AssocTyFamInfo -> FamEqn GhcPs rhs + -> FreeKiTyVars -- Implicit binders of the rhs payload -> (HsDocContext -> rhs -> RnM (rhs', FreeVars)) -> RnM (FamEqn GhcRn rhs', FreeVars) rnFamEqn doc atfi @@ -666,7 +667,7 @@ rnFamEqn doc atfi , feqn_bndrs = outer_bndrs , feqn_pats = pats , feqn_fixity = fixity - , feqn_rhs = payload }) rn_payload + , feqn_rhs = payload }) payload_kvs rn_payload = do { tycon' <- lookupFamInstName mb_cls tycon -- all_imp_vars represent the implicitly bound type variables. This is @@ -697,7 +698,7 @@ rnFamEqn doc atfi -- -- For associated type family instances, exclude the type variables -- bound by the instance head with filterInScopeM (#19649). - ; all_imp_vars <- filterInScopeM $ pat_kity_vars + ; all_imp_vars <- filterInScopeM $ (pat_kity_vars ++ payload_kvs) ; bindHsOuterTyVarBndrs doc mb_cls all_imp_vars outer_bndrs $ \rn_outer_bndrs -> do { (pats', pat_fvs) <- rnLHsTypeArgs (FamPatCtx tycon) pats @@ -788,7 +789,7 @@ rnFamEqn doc atfi -- type instance F a b c = Either a b -- ^^^^^ lhs_loc = case map lhsTypeArgSrcSpan pats of - [] -> panic "rnFamEqn.lhs_loc" + [] -> getLocA tycon [loc] -> loc (loc:locs) -> loc `combineSrcSpans` last locs @@ -847,8 +848,9 @@ rnTyFamInstEqn :: AssocTyFamInfo -> TyFamInstEqn GhcPs -> RnM (TyFamInstEqn GhcRn, FreeVars) rnTyFamInstEqn atfi eqn@(FamEqn { feqn_tycon = tycon }) - = rnFamEqn (TySynCtx tycon) atfi eqn rnTySyn - + = rnFamEqn (TySynCtx tycon) atfi eqn + [{- No implicit vars on RHS of a type instance -}] + rnTySyn rnTyFamDefltDecl :: Name -> TyFamDefltDecl GhcPs @@ -859,9 +861,9 @@ rnDataFamInstDecl :: AssocTyFamInfo -> DataFamInstDecl GhcPs -> RnM (DataFamInstDecl GhcRn, FreeVars) rnDataFamInstDecl atfi (DataFamInstDecl { dfid_eqn = - eqn@(FamEqn { feqn_tycon = tycon })}) - = do { (eqn', fvs) <- - rnFamEqn (TyDataCtx tycon) atfi eqn rnDataDefn + eqn@(FamEqn { feqn_tycon = tycon, feqn_rhs = defn })}) + = do { let implicit_kvs = extractDataDefnKindVars defn + ; (eqn', fvs) <- rnFamEqn (TyDataCtx tycon) atfi eqn implicit_kvs rnDataDefn ; return (DataFamInstDecl { dfid_eqn = eqn' }, fvs) } -- Renaming of the associated types in instances. ===================================== compiler/GHC/Runtime/Interpreter.hs ===================================== @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} -- | Interacting with the iserv interpreter, whether it is running on an -- external process or in the current process. @@ -83,7 +84,6 @@ import GHC.Data.Maybe import GHC.Data.FastString import GHC.Types.SrcLoc -import GHC.Types.Unique.FM import GHC.Types.Basic import GHC.Utils.Panic @@ -116,6 +116,12 @@ import GHC.Stack.CCS (CostCentre,CostCentreStack) import System.Directory import System.Process +import GHC.Builtin.Names +import GHC.Types.Name + +-- Standard libraries +import GHC.Exts + {- Note [Remote GHCi] ~~~~~~~~~~~~~~~~~~ When the flag -fexternal-interpreter is given to GHC, interpreted code @@ -457,38 +463,65 @@ handleSeqHValueStatus interp unit_env eval_status = initObjLinker :: Interp -> IO () initObjLinker interp = interpCmd interp InitLinker -lookupSymbol :: Interp -> FastString -> IO (Maybe (Ptr ())) +lookupSymbol :: Interp -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbol interp str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbol (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) ExtWasm i -> withWasmInterp i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbol (unpackFS str)) + sendMessage inst (LookupSymbol (unpackFS (interpSymbolToCLabel str))) -lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> FastString -> IO (Maybe (Ptr ())) +lookupSymbolInDLL :: Interp -> RemotePtr LoadedDLL -> InterpSymbol s -> IO (Maybe (Ptr ())) lookupSymbolInDLL interp dll str = withSymbolCache interp str $ case interpInstance interp of #if defined(HAVE_INTERNAL_INTERPRETER) - InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS str)) + InternalInterp -> fmap fromRemotePtr <$> run (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) #endif ExternalInterp ext -> case ext of ExtIServ i -> withIServ i $ \inst -> fmap fromRemotePtr <$> do uninterruptibleMask_ $ - sendMessage inst (LookupSymbolInDLL dll (unpackFS str)) + sendMessage inst (LookupSymbolInDLL dll (unpackFS (interpSymbolToCLabel str))) ExtJS {} -> pprPanic "lookupSymbol not supported by the JS interpreter" (ppr str) -- wasm dyld doesn't track which symbol comes from which .so ExtWasm {} -> lookupSymbol interp str -lookupClosure :: Interp -> String -> IO (Maybe HValueRef) +interpSymbolToCLabel :: forall s . InterpSymbol s -> FastString +interpSymbolToCLabel s = eliminateInterpSymbol s interpretedInterpSymbol $ \is -> + let + n = interpSymbolName is + suffix = interpSymbolSuffix is + + encodeZ = fastZStringToByteString . zEncodeFS + (Module pkgKey modName) = assert (isExternalName n) $ case nameModule n of + -- Primops are exported from GHC.Prim, their HValues live in GHC.PrimopWrappers + -- See Note [Primop wrappers] in GHC.Builtin.PrimOps. + mod | mod == gHC_PRIM -> gHC_PRIMOPWRAPPERS + mod -> mod + packagePart = encodeZ (unitFS pkgKey) + modulePart = encodeZ (moduleNameFS modName) + occPart = encodeZ $ occNameMangledFS (nameOccName n) + + label = mconcat $ + [ packagePart `mappend` "_" | pkgKey /= mainUnit ] + ++ + [modulePart + , "_" + , occPart + , "_" + , fromString suffix + ] + in mkFastStringByteString label + +lookupClosure :: Interp -> InterpSymbol s -> IO (Maybe HValueRef) lookupClosure interp str = - interpCmd interp (LookupClosure str) + interpCmd interp (LookupClosure (unpackFS (interpSymbolToCLabel str))) -- | 'withSymbolCache' tries to find a symbol in the 'interpLookupSymbolCache' -- which maps symbols to the address where they are loaded. @@ -496,7 +529,7 @@ lookupClosure interp str = -- a miss we run the action which determines the symbol's address and populate -- the cache with the answer. withSymbolCache :: Interp - -> FastString + -> InterpSymbol s -- ^ The symbol we are looking up in the cache -> IO (Maybe (Ptr ())) -- ^ An action which determines the address of the symbol we @@ -513,21 +546,19 @@ withSymbolCache interp str determine_addr = do -- The analysis in #23415 further showed this cache should also benefit the -- internal interpreter's loading times, and needn't be used by the external -- interpreter only. - cache <- readMVar (interpLookupSymbolCache interp) - case lookupUFM cache str of - Just p -> return (Just p) + cached_val <- lookupInterpSymbolCache str (interpSymbolCache interp) + case cached_val of + Just {} -> return cached_val Nothing -> do - maddr <- determine_addr case maddr of Nothing -> return Nothing Just p -> do - let upd_cache cache' = addToUFM cache' str p - modifyMVar_ (interpLookupSymbolCache interp) (pure . upd_cache) - return (Just p) + updateInterpSymbolCache str (interpSymbolCache interp) p + return maddr purgeLookupSymbolCache :: Interp -> IO () -purgeLookupSymbolCache interp = modifyMVar_ (interpLookupSymbolCache interp) (const (pure emptyUFM)) +purgeLookupSymbolCache interp = purgeInterpSymbolCache (interpSymbolCache interp) -- | loadDLL loads a dynamic library using the OS's native linker -- (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either ===================================== compiler/GHC/Runtime/Interpreter/Types.hs ===================================== @@ -1,4 +1,6 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} -- | Types used by the runtime interpreter module GHC.Runtime.Interpreter.Types @@ -10,6 +12,20 @@ module GHC.Runtime.Interpreter.Types , ExtInterpInstance (..) , ExtInterpState (..) , InterpStatus(..) + -- * InterpSymbolCache + , InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + + -- * IServ , IServ , IServConfig(..) @@ -30,9 +46,6 @@ import GHC.Linker.Types import GHCi.RemoteTypes import GHCi.Message ( Pipe ) -import GHC.Types.Unique.FM -import GHC.Data.FastString ( FastString ) -import Foreign import GHC.Platform import GHC.Utils.TmpFs @@ -42,6 +55,7 @@ import GHC.Unit.State import GHC.Unit.Types import GHC.StgToJS.Types import GHC.StgToJS.Linker.Types +import GHC.Runtime.Interpreter.Types.SymbolCache import Control.Concurrent import System.Process ( ProcessHandle, CreateProcess ) @@ -56,7 +70,7 @@ data Interp = Interp , interpLoader :: !Loader -- ^ Interpreter loader - , interpLookupSymbolCache :: !(MVar (UniqFM FastString (Ptr ()))) + , interpSymbolCache :: !InterpSymbolCache -- ^ LookupSymbol cache } ===================================== compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs ===================================== @@ -0,0 +1,142 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE RecordWildCards #-} + +-- | The SymbolCache is used to cache lookups for specific symbols when using +-- the interpreter. +module GHC.Runtime.Interpreter.Types.SymbolCache ( + InterpSymbolCache(..) + , mkInterpSymbolCache + , lookupInterpSymbolCache + , updateInterpSymbolCache + , purgeInterpSymbolCache + , InterpSymbol(..) + , SuffixOrInterpreted(..) + , interpSymbolName + , interpSymbolSuffix + , eliminateInterpSymbol + , interpretedInterpSymbol + ) where + +import GHC.Prelude + +import GHC.Types.Unique.FM +import GHC.Types.Name +import GHC.Data.FastString +import Foreign + +import Control.Concurrent +import GHC.Utils.Outputable +import GHC.TypeLits + + +-- The symbols records the suffix which each cache deals with. +newtype SymbolCache (s :: Symbol) = SymbolCache { _getSymbolCache :: UniqFM Name (Ptr ()) } + +-- Each cache is keyed by Name, there is one cache for each type of symbol we will +-- potentially lookup. The caches are keyed by 'Name' so that it is not necessary to consult +-- a complicated `FastString` each time. +data InterpSymbolCache = InterpSymbolCache { + interpClosureCache :: MVar (SymbolCache "closure") + , interpConInfoCache :: MVar (SymbolCache "con_info") + , interpStaticInfoCache :: MVar (SymbolCache "static_info") + , interpBytesCache :: MVar (SymbolCache "bytes") + , interpFaststringCache :: MVar (UniqFM FastString (Ptr ())) + } + +data SuffixOrInterpreted = Suffix Symbol | Interpreted + +data InterpSymbol (s :: SuffixOrInterpreted) where + IClosureSymbol :: Name -> InterpSymbol (Suffix "closure") + IConInfoSymbol :: Name -> InterpSymbol (Suffix "con_info") + IStaticInfoSymbol :: Name -> InterpSymbol (Suffix "static_info") + IBytesSymbol :: Name -> InterpSymbol (Suffix "bytes") + IFaststringSymbol :: FastString -> InterpSymbol Interpreted + +instance Outputable (InterpSymbol s) where + ppr s = eliminateInterpSymbol s + (\(IFaststringSymbol s) -> text "interpreted:" <> ppr s) + (\s -> text (interpSymbolSuffix s) <> colon <> ppr (interpSymbolName s)) + +eliminateInterpSymbol :: InterpSymbol s -> (InterpSymbol Interpreted -> r) + -> (forall x . InterpSymbol (Suffix x) -> r) + -> r +eliminateInterpSymbol s k1 k2 = + case s of + IFaststringSymbol {} -> k1 s + IBytesSymbol {} -> k2 s + IStaticInfoSymbol {} -> k2 s + IConInfoSymbol {} -> k2 s + IClosureSymbol {} -> k2 s + + +interpSymbolName :: InterpSymbol (Suffix s) -> Name +interpSymbolName (IClosureSymbol n) = n +interpSymbolName (IConInfoSymbol n) = n +interpSymbolName (IStaticInfoSymbol n) = n +interpSymbolName (IBytesSymbol n) = n + +interpretedInterpSymbol :: InterpSymbol Interpreted -> FastString +interpretedInterpSymbol (IFaststringSymbol s) = s + +interpSymbolSuffix :: InterpSymbol (Suffix s) -> String +interpSymbolSuffix (IClosureSymbol {}) = "closure" +interpSymbolSuffix (IConInfoSymbol {}) = "con_info" +interpSymbolSuffix (IStaticInfoSymbol {}) = "static_info" +interpSymbolSuffix (IBytesSymbol {}) = "bytes" + +emptySymbolCache :: SymbolCache s +emptySymbolCache = SymbolCache emptyUFM + +lookupSymbolCache :: InterpSymbol (Suffix s) -> SymbolCache s -> Maybe (Ptr ()) +lookupSymbolCache s (SymbolCache cache) = lookupUFM cache (interpSymbolName s) + +insertSymbolCache :: InterpSymbol (Suffix s) -> Ptr () -> SymbolCache s -> SymbolCache s +insertSymbolCache s v (SymbolCache cache) = SymbolCache (addToUFM cache (interpSymbolName s) v) + +lookupInterpSymbolCache :: InterpSymbol s -> InterpSymbolCache -> IO (Maybe (Ptr ())) +lookupInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var -> (\cache -> lookupUFM cache f) <$> readMVar mvar_var) + (\s mvar_var -> lookupSymbolCache s <$> readMVar mvar_var) + + +updateInterpSymbolCache :: InterpSymbol s + -> InterpSymbolCache -> Ptr () -> IO () +updateInterpSymbolCache = withInterpSymbolCache + (\(IFaststringSymbol f) mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ addToUFM cache f v)) + (\s mvar_var v -> modifyMVar_ mvar_var (\cache -> pure $ insertSymbolCache s v cache)) + +withInterpSymbolCache :: + (InterpSymbol Interpreted -> MVar (UniqFM FastString (Ptr ())) -> r) + -> (forall x . InterpSymbol (Suffix x) -> MVar (SymbolCache x) -> r) + -> InterpSymbol s + -> InterpSymbolCache + -> r +withInterpSymbolCache k1 k2 key InterpSymbolCache{..} = + case key of + IClosureSymbol {} -> k2 key interpClosureCache + IConInfoSymbol {} -> k2 key interpConInfoCache + IStaticInfoSymbol {} -> k2 key interpStaticInfoCache + IBytesSymbol {} -> k2 key interpBytesCache + IFaststringSymbol {} -> k1 key interpFaststringCache + +-- | Clear all symbol caches. +purgeInterpSymbolCache :: InterpSymbolCache -> IO () +purgeInterpSymbolCache (InterpSymbolCache a b c d e) = do + modifyMVar_ a (\_ -> do + modifyMVar_ b (\_ -> do + modifyMVar_ c (\_ -> do + modifyMVar_ d (\_ -> do + modifyMVar_ e (\_ -> pure emptyUFM) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + pure emptySymbolCache) + +mkInterpSymbolCache :: IO InterpSymbolCache +mkInterpSymbolCache = do + InterpSymbolCache <$> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptySymbolCache + <*> newMVar emptyUFM ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -777,17 +777,18 @@ There is also the possibility of mentioning a wildcard -} -tcFamTyPats :: TyCon +tcFamTyPats :: (Maybe SkolemInfo) + -> TyCon -> HsFamEqnPats GhcRn -- Patterns -> TcM (TcType, TcKind) -- (lhs_type, lhs_kind) -- Check the LHS of a type/data family instance -- e.g. type instance F ty1 .. tyn = ... -- Used for both type and data families -tcFamTyPats fam_tc hs_pats +tcFamTyPats skol_info fam_tc hs_pats = do { traceTc "tcFamTyPats {" $ vcat [ ppr fam_tc, text "arity:" <+> ppr fam_arity ] - ; mode <- mkHoleMode TypeLevel HM_FamPat + ; mode <- mkHoleMode TypeLevel (HM_FamPat skol_info) -- HM_FamPat: See Note [Wildcards in family instances] in -- GHC.Rename.Module ; let fun_ty = mkTyConApp fam_tc [] @@ -967,7 +968,7 @@ type HoleInfo = Maybe (TcLevel, HoleMode) -- HoleMode says how to treat the occurrences -- of anonymous wildcards; see tcAnonWildCardOcc data HoleMode = HM_Sig -- Partial type signatures: f :: _ -> Int - | HM_FamPat -- Family instances: F _ Int = Bool + | HM_FamPat (Maybe SkolemInfo) -- Family instances: F _ Int = Bool | HM_VTA -- Visible type and kind application: -- f @(Maybe _) -- Maybe @(_ -> _) @@ -990,10 +991,10 @@ mkHoleMode tyki hm , mode_holes = Just (lvl,hm) }) } instance Outputable HoleMode where - ppr HM_Sig = text "HM_Sig" - ppr HM_FamPat = text "HM_FamPat" - ppr HM_VTA = text "HM_VTA" - ppr HM_TyAppPat = text "HM_TyAppPat" + ppr HM_Sig = text "HM_Sig" + ppr (HM_FamPat _) = text "HM_FamPat" + ppr HM_VTA = text "HM_VTA" + ppr HM_TyAppPat = text "HM_TyAppPat" instance Outputable TcTyMode where ppr (TcTyMode { mode_tyki = tyki, mode_holes = hm }) @@ -2212,7 +2213,7 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- esp the bullet on nested forall types = do { kv_details <- newTauTvDetailsAtLevel hole_lvl ; kv_name <- newMetaTyVarName (fsLit "k") - ; wc_details <- newTauTvDetailsAtLevel hole_lvl + ; wc_details <- mk_wc_details ; wc_name <- newMetaTyVarName wc_nm ; let kv = mkTcTyVar kv_name liftedTypeKind kv_details wc_kind = mkTyVarTy kv @@ -2230,17 +2231,21 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- so we have to do it properly (T14140a) ; checkExpectedKind ty (mkTyVarTy wc_tv) wc_kind exp_kind } where + -- make sure we align with none-wild card type variables + mk_wc_details = case hole_mode of + HM_FamPat (Just skol_info) -> return $ SkolemTv skol_info hole_lvl False + _ -> newTauTvDetailsAtLevel hole_lvl -- See Note [Wildcard names] wc_nm = case hole_mode of HM_Sig -> fsLit "w" - HM_FamPat -> fsLit "_" + HM_FamPat _ -> fsLit "_" HM_VTA -> fsLit "w" HM_TyAppPat -> fsLit "_" emit_holes = case hole_mode of - HM_Sig -> True - HM_FamPat -> False - HM_VTA -> False + HM_Sig -> True + HM_FamPat _ -> False + HM_VTA -> False HM_TyAppPat -> False tcAnonWildCardOcc is_extra _ _ _ ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -3141,7 +3141,7 @@ tcDataDefn err_ctxt roles_info tc_name -- via inferInitialKinds , dd_cons = cons , dd_derivs = derivs }) - = bindTyClTyVars tc_name $ \ tc_bndrs res_kind -> + = bindTyClTyVars tc_name $ \ tc_bndrs tc_res_kind -> -- The TyCon tyvars must scope over -- - the stupid theta (dd_ctxt) -- - for H98 constructors only, the ConDecl @@ -3152,18 +3152,18 @@ tcDataDefn err_ctxt roles_info tc_name ; tcg_env <- getGblEnv ; let hsc_src = tcg_src tcg_env ; unless (mk_permissive_kind hsc_src cons) $ - checkDataKindSig (DataDeclSort (dataDefnConsNewOrData cons)) res_kind + checkDataKindSig (DataDeclSort (dataDefnConsNewOrData cons)) tc_res_kind - ; stupid_tc_theta <- pushLevelAndSolveEqualities skol_info tc_bndrs $ + ; tc_stupid_theta <- pushLevelAndSolveEqualities skol_info tc_bndrs $ tcHsContext ctxt -- See Note [Error on unconstrained meta-variables] in GHC.Tc.Utils.TcMType -- Example: (typecheck/should_fail/T17567StupidTheta) -- data (forall a. a b ~ a c) => T b c -- The kind of 'a' is unconstrained. - ; dvs <- candidateQTyVarsOfTypes stupid_tc_theta + ; dvs <- candidateQTyVarsOfTypes tc_stupid_theta ; let err_ctx tidy_env - = do { (tidy_env2, theta) <- zonkTidyTcTypes tidy_env stupid_tc_theta + = do { (tidy_env2, theta) <- zonkTidyTcTypes tidy_env tc_stupid_theta ; return (tidy_env2, UninfTyCtx_DataContext theta) } ; doNotQuantifyTyVars dvs err_ctx @@ -3177,12 +3177,12 @@ tcDataDefn err_ctxt roles_info tc_name ; (bndrs, stupid_theta, res_kind) <- initZonkEnv NoFlexi $ runZonkBndrT (zonkTyVarBindersX tc_bndrs) $ \ bndrs -> - do { stupid_theta <- zonkTcTypesToTypesX stupid_tc_theta - ; res_kind <- zonkTcTypeToTypeX res_kind + do { stupid_theta <- zonkTcTypesToTypesX tc_stupid_theta + ; res_kind <- zonkTcTypeToTypeX tc_res_kind ; return (bndrs, stupid_theta, res_kind) } ; tycon <- fixM $ \ rec_tycon -> do - { data_cons <- tcConDecls DDataType rec_tycon tc_bndrs res_kind cons + { data_cons <- tcConDecls DDataType rec_tycon tc_bndrs tc_res_kind cons ; tc_rhs <- mk_tc_rhs hsc_src rec_tycon data_cons ; tc_rep_nm <- newTyConRepName tc_name @@ -3253,7 +3253,7 @@ kcTyFamInstEqn tc_fam_tc ; discardResult $ bindOuterFamEqnTKBndrs_Q_Tv outer_bndrs $ - do { (_fam_app, res_kind) <- tcFamTyPats tc_fam_tc hs_pats + do { (_fam_app, res_kind) <- tcFamTyPats Nothing tc_fam_tc hs_pats ; tcCheckLHsTypeInContext hs_rhs_ty (TheKind res_kind) } -- Why "_Tv" here? Consider (#14066) -- type family Bar x y where @@ -3275,7 +3275,7 @@ tcTyFamInstEqn fam_tc mb_clsinfo , feqn_rhs = hs_rhs_ty })) = setSrcSpanA loc $ do { traceTc "tcTyFamInstEqn" $ - vcat [ ppr loc, ppr fam_tc <+> ppr hs_pats + vcat [ ppr loc, ppr fam_tc <+> ppr hs_pats <+> ppr outer_bndrs , text "fam tc bndrs" <+> pprTyVars (tyConTyVars fam_tc) , case mb_clsinfo of NotAssociated {} -> empty @@ -3360,24 +3360,52 @@ So, we use bindOuterFamEqnTKBndrs (which does not create an implication for the telescope), and generalise over /all/ the variables in the LHS, without treating the explicitly-quantified ones specially. Wrinkles: - - When generalising, include the explicit user-specified forall'd +(GT1) When generalising, include the explicit user-specified forall'd variables, so that we get an error from Validity.checkFamPatBinders if a forall'd variable is not bound on the LHS - - We still want to complain about a bad telescope among the user-specified +(GT2) We still want to complain about a bad telescope among the user-specified variables. So in checkFamTelescope we emit an implication constraint quantifying only over them, purely so that we get a good telescope error. - - Note that, unlike a type signature like +(GT3) Note that, unlike a type signature like f :: forall (a::k). blah we do /not/ care about the Inferred/Specified designation or order for the final quantified tyvars. Type-family instances are not invoked directly in Haskell source code, so visible type application etc plays no role. -See also Note [Re-quantify type variables in rules] in -GHC.Tc.Gen.Rule, which explains a /very/ similar design when -generalising over the type of a rewrite rule. +(GT4) Consider #25647 (with UnliftedNewtypes) + type N :: forall r. (TYPE r -> TYPE r) -> TYPE r + newtype N f where { MkN :: ff (N ff) -> N ff } + When kind-checking the type signature for MkN we'll start wtih + ff :: TYPE kappa -> TYPE kappa + MkN :: ff (N @kappa) ff -> N @kappa ff + Then we generalise /and default the RuntimeRep variable kappa/ + (via `kindGeneralizeAll` in `tcConDecl`), thus kappa := LiftedRep + + But now the newtype looks like a GADT and we get an error + A newtype must not be a GADT + + This seems OK. We are just following the rules. + + But this variant (the original report in #25647) + data family Fix2 :: (k -> Type) -> k + newtype instance Fix2 f where { In2 :: f (Fix2 f) -> Fix2 f } + At the `newtype instance`, we first + 1. Find the kind of the newtype instance in `tcDataFamInstHeader` + 2. Typecheck the newtype definitition itself in `tcConDecl` + In step 1 we do /not/ want to get + newtype instance forall r . Fix2 (f :: TYPE r -> TYPE r) :: TYPE r where + If we do, we'll get that same "newtype must not be GADT" error as for N above. + Rather, we want to default the RuntimeRep variable r := LiftedRep. Hence + the use of `DefaultNonStandardTyVars` in `tcDataFamInstHeader`. The key thing + is that we must make the /same/ choice here as we do in kind-checking the data + constructor's type. + +See also Note [Re-quantify type variables in rules] in GHC.Tc.Gen.Rule, which +explains a /very/ similar design when generalising over the type of a rewrite +rule. -} @@ -3402,7 +3430,7 @@ tcTyFamInstEqnGuts fam_tc mb_clsinfo outer_hs_bndrs hs_pats hs_rhs_ty ; (tclvl, wanted, (outer_bndrs, (lhs_ty, rhs_ty))) <- pushLevelAndSolveEqualitiesX "tcTyFamInstEqnGuts" $ bindOuterFamEqnTKBndrs skol_info outer_hs_bndrs $ - do { (lhs_ty, rhs_kind) <- tcFamTyPats fam_tc hs_pats + do { (lhs_ty, rhs_kind) <- tcFamTyPats (Just skol_info) fam_tc hs_pats -- Ensure that the instance is consistent with its -- parent class (#16008) ; addConsistencyConstraints mb_clsinfo lhs_ty @@ -3423,7 +3451,7 @@ tcTyFamInstEqnGuts fam_tc mb_clsinfo outer_hs_bndrs hs_pats hs_rhs_ty -- See Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] @@ -3753,23 +3781,30 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs res_kind tag_map ; return (NE.singleton dc) } -tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map - -- NB: don't use res_kind here, as it's ill-scoped. Instead, +tcConDecl new_or_data dd_info rep_tycon tc_bndrs _tc_res_kind tag_map + -- NB: don't use _tc_res_kind here, as it's ill-scoped. Instead, -- we get the res_kind by typechecking the result type. (ConDeclGADT { con_names = names , con_bndrs = L _ outer_hs_bndrs , con_mb_cxt = cxt, con_g_args = hs_args , con_res_ty = hs_res_ty }) = addErrCtxt (DataConDefCtxt names) $ - do { traceTc "tcConDecl 1 gadt" (ppr names) + do { traceTc "tcConDecl 1 gadt" (ppr names $$ ppr _tc_res_kind) ; let L _ name :| _ = names ; skol_info <- mkSkolemInfo (DataConSkol name) - ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts))) + ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind))) <- pushLevelAndSolveEqualitiesX "tcConDecl:GADT" $ tcOuterTKBndrs skol_info outer_hs_bndrs $ do { ctxt <- tcHsContext cxt + ; (res_ty, res_kind) <- tcInferLHsTypeKind hs_res_ty - -- See Note [GADT return kinds] + -- See Note [GADT return kinds] + + -- See Note [Datatype return kinds] + ; let exp_kind = getArgExpKind new_or_data res_kind + ; btys <- tcConGADTArgs exp_kind hs_args + + ; traceTc "tcConDecl 1a gadt" (ppr res_ty <+> dcolon <+> ppr res_kind) -- For data instances (only), ensure that the return type, -- res_ty, is a substitution instance of the header. @@ -3784,13 +3819,9 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map addErrCtxt (DataConResTyCtxt names) $ unifyType Nothing res_ty head_shape } - -- See Note [Datatype return kinds] - ; let exp_kind = getArgExpKind new_or_data res_kind - ; btys <- tcConGADTArgs exp_kind hs_args - ; let (arg_tys, stricts) = unzip btys ; field_lbls <- lookupConstructorFields name - ; return (ctxt, arg_tys, res_ty, field_lbls, stricts) + ; return (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind) } ; outer_bndrs <- scopedSortOuter outer_bndrs @@ -3801,7 +3832,10 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map tcMkPhiTy ctxt $ tcMkScaledFunTys arg_tys $ res_ty) - ; traceTc "tcConDecl:GADT" (ppr names $$ ppr res_ty $$ ppr tkvs) + ; traceTc "tcConDecl:GADT" (vcat [ text "names:" <+> ppr names + , text "tkvs:" <+> ppr tkvs + , text "res_ty:" <+> ppr res_ty + , text "res_kind:" <+> ppr res_kind ]) ; reportUnsolvedEqualities skol_info tkvs tclvl wanted ; let tvbndrs = mkTyVarBinders InferredSpec tkvs ++ outer_tv_bndrs ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -790,10 +790,10 @@ tcDataFamInstDecl mb_clsinfo tv_skol_env , text "eta_tcbs" <+> ppr eta_tcbs ] ; (rep_tc, (axiom, ax_rhs)) <- fixM $ \ ~(rec_rep_tc, _) -> do { data_cons <- tcExtendTyVarEnv (binderVars tc_ty_binders) $ - -- For H98 decls, the tyvars scope - -- over the data constructors - tcConDecls (DDataInstance orig_res_ty) rec_rep_tc tc_ty_binders tc_res_kind - hs_cons + -- tcExtendTyVarEnv: for H98 decls, the tyvars + -- scope over the data constructors + tcConDecls (DDataInstance orig_res_ty) rec_rep_tc + tc_ty_binders tc_res_kind hs_cons ; rep_tc_name <- newFamInstTyConName lfam_name pats ; axiom_name <- newFamInstAxiomName lfam_name [pats] @@ -933,7 +933,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity <- pushLevelAndSolveEqualitiesX "tcDataFamInstHeader" $ bindOuterFamEqnTKBndrs skol_info hs_outer_bndrs $ -- Binds skolem TcTyVars do { stupid_theta <- tcHsContext hs_ctxt - ; (lhs_ty, lhs_kind) <- tcFamTyPats fam_tc hs_pats + ; (lhs_ty, lhs_kind) <- tcFamTyPats (Just skol_info) fam_tc hs_pats ; (lhs_applied_ty, lhs_applied_kind) <- tcInstInvisibleTyBinders lhs_ty lhs_kind -- See Note [Data family/instance return kinds] @@ -943,11 +943,6 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- with its parent class ; addConsistencyConstraints mb_clsinfo lhs_ty - -- Add constraints from the data constructors - -- Fix #25611 - -- See DESIGN CHOICE in Note [Kind inference for data family instances] - ; when is_H98_or_newtype $ kcConDecls lhs_applied_kind hs_cons - -- Check that the result kind of the TyCon applied to its args -- is compatible with the explicit signature (or Type, if there -- is none) @@ -956,6 +951,11 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity ; res_kind <- tc_kind_sig m_ksig ; _ <- unifyKind (Just . HsTypeRnThing $ unLoc hs_lhs) lhs_applied_kind res_kind + -- Add constraints from the data constructors + -- Fix #25611 + -- See DESIGN CHOICE in Note [Kind inference for data family instances] + ; when is_H98_or_newtype $ kcConDecls lhs_applied_kind hs_cons + ; traceTc "tcDataFamInstHeader" $ vcat [ ppr fam_tc, ppr m_ksig, ppr lhs_applied_kind, ppr res_kind, ppr m_ksig] ; return ( stupid_theta @@ -975,7 +975,10 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs + -- DefaultNonStandardTyVars: see (GT4) in + -- GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] + ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] @@ -999,7 +1002,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- Split up the LHS type to get the type patterns -- For the scopedSort see Note [Generalising in tcTyFamInstEqnGuts] - ; let pats = unravelFamInstPats lhs_ty + ; let pats = unravelFamInstPats lhs_ty ; return (final_tvs, mkVarSet non_user_tvs, pats, master_res_kind, stupid_theta) } where ===================================== compiler/GHC/Types/Error.hs ===================================== @@ -298,8 +298,8 @@ data UnknownDiagnostic opts hint where type UnknownDiagnosticFor a = UnknownDiagnostic (DiagnosticOpts a) (DiagnosticHint a) instance (HasDefaultDiagnosticOpts opts, Outputable hint) => Diagnostic (UnknownDiagnostic opts hint) where - type DiagnosticOpts (UnknownDiagnostic opts _) = opts - type DiagnosticHint (UnknownDiagnostic _ hint) = hint + type DiagnosticOpts (UnknownDiagnostic opts hint) = opts + type DiagnosticHint (UnknownDiagnostic opts hint) = hint diagnosticMessage opts (UnknownDiagnostic f _ diag) = diagnosticMessage (f opts) diag diagnosticReason (UnknownDiagnostic _ _ diag) = diagnosticReason diag diagnosticHints (UnknownDiagnostic _ f diag) = map f (diagnosticHints diag) ===================================== compiler/Language/Haskell/Syntax/Decls.hs ===================================== @@ -809,9 +809,11 @@ data HsDataDefn pass -- The payload of a data type defn -- *and* for data family instances = -- | Declares a data type or newtype, giving its constructors -- @ - -- data/newtype T a = - -- data/newtype instance T [a] = + -- data/newtype T a :: ksig = + -- data/newtype instance T [a] :: ksig = -- @ + -- The HsDataDefn describes the (optional) kind signature and the + -- but not the `data T a` or `newtype T [a]` headers HsDataDefn { dd_ext :: XCHsDataDefn pass, dd_ctxt :: Maybe (LHsContext pass), -- ^ Context dd_cType :: Maybe (XRec pass CType), ===================================== compiler/ghc.cabal.in ===================================== @@ -699,6 +699,7 @@ Library GHC.Runtime.Interpreter.JS GHC.Runtime.Interpreter.Process GHC.Runtime.Interpreter.Types + GHC.Runtime.Interpreter.Types.SymbolCache GHC.Runtime.Interpreter.Wasm GHC.Runtime.Loader GHC.Runtime.Utils ===================================== rts/Interpreter.c ===================================== @@ -182,6 +182,8 @@ int rts_stop_on_exception = 0; #if defined(INTERP_STATS) +#define N_CODES 128 + /* Hacky stats, for tuning the interpreter ... */ int it_unknown_entries[N_CLOSURE_TYPES]; int it_total_unknown_entries; @@ -195,8 +197,8 @@ int it_slides; int it_insns; int it_BCO_entries; -int it_ofreq[27]; -int it_oofreq[27][27]; +int it_ofreq[N_CODES]; +int it_oofreq[N_CODES][N_CODES]; int it_lastopc; @@ -210,9 +212,9 @@ void interp_startup ( void ) for (i = 0; i < N_CLOSURE_TYPES; i++) it_unknown_entries[i] = 0; it_slides = it_insns = it_BCO_entries = 0; - for (i = 0; i < 27; i++) it_ofreq[i] = 0; - for (i = 0; i < 27; i++) - for (j = 0; j < 27; j++) + for (i = 0; i < N_CODES; i++) it_ofreq[i] = 0; + for (i = 0; i < N_CODES; i++) + for (j = 0; j < N_CODES; j++) it_oofreq[i][j] = 0; it_lastopc = 0; } @@ -234,14 +236,14 @@ void interp_shutdown ( void ) } debugBelch("%d insns, %d slides, %d BCO_entries\n", it_insns, it_slides, it_BCO_entries); - for (i = 0; i < 27; i++) + for (i = 0; i < N_CODES; i++) debugBelch("opcode %2d got %d\n", i, it_ofreq[i] ); for (k = 1; k < 20; k++) { o_max = 0; i_max = j_max = 0; - for (i = 0; i < 27; i++) { - for (j = 0; j < 27; j++) { + for (i = 0; i < N_CODES; i++) { + for (j = 0; j < N_CODES; j++) { if (it_oofreq[i][j] > o_max) { o_max = it_oofreq[i][j]; i_max = i; j_max = j; @@ -259,6 +261,12 @@ void interp_shutdown ( void ) #else // !INTERP_STATS +void interp_startup( void ){ +} + +void interp_shutdown( void ){ +} + #define INTERP_TICK(n) /* nothing */ #endif @@ -419,7 +427,7 @@ eval: eval_obj: obj = UNTAG_CLOSURE(tagged_obj); - INTERP_TICK(it_total_evals); + INTERP_TICK(it_total_entries); IF_DEBUG(interpreter, debugBelch( @@ -1098,7 +1106,7 @@ run_BCO: INTERP_TICK(it_insns); #if defined(INTERP_STATS) - ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < 27 ); + ASSERT( (int)instrs[bciPtr] >= 0 && (int)instrs[bciPtr] < N_CODES ); it_ofreq[ (int)instrs[bciPtr] ] ++; it_oofreq[ it_lastopc ][ (int)instrs[bciPtr] ] ++; it_lastopc = (int)instrs[bciPtr]; ===================================== rts/Interpreter.h ===================================== @@ -9,3 +9,5 @@ #pragma once RTS_PRIVATE Capability *interpretBCO (Capability* cap); +void interp_startup ( void ); +void interp_shutdown ( void ); ===================================== rts/RtsMain.c ===================================== @@ -17,6 +17,7 @@ #include "Prelude.h" #include "Task.h" #include "Excn.h" +#include "Interpreter.h" #if defined(DEBUG) # include "Printer.h" /* for printing */ @@ -56,6 +57,8 @@ int hs_main ( int argc, char *argv[], // program args hs_init_ghc(&argc, &argv, rts_config); + interp_startup(); + BEGIN_WINDOWS_VEH_HANDLER // kick off the computation by creating the main thread with a pointer @@ -96,6 +99,8 @@ int hs_main ( int argc, char *argv[], // program args END_WINDOWS_VEH_HANDLER + interp_shutdown(); + shutdownHaskellAndExit(exit_status, 0 /* !fastExit */); // No code beyond this point. Dead code elimination will remove it } ===================================== testsuite/tests/indexed-types/should_compile/T17536.hs ===================================== @@ -28,3 +28,27 @@ type family M m where g :: M One -> Int g x = x + + +-- make sure wildcard and non-wildcard type variables are treated the same + +type R1 :: RuntimeRep -> Type +type family R1 r where + R1 r = Int + +r1 :: R1 FloatRep -> Int +r1 x = x + +type L1 :: Levity -> Type +type family L1 l where + L1 l = Int + +l1 :: L1 Unlifted -> Int +l1 x = x + +type M1 :: Multiplicity -> Type +type family M1 m where + M1 m = Int + +g1 :: M1 One -> Int +g1 x = x ===================================== testsuite/tests/indexed-types/should_compile/T17536c.hs ===================================== @@ -15,3 +15,11 @@ type family R r a where r :: R FloatRep Float# -> Int r x = x + +-- make sure wildcard and non-wildcard type variables are treated the same +type R1 :: forall (r :: RuntimeRep) -> TYPE r -> Type +type family R1 r a where + R1 r a = Int + +r1 :: R1 FloatRep Float# -> Int +r1 x = x ===================================== testsuite/tests/indexed-types/should_compile/T25611d.hs ===================================== @@ -20,7 +20,7 @@ data instance T p q where MkkV :: forall l. l Int# -> T l Int# type N :: TYPE r -> TYPE r -newtype N a = MkN a +newtype N (a::TYPE r) = MkN a f :: Int# -> N Int# f x = MkN x @@ -29,7 +29,7 @@ g :: Int -> N Int g x = MkN x data family D :: Type -> k -> k -newtype instance D Int a = MkD a +newtype instance D Int (a::TYPE r) = MkD a f1 :: Int# -> D Int Int# f1 x = MkD x ===================================== testsuite/tests/indexed-types/should_fail/T9357.stderr ===================================== @@ -1,4 +1,4 @@ T9357.hs:12:15: error: [GHC-91510] - • Illegal polymorphic type: forall (a :: TYPE t). a -> a + Illegal polymorphic type: forall a. a -> a • In the type family instance declaration for ‘F’ ===================================== testsuite/tests/rename/should_fail/T23512a.stderr ===================================== @@ -1,6 +1,3 @@ - T23512a.hs:6:31: error: [GHC-76037] Not in scope: type variable ‘j’ T23512a.hs:6:36: error: [GHC-76037] Not in scope: type variable ‘j’ - -T23512a.hs:9:20: error: [GHC-76037] Not in scope: type variable ‘k’ ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.hs ===================================== @@ -0,0 +1,21 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647_fail where + +import GHC.Exts +import Data.Kind + +-- Rejected because in the type signature for In2 we default +-- the runtime-rep variable to LiftedRep, and that makes In2 +-- into a GADT +newtype Fix2 f :: TYPE r where + In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff + +-- Rejected for the same reason +type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4a f where + In4a :: ff (Fix4a ff) -> Fix4a ff + +data family Dix6 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix6 f where + DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.stderr ===================================== @@ -0,0 +1,23 @@ +T25647_fail.hs:12:4: [GHC-89498] + A newtype must not be a GADT + In2 :: forall (ff :: * -> *). + ff (Fix2 @LiftedRep ff) -> Fix2 @LiftedRep ff + In the definition of data constructor ‘In2’ + In the newtype declaration for ‘Fix2’ + +T25647_fail.hs:17:3: [GHC-89498] + A newtype must not be a GADT + In4a :: forall (ff :: * -> *). + ff (Fix4a @LiftedRep ff) -> Fix4a @LiftedRep ff + In the definition of data constructor ‘In4a’ + In the newtype declaration for ‘Fix4a’ + +T25647_fail.hs:21:3: [GHC-18872] + Couldn't match a lifted type with an unlifted type + When matching types + ff :: TYPE IntRep -> TYPE IntRep + f0 :: * -> TYPE IntRep + Expected: Dix6 f0 + Actual: Dix6 ff + In the result type of data constructor ‘DIn6’ + In the newtype family instance declaration for ‘Dix6’ \ No newline at end of file ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -0,0 +1,82 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647a where + +import GHC.Exts +import Data.Kind + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r +newtype Fix2 f :: TYPE r where + In2 :: forall r (ff :: TYPE r -> TYPE r). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f +type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f +type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4 f where + In4 :: forall rr (ff :: TYPE rr -> TYPE rr). + ff (Fix4 ff) -> Fix4 @rr ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in GADT syntax +-- The newtype instance defaults to LiftedRep +data family Dix4 :: (k -> TYPE r) -> k +newtype instance Dix4 f where + DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +-- -- newtype instance that is not TYPE 'LiftedRep +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff + +data family Dix7 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix7 f = DIn7 (f (Dix7 f)) + + +-- user written wildcards +type Dix8 :: RuntimeRep -> Type +data family Dix8 r +newtype instance Dix8 _ = Dix8 Int + +dix8 :: Dix8 FloatRep -> Int +dix8 (Dix8 x) = x ===================================== testsuite/tests/typecheck/should_compile/T25647b.hs ===================================== @@ -0,0 +1,65 @@ +{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647b where + +import GHC.Exts +import Data.Kind + +--------------------------- +-- without UnliftedNewtypes +--------------------------- + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: (Type -> Type) -> Type +newtype Fix2 f where + In2 :: forall (ff :: Type -> Type). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix3 :: (Type -> Type) -> Type +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix4 :: (Type -> Type) -> Type +newtype Fix4 f where + In4 :: forall (ff :: Type -> Type). + ff (Fix4 ff) -> Fix4 ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/typecheck/should_compile/T25725.hs ===================================== @@ -0,0 +1,17 @@ +{-# LANGUAGE TypeFamilies, PolyKinds #-} + +module T25725 where + +import Data.Kind +import GHC.Exts + +--This one was OK +data D :: TYPE r -> Type where + MkD :: p -> D p + +-- But this was rejected +data family Dix4 :: Type -> k +data instance Dix4 Int :: TYPE r -> Type where + DIn4 :: p -> Dix4 Int p + + ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -933,3 +933,6 @@ test('T25266', normal, compile, ['']) test('T25266a', normal, compile_fail, ['']) test('T25266b', normal, compile, ['']) test('T25597', normal, compile, ['']) +test('T25647a', normal, compile, ['']) +test('T25647b', normal, compile, ['']) +test('T25647_fail', normal, compile_fail, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/602f6072d5fd8039e918ab77b7adde54d5cd5312...ccc9152f23177ab7a542852ffedf626edcdcef95 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/602f6072d5fd8039e918ab77b7adde54d5cd5312...ccc9152f23177ab7a542852ffedf626edcdcef95 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 20:26:19 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Fri, 07 Feb 2025 15:26:19 -0500 Subject: [Git][ghc/ghc][wip/T25693] 2 commits: hadrian: Drop uses of head/tail Message-ID: <67a66c6bb4a20_3efddcc07d843575@gitlab.mail> Ben Gamari pushed to branch wip/T25693 at Glasgow Haskell Compiler / GHC Commits: 7e865429 by Ben Gamari at 2025-02-07T15:25:57-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - 123db914 by Ben Gamari at 2025-02-07T15:25:57-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 2 changed files: - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs Changes: ===================================== hadrian/src/Rules/Dependencies.hs ===================================== @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wno-deprecations #-} +{-# OPTIONS_GHC -Wno-x-data-list-nonempty-unzip #-} module Rules.Dependencies (buildPackageDependencies) where ===================================== hadrian/src/Settings/Parser.hs ===================================== @@ -189,7 +189,7 @@ matchStringSettingsM s = do else go (head ks) where go k - | k == s = State.modify tail + | k == s = State.modify (drop 1) | otherwise = throwError $ "expected " ++ show s ++ ", got " ++ show k View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/becffc9cd840215cc94de44c77e60a3378278e58...123db91417734ff5b6080cfa86b16fad60538766 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/becffc9cd840215cc94de44c77e60a3378278e58...123db91417734ff5b6080cfa86b16fad60538766 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 21:16:55 2025 From: gitlab at gitlab.haskell.org (Ben Gamari (@bgamari)) Date: Fri, 07 Feb 2025 16:16:55 -0500 Subject: [Git][ghc/ghc][wip/T25693] 2 commits: hadrian: Drop uses of head/tail Message-ID: <67a6784724df2_3efddc80d0685127e@gitlab.mail> Ben Gamari pushed to branch wip/T25693 at Glasgow Haskell Compiler / GHC Commits: f47bcc22 by Ben Gamari at 2025-02-07T16:16:49-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - 30528c4a by Ben Gamari at 2025-02-07T16:16:49-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 4 changed files: - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs Changes: ===================================== hadrian/src/Hadrian/Utilities.hs ===================================== @@ -149,7 +149,10 @@ as /c/foo, while it occasionally falls over on paths of the form C:\foo. -- -- See Note [Absolute paths and MSYS]. (-/-) :: FilePath -> FilePath -> FilePath -_ -/- b | isAbsolute b && not (isAbsolute $ tail b) = b +_ -/- b + | isAbsolute b + , _:b' <- b + , not (isAbsolute b') = b "" -/- b = b a -/- b | last a == '/' = a ++ b @@ -636,7 +639,8 @@ renderLibrary name lib synopsis = renderBox $ -- | ipsum | -- \----------/ renderBox :: [String] -> String -renderBox ls = tail $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) +renderBox ls = + drop 1 $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) where -- Minimum total width of the box in characters minimumBoxWidth = 32 ===================================== hadrian/src/Oracles/ModuleFiles.hs ===================================== @@ -169,10 +169,12 @@ moduleFilesOracle = void $ do let pairs = sort $ mainpairs ++ [ (encodeModule d f, f) | (fs, d) <- result, f <- fs ] multi = [ (m, f1, f2) | (m, f1):(n, f2):_ <- tails pairs, m == n ] - unless (null multi) $ do - let (m, f1, f2) = head multi - error $ "Module " ++ m ++ " has more than one source file: " - ++ f1 ++ " and " ++ f2 ++ "." + + case multi of + [] -> return () + (m, f1, f2) : _ -> + fail $ "Module " ++ m ++ " has more than one source file: " + ++ f1 ++ " and " ++ f2 ++ "." return $ lookupAll modules pairs -- Optimisation: we discard Haskell files here, because they are never used ===================================== hadrian/src/Rules/Dependencies.hs ===================================== @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wno-deprecations #-} +{-# OPTIONS_GHC -Wno-x-data-list-nonempty-unzip #-} module Rules.Dependencies (buildPackageDependencies) where ===================================== hadrian/src/Settings/Parser.hs ===================================== @@ -184,14 +184,11 @@ instance Match SettingsM where matchStringSettingsM :: String -> SettingsM () matchStringSettingsM s = do ks <- State.get - if null ks - then throwError $ "expected " ++ show s ++ ", got nothing" - else go (head ks) - - where go k - | k == s = State.modify tail - | otherwise = throwError $ - "expected " ++ show s ++ ", got " ++ show k + case ks of + [] -> throwError $ "expected " ++ show s ++ ", got nothing" + k:_ + | k == s -> State.modify (drop 1) + | otherwise -> throwError $ "expected " ++ show s ++ ", got " ++ show k matchOneOfSettingsM :: [SettingsM a] -> SettingsM a matchOneOfSettingsM acts = StateT $ \k -> do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/123db91417734ff5b6080cfa86b16fad60538766...30528c4a2b0cd8b0ece1f33c4328737010dfbc4a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/123db91417734ff5b6080cfa86b16fad60538766...30528c4a2b0cd8b0ece1f33c4328737010dfbc4a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Feb 7 23:27:38 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 07 Feb 2025 18:27:38 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 8 commits: base: Label threads forked by IO operations Message-ID: <67a696ea92c29_3efddc1e87ec4620f7@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: bab55603 by Ben Gamari at 2025-02-07T18:27:15-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - d70ae5a3 by Ben Gamari at 2025-02-07T18:27:16-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 58cc664d by Ben Gamari at 2025-02-07T18:27:16-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - b8b0096f by Ben Gamari at 2025-02-07T18:27:16-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 1a361e0f by Ben Gamari at 2025-02-07T18:27:16-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - c5ed83eb by Ben Gamari at 2025-02-07T18:27:16-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - ec91a79b by Ben Gamari at 2025-02-07T18:27:16-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - aa0df0c5 by Ben Gamari at 2025-02-07T18:27:16-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 11 changed files: - .gitlab/generate-ci/gen_ci.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -5,6 +5,12 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ViewPatterns #-} +{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} + +{-# HLINT ignore "Use newtype instead of data" #-} +{-# HLINT ignore "Use camelCase" #-} +{-# LANGUAGE DerivingStrategies #-} + import Data.Aeson as A import qualified Data.Map as Map import Data.Map (Map) @@ -199,7 +205,7 @@ data FlavourTrans = data BaseFlavour = Release | Validate | SlowValidate deriving Eq ----------------------------------------------------------------------------- --- Build Configs +-- Build Configurations ----------------------------------------------------------------------------- -- | A standard build config @@ -244,7 +250,7 @@ releaseConfig = vanilla { buildFlavour = Release } debug :: BuildConfig debug = vanilla { buildFlavour = SlowValidate , withAssertions = True - -- WithNuma so at least one job tests Numa + -- WithNuma so at least one job tests Numa , withNuma = True } @@ -280,21 +286,21 @@ usePerfProfilingTestsuite :: BuildConfig -> BuildConfig usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True } ----------------------------------------------------------------------------- --- Platform specific variables +-- Identifying Platforms ----------------------------------------------------------------------------- -- | These tags have to match what we call the runners on gitlab runnerTag :: Arch -> Opsys -> String runnerTag arch (Linux _) = case arch of - Amd64 -> "x86_64-linux" - AArch64 -> "aarch64-linux" - I386 -> "x86_64-linux" -runnerTag AArch64 Darwin = "aarch64-darwin" -runnerTag Amd64 Darwin = "x86_64-darwin-m1" -runnerTag Amd64 Windows = "new-x86_64-windows" + Amd64 -> "x86_64-linux" + AArch64 -> "aarch64-linux" + I386 -> "x86_64-linux" +runnerTag AArch64 Darwin = "aarch64-darwin" +runnerTag Amd64 Darwin = "x86_64-darwin-m1" +runnerTag Amd64 Windows = "new-x86_64-windows" runnerTag Amd64 FreeBSD14 = "x86_64-freebsd14" -runnerTag _ _ = error "Invalid arch/opsys" +runnerTag _ _ = error "Invalid arch/opsys" tags :: Arch -> Opsys -> BuildConfig -> [String] tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use @@ -305,34 +311,34 @@ runnerPerfTag arch sys = runnerTag arch sys ++ "-perf" -- These names are used to find the docker image so they have to match what is -- in the docker registry. distroName :: LinuxDistro -> String -distroName Debian12 = "deb12" -distroName Debian11 = "deb11" -distroName Debian11Js = "deb11-emsdk-closure" +distroName Debian12 = "deb12" +distroName Debian11 = "deb11" +distroName Debian11Js = "deb11-emsdk-closure" distroName Debian12Riscv = "deb12-riscv" -distroName Debian10 = "deb10" -distroName Debian9 = "deb9" -distroName Fedora33 = "fedora33" -distroName Fedora38 = "fedora38" -distroName Ubuntu1804 = "ubuntu18_04" -distroName Ubuntu2004 = "ubuntu20_04" -distroName Ubuntu2204 = "ubuntu22_04" -distroName Centos7 = "centos7" -distroName Alpine312 = "alpine3_12" -distroName Alpine318 = "alpine3_18" -distroName Alpine320 = "alpine3_20" -distroName AlpineWasm = "alpine3_20-wasm" -distroName Rocky8 = "rocky8" +distroName Debian10 = "deb10" +distroName Debian9 = "deb9" +distroName Fedora33 = "fedora33" +distroName Fedora38 = "fedora38" +distroName Ubuntu1804 = "ubuntu18_04" +distroName Ubuntu2004 = "ubuntu20_04" +distroName Ubuntu2204 = "ubuntu22_04" +distroName Centos7 = "centos7" +distroName Alpine312 = "alpine3_12" +distroName Alpine318 = "alpine3_18" +distroName Alpine320 = "alpine3_20" +distroName AlpineWasm = "alpine3_20-wasm" +distroName Rocky8 = "rocky8" opsysName :: Opsys -> String opsysName (Linux distro) = "linux-" ++ distroName distro -opsysName Darwin = "darwin" -opsysName FreeBSD14 = "freebsd14" -opsysName Windows = "windows" +opsysName Darwin = "darwin" +opsysName FreeBSD14 = "freebsd14" +opsysName Windows = "windows" archName :: Arch -> String -archName Amd64 = "x86_64" +archName Amd64 = "x86_64" archName AArch64 = "aarch64" -archName I386 = "i386" +archName I386 = "i386" binDistName :: Arch -> Opsys -> BuildConfig -> String binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc @@ -341,16 +347,18 @@ binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc -- Either the change is reflected by modifying the flavourString or directly (as is -- the case for settings which affect environment variables) testEnv :: Arch -> Opsys -> BuildConfig -> String -testEnv arch opsys bc = intercalate "-" $ - [ archName arch - , opsysName opsys ] - ++ ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] - ++ ["unreg" | unregisterised bc ] - ++ ["numa" | withNuma bc ] - ++ ["zstd" | withZstd bc ] - ++ ["no_tntc" | not (tablesNextToCode bc) ] - ++ ["cross_"++triple | Just triple <- pure $ crossTarget bc ] - ++ [flavourString (mkJobFlavour bc)] +testEnv arch opsys bc = + intercalate "-" $ concat + [ [ archName arch + , opsysName opsys ] + , ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] + , ["unreg" | unregisterised bc ] + , ["numa" | withNuma bc ] + , ["zstd" | withZstd bc ] + , ["no_tntc" | not (tablesNextToCode bc) ] + , ["cross_"++triple | Just triple <- pure $ crossTarget bc ] + , [flavourString (mkJobFlavour bc)] + ] -- | The hadrian flavour string we are going to use for this build flavourString :: Flavour -> String @@ -384,7 +392,7 @@ dockerImage arch (Linux distro) = dockerImage _ _ = Nothing ----------------------------------------------------------------------------- --- Platform specific variables +-- Platform-specific variables ----------------------------------------------------------------------------- -- The variables map is a monoidal map so that we don't ever accidentally lose @@ -438,35 +446,36 @@ opsysVariables _ FreeBSD14 = mconcat , "CABAL_INSTALL_VERSION" =: "3.10.3.0" ] opsysVariables arch (Linux distro) = distroVariables arch distro -opsysVariables AArch64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "aarch64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables Amd64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "x86_64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - -- "# Only Sierra and onwards supports clock_gettime. See #12858" - , "ac_cv_func_clock_gettime" =: "no" - -- # Only newer OS Xs support utimensat. See #17895 - , "ac_cv_func_utimensat" =: "no" - -- # Only newer OS Xs support futimens. See #22938 - , "ac_cv_func_futimens" =: "no" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" +opsysVariables AArch64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "aarch64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + ] +opsysVariables Amd64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "x86_64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + -- Only Sierra and onwards supports clock_gettime. See #12858 + , "ac_cv_func_clock_gettime" =: "no" + -- Only newer OS Xs support utimensat. See #17895 + , "ac_cv_func_utimensat" =: "no" + -- Only newer OS Xs support futimens. See #22938 + , "ac_cv_func_futimens" =: "no" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables _ (Windows {}) = - mconcat [ "MSYSTEM" =: "CLANG64" - , "LANG" =: "en_US.UTF-8" - , "CABAL_INSTALL_VERSION" =: "3.10.2.0" - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - , "GHC_VERSION" =: "9.6.4" ] + ] +opsysVariables _ (Windows {}) = mconcat + [ "MSYSTEM" =: "CLANG64" + , "LANG" =: "en_US.UTF-8" + , "CABAL_INSTALL_VERSION" =: "3.10.2.0" + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + , "GHC_VERSION" =: "9.6.4" + ] opsysVariables _ _ = mempty alpineVariables :: Arch -> Variables @@ -481,7 +490,7 @@ alpineVariables arch = mconcat $ | I386 <- [arch] ] ++ [ brokenTest "T22033" "#25497" | I386 <- [arch] ] ++ - [-- Bootstrap compiler has incorrectly configured target triple #25200 + [ -- Bootstrap compiler has incorrectly configured target triple #25200 "CONFIGURE_ARGS" =: "--enable-ignore-build-platform-mismatch --build=aarch64-unknown-linux --host=aarch64-unknown-linux --target=aarch64-unknown-linux" | AArch64 <- [arch] ] @@ -491,15 +500,14 @@ distroVariables :: Arch -> LinuxDistro -> Variables distroVariables arch Alpine312 = alpineVariables arch distroVariables arch Alpine318 = alpineVariables arch distroVariables arch Alpine320 = alpineVariables arch -distroVariables _ Centos7 = mconcat [ - "HADRIAN_ARGS" =: "--docs=no-sphinx" - , brokenTest "T22012" "#23979" - ] -distroVariables _ Fedora33 = mconcat +distroVariables _ Centos7 = mconcat [ "HADRIAN_ARGS" =: "--docs=no-sphinx" + , brokenTest "T22012" "#23979" + ] +distroVariables _ Fedora33 = mconcat -- LLC/OPT do not work for some reason in our fedora images -- These tests fail with this error: T11649 T5681 T7571 T8131b -- +/opt/llvm/bin/opt: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/opt) --- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) + -- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) [ "LLC" =: "/bin/false" , "OPT" =: "/bin/false" ] @@ -510,7 +518,7 @@ distroVariables _ _ = mempty ----------------------------------------------------------------------------- data Cache - = Cache { cacheKey :: String + = Cache { cacheKey :: String , cachePaths :: [String] } @@ -550,25 +558,27 @@ data ArtifactsWhen = ArtifactsOnSuccess | ArtifactsOnFailure | ArtifactsAlways instance ToJSON ArtifactsWhen where toJSON ArtifactsOnSuccess = "on_success" toJSON ArtifactsOnFailure = "on_failure" - toJSON ArtifactsAlways = "always" + toJSON ArtifactsAlways = "always" ------------------------------------------------------------------------------ +--------------------------------------------------------------------- -- Rules, when do we run a job ------------------------------------------------------------------------------ +--------------------------------------------------------------------- --- Data structure which records the condition when a job is run. -data OnOffRules = OnOffRules { rule_set :: Rule -- ^ The enabled rules - , when :: ManualFlag -- ^ The additional condition about when to run this job. - } +-- | Data structure which records the condition when a job is run. +data OnOffRules + = OnOffRules { rule_set :: Rule -- ^ The enabled rules + , when :: ManualFlag -- ^ The additional condition about when to run this job. + } -- The initial set of rules, which assumes a Validate pipeline which is run with FullCI. emptyRules :: String -> OnOffRules emptyRules jobName = OnOffRules (ValidateOnly jobName (S.fromList [FullCI])) OnSuccess -- When to run the job -data ManualFlag = Manual -- ^ Only run the job when explicitly triggered by a user - | OnSuccess -- ^ Always run it, if the rules pass (the default) - deriving Eq +data ManualFlag + = Manual -- ^ Only run the job when explicitly triggered by a user + | OnSuccess -- ^ Always run it, if the rules pass (the default) + deriving Eq setRule :: Rule -> OnOffRules -> OnOffRules setRule r (OnOffRules _ m) = OnOffRules r m @@ -595,18 +605,23 @@ manualRule rules = rules { when = Manual } enumRules :: OnOffRules -> [OnOffRule] enumRules (OnOffRules r _) = rulesList where - rulesList = case r of - ValidateOnly s rs -> [OnOffRule On (ValidateOnly s rs) - , OnOffRule Off ReleaseOnly - , OnOffRule Off Nightly ] - Nightly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule Off ReleaseOnly - , OnOffRule On Nightly ] - ReleaseOnly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule On ReleaseOnly - , OnOffRule Off Nightly ] - - + rulesList = + case r of + ValidateOnly s rs -> + [ OnOffRule On (ValidateOnly s rs) + , OnOffRule Off ReleaseOnly + , OnOffRule Off Nightly + ] + Nightly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule Off ReleaseOnly + , OnOffRule On Nightly + ] + ReleaseOnly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule On ReleaseOnly + , OnOffRule Off Nightly + ] data OnOffRule = OnOffRule OnOff Rule @@ -617,102 +632,135 @@ instance ToJSON ManualFlag where toJSON OnSuccess = "on_success" instance ToJSON OnOffRules where - toJSON rules = toJSON [object ([ - "if" A..= and_all (map one_rule (enumRules rules)) - , "when" A..= toJSON (when rules)] - -- Necessary to stop manual jobs stopping pipeline progress - -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure - ++ - ["allow_failure" A..= True | when rules == Manual ])] - + toJSON rules = toJSON + [object $ + [ "if" A..= and_all (map one_rule (enumRules rules)) + , "when" A..= toJSON (when rules) + ] ++ + -- Necessary to stop manual jobs stopping pipeline progress + -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure + [ "allow_failure" A..= True | when rules == Manual ] + ] where - one_rule (OnOffRule onoff r) = ruleString onoff r + one_rule (OnOffRule onoff r) = ruleToCond onoff r +--------------------------------------------------------------------- +-- Rule conditions +--------------------------------------------------------------------- -parens :: [Char] -> [Char] -parens s = "(" ++ s ++ ")" -and_all :: [[Char]] -> [Char] -and_all rs = intercalate " && " (map parens rs) -or_all :: [[Char]] -> [Char] -or_all rs = intercalate " || " (map parens rs) +-- | A predicate in GitLab's rules language. +newtype Cond = Cond { getCond :: String } + deriving newtype (ToJSON) --- | A Rule corresponds to some condition which must be satisifed in order to --- run the job. -data Rule = ReleaseOnly -- ^ Only run this job in a release pipeline - | Nightly -- ^ Only run this job in the nightly pipeline - | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. - deriving (Show, Ord, Eq) - -data ValidateRule = - FullCI -- ^ Run this job when the "full-ci" label is present. - | FastCI -- ^ Run this job on every validation pipeline - | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present - | JSBackend -- ^ Run this job when the "javascript" label is present - | RiscV -- ^ Run this job when the "RISC-V" label is present - | WasmBackend -- ^ Run this job when the "wasm" label is present - | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. - | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. - | IpeData -- ^ Run this job when the "IPE" label is set - | TestPrimops -- ^ Run this job when "test-primops" label is set - | I386Backend -- ^ Run this job when the "i386" label is set - deriving (Show, Ord, Eq) - --- A constant evaluating to True because gitlab doesn't support "true" in the +parens :: Cond -> Cond +parens (Cond s) = Cond $ "(" ++ s ++ ")" + +and_all :: [Cond] -> Cond +and_all = + Cond . intercalate " && " . map (getCond . parens) + +or_all :: [Cond] -> Cond +or_all = + Cond . intercalate " || " . map (getCond . parens) + +type Var = String + +varIsSet :: Var -> Cond +varIsSet var = + Cond $ "$" <> var + +-- | A constant evaluating to True because gitlab doesn't support "true" in the -- expression language. -true :: String -true = "\"true\" == \"true\"" --- A constant evaluating to False because gitlab doesn't support "true" in the +true :: Cond +true = Cond "\"true\" == \"true\"" + +-- | A constant evaluating to False because gitlab doesn't support "true" in the -- expression language. -_false :: String -_false = "\"disabled\" != \"disabled\"" - --- Convert the state of the rule into a string that gitlab understand. -ruleString :: OnOff -> Rule -> String -ruleString On (ValidateOnly only_job_name vs) = - let conds = S.toList vs - empty_only_job = envVarNull "ONLY_JOBS" - run_cond = case conds of - [] -> _false - cs -> or_all (map validateRuleString conds) - escape :: String -> String - escape = concatMap (\c -> if c == '+' then "\\+" else [c]) - - in - or_all [ - -- 1. Case when ONLY_JOBS is set - and_all [ "$ONLY_JOBS", "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" ] - -- 2. Case when ONLY_JOBS is null - , and_all [ empty_only_job, run_cond ] - ] -ruleString Off (ValidateOnly {}) = true -ruleString On ReleaseOnly = "$RELEASE_JOB == \"yes\"" -ruleString Off ReleaseOnly = "$RELEASE_JOB != \"yes\"" -ruleString On Nightly = "$NIGHTLY" -ruleString Off Nightly = envVarNull "NIGHTLY" +_false :: Cond +_false = Cond "\"disabled\" != \"disabled\"" + +labelString :: String -> Cond +labelString s = + Cond $ "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" -labelString :: String -> String -labelString s = "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" +branchStringExact :: String -> Cond +branchStringExact = + varEqString "CI_COMMIT_BRANCH" -branchStringExact :: String -> String -branchStringExact s = envVarString "CI_COMMIT_BRANCH" s +branchStringLike :: String -> Cond +branchStringLike s = + Cond $ "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" -branchStringLike :: String -> String -branchStringLike s = "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" +varEqString :: String -> String -> Cond +varEqString var s = + Cond $ "$" ++ var ++ " == \"" ++ s ++ "\"" -envVarString :: String -> String -> String -envVarString var s = "$" ++ var ++ " == \"" ++ s ++ "\"" +varNeString :: String -> String -> Cond +varNeString var s = + Cond $ "$" ++ var ++ " != \"" ++ s ++ "\"" -envVarNull :: String -> String -envVarNull var = "$" ++ var ++ " == null" +varIsNull :: String -> Cond +varIsNull var = + Cond $ "$" ++ var ++ " == null" +--------------------------------------------------------------------- +-- Our Rules +--------------------------------------------------------------------- -validateRuleString :: ValidateRule -> String -validateRuleString FullCI = or_all ([ labelString "full-ci" - , labelString "marge_bot_batch_merge_job" - , branchStringExact "master" - , branchStringLike "ghc-[0-9]+\\.[0-9]+" - ]) -validateRuleString FastCI = true +-- | A Rule corresponds to some condition which must be satisifed in order to +-- run the job. +data Rule + = ReleaseOnly -- ^ Only run this job in a release pipeline + | Nightly -- ^ Only run this job in the nightly pipeline + | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. + deriving (Show, Ord, Eq) + +data ValidateRule + = FullCI -- ^ Run this job when the "full-ci" label is present. + | FastCI -- ^ Run this job on every validation pipeline + | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present + | JSBackend -- ^ Run this job when the "javascript" label is present + | RiscV -- ^ Run this job when the "RISC-V" label is present + | WasmBackend -- ^ Run this job when the "wasm" label is present + | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. + | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. + | IpeData -- ^ Run this job when the "IPE" label is set + | TestPrimops -- ^ Run this job when "test-primops" label is set + | I386Backend -- ^ Run this job when the "i386" label is set + deriving (Show, Ord, Eq) + +-- | Convert the state of the rule into a string that gitlab understand. +ruleToCond :: OnOff -> Rule -> Cond +ruleToCond On (ValidateOnly only_job_name vs) = + or_all + [ -- 1. Case when ONLY_JOBS is set + and_all [ varIsSet "ONLY_JOBS" + , Cond $ "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" + ] + -- 2. Case when ONLY_JOBS is null + , and_all [ varIsNull "ONLY_JOBS" + , case S.toList vs of + [] -> _false + cs -> or_all (map validateRuleString cs) + ] + ] + where + escape :: String -> String + escape = concatMap (\c -> if c == '+' then "\\+" else [c]) +ruleToCond Off (ValidateOnly {}) = true +ruleToCond On ReleaseOnly = "RELEASE_JOB" `varEqString` "yes" +ruleToCond Off ReleaseOnly = "RELEASE_JOB" `varNeString` "yes" +ruleToCond On Nightly = varIsSet "NIGHTLY" +ruleToCond Off Nightly = varIsNull "NIGHTLY" + + +validateRuleString :: ValidateRule -> Cond +validateRuleString FullCI = or_all [ labelString "full-ci" + , labelString "marge_bot_batch_merge_job" + , branchStringExact "master" + , branchStringLike "ghc-[0-9]+\\.[0-9]+" + ] +validateRuleString FastCI = true validateRuleString LLVMBackend = labelString "LLVM backend" validateRuleString JSBackend = labelString "javascript" @@ -724,6 +772,10 @@ validateRuleString IpeData = labelString "IPE" validateRuleString TestPrimops = labelString "test-primops" validateRuleString I386Backend = labelString "i386" +--------------------------------------------------------------------- +-- The Job type +--------------------------------------------------------------------- + -- | A 'Job' is the description of a single job in a gitlab pipeline. The -- job contains all the information about how to do the build but can be further -- modified with information about when to run jobs, which variables to set for @@ -747,15 +799,15 @@ data Job instance ToJSON Job where toJSON Job{..} = object [ "stage" A..= jobStage - -- Convoluted to avoid download artifacts from ghci job - -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts + -- Convoluted to avoid download artifacts from ghci job + -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts , "needs" A..= map (\j -> object [ "job" A..= j, "artifacts" A..= False ]) jobNeeds , "dependencies" A..= jobDependencies , "image" A..= jobDockerImage , "tags" A..= jobTags , "allow_failure" A..= jobAllowFailure - -- Joining up variables like this may well be the wrong thing to do but - -- at least it doesn't lose information silently by overriding. + -- Joining up variables like this may well be the wrong thing to do but + -- at least it doesn't lose information silently by overriding. , "variables" A..= fmap unwords jobVariables , "artifacts" A..= jobArtifacts , "cache" A..= jobCache @@ -783,7 +835,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } = [ "bash .gitlab/ci.sh setup" , "bash .gitlab/ci.sh configure" , "bash .gitlab/ci.sh build_hadrian" - , "bash .gitlab/ci.sh test_hadrian" ] + , "bash .gitlab/ci.sh test_hadrian" + ] | otherwise = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++ [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++ @@ -803,7 +856,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } [ ".gitlab/ci.sh save_cache" , ".gitlab/ci.sh save_test_output" , ".gitlab/ci.sh clean" - , "cat ci_timings" ] + , "cat ci_timings" + ] jobFlavour = mkJobFlavour buildConfig @@ -819,9 +873,11 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig) , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig) , case crossEmulator buildConfig of - NoEmulator -> case crossTarget buildConfig of - Nothing -> mempty - Just _ -> "CROSS_EMULATOR" =: "NOT_SET" -- we need an emulator but it isn't set. Won't run the testsuite + NoEmulator + -- we need an emulator but it isn't set. Won't run the testsuite + | Just _ <- crossTarget buildConfig + -> "CROSS_EMULATOR" =: "NOT_SET" + | otherwise -> mempty Emulator s -> "CROSS_EMULATOR" =: s NoEmulatorNeeded -> mempty , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty @@ -901,8 +957,10 @@ setVariable k v j = j { jobVariables = MonoidalMap $ Map.insert k [v] $ unMonoid delVariable :: String -> Job -> Job delVariable k j = j { jobVariables = MonoidalMap $ Map.delete k $ unMonoidalMap $ jobVariables j } +--------------------------------------------------------------------- -- Building the standard jobs --- +--------------------------------------------------------------------- + -- | Make a normal validate CI job validate :: Arch -> Opsys -> BuildConfig -> NamedJob Job validate = job @@ -919,15 +977,27 @@ releaseRule = setJobRule ReleaseOnly nightly :: Arch -> Opsys -> BuildConfig -> NamedJob Job nightly arch opsys bc = let NamedJob n j = job arch opsys bc - in NamedJob { name = "nightly-" ++ n, jobInfo = nightlyRule . keepArtifacts "8 weeks" . highCompression $ j} + in NamedJob { name = "nightly-" ++ n + , jobInfo = nightlyRule + . keepArtifacts "8 weeks" + . highCompression $ j + } -- | Make a normal release CI job release :: Arch -> Opsys -> BuildConfig -> NamedJob Job release arch opsys bc = let NamedJob n j = job arch opsys (bc { buildFlavour = Release }) - in NamedJob { name = "release-" ++ n, jobInfo = releaseRule . keepArtifacts "1 year" . ignorePerfFailures . useHashUnitIds . highCompression $ j} + in NamedJob { name = "release-" ++ n + , jobInfo = releaseRule + . keepArtifacts "1 year" + . ignorePerfFailures + . useHashUnitIds + . highCompression $ j + } +--------------------------------------------------------------------- -- Specific job modification functions +--------------------------------------------------------------------- -- | Mark a job as requiring a manual trigger. manual :: Job -> Job @@ -984,6 +1054,10 @@ onlyRule t = modifyValidateJobs (onlyValidateJobRule t) disableValidate :: JobGroup Job -> JobGroup Job disableValidate = modifyValidateJobs (removeValidateJobRule FastCI . removeValidateJobRule FullCI) +--------------------------------------------------------------------- +-- NamedJob +--------------------------------------------------------------------- + data NamedJob a = NamedJob { name :: String, jobInfo :: a } deriving (Show, Functor) renameJob :: (String -> String) -> NamedJob a -> NamedJob a @@ -994,14 +1068,18 @@ instance ToJSON a => ToJSON (NamedJob a) where [ "name" A..= name nj , "jobInfo" A..= jobInfo nj ] - ---data NamedJobGroup a = NamedJobGroup { platform :: String, jg :: JobGroup a } +--------------------------------------------------------------------- +-- JobGroup +--------------------------------------------------------------------- -- Jobs are grouped into either triples or pairs depending on whether the -- job is just validate and nightly, or also release. -data JobGroup a = StandardTriple { v :: Maybe (NamedJob a) - , n :: Maybe (NamedJob a) - , r :: Maybe (NamedJob a) } deriving (Functor, Show) +data JobGroup a + = StandardTriple { v :: Maybe (NamedJob a) + , n :: Maybe (NamedJob a) + , r :: Maybe (NamedJob a) + } + deriving (Functor, Show) instance ToJSON a => ToJSON (JobGroup a) where toJSON StandardTriple{..} = object @@ -1039,16 +1117,19 @@ flattenJobGroup (StandardTriple a b c) = map flattenNamedJob (catMaybes [a,b,c]) flattenNamedJob :: NamedJob a -> (String, a) flattenNamedJob (NamedJob n i) = (n, i) - -- | Specification for all the jobs we want to build. jobs :: Map String Job -jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups +jobs = Map.fromList $ concatMap flattenJobGroup job_groups + +--------------------------------------------------------------------- +-- Job definitions +--------------------------------------------------------------------- debian_x86 :: [JobGroup Job] debian_x86 = [ -- Release configurations - -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 - -- not being at EOL until April 2023 and they still need tinfo5. + -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 + -- not being at EOL until April 2023 and they still need tinfo5. disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) , disableValidate (standardBuilds Amd64 (Linux Debian10)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) @@ -1056,15 +1137,15 @@ debian_x86 = , disableValidate (standardBuilds Amd64 (Linux Debian12)) - -- Validate only builds + -- Validate only builds , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) , validateBuilds Amd64 (Linux validate_debian) nativeInt , validateBuilds Amd64 (Linux validate_debian) unreg - -- More work is needed to address TSAN failures: #22520 + -- More work is needed to address TSAN failures: #22520 , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) , -- Nightly allowed to fail: #22343 modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) - -- Run the 'perf' profiling nightly job in the release config. + -- Run the 'perf' profiling nightly job in the release config. , perfProfilingJob Amd64 (Linux Debian12) releaseConfig , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) @@ -1095,7 +1176,7 @@ debian_aarch64 = [ disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) - -- LLVM backend bootstrap + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] @@ -1120,11 +1201,10 @@ rhel_x86 = fedora_x86 :: [JobGroup Job] fedora_x86 = - [ - -- Fedora33 job is always built with perf so there's one job in the normal - -- validate pipeline which is built with perf. + [ -- Fedora33 job is always built with perf so there's one job in the normal + -- validate pipeline which is built with perf. fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) - -- This job is only for generating head.hackage docs + -- This job is only for generating head.hackage docs , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) , disableValidate (standardBuilds Amd64 (Linux Fedora38)) @@ -1154,7 +1234,7 @@ alpine_x86 = [ -- Fully static build, in theory usable on any linux distribution. fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) - -- Dynamically linked build, suitable for building your own static executables on alpine + -- Dynamically linked build, suitable for building your own static executables on alpine , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) , allowFailureGroup (standardBuildsWithConfig I386 (Linux Alpine320) (splitSectionsBroken vanilla)) @@ -1173,16 +1253,16 @@ alpine_aarch64 = [ cross_jobs :: [JobGroup Job] cross_jobs = [ - -- x86 -> aarch64 + -- x86 -> aarch64 validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - -- x86_64 -> riscv + -- x86_64 -> riscv , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian12Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing)) - -- Javascript + -- Javascript , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) - -- Wasm + -- Wasm , make_wasm_jobs wasm_build_config , modifyValidateJobs manual $ make_wasm_jobs wasm_build_config {bignumBackend = Native} @@ -1203,10 +1283,9 @@ cross_jobs = [ wasm_build_config = (crossConfig "wasm32-wasi" NoEmulatorNeeded Nothing) - { - hostFullyStatic = True - , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet - , textWithSIMDUTF = True + { hostFullyStatic = True + , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet + , textWithSIMDUTF = True } job_groups :: [JobGroup Job] @@ -1224,6 +1303,9 @@ job_groups = ++ cross_jobs ++ freebsd_jobs +--------------------------------------------------------------------- +-- Platform mapping for GHCup metadata +--------------------------------------------------------------------- mkPlatform :: Arch -> Opsys -> String mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys @@ -1267,7 +1349,11 @@ platform_mapping = Map.map go combined_result , "release-x86_64-windows-release" ] - process sel = Map.fromListWith combine [ (uncurry mkPlatform (jobPlatform (jobInfo $ j)), j) | (sel -> Just j) <- job_groups ] + process sel = + Map.fromListWith combine + [ (uncurry mkPlatform (jobPlatform (jobInfo j)), j) + | (sel -> Just j) <- job_groups + ] vs = process v ns = process n @@ -1275,10 +1361,13 @@ platform_mapping = Map.map go combined_result all_platforms = Map.keysSet vs <> Map.keysSet ns <> Map.keysSet rs - combined_result = Map.fromList [ (p, StandardTriple { v = Map.lookup p vs - , n = Map.lookup p ns - , r = Map.lookup p rs }) - | p <- S.toList all_platforms ] + combined_result = + Map.fromList + [ (p, StandardTriple { v = Map.lookup p vs + , n = Map.lookup p ns + , r = Map.lookup p rs }) + | p <- S.toList all_platforms + ] combine a b | name a `elem` whitelist = a -- Explicitly selected @@ -1293,6 +1382,9 @@ data BindistInfo = BindistInfo { bindistName :: String } deriving Show instance ToJSON BindistInfo where toJSON (BindistInfo n) = object [ "bindistName" A..= n ] +--------------------------------------------------------------------- +-- Main entrypoint +--------------------------------------------------------------------- main :: IO () main = do ===================================== libraries/base/changelog.md ===================================== @@ -10,6 +10,13 @@ * `Data.List.NonEmpty` functions now have the same laziness as their `Data.List` counterparts (i.e. make them more strict than they currently are) ([CLC proposal #107](https://github.com/haskell/core-libraries-committee/issues/107)) * `instance Functor NonEmpty` is now specified using `map` (rather than duplicating code). ([CLC proposal #300](https://github.com/haskell/core-libraries-committee/issues/300)) * The `Data.Enum.enumerate` function was introduced ([CLC #306](https://github.com/haskell/core-libraries-committee/issues/306)) + * Worker threads used by various `base` facilities are now labelled with descriptive thread labels ([CLC proposal #305](https://github.com/haskell/core-libraries-committee/issues/305), [GHC #25452](https://gitlab.haskell.org/ghc/ghc/-/issues/25452)). Specifically, these include: + * `Control.Concurrent.threadWaitRead` + * `Control.Concurrent.threadWaitWrite` + * `Control.Concurrent.threadWaitReadSTM` + * `Control.Concurrent.threadWaitWriteSTM` + * `System.Timeout.timeout` + * `GHC.Conc.Signal.runHandlers` ## 4.21.0.0 *TBA* * Change `SrcLoc` to be a strict and unboxed (finishing [CLC proposal #55](https://github.com/haskell/core-libraries-committee/issues/55)) ===================================== libraries/base/src/Control/Concurrent.hs ===================================== @@ -265,7 +265,7 @@ threadWaitRead fd -- fdReady does the right thing, but we have to call it in a -- separate thread, otherwise threadWaitRead won't be interruptible, -- and this only works with -threaded. - | threaded = withThread (waitFd fd False) + | threaded = withThread "threadWaitRead worker" (waitFd fd False) | otherwise = case fd of 0 -> do _ <- hWaitForInput stdin (-1) return () @@ -286,7 +286,7 @@ threadWaitRead fd threadWaitWrite :: Fd -> IO () threadWaitWrite fd #if defined(mingw32_HOST_OS) - | threaded = withThread (waitFd fd True) + | threaded = withThread "threadWaitWrite worker" (waitFd fd True) | otherwise = errorWithoutStackTrace "threadWaitWrite requires -threaded on Windows" #else = Conc.threadWaitWrite fd @@ -302,8 +302,11 @@ threadWaitReadSTM :: Fd -> IO (STM (), IO ()) threadWaitReadSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd False) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitReadSTM worker" + result <- try (waitFd fd False) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -326,8 +329,11 @@ threadWaitWriteSTM :: Fd -> IO (STM (), IO ()) threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd True) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitWriteSTM worker" + result <- try (waitFd fd True) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -343,10 +349,14 @@ threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool -withThread :: IO a -> IO a -withThread io = do +withThread :: String -> IO a -> IO a +withThread label io = do m <- newEmptyMVar - _ <- mask_ $ forkIO $ try io >>= putMVar m + _ <- mask_ $ forkIO $ do + tid <- myThreadId + labelThread tid label + result <- try io + putMVar m result x <- takeMVar m case x of Right a -> return a ===================================== libraries/base/src/System/Timeout.hs ===================================== @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE Safe #-} +{-# LANGUAGE Trustworthy #-} ------------------------------------------------------------------------------- -- | @@ -29,6 +29,7 @@ import GHC.Internal.Control.Exception (Exception(..), handleJust, bracket, asyncExceptionToException, asyncExceptionFromException) import GHC.Internal.Data.Unique (Unique, newUnique) +import GHC.Conc (labelThread) import Prelude -- $setup @@ -119,7 +120,9 @@ timeout n f let handleTimeout = do v <- isEmptyMVar lock when v $ void $ forkIOWithUnmask $ \unmask -> unmask $ do - v2 <- tryPutMVar lock =<< myThreadId + tid <- myThreadId + labelThread tid "timeout worker" + v2 <- tryPutMVar lock tid when v2 $ throwTo pid ex cleanupTimeout key = uninterruptibleMask_ $ do v <- tryPutMVar lock undefined @@ -136,7 +139,9 @@ timeout n f ex <- fmap Timeout newUnique handleJust (\e -> if e == ex then Just () else Nothing) (\_ -> return Nothing) - (bracket (forkIOWithUnmask $ \unmask -> + (bracket (forkIOWithUnmask $ \unmask -> do + tid <- myThreadId + labelThread tid "timeout worker" unmask $ threadDelay n >> throwTo pid ex) (uninterruptibleMask_ . killThread) (\_ -> fmap Just f)) ===================================== libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Internal.Foreign.Ptr (Ptr, castPtr) import GHC.Internal.Foreign.Marshal.Alloc (finalizerFree) import GHC.Internal.Arr (inRange) import GHC.Internal.Base -import GHC.Internal.Conc.Sync (forkIO) +import GHC.Internal.Conc.Sync (myThreadId, labelThread, forkIO) import GHC.Internal.IO (mask_, unsafePerformIO) import GHC.Internal.IOArray (IOArray, boundsIOArray, newIOArray, unsafeReadIOArray, unsafeWriteIOArray) @@ -69,7 +69,10 @@ runHandlers p_info sig = do else do handler <- unsafeReadIOArray arr int case handler of Nothing -> return () - Just (f,_) -> do _ <- forkIO (f p_info) + Just (f,_) -> do _ <- forkIO $ do + tid <- myThreadId + labelThread tid "signal handler" + f p_info return () -- It is our responsibility to free the memory buffer, so we create a ===================================== libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc ===================================== @@ -53,7 +53,10 @@ start_console_handler :: Word32 -> IO () start_console_handler r = case toWin32ConsoleEvent r of Just x -> withMVar win32ConsoleHandler $ \handler -> do - _ <- forkIO (handler x) + _ <- forkIO $ do + tid <- myThreadId + labelThread tid "console event handler" + handler x return () Nothing -> return () ===================================== libraries/ghci/GHCi/Run.hs ===================================== @@ -226,7 +226,10 @@ sandboxIO opts io = do let runIt = measureAlloc $ tryEval $ rethrow opts $ clearCCS io if useSandboxThread opts then do - tid <- forkIO $ do unsafeUnmask runIt >>= putMVar statusMVar + tid <- forkIO $ do + tid <- myThreadId + labelThread tid "GHCi sandbox" + unsafeUnmask runIt >>= putMVar statusMVar -- empty: can't block redirectInterrupts tid $ unsafeUnmask $ takeMVar statusMVar else ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -13664,7 +13664,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -14770,7 +14770,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -15385,7 +15385,7 @@ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC. instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.JSException -- Defined in ‘GHC.Internal.JS.Prim’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.WouldBlockException -- Defined in ‘GHC.Internal.JS.Prim’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -16235,7 +16235,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -10881,7 +10881,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11992,7 +11992,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12608,7 +12608,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13476,7 +13476,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/50fdf33ff6c82c370659c8491457ca4ea05c8938...aa0df0c5aa43d2e16040ad7911362e3bf4bb16ce -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/50fdf33ff6c82c370659c8491457ca4ea05c8938...aa0df0c5aa43d2e16040ad7911362e3bf4bb16ce You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 06:17:55 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 08 Feb 2025 01:17:55 -0500 Subject: [Git][ghc/ghc][master] 6 commits: base: Label threads forked by IO operations Message-ID: <67a6f713847d9_c293614905606786c@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - 10 changed files: - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 Changes: ===================================== libraries/base/changelog.md ===================================== @@ -10,6 +10,13 @@ * `Data.List.NonEmpty` functions now have the same laziness as their `Data.List` counterparts (i.e. make them more strict than they currently are) ([CLC proposal #107](https://github.com/haskell/core-libraries-committee/issues/107)) * `instance Functor NonEmpty` is now specified using `map` (rather than duplicating code). ([CLC proposal #300](https://github.com/haskell/core-libraries-committee/issues/300)) * The `Data.Enum.enumerate` function was introduced ([CLC #306](https://github.com/haskell/core-libraries-committee/issues/306)) + * Worker threads used by various `base` facilities are now labelled with descriptive thread labels ([CLC proposal #305](https://github.com/haskell/core-libraries-committee/issues/305), [GHC #25452](https://gitlab.haskell.org/ghc/ghc/-/issues/25452)). Specifically, these include: + * `Control.Concurrent.threadWaitRead` + * `Control.Concurrent.threadWaitWrite` + * `Control.Concurrent.threadWaitReadSTM` + * `Control.Concurrent.threadWaitWriteSTM` + * `System.Timeout.timeout` + * `GHC.Conc.Signal.runHandlers` ## 4.21.0.0 *TBA* * Change `SrcLoc` to be a strict and unboxed (finishing [CLC proposal #55](https://github.com/haskell/core-libraries-committee/issues/55)) ===================================== libraries/base/src/Control/Concurrent.hs ===================================== @@ -265,7 +265,7 @@ threadWaitRead fd -- fdReady does the right thing, but we have to call it in a -- separate thread, otherwise threadWaitRead won't be interruptible, -- and this only works with -threaded. - | threaded = withThread (waitFd fd False) + | threaded = withThread "threadWaitRead worker" (waitFd fd False) | otherwise = case fd of 0 -> do _ <- hWaitForInput stdin (-1) return () @@ -286,7 +286,7 @@ threadWaitRead fd threadWaitWrite :: Fd -> IO () threadWaitWrite fd #if defined(mingw32_HOST_OS) - | threaded = withThread (waitFd fd True) + | threaded = withThread "threadWaitWrite worker" (waitFd fd True) | otherwise = errorWithoutStackTrace "threadWaitWrite requires -threaded on Windows" #else = Conc.threadWaitWrite fd @@ -302,8 +302,11 @@ threadWaitReadSTM :: Fd -> IO (STM (), IO ()) threadWaitReadSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd False) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitReadSTM worker" + result <- try (waitFd fd False) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -326,8 +329,11 @@ threadWaitWriteSTM :: Fd -> IO (STM (), IO ()) threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd True) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitWriteSTM worker" + result <- try (waitFd fd True) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -343,10 +349,14 @@ threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool -withThread :: IO a -> IO a -withThread io = do +withThread :: String -> IO a -> IO a +withThread label io = do m <- newEmptyMVar - _ <- mask_ $ forkIO $ try io >>= putMVar m + _ <- mask_ $ forkIO $ do + tid <- myThreadId + labelThread tid label + result <- try io + putMVar m result x <- takeMVar m case x of Right a -> return a ===================================== libraries/base/src/System/Timeout.hs ===================================== @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE Safe #-} +{-# LANGUAGE Trustworthy #-} ------------------------------------------------------------------------------- -- | @@ -29,6 +29,7 @@ import GHC.Internal.Control.Exception (Exception(..), handleJust, bracket, asyncExceptionToException, asyncExceptionFromException) import GHC.Internal.Data.Unique (Unique, newUnique) +import GHC.Conc (labelThread) import Prelude -- $setup @@ -119,7 +120,9 @@ timeout n f let handleTimeout = do v <- isEmptyMVar lock when v $ void $ forkIOWithUnmask $ \unmask -> unmask $ do - v2 <- tryPutMVar lock =<< myThreadId + tid <- myThreadId + labelThread tid "timeout worker" + v2 <- tryPutMVar lock tid when v2 $ throwTo pid ex cleanupTimeout key = uninterruptibleMask_ $ do v <- tryPutMVar lock undefined @@ -136,7 +139,9 @@ timeout n f ex <- fmap Timeout newUnique handleJust (\e -> if e == ex then Just () else Nothing) (\_ -> return Nothing) - (bracket (forkIOWithUnmask $ \unmask -> + (bracket (forkIOWithUnmask $ \unmask -> do + tid <- myThreadId + labelThread tid "timeout worker" unmask $ threadDelay n >> throwTo pid ex) (uninterruptibleMask_ . killThread) (\_ -> fmap Just f)) ===================================== libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Internal.Foreign.Ptr (Ptr, castPtr) import GHC.Internal.Foreign.Marshal.Alloc (finalizerFree) import GHC.Internal.Arr (inRange) import GHC.Internal.Base -import GHC.Internal.Conc.Sync (forkIO) +import GHC.Internal.Conc.Sync (myThreadId, labelThread, forkIO) import GHC.Internal.IO (mask_, unsafePerformIO) import GHC.Internal.IOArray (IOArray, boundsIOArray, newIOArray, unsafeReadIOArray, unsafeWriteIOArray) @@ -69,7 +69,10 @@ runHandlers p_info sig = do else do handler <- unsafeReadIOArray arr int case handler of Nothing -> return () - Just (f,_) -> do _ <- forkIO (f p_info) + Just (f,_) -> do _ <- forkIO $ do + tid <- myThreadId + labelThread tid "signal handler" + f p_info return () -- It is our responsibility to free the memory buffer, so we create a ===================================== libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc ===================================== @@ -53,7 +53,10 @@ start_console_handler :: Word32 -> IO () start_console_handler r = case toWin32ConsoleEvent r of Just x -> withMVar win32ConsoleHandler $ \handler -> do - _ <- forkIO (handler x) + _ <- forkIO $ do + tid <- myThreadId + labelThread tid "console event handler" + handler x return () Nothing -> return () ===================================== libraries/ghci/GHCi/Run.hs ===================================== @@ -226,7 +226,10 @@ sandboxIO opts io = do let runIt = measureAlloc $ tryEval $ rethrow opts $ clearCCS io if useSandboxThread opts then do - tid <- forkIO $ do unsafeUnmask runIt >>= putMVar statusMVar + tid <- forkIO $ do + tid <- myThreadId + labelThread tid "GHCi sandbox" + unsafeUnmask runIt >>= putMVar statusMVar -- empty: can't block redirectInterrupts tid $ unsafeUnmask $ takeMVar statusMVar else ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -13664,7 +13664,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -14770,7 +14770,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -15385,7 +15385,7 @@ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC. instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.JSException -- Defined in ‘GHC.Internal.JS.Prim’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.WouldBlockException -- Defined in ‘GHC.Internal.JS.Prim’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -16235,7 +16235,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -10881,7 +10881,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11992,7 +11992,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12608,7 +12608,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13476,7 +13476,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f71c2835bfacac879b294bbcd475d7acfac4adfb...38f78ce54ffa18187bb5ebaee992829d609db4ef -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f71c2835bfacac879b294bbcd475d7acfac4adfb...38f78ce54ffa18187bb5ebaee992829d609db4ef You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 06:18:38 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 08 Feb 2025 01:18:38 -0500 Subject: [Git][ghc/ghc][master] 2 commits: gen-ci: Clean up style Message-ID: <67a6f73e34a25_c2936124547c7043b@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 1 changed file: - .gitlab/generate-ci/gen_ci.hs Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -5,6 +5,12 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ViewPatterns #-} +{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} + +{-# HLINT ignore "Use newtype instead of data" #-} +{-# HLINT ignore "Use camelCase" #-} +{-# LANGUAGE DerivingStrategies #-} + import Data.Aeson as A import qualified Data.Map as Map import Data.Map (Map) @@ -199,7 +205,7 @@ data FlavourTrans = data BaseFlavour = Release | Validate | SlowValidate deriving Eq ----------------------------------------------------------------------------- --- Build Configs +-- Build Configurations ----------------------------------------------------------------------------- -- | A standard build config @@ -244,7 +250,7 @@ releaseConfig = vanilla { buildFlavour = Release } debug :: BuildConfig debug = vanilla { buildFlavour = SlowValidate , withAssertions = True - -- WithNuma so at least one job tests Numa + -- WithNuma so at least one job tests Numa , withNuma = True } @@ -280,21 +286,21 @@ usePerfProfilingTestsuite :: BuildConfig -> BuildConfig usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True } ----------------------------------------------------------------------------- --- Platform specific variables +-- Identifying Platforms ----------------------------------------------------------------------------- -- | These tags have to match what we call the runners on gitlab runnerTag :: Arch -> Opsys -> String runnerTag arch (Linux _) = case arch of - Amd64 -> "x86_64-linux" - AArch64 -> "aarch64-linux" - I386 -> "x86_64-linux" -runnerTag AArch64 Darwin = "aarch64-darwin" -runnerTag Amd64 Darwin = "x86_64-darwin-m1" -runnerTag Amd64 Windows = "new-x86_64-windows" + Amd64 -> "x86_64-linux" + AArch64 -> "aarch64-linux" + I386 -> "x86_64-linux" +runnerTag AArch64 Darwin = "aarch64-darwin" +runnerTag Amd64 Darwin = "x86_64-darwin-m1" +runnerTag Amd64 Windows = "new-x86_64-windows" runnerTag Amd64 FreeBSD14 = "x86_64-freebsd14" -runnerTag _ _ = error "Invalid arch/opsys" +runnerTag _ _ = error "Invalid arch/opsys" tags :: Arch -> Opsys -> BuildConfig -> [String] tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use @@ -305,34 +311,34 @@ runnerPerfTag arch sys = runnerTag arch sys ++ "-perf" -- These names are used to find the docker image so they have to match what is -- in the docker registry. distroName :: LinuxDistro -> String -distroName Debian12 = "deb12" -distroName Debian11 = "deb11" -distroName Debian11Js = "deb11-emsdk-closure" +distroName Debian12 = "deb12" +distroName Debian11 = "deb11" +distroName Debian11Js = "deb11-emsdk-closure" distroName Debian12Riscv = "deb12-riscv" -distroName Debian10 = "deb10" -distroName Debian9 = "deb9" -distroName Fedora33 = "fedora33" -distroName Fedora38 = "fedora38" -distroName Ubuntu1804 = "ubuntu18_04" -distroName Ubuntu2004 = "ubuntu20_04" -distroName Ubuntu2204 = "ubuntu22_04" -distroName Centos7 = "centos7" -distroName Alpine312 = "alpine3_12" -distroName Alpine318 = "alpine3_18" -distroName Alpine320 = "alpine3_20" -distroName AlpineWasm = "alpine3_20-wasm" -distroName Rocky8 = "rocky8" +distroName Debian10 = "deb10" +distroName Debian9 = "deb9" +distroName Fedora33 = "fedora33" +distroName Fedora38 = "fedora38" +distroName Ubuntu1804 = "ubuntu18_04" +distroName Ubuntu2004 = "ubuntu20_04" +distroName Ubuntu2204 = "ubuntu22_04" +distroName Centos7 = "centos7" +distroName Alpine312 = "alpine3_12" +distroName Alpine318 = "alpine3_18" +distroName Alpine320 = "alpine3_20" +distroName AlpineWasm = "alpine3_20-wasm" +distroName Rocky8 = "rocky8" opsysName :: Opsys -> String opsysName (Linux distro) = "linux-" ++ distroName distro -opsysName Darwin = "darwin" -opsysName FreeBSD14 = "freebsd14" -opsysName Windows = "windows" +opsysName Darwin = "darwin" +opsysName FreeBSD14 = "freebsd14" +opsysName Windows = "windows" archName :: Arch -> String -archName Amd64 = "x86_64" +archName Amd64 = "x86_64" archName AArch64 = "aarch64" -archName I386 = "i386" +archName I386 = "i386" binDistName :: Arch -> Opsys -> BuildConfig -> String binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc @@ -341,16 +347,18 @@ binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc -- Either the change is reflected by modifying the flavourString or directly (as is -- the case for settings which affect environment variables) testEnv :: Arch -> Opsys -> BuildConfig -> String -testEnv arch opsys bc = intercalate "-" $ - [ archName arch - , opsysName opsys ] - ++ ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] - ++ ["unreg" | unregisterised bc ] - ++ ["numa" | withNuma bc ] - ++ ["zstd" | withZstd bc ] - ++ ["no_tntc" | not (tablesNextToCode bc) ] - ++ ["cross_"++triple | Just triple <- pure $ crossTarget bc ] - ++ [flavourString (mkJobFlavour bc)] +testEnv arch opsys bc = + intercalate "-" $ concat + [ [ archName arch + , opsysName opsys ] + , ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] + , ["unreg" | unregisterised bc ] + , ["numa" | withNuma bc ] + , ["zstd" | withZstd bc ] + , ["no_tntc" | not (tablesNextToCode bc) ] + , ["cross_"++triple | Just triple <- pure $ crossTarget bc ] + , [flavourString (mkJobFlavour bc)] + ] -- | The hadrian flavour string we are going to use for this build flavourString :: Flavour -> String @@ -384,7 +392,7 @@ dockerImage arch (Linux distro) = dockerImage _ _ = Nothing ----------------------------------------------------------------------------- --- Platform specific variables +-- Platform-specific variables ----------------------------------------------------------------------------- -- The variables map is a monoidal map so that we don't ever accidentally lose @@ -438,35 +446,36 @@ opsysVariables _ FreeBSD14 = mconcat , "CABAL_INSTALL_VERSION" =: "3.10.3.0" ] opsysVariables arch (Linux distro) = distroVariables arch distro -opsysVariables AArch64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "aarch64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables Amd64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "x86_64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - -- "# Only Sierra and onwards supports clock_gettime. See #12858" - , "ac_cv_func_clock_gettime" =: "no" - -- # Only newer OS Xs support utimensat. See #17895 - , "ac_cv_func_utimensat" =: "no" - -- # Only newer OS Xs support futimens. See #22938 - , "ac_cv_func_futimens" =: "no" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" +opsysVariables AArch64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "aarch64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + ] +opsysVariables Amd64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "x86_64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + -- Only Sierra and onwards supports clock_gettime. See #12858 + , "ac_cv_func_clock_gettime" =: "no" + -- Only newer OS Xs support utimensat. See #17895 + , "ac_cv_func_utimensat" =: "no" + -- Only newer OS Xs support futimens. See #22938 + , "ac_cv_func_futimens" =: "no" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables _ (Windows {}) = - mconcat [ "MSYSTEM" =: "CLANG64" - , "LANG" =: "en_US.UTF-8" - , "CABAL_INSTALL_VERSION" =: "3.10.2.0" - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - , "GHC_VERSION" =: "9.6.4" ] + ] +opsysVariables _ (Windows {}) = mconcat + [ "MSYSTEM" =: "CLANG64" + , "LANG" =: "en_US.UTF-8" + , "CABAL_INSTALL_VERSION" =: "3.10.2.0" + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + , "GHC_VERSION" =: "9.6.4" + ] opsysVariables _ _ = mempty alpineVariables :: Arch -> Variables @@ -481,7 +490,7 @@ alpineVariables arch = mconcat $ | I386 <- [arch] ] ++ [ brokenTest "T22033" "#25497" | I386 <- [arch] ] ++ - [-- Bootstrap compiler has incorrectly configured target triple #25200 + [ -- Bootstrap compiler has incorrectly configured target triple #25200 "CONFIGURE_ARGS" =: "--enable-ignore-build-platform-mismatch --build=aarch64-unknown-linux --host=aarch64-unknown-linux --target=aarch64-unknown-linux" | AArch64 <- [arch] ] @@ -491,15 +500,14 @@ distroVariables :: Arch -> LinuxDistro -> Variables distroVariables arch Alpine312 = alpineVariables arch distroVariables arch Alpine318 = alpineVariables arch distroVariables arch Alpine320 = alpineVariables arch -distroVariables _ Centos7 = mconcat [ - "HADRIAN_ARGS" =: "--docs=no-sphinx" - , brokenTest "T22012" "#23979" - ] -distroVariables _ Fedora33 = mconcat +distroVariables _ Centos7 = mconcat [ "HADRIAN_ARGS" =: "--docs=no-sphinx" + , brokenTest "T22012" "#23979" + ] +distroVariables _ Fedora33 = mconcat -- LLC/OPT do not work for some reason in our fedora images -- These tests fail with this error: T11649 T5681 T7571 T8131b -- +/opt/llvm/bin/opt: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/opt) --- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) + -- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) [ "LLC" =: "/bin/false" , "OPT" =: "/bin/false" ] @@ -510,7 +518,7 @@ distroVariables _ _ = mempty ----------------------------------------------------------------------------- data Cache - = Cache { cacheKey :: String + = Cache { cacheKey :: String , cachePaths :: [String] } @@ -550,25 +558,27 @@ data ArtifactsWhen = ArtifactsOnSuccess | ArtifactsOnFailure | ArtifactsAlways instance ToJSON ArtifactsWhen where toJSON ArtifactsOnSuccess = "on_success" toJSON ArtifactsOnFailure = "on_failure" - toJSON ArtifactsAlways = "always" + toJSON ArtifactsAlways = "always" ------------------------------------------------------------------------------ +--------------------------------------------------------------------- -- Rules, when do we run a job ------------------------------------------------------------------------------ +--------------------------------------------------------------------- --- Data structure which records the condition when a job is run. -data OnOffRules = OnOffRules { rule_set :: Rule -- ^ The enabled rules - , when :: ManualFlag -- ^ The additional condition about when to run this job. - } +-- | Data structure which records the condition when a job is run. +data OnOffRules + = OnOffRules { rule_set :: Rule -- ^ The enabled rules + , when :: ManualFlag -- ^ The additional condition about when to run this job. + } -- The initial set of rules, which assumes a Validate pipeline which is run with FullCI. emptyRules :: String -> OnOffRules emptyRules jobName = OnOffRules (ValidateOnly jobName (S.fromList [FullCI])) OnSuccess -- When to run the job -data ManualFlag = Manual -- ^ Only run the job when explicitly triggered by a user - | OnSuccess -- ^ Always run it, if the rules pass (the default) - deriving Eq +data ManualFlag + = Manual -- ^ Only run the job when explicitly triggered by a user + | OnSuccess -- ^ Always run it, if the rules pass (the default) + deriving Eq setRule :: Rule -> OnOffRules -> OnOffRules setRule r (OnOffRules _ m) = OnOffRules r m @@ -595,18 +605,23 @@ manualRule rules = rules { when = Manual } enumRules :: OnOffRules -> [OnOffRule] enumRules (OnOffRules r _) = rulesList where - rulesList = case r of - ValidateOnly s rs -> [OnOffRule On (ValidateOnly s rs) - , OnOffRule Off ReleaseOnly - , OnOffRule Off Nightly ] - Nightly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule Off ReleaseOnly - , OnOffRule On Nightly ] - ReleaseOnly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule On ReleaseOnly - , OnOffRule Off Nightly ] - - + rulesList = + case r of + ValidateOnly s rs -> + [ OnOffRule On (ValidateOnly s rs) + , OnOffRule Off ReleaseOnly + , OnOffRule Off Nightly + ] + Nightly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule Off ReleaseOnly + , OnOffRule On Nightly + ] + ReleaseOnly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule On ReleaseOnly + , OnOffRule Off Nightly + ] data OnOffRule = OnOffRule OnOff Rule @@ -617,102 +632,135 @@ instance ToJSON ManualFlag where toJSON OnSuccess = "on_success" instance ToJSON OnOffRules where - toJSON rules = toJSON [object ([ - "if" A..= and_all (map one_rule (enumRules rules)) - , "when" A..= toJSON (when rules)] - -- Necessary to stop manual jobs stopping pipeline progress - -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure - ++ - ["allow_failure" A..= True | when rules == Manual ])] - + toJSON rules = toJSON + [object $ + [ "if" A..= and_all (map one_rule (enumRules rules)) + , "when" A..= toJSON (when rules) + ] ++ + -- Necessary to stop manual jobs stopping pipeline progress + -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure + [ "allow_failure" A..= True | when rules == Manual ] + ] where - one_rule (OnOffRule onoff r) = ruleString onoff r + one_rule (OnOffRule onoff r) = ruleToCond onoff r +--------------------------------------------------------------------- +-- Rule conditions +--------------------------------------------------------------------- -parens :: [Char] -> [Char] -parens s = "(" ++ s ++ ")" -and_all :: [[Char]] -> [Char] -and_all rs = intercalate " && " (map parens rs) -or_all :: [[Char]] -> [Char] -or_all rs = intercalate " || " (map parens rs) +-- | A predicate in GitLab's rules language. +newtype Cond = Cond { getCond :: String } + deriving newtype (ToJSON) --- | A Rule corresponds to some condition which must be satisifed in order to --- run the job. -data Rule = ReleaseOnly -- ^ Only run this job in a release pipeline - | Nightly -- ^ Only run this job in the nightly pipeline - | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. - deriving (Show, Ord, Eq) - -data ValidateRule = - FullCI -- ^ Run this job when the "full-ci" label is present. - | FastCI -- ^ Run this job on every validation pipeline - | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present - | JSBackend -- ^ Run this job when the "javascript" label is present - | RiscV -- ^ Run this job when the "RISC-V" label is present - | WasmBackend -- ^ Run this job when the "wasm" label is present - | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. - | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. - | IpeData -- ^ Run this job when the "IPE" label is set - | TestPrimops -- ^ Run this job when "test-primops" label is set - | I386Backend -- ^ Run this job when the "i386" label is set - deriving (Show, Ord, Eq) - --- A constant evaluating to True because gitlab doesn't support "true" in the +parens :: Cond -> Cond +parens (Cond s) = Cond $ "(" ++ s ++ ")" + +and_all :: [Cond] -> Cond +and_all = + Cond . intercalate " && " . map (getCond . parens) + +or_all :: [Cond] -> Cond +or_all = + Cond . intercalate " || " . map (getCond . parens) + +type Var = String + +varIsSet :: Var -> Cond +varIsSet var = + Cond $ "$" <> var + +-- | A constant evaluating to True because gitlab doesn't support "true" in the -- expression language. -true :: String -true = "\"true\" == \"true\"" --- A constant evaluating to False because gitlab doesn't support "true" in the +true :: Cond +true = Cond "\"true\" == \"true\"" + +-- | A constant evaluating to False because gitlab doesn't support "true" in the -- expression language. -_false :: String -_false = "\"disabled\" != \"disabled\"" - --- Convert the state of the rule into a string that gitlab understand. -ruleString :: OnOff -> Rule -> String -ruleString On (ValidateOnly only_job_name vs) = - let conds = S.toList vs - empty_only_job = envVarNull "ONLY_JOBS" - run_cond = case conds of - [] -> _false - cs -> or_all (map validateRuleString conds) - escape :: String -> String - escape = concatMap (\c -> if c == '+' then "\\+" else [c]) - - in - or_all [ - -- 1. Case when ONLY_JOBS is set - and_all [ "$ONLY_JOBS", "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" ] - -- 2. Case when ONLY_JOBS is null - , and_all [ empty_only_job, run_cond ] - ] -ruleString Off (ValidateOnly {}) = true -ruleString On ReleaseOnly = "$RELEASE_JOB == \"yes\"" -ruleString Off ReleaseOnly = "$RELEASE_JOB != \"yes\"" -ruleString On Nightly = "$NIGHTLY" -ruleString Off Nightly = envVarNull "NIGHTLY" +_false :: Cond +_false = Cond "\"disabled\" != \"disabled\"" + +labelString :: String -> Cond +labelString s = + Cond $ "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" -labelString :: String -> String -labelString s = "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" +branchStringExact :: String -> Cond +branchStringExact = + varEqString "CI_COMMIT_BRANCH" -branchStringExact :: String -> String -branchStringExact s = envVarString "CI_COMMIT_BRANCH" s +branchStringLike :: String -> Cond +branchStringLike s = + Cond $ "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" -branchStringLike :: String -> String -branchStringLike s = "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" +varEqString :: String -> String -> Cond +varEqString var s = + Cond $ "$" ++ var ++ " == \"" ++ s ++ "\"" -envVarString :: String -> String -> String -envVarString var s = "$" ++ var ++ " == \"" ++ s ++ "\"" +varNeString :: String -> String -> Cond +varNeString var s = + Cond $ "$" ++ var ++ " != \"" ++ s ++ "\"" -envVarNull :: String -> String -envVarNull var = "$" ++ var ++ " == null" +varIsNull :: String -> Cond +varIsNull var = + Cond $ "$" ++ var ++ " == null" +--------------------------------------------------------------------- +-- Our Rules +--------------------------------------------------------------------- -validateRuleString :: ValidateRule -> String -validateRuleString FullCI = or_all ([ labelString "full-ci" - , labelString "marge_bot_batch_merge_job" - , branchStringExact "master" - , branchStringLike "ghc-[0-9]+\\.[0-9]+" - ]) -validateRuleString FastCI = true +-- | A Rule corresponds to some condition which must be satisifed in order to +-- run the job. +data Rule + = ReleaseOnly -- ^ Only run this job in a release pipeline + | Nightly -- ^ Only run this job in the nightly pipeline + | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. + deriving (Show, Ord, Eq) + +data ValidateRule + = FullCI -- ^ Run this job when the "full-ci" label is present. + | FastCI -- ^ Run this job on every validation pipeline + | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present + | JSBackend -- ^ Run this job when the "javascript" label is present + | RiscV -- ^ Run this job when the "RISC-V" label is present + | WasmBackend -- ^ Run this job when the "wasm" label is present + | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. + | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. + | IpeData -- ^ Run this job when the "IPE" label is set + | TestPrimops -- ^ Run this job when "test-primops" label is set + | I386Backend -- ^ Run this job when the "i386" label is set + deriving (Show, Ord, Eq) + +-- | Convert the state of the rule into a string that gitlab understand. +ruleToCond :: OnOff -> Rule -> Cond +ruleToCond On (ValidateOnly only_job_name vs) = + or_all + [ -- 1. Case when ONLY_JOBS is set + and_all [ varIsSet "ONLY_JOBS" + , Cond $ "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" + ] + -- 2. Case when ONLY_JOBS is null + , and_all [ varIsNull "ONLY_JOBS" + , case S.toList vs of + [] -> _false + cs -> or_all (map validateRuleString cs) + ] + ] + where + escape :: String -> String + escape = concatMap (\c -> if c == '+' then "\\+" else [c]) +ruleToCond Off (ValidateOnly {}) = true +ruleToCond On ReleaseOnly = "RELEASE_JOB" `varEqString` "yes" +ruleToCond Off ReleaseOnly = "RELEASE_JOB" `varNeString` "yes" +ruleToCond On Nightly = varIsSet "NIGHTLY" +ruleToCond Off Nightly = varIsNull "NIGHTLY" + + +validateRuleString :: ValidateRule -> Cond +validateRuleString FullCI = or_all [ labelString "full-ci" + , labelString "marge_bot_batch_merge_job" + , branchStringExact "master" + , branchStringLike "ghc-[0-9]+\\.[0-9]+" + ] +validateRuleString FastCI = true validateRuleString LLVMBackend = labelString "LLVM backend" validateRuleString JSBackend = labelString "javascript" @@ -724,6 +772,10 @@ validateRuleString IpeData = labelString "IPE" validateRuleString TestPrimops = labelString "test-primops" validateRuleString I386Backend = labelString "i386" +--------------------------------------------------------------------- +-- The Job type +--------------------------------------------------------------------- + -- | A 'Job' is the description of a single job in a gitlab pipeline. The -- job contains all the information about how to do the build but can be further -- modified with information about when to run jobs, which variables to set for @@ -747,15 +799,15 @@ data Job instance ToJSON Job where toJSON Job{..} = object [ "stage" A..= jobStage - -- Convoluted to avoid download artifacts from ghci job - -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts + -- Convoluted to avoid download artifacts from ghci job + -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts , "needs" A..= map (\j -> object [ "job" A..= j, "artifacts" A..= False ]) jobNeeds , "dependencies" A..= jobDependencies , "image" A..= jobDockerImage , "tags" A..= jobTags , "allow_failure" A..= jobAllowFailure - -- Joining up variables like this may well be the wrong thing to do but - -- at least it doesn't lose information silently by overriding. + -- Joining up variables like this may well be the wrong thing to do but + -- at least it doesn't lose information silently by overriding. , "variables" A..= fmap unwords jobVariables , "artifacts" A..= jobArtifacts , "cache" A..= jobCache @@ -783,7 +835,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } = [ "bash .gitlab/ci.sh setup" , "bash .gitlab/ci.sh configure" , "bash .gitlab/ci.sh build_hadrian" - , "bash .gitlab/ci.sh test_hadrian" ] + , "bash .gitlab/ci.sh test_hadrian" + ] | otherwise = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++ [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++ @@ -803,7 +856,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } [ ".gitlab/ci.sh save_cache" , ".gitlab/ci.sh save_test_output" , ".gitlab/ci.sh clean" - , "cat ci_timings" ] + , "cat ci_timings" + ] jobFlavour = mkJobFlavour buildConfig @@ -819,9 +873,11 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig) , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig) , case crossEmulator buildConfig of - NoEmulator -> case crossTarget buildConfig of - Nothing -> mempty - Just _ -> "CROSS_EMULATOR" =: "NOT_SET" -- we need an emulator but it isn't set. Won't run the testsuite + NoEmulator + -- we need an emulator but it isn't set. Won't run the testsuite + | Just _ <- crossTarget buildConfig + -> "CROSS_EMULATOR" =: "NOT_SET" + | otherwise -> mempty Emulator s -> "CROSS_EMULATOR" =: s NoEmulatorNeeded -> mempty , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty @@ -901,8 +957,10 @@ setVariable k v j = j { jobVariables = MonoidalMap $ Map.insert k [v] $ unMonoid delVariable :: String -> Job -> Job delVariable k j = j { jobVariables = MonoidalMap $ Map.delete k $ unMonoidalMap $ jobVariables j } +--------------------------------------------------------------------- -- Building the standard jobs --- +--------------------------------------------------------------------- + -- | Make a normal validate CI job validate :: Arch -> Opsys -> BuildConfig -> NamedJob Job validate = job @@ -919,15 +977,27 @@ releaseRule = setJobRule ReleaseOnly nightly :: Arch -> Opsys -> BuildConfig -> NamedJob Job nightly arch opsys bc = let NamedJob n j = job arch opsys bc - in NamedJob { name = "nightly-" ++ n, jobInfo = nightlyRule . keepArtifacts "8 weeks" . highCompression $ j} + in NamedJob { name = "nightly-" ++ n + , jobInfo = nightlyRule + . keepArtifacts "8 weeks" + . highCompression $ j + } -- | Make a normal release CI job release :: Arch -> Opsys -> BuildConfig -> NamedJob Job release arch opsys bc = let NamedJob n j = job arch opsys (bc { buildFlavour = Release }) - in NamedJob { name = "release-" ++ n, jobInfo = releaseRule . keepArtifacts "1 year" . ignorePerfFailures . useHashUnitIds . highCompression $ j} + in NamedJob { name = "release-" ++ n + , jobInfo = releaseRule + . keepArtifacts "1 year" + . ignorePerfFailures + . useHashUnitIds + . highCompression $ j + } +--------------------------------------------------------------------- -- Specific job modification functions +--------------------------------------------------------------------- -- | Mark a job as requiring a manual trigger. manual :: Job -> Job @@ -984,6 +1054,10 @@ onlyRule t = modifyValidateJobs (onlyValidateJobRule t) disableValidate :: JobGroup Job -> JobGroup Job disableValidate = modifyValidateJobs (removeValidateJobRule FastCI . removeValidateJobRule FullCI) +--------------------------------------------------------------------- +-- NamedJob +--------------------------------------------------------------------- + data NamedJob a = NamedJob { name :: String, jobInfo :: a } deriving (Show, Functor) renameJob :: (String -> String) -> NamedJob a -> NamedJob a @@ -994,14 +1068,18 @@ instance ToJSON a => ToJSON (NamedJob a) where [ "name" A..= name nj , "jobInfo" A..= jobInfo nj ] - ---data NamedJobGroup a = NamedJobGroup { platform :: String, jg :: JobGroup a } +--------------------------------------------------------------------- +-- JobGroup +--------------------------------------------------------------------- -- Jobs are grouped into either triples or pairs depending on whether the -- job is just validate and nightly, or also release. -data JobGroup a = StandardTriple { v :: Maybe (NamedJob a) - , n :: Maybe (NamedJob a) - , r :: Maybe (NamedJob a) } deriving (Functor, Show) +data JobGroup a + = StandardTriple { v :: Maybe (NamedJob a) + , n :: Maybe (NamedJob a) + , r :: Maybe (NamedJob a) + } + deriving (Functor, Show) instance ToJSON a => ToJSON (JobGroup a) where toJSON StandardTriple{..} = object @@ -1039,16 +1117,19 @@ flattenJobGroup (StandardTriple a b c) = map flattenNamedJob (catMaybes [a,b,c]) flattenNamedJob :: NamedJob a -> (String, a) flattenNamedJob (NamedJob n i) = (n, i) - -- | Specification for all the jobs we want to build. jobs :: Map String Job -jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups +jobs = Map.fromList $ concatMap flattenJobGroup job_groups + +--------------------------------------------------------------------- +-- Job definitions +--------------------------------------------------------------------- debian_x86 :: [JobGroup Job] debian_x86 = [ -- Release configurations - -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 - -- not being at EOL until April 2023 and they still need tinfo5. + -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 + -- not being at EOL until April 2023 and they still need tinfo5. disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) , disableValidate (standardBuilds Amd64 (Linux Debian10)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) @@ -1056,15 +1137,15 @@ debian_x86 = , disableValidate (standardBuilds Amd64 (Linux Debian12)) - -- Validate only builds + -- Validate only builds , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) , validateBuilds Amd64 (Linux validate_debian) nativeInt , validateBuilds Amd64 (Linux validate_debian) unreg - -- More work is needed to address TSAN failures: #22520 + -- More work is needed to address TSAN failures: #22520 , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) , -- Nightly allowed to fail: #22343 modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) - -- Run the 'perf' profiling nightly job in the release config. + -- Run the 'perf' profiling nightly job in the release config. , perfProfilingJob Amd64 (Linux Debian12) releaseConfig , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) @@ -1095,7 +1176,7 @@ debian_aarch64 = [ disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) - -- LLVM backend bootstrap + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] @@ -1120,11 +1201,10 @@ rhel_x86 = fedora_x86 :: [JobGroup Job] fedora_x86 = - [ - -- Fedora33 job is always built with perf so there's one job in the normal - -- validate pipeline which is built with perf. + [ -- Fedora33 job is always built with perf so there's one job in the normal + -- validate pipeline which is built with perf. fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) - -- This job is only for generating head.hackage docs + -- This job is only for generating head.hackage docs , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) , disableValidate (standardBuilds Amd64 (Linux Fedora38)) @@ -1154,7 +1234,7 @@ alpine_x86 = [ -- Fully static build, in theory usable on any linux distribution. fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) - -- Dynamically linked build, suitable for building your own static executables on alpine + -- Dynamically linked build, suitable for building your own static executables on alpine , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) , allowFailureGroup (standardBuildsWithConfig I386 (Linux Alpine320) (splitSectionsBroken vanilla)) @@ -1173,16 +1253,16 @@ alpine_aarch64 = [ cross_jobs :: [JobGroup Job] cross_jobs = [ - -- x86 -> aarch64 + -- x86 -> aarch64 validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - -- x86_64 -> riscv + -- x86_64 -> riscv , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian12Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing)) - -- Javascript + -- Javascript , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) - -- Wasm + -- Wasm , make_wasm_jobs wasm_build_config , modifyValidateJobs manual $ make_wasm_jobs wasm_build_config {bignumBackend = Native} @@ -1203,10 +1283,9 @@ cross_jobs = [ wasm_build_config = (crossConfig "wasm32-wasi" NoEmulatorNeeded Nothing) - { - hostFullyStatic = True - , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet - , textWithSIMDUTF = True + { hostFullyStatic = True + , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet + , textWithSIMDUTF = True } job_groups :: [JobGroup Job] @@ -1224,6 +1303,9 @@ job_groups = ++ cross_jobs ++ freebsd_jobs +--------------------------------------------------------------------- +-- Platform mapping for GHCup metadata +--------------------------------------------------------------------- mkPlatform :: Arch -> Opsys -> String mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys @@ -1267,7 +1349,11 @@ platform_mapping = Map.map go combined_result , "release-x86_64-windows-release" ] - process sel = Map.fromListWith combine [ (uncurry mkPlatform (jobPlatform (jobInfo $ j)), j) | (sel -> Just j) <- job_groups ] + process sel = + Map.fromListWith combine + [ (uncurry mkPlatform (jobPlatform (jobInfo j)), j) + | (sel -> Just j) <- job_groups + ] vs = process v ns = process n @@ -1275,10 +1361,13 @@ platform_mapping = Map.map go combined_result all_platforms = Map.keysSet vs <> Map.keysSet ns <> Map.keysSet rs - combined_result = Map.fromList [ (p, StandardTriple { v = Map.lookup p vs - , n = Map.lookup p ns - , r = Map.lookup p rs }) - | p <- S.toList all_platforms ] + combined_result = + Map.fromList + [ (p, StandardTriple { v = Map.lookup p vs + , n = Map.lookup p ns + , r = Map.lookup p rs }) + | p <- S.toList all_platforms + ] combine a b | name a `elem` whitelist = a -- Explicitly selected @@ -1293,6 +1382,9 @@ data BindistInfo = BindistInfo { bindistName :: String } deriving Show instance ToJSON BindistInfo where toJSON (BindistInfo n) = object [ "bindistName" A..= n ] +--------------------------------------------------------------------- +-- Main entrypoint +--------------------------------------------------------------------- main :: IO () main = do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/38f78ce54ffa18187bb5ebaee992829d609db4ef...c4a7680afc5a374c668dc80a8abdb3641ab115a2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/38f78ce54ffa18187bb5ebaee992829d609db4ef...c4a7680afc5a374c668dc80a8abdb3641ab115a2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 08:10:39 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 03:10:39 -0500 Subject: [Git][ghc/ghc][wip/T25647] 2 commits: Revert "align wildcard with named typevar on wether it is skolem" Message-ID: <67a7117fdf0e0_c29362ff786c745d2@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 69bdf58d by Patrick at 2025-02-08T14:12:42+08:00 Revert "align wildcard with named typevar on wether it is skolem" This reverts commit d1f61858328cc190de9b34c9a24e8d6b28ee5fa9. - - - - - f2dafbf2 by Patrick at 2025-02-08T16:10:27+08:00 add WildCardTv to forbid wildcard from defaulting - - - - - 13 changed files: - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Tc/Utils/Unify.hs - + testsuite/tests/indexed-types/should_compile/T11450a.hs - testsuite/tests/indexed-types/should_compile/T17536.hs - testsuite/tests/indexed-types/should_compile/T17536c.hs - testsuite/tests/indexed-types/should_compile/all.T - testsuite/tests/typecheck/should_compile/T25647a.hs - testsuite/tests/typecheck/should_compile/T25725.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -777,18 +777,17 @@ There is also the possibility of mentioning a wildcard -} -tcFamTyPats :: (Maybe SkolemInfo) - -> TyCon +tcFamTyPats :: TyCon -> HsFamEqnPats GhcRn -- Patterns -> TcM (TcType, TcKind) -- (lhs_type, lhs_kind) -- Check the LHS of a type/data family instance -- e.g. type instance F ty1 .. tyn = ... -- Used for both type and data families -tcFamTyPats skol_info fam_tc hs_pats +tcFamTyPats fam_tc hs_pats = do { traceTc "tcFamTyPats {" $ vcat [ ppr fam_tc, text "arity:" <+> ppr fam_arity ] - ; mode <- mkHoleMode TypeLevel (HM_FamPat skol_info) + ; mode <- mkHoleMode TypeLevel HM_FamPat -- HM_FamPat: See Note [Wildcards in family instances] in -- GHC.Rename.Module ; let fun_ty = mkTyConApp fam_tc [] @@ -968,7 +967,7 @@ type HoleInfo = Maybe (TcLevel, HoleMode) -- HoleMode says how to treat the occurrences -- of anonymous wildcards; see tcAnonWildCardOcc data HoleMode = HM_Sig -- Partial type signatures: f :: _ -> Int - | HM_FamPat (Maybe SkolemInfo) -- Family instances: F _ Int = Bool + | HM_FamPat -- Family instances: F _ Int = Bool | HM_VTA -- Visible type and kind application: -- f @(Maybe _) -- Maybe @(_ -> _) @@ -991,10 +990,10 @@ mkHoleMode tyki hm , mode_holes = Just (lvl,hm) }) } instance Outputable HoleMode where - ppr HM_Sig = text "HM_Sig" - ppr (HM_FamPat _) = text "HM_FamPat" - ppr HM_VTA = text "HM_VTA" - ppr HM_TyAppPat = text "HM_TyAppPat" + ppr HM_Sig = text "HM_Sig" + ppr HM_FamPat = text "HM_FamPat" + ppr HM_VTA = text "HM_VTA" + ppr HM_TyAppPat = text "HM_TyAppPat" instance Outputable TcTyMode where ppr (TcTyMode { mode_tyki = tyki, mode_holes = hm }) @@ -2213,7 +2212,7 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- esp the bullet on nested forall types = do { kv_details <- newTauTvDetailsAtLevel hole_lvl ; kv_name <- newMetaTyVarName (fsLit "k") - ; wc_details <- mk_wc_details + ; wc_details <- newWildCardTvDetailsAtLevel hole_lvl ; wc_name <- newMetaTyVarName wc_nm ; let kv = mkTcTyVar kv_name liftedTypeKind kv_details wc_kind = mkTyVarTy kv @@ -2231,21 +2230,17 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- so we have to do it properly (T14140a) ; checkExpectedKind ty (mkTyVarTy wc_tv) wc_kind exp_kind } where - -- make sure we align with none-wild card type variables - mk_wc_details = case hole_mode of - HM_FamPat (Just skol_info) -> return $ SkolemTv skol_info hole_lvl False - _ -> newTauTvDetailsAtLevel hole_lvl -- See Note [Wildcard names] wc_nm = case hole_mode of HM_Sig -> fsLit "w" - HM_FamPat _ -> fsLit "_" + HM_FamPat -> fsLit "_" HM_VTA -> fsLit "w" HM_TyAppPat -> fsLit "_" emit_holes = case hole_mode of - HM_Sig -> True - HM_FamPat _ -> False - HM_VTA -> False + HM_Sig -> True + HM_FamPat -> False + HM_VTA -> False HM_TyAppPat -> False tcAnonWildCardOcc is_extra _ _ _ ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -3253,7 +3253,7 @@ kcTyFamInstEqn tc_fam_tc ; discardResult $ bindOuterFamEqnTKBndrs_Q_Tv outer_bndrs $ - do { (_fam_app, res_kind) <- tcFamTyPats Nothing tc_fam_tc hs_pats + do { (_fam_app, res_kind) <- tcFamTyPats tc_fam_tc hs_pats ; tcCheckLHsTypeInContext hs_rhs_ty (TheKind res_kind) } -- Why "_Tv" here? Consider (#14066) -- type family Bar x y where @@ -3275,7 +3275,7 @@ tcTyFamInstEqn fam_tc mb_clsinfo , feqn_rhs = hs_rhs_ty })) = setSrcSpanA loc $ do { traceTc "tcTyFamInstEqn" $ - vcat [ ppr loc, ppr fam_tc <+> ppr hs_pats <+> ppr outer_bndrs + vcat [ ppr loc, ppr fam_tc <+> ppr hs_pats , text "fam tc bndrs" <+> pprTyVars (tyConTyVars fam_tc) , case mb_clsinfo of NotAssociated {} -> empty @@ -3430,7 +3430,7 @@ tcTyFamInstEqnGuts fam_tc mb_clsinfo outer_hs_bndrs hs_pats hs_rhs_ty ; (tclvl, wanted, (outer_bndrs, (lhs_ty, rhs_ty))) <- pushLevelAndSolveEqualitiesX "tcTyFamInstEqnGuts" $ bindOuterFamEqnTKBndrs skol_info outer_hs_bndrs $ - do { (lhs_ty, rhs_kind) <- tcFamTyPats (Just skol_info) fam_tc hs_pats + do { (lhs_ty, rhs_kind) <- tcFamTyPats fam_tc hs_pats -- Ensure that the instance is consistent with its -- parent class (#16008) ; addConsistencyConstraints mb_clsinfo lhs_ty ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -933,7 +933,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity <- pushLevelAndSolveEqualitiesX "tcDataFamInstHeader" $ bindOuterFamEqnTKBndrs skol_info hs_outer_bndrs $ -- Binds skolem TcTyVars do { stupid_theta <- tcHsContext hs_ctxt - ; (lhs_ty, lhs_kind) <- tcFamTyPats (Just skol_info) fam_tc hs_pats + ; (lhs_ty, lhs_kind) <- tcFamTyPats fam_tc hs_pats ; (lhs_applied_ty, lhs_applied_kind) <- tcInstInvisibleTyBinders lhs_ty lhs_kind -- See Note [Data family/instance return kinds] ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -34,7 +34,8 @@ module GHC.Tc.Utils.TcMType ( newMultiplicityVar, readMetaTyVar, writeMetaTyVar, writeMetaTyVarRef, - newTauTvDetailsAtLevel, newMetaDetails, newMetaTyVarName, + newWildCardTvDetailsAtLevel, newTauTvDetailsAtLevel, + newMetaDetails, newMetaTyVarName, isFilledMetaTyVar_maybe, isFilledMetaTyVar, isUnfilledMetaTyVar, -------------------------------- @@ -692,6 +693,16 @@ the thinking. * * ********************************************************************* -} +{- Note [WildCardTv] +~~~~~~~~~~~~~~~~~ +A WildCardTv behaves like a TauTv, except that it can not be defaulted. + +It is used for a anonymous wildcard in a type signature, e.g. + f :: _ -> Int + f = ... + +-} + {- Note [TyVarTv] ~~~~~~~~~~~~~~~~~ A TyVarTv can unify with type *variables* only, including other TyVarTvs and @@ -740,6 +751,7 @@ metaInfoToTyVarName :: MetaInfo -> FastString metaInfoToTyVarName meta_info = case meta_info of TauTv -> fsLit "t" + WildCardTv -> fsLit "_" TyVarTv -> fsLit "a" RuntimeUnkTv -> fsLit "r" CycleBreakerTv -> fsLit "b" @@ -853,6 +865,13 @@ newTauTvDetailsAtLevel tclvl , mtv_ref = ref , mtv_tclvl = tclvl }) } +newWildCardTvDetailsAtLevel :: TcLevel -> TcM TcTyVarDetails +newWildCardTvDetailsAtLevel tclvl + = do { ref <- newMutVar Flexi + ; return (MetaTv { mtv_info = WildCardTv + , mtv_ref = ref + , mtv_tclvl = tclvl }) } + newConcreteTvDetailsAtLevel :: ConcreteTvOrigin -> TcLevel -> TcM TcTyVarDetails newConcreteTvDetailsAtLevel conc_orig tclvl = do { ref <- newMutVar Flexi @@ -1841,7 +1860,10 @@ defaultTyVar :: DefaultingStrategy -> TcTyVar -- If it's a MetaTyVar then it is unbound -> TcM Bool -- True <=> defaulted away altogether defaultTyVar def_strat tv - | not (isMetaTyVar tv) + | not (isMetaTyVar tv ) + || isWildCardMetaTyVar tv + -- do not default WildcardTvs, wildcardTvs are are only meant to be unified + -- or be on its own but never defaulted. || isTyVarTyVar tv -- Do not default TyVarTvs. Doing so would violate the invariants -- on TyVarTvs; see Note [TyVarTv] in GHC.Tc.Utils.TcMType. ===================================== compiler/GHC/Tc/Utils/TcType.hs ===================================== @@ -51,7 +51,8 @@ module GHC.Tc.Utils.TcType ( TcTyVarDetails(..), pprTcTyVarDetails, vanillaSkolemTvUnk, MetaDetails(Flexi, Indirect), MetaInfo(..), skolemSkolInfo, isImmutableTyVar, isSkolemTyVar, isMetaTyVar, isMetaTyVarTy, isTyVarTy, - tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar, isTyConableTyVar, + isWildCardMetaTyVar, tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar, + isTyConableTyVar, ConcreteTvOrigin(..), isConcreteTyVar_maybe, isConcreteTyVar, isConcreteTyVarTy, isConcreteTyVarTy_maybe, concreteInfo_maybe, ConcreteTyVars, noConcreteTyVars, @@ -640,7 +641,8 @@ data MetaInfo = TauTv -- ^ This MetaTv is an ordinary unification variable -- A TauTv is always filled in with a tau-type, which -- never contains any ForAlls. - + | WildCardTv -- ^ A variant of TauTv, except that is should not be + -- defaulted. | TyVarTv -- ^ A variant of TauTv, except that it should not be -- unified with a type, only with a type variable -- See Note [TyVarTv] in GHC.Tc.Utils.TcMType @@ -670,6 +672,8 @@ instance Outputable MetaInfo where ppr RuntimeUnkTv = text "rutv" ppr CycleBreakerTv = text "cbv" ppr (ConcreteTv {}) = text "conc" + ppr (WildCardTv) = text "wc" + -- | What caused us to create a 'ConcreteTv' metavariable? -- See Note [ConcreteTv] in GHC.Tc.Utils.Concrete. @@ -1179,7 +1183,7 @@ isImmutableTyVar :: TyVar -> Bool isImmutableTyVar tv = isSkolemTyVar tv isTyConableTyVar, isSkolemTyVar, isOverlappableTyVar, - isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar :: TcTyVar -> Bool + isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar, isWildCardMetaTyVar :: TcTyVar -> Bool isTyConableTyVar tv -- True of a meta-type variable that can be filled in @@ -1220,6 +1224,13 @@ isMetaTyVar tv _ -> False | otherwise = False +isWildCardMetaTyVar tv + | isTyVar tv -- See Note [Coercion variables in free variable lists] + = case tcTyVarDetails tv of + MetaTv { mtv_info = WildCardTv } -> True + _ -> False + | otherwise = False + -- isAmbiguousTyVar is used only when reporting type errors -- It picks out variables that are unbound, namely meta -- type variables and the RuntimeUnk variables created by ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2574,8 +2574,9 @@ lhsPriority tv CycleBreakerTv -> 0 TyVarTv -> 1 ConcreteTv {} -> 2 - TauTv -> 3 - RuntimeUnkTv -> 4 + WildCardTv -> 3 + TauTv -> 4 + RuntimeUnkTv -> 5 {- Note [Unification preconditions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== testsuite/tests/indexed-types/should_compile/T11450a.hs ===================================== @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} + +module T11450a where + +class C x where + type T x + +instance C (Either a b) where + type T (Either _ b) = b -> b ===================================== testsuite/tests/indexed-types/should_compile/T17536.hs ===================================== @@ -28,27 +28,3 @@ type family M m where g :: M One -> Int g x = x - - --- make sure wildcard and non-wildcard type variables are treated the same - -type R1 :: RuntimeRep -> Type -type family R1 r where - R1 r = Int - -r1 :: R1 FloatRep -> Int -r1 x = x - -type L1 :: Levity -> Type -type family L1 l where - L1 l = Int - -l1 :: L1 Unlifted -> Int -l1 x = x - -type M1 :: Multiplicity -> Type -type family M1 m where - M1 m = Int - -g1 :: M1 One -> Int -g1 x = x ===================================== testsuite/tests/indexed-types/should_compile/T17536c.hs ===================================== @@ -15,11 +15,3 @@ type family R r a where r :: R FloatRep Float# -> Int r x = x - --- make sure wildcard and non-wildcard type variables are treated the same -type R1 :: forall (r :: RuntimeRep) -> TYPE r -> Type -type family R1 r a where - R1 r a = Int - -r1 :: R1 FloatRep Float# -> Int -r1 x = x ===================================== testsuite/tests/indexed-types/should_compile/all.T ===================================== @@ -315,3 +315,4 @@ test('T25611a', normal, compile, ['']) test('T25611b', normal, compile, ['']) test('T25611c', normal, compile, ['']) test('T25611d', normal, compile, ['']) +test('T11450a', normal, compile, ['']) ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -72,11 +72,3 @@ newtype instance Dix5 f = DIn5 (f (Dix5 f)) data family Dix7 :: (k -> TYPE 'IntRep) -> k newtype instance Dix7 f = DIn7 (f (Dix7 f)) - --- user written wildcards -type Dix8 :: RuntimeRep -> Type -data family Dix8 r -newtype instance Dix8 _ = Dix8 Int - -dix8 :: Dix8 FloatRep -> Int -dix8 (Dix8 x) = x ===================================== testsuite/tests/typecheck/should_compile/T25725.hs ===================================== @@ -9,7 +9,7 @@ import GHC.Exts data D :: TYPE r -> Type where MkD :: p -> D p --- But this was rejected +-- now this is OK too data family Dix4 :: Type -> k data instance Dix4 Int :: TYPE r -> Type where DIn4 :: p -> Dix4 Int p ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -936,3 +936,4 @@ test('T25597', normal, compile, ['']) test('T25647a', normal, compile, ['']) test('T25647b', normal, compile, ['']) test('T25647_fail', normal, compile_fail, ['']) +test('T25725', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ccc9152f23177ab7a542852ffedf626edcdcef95...f2dafbf21d3e46bd82ee8f43502a04c164ef37b2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ccc9152f23177ab7a542852ffedf626edcdcef95...f2dafbf21d3e46bd82ee8f43502a04c164ef37b2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 10:26:19 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 05:26:19 -0500 Subject: [Git][ghc/ghc][wip/T25647] Fix wildcard related tests Message-ID: <67a7314bc653_182986152f208774@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 8756ab87 by Patrick at 2025-02-08T18:26:09+08:00 Fix wildcard related tests - - - - - 5 changed files: - testsuite/tests/linear/should_fail/LinearPartialSig.stderr - testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr - testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr - testsuite/tests/polykinds/T14172.stderr - testsuite/tests/typecheck/should_compile/T10072.stderr Changes: ===================================== testsuite/tests/linear/should_fail/LinearPartialSig.stderr ===================================== @@ -1,6 +1,8 @@ -LinearPartialSig.hs:5:9: error: [GHC-88464] - • Found type wildcard ‘_’ - standing for ‘Many :: GHC.Internal.Types.Multiplicity’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: f :: a %_ -> a - +LinearPartialSig.hs:5:9: [GHC-88464] + Found type wildcard ‘_’ + standing for ‘w :: GHC.Internal.Types.Multiplicity’ + Where: ‘w’ is a rigid type variable bound by + the inferred type of f :: a %w -> a + at LinearPartialSig.hs:6:1-7 + To use the inferred type, enable PartialTypeSignatures + In the type signature: f :: a %_ -> a ===================================== testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr ===================================== @@ -1,5 +1,5 @@ TYPE SIGNATURES - bar :: forall {t} {w}. t -> (t -> w) -> w + bar :: forall {w1} {w2}. w1 -> (w1 -> w2) -> w2 foo :: forall {a}. (Show a, Enum a) => a -> String Dependent modules: [] Dependent packages: [base-4.17.0.0] @@ -23,22 +23,22 @@ WarningWildcardInstantiations.hs:5:30: warning: [GHC-88464] [-Wpartial-type-sign • In the type signature: foo :: (Show _a, _) => _a -> _ WarningWildcardInstantiations.hs:8:8: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: t -> (t -> w) -> w + Found type wildcard ‘_’ standing for ‘w1’ + Where: ‘w1’ is a rigid type variable bound by + the inferred type of bar :: w1 -> (w1 -> w2) -> w2 at WarningWildcardInstantiations.hs:9:1-13 • In the type signature: bar :: _ -> _ -> _ WarningWildcardInstantiations.hs:8:13: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘t -> w’ - Where: ‘t’, ‘w’ are rigid type variables bound by - the inferred type of bar :: t -> (t -> w) -> w + Found type wildcard ‘_’ standing for ‘w1 -> w2’ + Where: ‘w1’, ‘w2’ are rigid type variables bound by + the inferred type of bar :: w1 -> (w1 -> w2) -> w2 at WarningWildcardInstantiations.hs:9:1-13 • In the type signature: bar :: _ -> _ -> _ WarningWildcardInstantiations.hs:8:18: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘w’ - Where: ‘w’ is a rigid type variable bound by - the inferred type of bar :: t -> (t -> w) -> w + Found type wildcard ‘_’ standing for ‘w2’ + Where: ‘w2’ is a rigid type variable bound by + the inferred type of bar :: w1 -> (w1 -> w2) -> w2 at WarningWildcardInstantiations.hs:9:1-13 • In the type signature: bar :: _ -> _ -> _ ===================================== testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr ===================================== @@ -1,4 +1,3 @@ - WildcardInstantiations.hs:5:14: error: [GHC-88464] • Found type wildcard ‘_a’ standing for ‘a’ Where: ‘a’ is a rigid type variable bound by @@ -21,25 +20,25 @@ WildcardInstantiations.hs:5:30: error: [GHC-88464] • In the type signature: foo :: (Show _a, _) => _a -> _ WildcardInstantiations.hs:8:8: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: t -> (t -> w) -> w + • Found type wildcard ‘_’ standing for ‘w1’ + Where: ‘w1’ is a rigid type variable bound by + the inferred type of bar :: w1 -> (w1 -> w2) -> w2 at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures • In the type signature: bar :: _ -> _ -> _ WildcardInstantiations.hs:8:13: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘t -> w’ - Where: ‘t’, ‘w’ are rigid type variables bound by - the inferred type of bar :: t -> (t -> w) -> w + • Found type wildcard ‘_’ standing for ‘w1 -> w2’ + Where: ‘w1’, ‘w2’ are rigid type variables bound by + the inferred type of bar :: w1 -> (w1 -> w2) -> w2 at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures • In the type signature: bar :: _ -> _ -> _ WildcardInstantiations.hs:8:18: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘w’ - Where: ‘w’ is a rigid type variable bound by - the inferred type of bar :: t -> (t -> w) -> w + • Found type wildcard ‘_’ standing for ‘w2’ + Where: ‘w2’ is a rigid type variable bound by + the inferred type of bar :: w1 -> (w1 -> w2) -> w2 at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures - • In the type signature: bar :: _ -> _ -> _ + • In the type signature: bar :: _ -> _ -> _ \ No newline at end of file ===================================== testsuite/tests/polykinds/T14172.stderr ===================================== @@ -1,8 +1,8 @@ T14172.hs:7:46: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘a'’ - Where: ‘a'’ is a rigid type variable bound by + • Found type wildcard ‘_’ standing for ‘w’ + Where: ‘w’ is a rigid type variable bound by the inferred type of - traverseCompose :: (a -> f b) -> g a -> f (h a') + traverseCompose :: (a -> f b) -> g a -> f (h w) at T14172.hs:8:1-46 To use the inferred type, enable PartialTypeSignatures • In the first argument of ‘h’, namely ‘_’ @@ -12,18 +12,18 @@ T14172.hs:7:46: error: [GHC-88464] T14172.hs:8:19: error: [GHC-25897] • Couldn't match type ‘a’ with ‘g'1 a'0’ - Expected: (f'0 a -> f (f'0 b)) -> g a -> f (h a') - Actual: (Unwrapped (Compose f'0 g'1 a'0) -> f (Unwrapped (h a'))) - -> Compose f'0 g'1 a'0 -> f (h a') + Expected: (f'0 a -> f (f'0 b)) -> g a -> f (h w) + Actual: (Unwrapped (Compose f'0 g'1 a'0) -> f (Unwrapped (h w))) + -> Compose f'0 g'1 a'0 -> f (h w) ‘a’ is a rigid type variable bound by the inferred type of - traverseCompose :: (a -> f b) -> g a -> f (h a') + traverseCompose :: (a -> f b) -> g a -> f (h w) at T14172.hs:7:1-47 • In the first argument of ‘(.)’, namely ‘_Wrapping Compose’ In the expression: _Wrapping Compose . traverse In an equation for ‘traverseCompose’: traverseCompose = _Wrapping Compose . traverse • Relevant bindings include - traverseCompose :: (a -> f b) -> g a -> f (h a') + traverseCompose :: (a -> f b) -> g a -> f (h w) (bound at T14172.hs:8:1) ===================================== testsuite/tests/typecheck/should_compile/T10072.stderr ===================================== @@ -1,7 +1,7 @@ T10072.hs:3:31: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘b’ - Where: ‘b’ is a rigid type variable bound by + • Found type wildcard ‘_’ standing for ‘w’ + Where: ‘w’ is a rigid type variable bound by the RULE "map/empty" at T10072.hs:3:1-47 To use the inferred type, enable PartialTypeSignatures View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8756ab87f4e3d74968d3937f84f811f78a861852 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8756ab87f4e3d74968d3937f84f811f78a861852 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 15:01:04 2025 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Sat, 08 Feb 2025 10:01:04 -0500 Subject: [Git][ghc/ghc][wip/supersven/ghc-9.12.1-release+JumpTableReproducer] 2 commits: Ignore incomplete patterns in SpecConstr Message-ID: <67a771b09acb5_1d724d188d4b07508a@gitlab.mail> Sven Tennie pushed to branch wip/supersven/ghc-9.12.1-release+JumpTableReproducer at Glasgow Haskell Compiler / GHC Commits: 21018cbd by Sven Tennie at 2025-02-08T15:57:16+01:00 Ignore incomplete patterns in SpecConstr I wasn't able to build the validate flavour with GHC 9.10.1 without this. - - - - - 3b49aea8 by Sven Tennie at 2025-02-08T15:59:08+01:00 Add the reproducer of #25733 as test - - - - - 4 changed files: - compiler/GHC/Core/Opt/SpecConstr.hs - + testsuite/tests/codeGen/should_run/JumpTableReproducer.hs - + testsuite/tests/codeGen/should_run/JumpTableReproducer.stdout - testsuite/tests/codeGen/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/SpecConstr.hs ===================================== @@ -17,6 +17,7 @@ ToDo [Oct 2013] {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} +{-# OPTIONS_GHC -Wno-incomplete-patterns #-} module GHC.Core.Opt.SpecConstr( specConstrProgram, ===================================== testsuite/tests/codeGen/should_run/JumpTableReproducer.hs ===================================== @@ -0,0 +1,76 @@ +module Main (main) where + +import GHC.IO (unsafePerformIO) +import qualified Data.Array.IO as Array +import Data.Array.Base ( unsafeWrite ) +import Data.Word +import Control.Monad + +data BCInstr = C0 | C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9 + | C10 | C11 | C12 | C13 | C14 | C15 | C16 | C17 | C18 | C19 + | C20 | C21 | C22 | C23 | C24 | C25 | C26 | C27 | C28 | C29 + | C30 | C31 | C32 | C33 | C34 | C35 | C36 | C37 | C38 | C39 + | C40 | C41 | C42 | C43 | C44 | C45 | C46 | C47 | C48 | C49 + | C50 | C51 | C52 | C53 | C54 | C55 | C56 | C57 | C58 | C59 + | C60 | C61 | C62 | C63 | C64 | C65 | C66 | C67 | C68 | C69 + | C70 | C71 | C72 | C73 | C74 | C75 | C76 + +assembleI :: BCInstr -> Int -> IO Int +assembleI i = case i of + C4 -> emit; C5 -> emit; C6 -> emit; C7 -> emit; C8 -> emit; C9 -> emit; C10 -> emit + C11 -> emit; C12 -> emit; C13 -> emit; C14 -> emit; C15 -> emit; C16 -> emit; C17 -> emit + C18 -> emit; C19 -> emit; C20 -> emit; C21 -> emit; C22 -> emit; C23 -> emit; C24 -> emit + C25 -> emit; C26 -> emit; C27 -> emit; C28 -> emit; C29 -> emit; C30 -> emit; C31 -> emit + C32 -> emit; C33 -> emit; C34 -> emit; C35 -> emit; C36 -> emit; C37 -> emit; C38 -> emit + C39 -> emit; C40 -> emit; C41 -> emit; C42 -> emit; C43 -> emit; C44 -> emit; C45 -> emit + C46 -> emit; C47 -> emit; C48 -> emit; C49 -> emit; C50 -> emit; C51 -> emit; C52 -> emit + C53 -> emit; C54 -> emit; C55 -> emit; C56 -> emit; C57 -> emit; C58 -> emit; C59 -> emit + C60 -> emit; C61 -> emit; C62 -> emit; C63 -> emit; C64 -> emit; C65 -> emit; C66 -> emit + C67 -> emit; C68 -> emit; C69 -> emit; C70 -> emit; C71 -> emit; C72 -> emit; C73 -> emit + C74 -> emit; C75 -> emit; C76 -> emit + +emit :: Int -> IO Int +emit i = do + mapM6 (\w1 -> case l of + [] -> writeIsn w1 i + _ -> largeArg (fromIntegral @Word @Word64 w1) i) l +{-# INLINE emit #-} + +isn_array :: Array.IOUArray Int Word +isn_array = unsafePerformIO $ Array.newArray_ (0, 2) +{-# NOINLINE isn_array #-} + +runInstrs :: [BCInstr] -> IO Int +runInstrs instrs = foldM (\a i -> assembleI i a) 0 instrs +{-# NOINLINE runInstrs #-} + +writeIsn :: Word -> Int -> IO Int +writeIsn w nisn = do + unsafeWrite isn_array nisn w + return (nisn + 1) +{-# INLINE writeIsn #-} + +mapM6 :: (Word -> IO Int) -> [Word] -> IO Int +mapM6 _ [] = return 0 +mapM6 f [x] = f x +mapM6 f [x,y] = (+) <$> f x <*> f y +{-# INLINE mapM6 #-} + +largeArg :: Word64 -> Int -> IO Int +largeArg w i = + do i1 <- writeIsn (fromIntegral @Word64 @Word w) i + i2 <- writeIsn (fromIntegral @Word64 @Word w) i1 + i3 <- writeIsn (fromIntegral @Word64 @Word w) i2 + return i3 +{-# INLINE largeArg #-} + +l :: [a] +l = [] +{-# NOINLINE l #-} + +main :: IO () +main = do + putStrLn "hi" + !_ <- runInstrs [ C12 ] + putStrLn "bye" + ===================================== testsuite/tests/codeGen/should_run/JumpTableReproducer.stdout ===================================== @@ -0,0 +1,2 @@ +hi +bye ===================================== testsuite/tests/codeGen/should_run/all.T ===================================== @@ -252,3 +252,5 @@ test('T24700', normal, compile_and_run, ['-O']) test('T24893', normal, compile_and_run, ['-O']) test('CCallConv', [req_c], compile_and_run, ['CCallConv_c.c']) + +test('JumpTableReproducer', normal, compile_and_run, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/daf659b6e3c8f2a84100fbee797cd9d457c00df5...3b49aea89bcb2f49d7d5348a8ef0742b8a16aeec -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/daf659b6e3c8f2a84100fbee797cd9d457c00df5...3b49aea89bcb2f49d7d5348a8ef0742b8a16aeec You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 15:10:40 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 10:10:40 -0500 Subject: [Git][ghc/ghc][wip/T25647] add wildcards testcase for T25647a Message-ID: <67a773f0e8b85_1d724d1ae4308776c4@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 84f53fe2 by Patrick at 2025-02-08T23:10:30+08:00 add wildcards testcase for T25647a - - - - - 1 changed file: - testsuite/tests/typecheck/should_compile/T25647a.hs Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -72,3 +72,21 @@ newtype instance Dix5 f = DIn5 (f (Dix5 f)) data family Dix7 :: (k -> TYPE 'IntRep) -> k newtype instance Dix7 f = DIn7 (f (Dix7 f)) + + +-- anonymous wildcards +type Dix8 :: RuntimeRep -> Type +data family Dix8 r +newtype instance Dix8 _ = Dix8 Int + +dix8 :: Dix8 FloatRep -> Int +dix8 (Dix8 x) = x + + +-- named wildcards +type Dix9 :: RuntimeRep -> Type +data family Dix9 r +newtype instance Dix9 _r = Dix9 Int + +dix8 :: Dix9 FloatRep -> Int +dix8 (Dix9 x) = x View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84f53fe2a94f9d72b82b42c3928f394b1dd5e18b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84f53fe2a94f9d72b82b42c3928f394b1dd5e18b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 15:17:33 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 10:17:33 -0500 Subject: [Git][ghc/ghc][wip/T25647] Fix T25647a Message-ID: <67a7758d85782_1d724d1ae42cc7835f@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 945e730f by Patrick at 2025-02-08T23:17:25+08:00 Fix T25647a - - - - - 1 changed file: - testsuite/tests/typecheck/should_compile/T25647a.hs Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -88,5 +88,5 @@ type Dix9 :: RuntimeRep -> Type data family Dix9 r newtype instance Dix9 _r = Dix9 Int -dix8 :: Dix9 FloatRep -> Int -dix8 (Dix9 x) = x +dix9 :: Dix9 FloatRep -> Int +dix9 (Dix9 x) = x View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/945e730ffee35196cf6a1996ee2a5a1d81f79d2c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/945e730ffee35196cf6a1996ee2a5a1d81f79d2c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 16:15:29 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 11:15:29 -0500 Subject: [Git][ghc/ghc][wip/T25647] Revert "Fix wildcard related tests" Message-ID: <67a7832148997_25d95145c40040268@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: eb83dc29 by Patrick at 2025-02-09T00:13:46+08:00 Revert "Fix wildcard related tests" This reverts commit 8756ab87f4e3d74968d3937f84f811f78a861852. - - - - - 5 changed files: - testsuite/tests/linear/should_fail/LinearPartialSig.stderr - testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr - testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr - testsuite/tests/polykinds/T14172.stderr - testsuite/tests/typecheck/should_compile/T10072.stderr Changes: ===================================== testsuite/tests/linear/should_fail/LinearPartialSig.stderr ===================================== @@ -1,8 +1,6 @@ -LinearPartialSig.hs:5:9: [GHC-88464] - Found type wildcard ‘_’ - standing for ‘w :: GHC.Internal.Types.Multiplicity’ - Where: ‘w’ is a rigid type variable bound by - the inferred type of f :: a %w -> a - at LinearPartialSig.hs:6:1-7 - To use the inferred type, enable PartialTypeSignatures - In the type signature: f :: a %_ -> a +LinearPartialSig.hs:5:9: error: [GHC-88464] + • Found type wildcard ‘_’ + standing for ‘Many :: GHC.Internal.Types.Multiplicity’ + To use the inferred type, enable PartialTypeSignatures + • In the type signature: f :: a %_ -> a + ===================================== testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr ===================================== @@ -1,5 +1,5 @@ TYPE SIGNATURES - bar :: forall {w1} {w2}. w1 -> (w1 -> w2) -> w2 + bar :: forall {t} {w}. t -> (t -> w) -> w foo :: forall {a}. (Show a, Enum a) => a -> String Dependent modules: [] Dependent packages: [base-4.17.0.0] @@ -23,22 +23,22 @@ WarningWildcardInstantiations.hs:5:30: warning: [GHC-88464] [-Wpartial-type-sign • In the type signature: foo :: (Show _a, _) => _a -> _ WarningWildcardInstantiations.hs:8:8: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - Found type wildcard ‘_’ standing for ‘w1’ - Where: ‘w1’ is a rigid type variable bound by - the inferred type of bar :: w1 -> (w1 -> w2) -> w2 + • Found type wildcard ‘_’ standing for ‘t’ + Where: ‘t’ is a rigid type variable bound by + the inferred type of bar :: t -> (t -> w) -> w at WarningWildcardInstantiations.hs:9:1-13 • In the type signature: bar :: _ -> _ -> _ WarningWildcardInstantiations.hs:8:13: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - Found type wildcard ‘_’ standing for ‘w1 -> w2’ - Where: ‘w1’, ‘w2’ are rigid type variables bound by - the inferred type of bar :: w1 -> (w1 -> w2) -> w2 + • Found type wildcard ‘_’ standing for ‘t -> w’ + Where: ‘t’, ‘w’ are rigid type variables bound by + the inferred type of bar :: t -> (t -> w) -> w at WarningWildcardInstantiations.hs:9:1-13 • In the type signature: bar :: _ -> _ -> _ WarningWildcardInstantiations.hs:8:18: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - Found type wildcard ‘_’ standing for ‘w2’ - Where: ‘w2’ is a rigid type variable bound by - the inferred type of bar :: w1 -> (w1 -> w2) -> w2 + • Found type wildcard ‘_’ standing for ‘w’ + Where: ‘w’ is a rigid type variable bound by + the inferred type of bar :: t -> (t -> w) -> w at WarningWildcardInstantiations.hs:9:1-13 • In the type signature: bar :: _ -> _ -> _ ===================================== testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr ===================================== @@ -1,3 +1,4 @@ + WildcardInstantiations.hs:5:14: error: [GHC-88464] • Found type wildcard ‘_a’ standing for ‘a’ Where: ‘a’ is a rigid type variable bound by @@ -20,25 +21,25 @@ WildcardInstantiations.hs:5:30: error: [GHC-88464] • In the type signature: foo :: (Show _a, _) => _a -> _ WildcardInstantiations.hs:8:8: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘w1’ - Where: ‘w1’ is a rigid type variable bound by - the inferred type of bar :: w1 -> (w1 -> w2) -> w2 + • Found type wildcard ‘_’ standing for ‘t’ + Where: ‘t’ is a rigid type variable bound by + the inferred type of bar :: t -> (t -> w) -> w at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures • In the type signature: bar :: _ -> _ -> _ WildcardInstantiations.hs:8:13: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘w1 -> w2’ - Where: ‘w1’, ‘w2’ are rigid type variables bound by - the inferred type of bar :: w1 -> (w1 -> w2) -> w2 + • Found type wildcard ‘_’ standing for ‘t -> w’ + Where: ‘t’, ‘w’ are rigid type variables bound by + the inferred type of bar :: t -> (t -> w) -> w at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures • In the type signature: bar :: _ -> _ -> _ WildcardInstantiations.hs:8:18: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘w2’ - Where: ‘w2’ is a rigid type variable bound by - the inferred type of bar :: w1 -> (w1 -> w2) -> w2 + • Found type wildcard ‘_’ standing for ‘w’ + Where: ‘w’ is a rigid type variable bound by + the inferred type of bar :: t -> (t -> w) -> w at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures - • In the type signature: bar :: _ -> _ -> _ \ No newline at end of file + • In the type signature: bar :: _ -> _ -> _ ===================================== testsuite/tests/polykinds/T14172.stderr ===================================== @@ -1,8 +1,8 @@ T14172.hs:7:46: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘w’ - Where: ‘w’ is a rigid type variable bound by + • Found type wildcard ‘_’ standing for ‘a'’ + Where: ‘a'’ is a rigid type variable bound by the inferred type of - traverseCompose :: (a -> f b) -> g a -> f (h w) + traverseCompose :: (a -> f b) -> g a -> f (h a') at T14172.hs:8:1-46 To use the inferred type, enable PartialTypeSignatures • In the first argument of ‘h’, namely ‘_’ @@ -12,18 +12,18 @@ T14172.hs:7:46: error: [GHC-88464] T14172.hs:8:19: error: [GHC-25897] • Couldn't match type ‘a’ with ‘g'1 a'0’ - Expected: (f'0 a -> f (f'0 b)) -> g a -> f (h w) - Actual: (Unwrapped (Compose f'0 g'1 a'0) -> f (Unwrapped (h w))) - -> Compose f'0 g'1 a'0 -> f (h w) + Expected: (f'0 a -> f (f'0 b)) -> g a -> f (h a') + Actual: (Unwrapped (Compose f'0 g'1 a'0) -> f (Unwrapped (h a'))) + -> Compose f'0 g'1 a'0 -> f (h a') ‘a’ is a rigid type variable bound by the inferred type of - traverseCompose :: (a -> f b) -> g a -> f (h w) + traverseCompose :: (a -> f b) -> g a -> f (h a') at T14172.hs:7:1-47 • In the first argument of ‘(.)’, namely ‘_Wrapping Compose’ In the expression: _Wrapping Compose . traverse In an equation for ‘traverseCompose’: traverseCompose = _Wrapping Compose . traverse • Relevant bindings include - traverseCompose :: (a -> f b) -> g a -> f (h w) + traverseCompose :: (a -> f b) -> g a -> f (h a') (bound at T14172.hs:8:1) ===================================== testsuite/tests/typecheck/should_compile/T10072.stderr ===================================== @@ -1,7 +1,7 @@ T10072.hs:3:31: error: [GHC-88464] - • Found type wildcard ‘_’ standing for ‘w’ - Where: ‘w’ is a rigid type variable bound by + • Found type wildcard ‘_’ standing for ‘b’ + Where: ‘b’ is a rigid type variable bound by the RULE "map/empty" at T10072.hs:3:1-47 To use the inferred type, enable PartialTypeSignatures View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eb83dc29f139fa8ede0dc60e8ec8b974eb57d5cf -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eb83dc29f139fa8ede0dc60e8ec8b974eb57d5cf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 18:11:19 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 13:11:19 -0500 Subject: [Git][ghc/ghc][wip/T25647] limit WildCardTv to only HM_FamPat Message-ID: <67a79e473c3cb_25d95116d995c447c2@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: cb24202e by Patrick at 2025-02-09T02:11:09+08:00 limit WildCardTv to only HM_FamPat - - - - - 2 changed files: - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Utils/TcType.hs Changes: ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -2212,7 +2212,7 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- esp the bullet on nested forall types = do { kv_details <- newTauTvDetailsAtLevel hole_lvl ; kv_name <- newMetaTyVarName (fsLit "k") - ; wc_details <- newWildCardTvDetailsAtLevel hole_lvl + ; wc_details <- mk_wc_details hole_lvl ; wc_name <- newMetaTyVarName wc_nm ; let kv = mkTcTyVar kv_name liftedTypeKind kv_details wc_kind = mkTyVarTy kv @@ -2231,11 +2231,11 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } ; checkExpectedKind ty (mkTyVarTy wc_tv) wc_kind exp_kind } where -- See Note [Wildcard names] - wc_nm = case hole_mode of - HM_Sig -> fsLit "w" - HM_FamPat -> fsLit "_" - HM_VTA -> fsLit "w" - HM_TyAppPat -> fsLit "_" + (wc_nm, mk_wc_details) = case hole_mode of + HM_Sig -> (fsLit "w", newTauTvDetailsAtLevel) + HM_FamPat -> (fsLit "_", newWildCardTvDetailsAtLevel) + HM_VTA -> (fsLit "w", newTauTvDetailsAtLevel) + HM_TyAppPat -> (fsLit "_", newTauTvDetailsAtLevel) emit_holes = case hole_mode of HM_Sig -> True @@ -2402,8 +2402,7 @@ kcCheckDeclHeader_cusk name flav -- skolemise and then quantify over. We do not include spec_req_tvs -- because they are /already/ skolems - ; inferred <- quantifyTyVars skol_info DefaultNonStandardTyVars $ - candidates `delCandidates` spec_req_tkvs + ; inferred <- quantifyTyVars skol_info $ candidates `delCandidates` spec_req_tkvs -- NB: 'inferred' comes back sorted in dependency order ; (scoped_kvs, tc_bndrs, res_kind) <- liftZonkM $ ===================================== compiler/GHC/Tc/Utils/TcType.hs ===================================== @@ -641,7 +641,7 @@ data MetaInfo = TauTv -- ^ This MetaTv is an ordinary unification variable -- A TauTv is always filled in with a tau-type, which -- never contains any ForAlls. - | WildCardTv -- ^ A variant of TauTv, except that is should not be + | WildCardTv -- ^ A variant of TauTv, except that it should not be -- defaulted. | TyVarTv -- ^ A variant of TauTv, except that it should not be -- unified with a type, only with a type variable View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cb24202e1123e81baf8aa1895dcf025ee3f63e93 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cb24202e1123e81baf8aa1895dcf025ee3f63e93 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 18:42:03 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 13:42:03 -0500 Subject: [Git][ghc/ghc][wip/T25647] 2 commits: fix Message-ID: <67a7a57bea13e_25d9511ca217c460ca@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 23607f3e by Patrick at 2025-02-09T02:41:31+08:00 fix - - - - - bfdbaffc by Patrick at 2025-02-09T02:41:49+08:00 Revert "remove wildcard usage" This reverts commit ccc9152f23177ab7a542852ffedf626edcdcef95. - - - - - 2 changed files: - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Types/Error.hs Changes: ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -2402,7 +2402,8 @@ kcCheckDeclHeader_cusk name flav -- skolemise and then quantify over. We do not include spec_req_tvs -- because they are /already/ skolems - ; inferred <- quantifyTyVars skol_info $ candidates `delCandidates` spec_req_tkvs + ; inferred <- quantifyTyVars skol_info DefaultNonStandardTyVars $ + candidates `delCandidates` spec_req_tkvs -- NB: 'inferred' comes back sorted in dependency order ; (scoped_kvs, tc_bndrs, res_kind) <- liftZonkM $ ===================================== compiler/GHC/Types/Error.hs ===================================== @@ -298,8 +298,8 @@ data UnknownDiagnostic opts hint where type UnknownDiagnosticFor a = UnknownDiagnostic (DiagnosticOpts a) (DiagnosticHint a) instance (HasDefaultDiagnosticOpts opts, Outputable hint) => Diagnostic (UnknownDiagnostic opts hint) where - type DiagnosticOpts (UnknownDiagnostic opts hint) = opts - type DiagnosticHint (UnknownDiagnostic opts hint) = hint + type DiagnosticOpts (UnknownDiagnostic opts _) = opts + type DiagnosticHint (UnknownDiagnostic _ hint) = hint diagnosticMessage opts (UnknownDiagnostic f _ diag) = diagnosticMessage (f opts) diag diagnosticReason (UnknownDiagnostic _ _ diag) = diagnosticReason diag diagnosticHints (UnknownDiagnostic _ f diag) = map f (diagnosticHints diag) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb24202e1123e81baf8aa1895dcf025ee3f63e93...bfdbaffc3bdab06e453c4e067e6deeb89bdd28ad -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb24202e1123e81baf8aa1895dcf025ee3f63e93...bfdbaffc3bdab06e453c4e067e6deeb89bdd28ad You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 20:37:07 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sat, 08 Feb 2025 15:37:07 -0500 Subject: [Git][ghc/ghc][wip/T25647] 35 commits: base: Label threads forked by IO operations Message-ID: <67a7c07333b82_25d9513168d90503d8@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 72d14be7 by Simon Peyton Jones at 2025-02-08T20:36:39+00:00 WIP towards #25267 - - - - - e71a4fb6 by Simon Peyton Jones at 2025-02-08T20:36:39+00:00 Wibbles - - - - - 5755d1b5 by Simon Peyton Jones at 2025-02-08T20:36:39+00:00 Default tyvars in data/newtype insnstances This is what fixes #25647 - - - - - 94962fe9 by Simon Peyton Jones at 2025-02-08T20:36:39+00:00 wibbles Including fix for #25725 - - - - - 1a1ac919 by Simon Peyton Jones at 2025-02-08T20:36:39+00:00 Wibble - - - - - 632c88ce by Patrick at 2025-02-08T20:36:39+00:00 add more tests - - - - - 899f7590 by Patrick at 2025-02-08T20:36:39+00:00 Fix up T25611d with explicit kind annotation - - - - - 57746293 by Patrick at 2025-02-08T20:36:39+00:00 fix up T25647_fail - - - - - c24c7bd5 by Patrick at 2025-02-08T20:36:39+00:00 cleanup whitespace - - - - - b005ce2a by Patrick at 2025-02-08T20:36:39+00:00 fix up T23512a - - - - - 2ff9e2c8 by Patrick at 2025-02-08T20:36:39+00:00 add more examples to T25647b - - - - - 56d57a2a by Patrick at 2025-02-08T20:36:39+00:00 add Dix6 to T25647_fail - - - - - 0431d5b0 by Patrick at 2025-02-08T20:36:39+00:00 add Dix7 for T25647a - - - - - dabcbc77 by Patrick at 2025-02-08T20:36:39+00:00 change DefaultingStrategy of tcTyFamInstEqnGuts as well - - - - - 73ec0074 by Patrick at 2025-02-08T20:36:39+00:00 align wildcard with named typevar on wether it is skolem - - - - - 42452076 by Patrick at 2025-02-08T20:36:39+00:00 fix T17536c - - - - - cfa92439 by Patrick at 2025-02-08T20:36:39+00:00 Fix T9357 - - - - - 49161a84 by Patrick at 2025-02-08T20:36:39+00:00 remove wildcard usage - - - - - 5d6aec85 by Patrick at 2025-02-08T20:36:39+00:00 Revert "align wildcard with named typevar on wether it is skolem" This reverts commit d1f61858328cc190de9b34c9a24e8d6b28ee5fa9. - - - - - d2aa8e86 by Patrick at 2025-02-08T20:36:39+00:00 add WildCardTv to forbid wildcard from defaulting - - - - - cb661de1 by Patrick at 2025-02-08T20:36:39+00:00 Fix wildcard related tests - - - - - c54624db by Patrick at 2025-02-08T20:36:39+00:00 add wildcards testcase for T25647a - - - - - 5d234718 by Patrick at 2025-02-08T20:36:39+00:00 Fix T25647a - - - - - f5abbf3a by Patrick at 2025-02-08T20:36:39+00:00 Revert "Fix wildcard related tests" This reverts commit 8756ab87f4e3d74968d3937f84f811f78a861852. - - - - - 1ff3327f by Patrick at 2025-02-08T20:36:39+00:00 limit WildCardTv to only HM_FamPat - - - - - 28528ae1 by Patrick at 2025-02-08T20:36:39+00:00 fix - - - - - 88dfabaa by Patrick at 2025-02-08T20:36:39+00:00 Revert "remove wildcard usage" This reverts commit ccc9152f23177ab7a542852ffedf626edcdcef95. - - - - - 30 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/Language/Haskell/Syntax/Decls.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - + testsuite/tests/indexed-types/should_compile/T11450a.hs - testsuite/tests/indexed-types/should_compile/T25611d.hs - testsuite/tests/indexed-types/should_compile/all.T - testsuite/tests/indexed-types/should_fail/T9357.stderr - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/rename/should_fail/T23512a.stderr - + testsuite/tests/typecheck/should_compile/T25647_fail.hs - + testsuite/tests/typecheck/should_compile/T25647_fail.stderr - + testsuite/tests/typecheck/should_compile/T25647a.hs - + testsuite/tests/typecheck/should_compile/T25647b.hs - + testsuite/tests/typecheck/should_compile/T25725.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -5,6 +5,12 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ViewPatterns #-} +{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} + +{-# HLINT ignore "Use newtype instead of data" #-} +{-# HLINT ignore "Use camelCase" #-} +{-# LANGUAGE DerivingStrategies #-} + import Data.Aeson as A import qualified Data.Map as Map import Data.Map (Map) @@ -199,7 +205,7 @@ data FlavourTrans = data BaseFlavour = Release | Validate | SlowValidate deriving Eq ----------------------------------------------------------------------------- --- Build Configs +-- Build Configurations ----------------------------------------------------------------------------- -- | A standard build config @@ -244,7 +250,7 @@ releaseConfig = vanilla { buildFlavour = Release } debug :: BuildConfig debug = vanilla { buildFlavour = SlowValidate , withAssertions = True - -- WithNuma so at least one job tests Numa + -- WithNuma so at least one job tests Numa , withNuma = True } @@ -280,21 +286,21 @@ usePerfProfilingTestsuite :: BuildConfig -> BuildConfig usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True } ----------------------------------------------------------------------------- --- Platform specific variables +-- Identifying Platforms ----------------------------------------------------------------------------- -- | These tags have to match what we call the runners on gitlab runnerTag :: Arch -> Opsys -> String runnerTag arch (Linux _) = case arch of - Amd64 -> "x86_64-linux" - AArch64 -> "aarch64-linux" - I386 -> "x86_64-linux" -runnerTag AArch64 Darwin = "aarch64-darwin" -runnerTag Amd64 Darwin = "x86_64-darwin-m1" -runnerTag Amd64 Windows = "new-x86_64-windows" + Amd64 -> "x86_64-linux" + AArch64 -> "aarch64-linux" + I386 -> "x86_64-linux" +runnerTag AArch64 Darwin = "aarch64-darwin" +runnerTag Amd64 Darwin = "x86_64-darwin-m1" +runnerTag Amd64 Windows = "new-x86_64-windows" runnerTag Amd64 FreeBSD14 = "x86_64-freebsd14" -runnerTag _ _ = error "Invalid arch/opsys" +runnerTag _ _ = error "Invalid arch/opsys" tags :: Arch -> Opsys -> BuildConfig -> [String] tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use @@ -305,34 +311,34 @@ runnerPerfTag arch sys = runnerTag arch sys ++ "-perf" -- These names are used to find the docker image so they have to match what is -- in the docker registry. distroName :: LinuxDistro -> String -distroName Debian12 = "deb12" -distroName Debian11 = "deb11" -distroName Debian11Js = "deb11-emsdk-closure" +distroName Debian12 = "deb12" +distroName Debian11 = "deb11" +distroName Debian11Js = "deb11-emsdk-closure" distroName Debian12Riscv = "deb12-riscv" -distroName Debian10 = "deb10" -distroName Debian9 = "deb9" -distroName Fedora33 = "fedora33" -distroName Fedora38 = "fedora38" -distroName Ubuntu1804 = "ubuntu18_04" -distroName Ubuntu2004 = "ubuntu20_04" -distroName Ubuntu2204 = "ubuntu22_04" -distroName Centos7 = "centos7" -distroName Alpine312 = "alpine3_12" -distroName Alpine318 = "alpine3_18" -distroName Alpine320 = "alpine3_20" -distroName AlpineWasm = "alpine3_20-wasm" -distroName Rocky8 = "rocky8" +distroName Debian10 = "deb10" +distroName Debian9 = "deb9" +distroName Fedora33 = "fedora33" +distroName Fedora38 = "fedora38" +distroName Ubuntu1804 = "ubuntu18_04" +distroName Ubuntu2004 = "ubuntu20_04" +distroName Ubuntu2204 = "ubuntu22_04" +distroName Centos7 = "centos7" +distroName Alpine312 = "alpine3_12" +distroName Alpine318 = "alpine3_18" +distroName Alpine320 = "alpine3_20" +distroName AlpineWasm = "alpine3_20-wasm" +distroName Rocky8 = "rocky8" opsysName :: Opsys -> String opsysName (Linux distro) = "linux-" ++ distroName distro -opsysName Darwin = "darwin" -opsysName FreeBSD14 = "freebsd14" -opsysName Windows = "windows" +opsysName Darwin = "darwin" +opsysName FreeBSD14 = "freebsd14" +opsysName Windows = "windows" archName :: Arch -> String -archName Amd64 = "x86_64" +archName Amd64 = "x86_64" archName AArch64 = "aarch64" -archName I386 = "i386" +archName I386 = "i386" binDistName :: Arch -> Opsys -> BuildConfig -> String binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc @@ -341,16 +347,18 @@ binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc -- Either the change is reflected by modifying the flavourString or directly (as is -- the case for settings which affect environment variables) testEnv :: Arch -> Opsys -> BuildConfig -> String -testEnv arch opsys bc = intercalate "-" $ - [ archName arch - , opsysName opsys ] - ++ ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] - ++ ["unreg" | unregisterised bc ] - ++ ["numa" | withNuma bc ] - ++ ["zstd" | withZstd bc ] - ++ ["no_tntc" | not (tablesNextToCode bc) ] - ++ ["cross_"++triple | Just triple <- pure $ crossTarget bc ] - ++ [flavourString (mkJobFlavour bc)] +testEnv arch opsys bc = + intercalate "-" $ concat + [ [ archName arch + , opsysName opsys ] + , ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp] + , ["unreg" | unregisterised bc ] + , ["numa" | withNuma bc ] + , ["zstd" | withZstd bc ] + , ["no_tntc" | not (tablesNextToCode bc) ] + , ["cross_"++triple | Just triple <- pure $ crossTarget bc ] + , [flavourString (mkJobFlavour bc)] + ] -- | The hadrian flavour string we are going to use for this build flavourString :: Flavour -> String @@ -384,7 +392,7 @@ dockerImage arch (Linux distro) = dockerImage _ _ = Nothing ----------------------------------------------------------------------------- --- Platform specific variables +-- Platform-specific variables ----------------------------------------------------------------------------- -- The variables map is a monoidal map so that we don't ever accidentally lose @@ -438,35 +446,36 @@ opsysVariables _ FreeBSD14 = mconcat , "CABAL_INSTALL_VERSION" =: "3.10.3.0" ] opsysVariables arch (Linux distro) = distroVariables arch distro -opsysVariables AArch64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "aarch64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables Amd64 (Darwin {}) = - mconcat [ "NIX_SYSTEM" =: "x86_64-darwin" - , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" - -- "# Only Sierra and onwards supports clock_gettime. See #12858" - , "ac_cv_func_clock_gettime" =: "no" - -- # Only newer OS Xs support utimensat. See #17895 - , "ac_cv_func_utimensat" =: "no" - -- # Only newer OS Xs support futimens. See #22938 - , "ac_cv_func_futimens" =: "no" - , "LANG" =: "en_US.UTF-8" - , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" - -- Fonts can't be installed on darwin - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" +opsysVariables AArch64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "aarch64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + ] +opsysVariables Amd64 (Darwin {}) = mconcat + [ "NIX_SYSTEM" =: "x86_64-darwin" + , "MACOSX_DEPLOYMENT_TARGET" =: "11.0" + -- Only Sierra and onwards supports clock_gettime. See #12858 + , "ac_cv_func_clock_gettime" =: "no" + -- Only newer OS Xs support utimensat. See #17895 + , "ac_cv_func_utimensat" =: "no" + -- Only newer OS Xs support futimens. See #22938 + , "ac_cv_func_futimens" =: "no" + , "LANG" =: "en_US.UTF-8" + , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi" + -- Fonts can't be installed on darwin + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - ] -opsysVariables _ (Windows {}) = - mconcat [ "MSYSTEM" =: "CLANG64" - , "LANG" =: "en_US.UTF-8" - , "CABAL_INSTALL_VERSION" =: "3.10.2.0" - , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - , "GHC_VERSION" =: "9.6.4" ] + ] +opsysVariables _ (Windows {}) = mconcat + [ "MSYSTEM" =: "CLANG64" + , "LANG" =: "en_US.UTF-8" + , "CABAL_INSTALL_VERSION" =: "3.10.2.0" + , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" + , "GHC_VERSION" =: "9.6.4" + ] opsysVariables _ _ = mempty alpineVariables :: Arch -> Variables @@ -481,7 +490,7 @@ alpineVariables arch = mconcat $ | I386 <- [arch] ] ++ [ brokenTest "T22033" "#25497" | I386 <- [arch] ] ++ - [-- Bootstrap compiler has incorrectly configured target triple #25200 + [ -- Bootstrap compiler has incorrectly configured target triple #25200 "CONFIGURE_ARGS" =: "--enable-ignore-build-platform-mismatch --build=aarch64-unknown-linux --host=aarch64-unknown-linux --target=aarch64-unknown-linux" | AArch64 <- [arch] ] @@ -491,15 +500,14 @@ distroVariables :: Arch -> LinuxDistro -> Variables distroVariables arch Alpine312 = alpineVariables arch distroVariables arch Alpine318 = alpineVariables arch distroVariables arch Alpine320 = alpineVariables arch -distroVariables _ Centos7 = mconcat [ - "HADRIAN_ARGS" =: "--docs=no-sphinx" - , brokenTest "T22012" "#23979" - ] -distroVariables _ Fedora33 = mconcat +distroVariables _ Centos7 = mconcat [ "HADRIAN_ARGS" =: "--docs=no-sphinx" + , brokenTest "T22012" "#23979" + ] +distroVariables _ Fedora33 = mconcat -- LLC/OPT do not work for some reason in our fedora images -- These tests fail with this error: T11649 T5681 T7571 T8131b -- +/opt/llvm/bin/opt: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/opt) --- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) + -- +/opt/llvm/bin/llc: /lib64/libtinfo.so.5: no version information available (required by /opt/llvm/bin/llc) [ "LLC" =: "/bin/false" , "OPT" =: "/bin/false" ] @@ -510,7 +518,7 @@ distroVariables _ _ = mempty ----------------------------------------------------------------------------- data Cache - = Cache { cacheKey :: String + = Cache { cacheKey :: String , cachePaths :: [String] } @@ -550,25 +558,27 @@ data ArtifactsWhen = ArtifactsOnSuccess | ArtifactsOnFailure | ArtifactsAlways instance ToJSON ArtifactsWhen where toJSON ArtifactsOnSuccess = "on_success" toJSON ArtifactsOnFailure = "on_failure" - toJSON ArtifactsAlways = "always" + toJSON ArtifactsAlways = "always" ------------------------------------------------------------------------------ +--------------------------------------------------------------------- -- Rules, when do we run a job ------------------------------------------------------------------------------ +--------------------------------------------------------------------- --- Data structure which records the condition when a job is run. -data OnOffRules = OnOffRules { rule_set :: Rule -- ^ The enabled rules - , when :: ManualFlag -- ^ The additional condition about when to run this job. - } +-- | Data structure which records the condition when a job is run. +data OnOffRules + = OnOffRules { rule_set :: Rule -- ^ The enabled rules + , when :: ManualFlag -- ^ The additional condition about when to run this job. + } -- The initial set of rules, which assumes a Validate pipeline which is run with FullCI. emptyRules :: String -> OnOffRules emptyRules jobName = OnOffRules (ValidateOnly jobName (S.fromList [FullCI])) OnSuccess -- When to run the job -data ManualFlag = Manual -- ^ Only run the job when explicitly triggered by a user - | OnSuccess -- ^ Always run it, if the rules pass (the default) - deriving Eq +data ManualFlag + = Manual -- ^ Only run the job when explicitly triggered by a user + | OnSuccess -- ^ Always run it, if the rules pass (the default) + deriving Eq setRule :: Rule -> OnOffRules -> OnOffRules setRule r (OnOffRules _ m) = OnOffRules r m @@ -595,18 +605,23 @@ manualRule rules = rules { when = Manual } enumRules :: OnOffRules -> [OnOffRule] enumRules (OnOffRules r _) = rulesList where - rulesList = case r of - ValidateOnly s rs -> [OnOffRule On (ValidateOnly s rs) - , OnOffRule Off ReleaseOnly - , OnOffRule Off Nightly ] - Nightly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule Off ReleaseOnly - , OnOffRule On Nightly ] - ReleaseOnly -> [ OnOffRule Off (ValidateOnly "" S.empty) - , OnOffRule On ReleaseOnly - , OnOffRule Off Nightly ] - - + rulesList = + case r of + ValidateOnly s rs -> + [ OnOffRule On (ValidateOnly s rs) + , OnOffRule Off ReleaseOnly + , OnOffRule Off Nightly + ] + Nightly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule Off ReleaseOnly + , OnOffRule On Nightly + ] + ReleaseOnly -> + [ OnOffRule Off (ValidateOnly "" S.empty) + , OnOffRule On ReleaseOnly + , OnOffRule Off Nightly + ] data OnOffRule = OnOffRule OnOff Rule @@ -617,102 +632,135 @@ instance ToJSON ManualFlag where toJSON OnSuccess = "on_success" instance ToJSON OnOffRules where - toJSON rules = toJSON [object ([ - "if" A..= and_all (map one_rule (enumRules rules)) - , "when" A..= toJSON (when rules)] - -- Necessary to stop manual jobs stopping pipeline progress - -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure - ++ - ["allow_failure" A..= True | when rules == Manual ])] - + toJSON rules = toJSON + [object $ + [ "if" A..= and_all (map one_rule (enumRules rules)) + , "when" A..= toJSON (when rules) + ] ++ + -- Necessary to stop manual jobs stopping pipeline progress + -- https://docs.gitlab.com/ee/ci/yaml/#rulesallow_failure + [ "allow_failure" A..= True | when rules == Manual ] + ] where - one_rule (OnOffRule onoff r) = ruleString onoff r + one_rule (OnOffRule onoff r) = ruleToCond onoff r +--------------------------------------------------------------------- +-- Rule conditions +--------------------------------------------------------------------- -parens :: [Char] -> [Char] -parens s = "(" ++ s ++ ")" -and_all :: [[Char]] -> [Char] -and_all rs = intercalate " && " (map parens rs) -or_all :: [[Char]] -> [Char] -or_all rs = intercalate " || " (map parens rs) +-- | A predicate in GitLab's rules language. +newtype Cond = Cond { getCond :: String } + deriving newtype (ToJSON) --- | A Rule corresponds to some condition which must be satisifed in order to --- run the job. -data Rule = ReleaseOnly -- ^ Only run this job in a release pipeline - | Nightly -- ^ Only run this job in the nightly pipeline - | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. - deriving (Show, Ord, Eq) - -data ValidateRule = - FullCI -- ^ Run this job when the "full-ci" label is present. - | FastCI -- ^ Run this job on every validation pipeline - | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present - | JSBackend -- ^ Run this job when the "javascript" label is present - | RiscV -- ^ Run this job when the "RISC-V" label is present - | WasmBackend -- ^ Run this job when the "wasm" label is present - | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. - | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. - | IpeData -- ^ Run this job when the "IPE" label is set - | TestPrimops -- ^ Run this job when "test-primops" label is set - | I386Backend -- ^ Run this job when the "i386" label is set - deriving (Show, Ord, Eq) - --- A constant evaluating to True because gitlab doesn't support "true" in the +parens :: Cond -> Cond +parens (Cond s) = Cond $ "(" ++ s ++ ")" + +and_all :: [Cond] -> Cond +and_all = + Cond . intercalate " && " . map (getCond . parens) + +or_all :: [Cond] -> Cond +or_all = + Cond . intercalate " || " . map (getCond . parens) + +type Var = String + +varIsSet :: Var -> Cond +varIsSet var = + Cond $ "$" <> var + +-- | A constant evaluating to True because gitlab doesn't support "true" in the -- expression language. -true :: String -true = "\"true\" == \"true\"" --- A constant evaluating to False because gitlab doesn't support "true" in the +true :: Cond +true = Cond "\"true\" == \"true\"" + +-- | A constant evaluating to False because gitlab doesn't support "true" in the -- expression language. -_false :: String -_false = "\"disabled\" != \"disabled\"" - --- Convert the state of the rule into a string that gitlab understand. -ruleString :: OnOff -> Rule -> String -ruleString On (ValidateOnly only_job_name vs) = - let conds = S.toList vs - empty_only_job = envVarNull "ONLY_JOBS" - run_cond = case conds of - [] -> _false - cs -> or_all (map validateRuleString conds) - escape :: String -> String - escape = concatMap (\c -> if c == '+' then "\\+" else [c]) - - in - or_all [ - -- 1. Case when ONLY_JOBS is set - and_all [ "$ONLY_JOBS", "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" ] - -- 2. Case when ONLY_JOBS is null - , and_all [ empty_only_job, run_cond ] - ] -ruleString Off (ValidateOnly {}) = true -ruleString On ReleaseOnly = "$RELEASE_JOB == \"yes\"" -ruleString Off ReleaseOnly = "$RELEASE_JOB != \"yes\"" -ruleString On Nightly = "$NIGHTLY" -ruleString Off Nightly = envVarNull "NIGHTLY" +_false :: Cond +_false = Cond "\"disabled\" != \"disabled\"" + +labelString :: String -> Cond +labelString s = + Cond $ "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" -labelString :: String -> String -labelString s = "$CI_MERGE_REQUEST_LABELS =~ /.*" ++ s ++ ".*/" +branchStringExact :: String -> Cond +branchStringExact = + varEqString "CI_COMMIT_BRANCH" -branchStringExact :: String -> String -branchStringExact s = envVarString "CI_COMMIT_BRANCH" s +branchStringLike :: String -> Cond +branchStringLike s = + Cond $ "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" -branchStringLike :: String -> String -branchStringLike s = "$CI_COMMIT_BRANCH =~ /" ++ s ++ "/" +varEqString :: String -> String -> Cond +varEqString var s = + Cond $ "$" ++ var ++ " == \"" ++ s ++ "\"" -envVarString :: String -> String -> String -envVarString var s = "$" ++ var ++ " == \"" ++ s ++ "\"" +varNeString :: String -> String -> Cond +varNeString var s = + Cond $ "$" ++ var ++ " != \"" ++ s ++ "\"" -envVarNull :: String -> String -envVarNull var = "$" ++ var ++ " == null" +varIsNull :: String -> Cond +varIsNull var = + Cond $ "$" ++ var ++ " == null" +--------------------------------------------------------------------- +-- Our Rules +--------------------------------------------------------------------- -validateRuleString :: ValidateRule -> String -validateRuleString FullCI = or_all ([ labelString "full-ci" - , labelString "marge_bot_batch_merge_job" - , branchStringExact "master" - , branchStringLike "ghc-[0-9]+\\.[0-9]+" - ]) -validateRuleString FastCI = true +-- | A Rule corresponds to some condition which must be satisifed in order to +-- run the job. +data Rule + = ReleaseOnly -- ^ Only run this job in a release pipeline + | Nightly -- ^ Only run this job in the nightly pipeline + | ValidateOnly String (S.Set ValidateRule) -- ^ Only run this job in a validate pipeline, when any of these rules are enabled. + deriving (Show, Ord, Eq) + +data ValidateRule + = FullCI -- ^ Run this job when the "full-ci" label is present. + | FastCI -- ^ Run this job on every validation pipeline + | LLVMBackend -- ^ Run this job when the "LLVM backend" label is present + | JSBackend -- ^ Run this job when the "javascript" label is present + | RiscV -- ^ Run this job when the "RISC-V" label is present + | WasmBackend -- ^ Run this job when the "wasm" label is present + | FreeBSDLabel -- ^ Run this job when the "FreeBSD" label is set. + | NonmovingGc -- ^ Run this job when the "non-moving GC" label is set. + | IpeData -- ^ Run this job when the "IPE" label is set + | TestPrimops -- ^ Run this job when "test-primops" label is set + | I386Backend -- ^ Run this job when the "i386" label is set + deriving (Show, Ord, Eq) + +-- | Convert the state of the rule into a string that gitlab understand. +ruleToCond :: OnOff -> Rule -> Cond +ruleToCond On (ValidateOnly only_job_name vs) = + or_all + [ -- 1. Case when ONLY_JOBS is set + and_all [ varIsSet "ONLY_JOBS" + , Cond $ "$ONLY_JOBS =~ /.*\\b" ++ escape only_job_name ++ "(\\s|$).*/" + ] + -- 2. Case when ONLY_JOBS is null + , and_all [ varIsNull "ONLY_JOBS" + , case S.toList vs of + [] -> _false + cs -> or_all (map validateRuleString cs) + ] + ] + where + escape :: String -> String + escape = concatMap (\c -> if c == '+' then "\\+" else [c]) +ruleToCond Off (ValidateOnly {}) = true +ruleToCond On ReleaseOnly = "RELEASE_JOB" `varEqString` "yes" +ruleToCond Off ReleaseOnly = "RELEASE_JOB" `varNeString` "yes" +ruleToCond On Nightly = varIsSet "NIGHTLY" +ruleToCond Off Nightly = varIsNull "NIGHTLY" + + +validateRuleString :: ValidateRule -> Cond +validateRuleString FullCI = or_all [ labelString "full-ci" + , labelString "marge_bot_batch_merge_job" + , branchStringExact "master" + , branchStringLike "ghc-[0-9]+\\.[0-9]+" + ] +validateRuleString FastCI = true validateRuleString LLVMBackend = labelString "LLVM backend" validateRuleString JSBackend = labelString "javascript" @@ -724,6 +772,10 @@ validateRuleString IpeData = labelString "IPE" validateRuleString TestPrimops = labelString "test-primops" validateRuleString I386Backend = labelString "i386" +--------------------------------------------------------------------- +-- The Job type +--------------------------------------------------------------------- + -- | A 'Job' is the description of a single job in a gitlab pipeline. The -- job contains all the information about how to do the build but can be further -- modified with information about when to run jobs, which variables to set for @@ -747,15 +799,15 @@ data Job instance ToJSON Job where toJSON Job{..} = object [ "stage" A..= jobStage - -- Convoluted to avoid download artifacts from ghci job - -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts + -- Convoluted to avoid download artifacts from ghci job + -- https://docs.gitlab.com/ee/ci/yaml/#needsartifacts , "needs" A..= map (\j -> object [ "job" A..= j, "artifacts" A..= False ]) jobNeeds , "dependencies" A..= jobDependencies , "image" A..= jobDockerImage , "tags" A..= jobTags , "allow_failure" A..= jobAllowFailure - -- Joining up variables like this may well be the wrong thing to do but - -- at least it doesn't lose information silently by overriding. + -- Joining up variables like this may well be the wrong thing to do but + -- at least it doesn't lose information silently by overriding. , "variables" A..= fmap unwords jobVariables , "artifacts" A..= jobArtifacts , "cache" A..= jobCache @@ -783,7 +835,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } = [ "bash .gitlab/ci.sh setup" , "bash .gitlab/ci.sh configure" , "bash .gitlab/ci.sh build_hadrian" - , "bash .gitlab/ci.sh test_hadrian" ] + , "bash .gitlab/ci.sh test_hadrian" + ] | otherwise = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++ [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++ @@ -803,7 +856,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } [ ".gitlab/ci.sh save_cache" , ".gitlab/ci.sh save_test_output" , ".gitlab/ci.sh clean" - , "cat ci_timings" ] + , "cat ci_timings" + ] jobFlavour = mkJobFlavour buildConfig @@ -819,9 +873,11 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig) , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig) , case crossEmulator buildConfig of - NoEmulator -> case crossTarget buildConfig of - Nothing -> mempty - Just _ -> "CROSS_EMULATOR" =: "NOT_SET" -- we need an emulator but it isn't set. Won't run the testsuite + NoEmulator + -- we need an emulator but it isn't set. Won't run the testsuite + | Just _ <- crossTarget buildConfig + -> "CROSS_EMULATOR" =: "NOT_SET" + | otherwise -> mempty Emulator s -> "CROSS_EMULATOR" =: s NoEmulatorNeeded -> mempty , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty @@ -901,8 +957,10 @@ setVariable k v j = j { jobVariables = MonoidalMap $ Map.insert k [v] $ unMonoid delVariable :: String -> Job -> Job delVariable k j = j { jobVariables = MonoidalMap $ Map.delete k $ unMonoidalMap $ jobVariables j } +--------------------------------------------------------------------- -- Building the standard jobs --- +--------------------------------------------------------------------- + -- | Make a normal validate CI job validate :: Arch -> Opsys -> BuildConfig -> NamedJob Job validate = job @@ -919,15 +977,27 @@ releaseRule = setJobRule ReleaseOnly nightly :: Arch -> Opsys -> BuildConfig -> NamedJob Job nightly arch opsys bc = let NamedJob n j = job arch opsys bc - in NamedJob { name = "nightly-" ++ n, jobInfo = nightlyRule . keepArtifacts "8 weeks" . highCompression $ j} + in NamedJob { name = "nightly-" ++ n + , jobInfo = nightlyRule + . keepArtifacts "8 weeks" + . highCompression $ j + } -- | Make a normal release CI job release :: Arch -> Opsys -> BuildConfig -> NamedJob Job release arch opsys bc = let NamedJob n j = job arch opsys (bc { buildFlavour = Release }) - in NamedJob { name = "release-" ++ n, jobInfo = releaseRule . keepArtifacts "1 year" . ignorePerfFailures . useHashUnitIds . highCompression $ j} + in NamedJob { name = "release-" ++ n + , jobInfo = releaseRule + . keepArtifacts "1 year" + . ignorePerfFailures + . useHashUnitIds + . highCompression $ j + } +--------------------------------------------------------------------- -- Specific job modification functions +--------------------------------------------------------------------- -- | Mark a job as requiring a manual trigger. manual :: Job -> Job @@ -984,6 +1054,10 @@ onlyRule t = modifyValidateJobs (onlyValidateJobRule t) disableValidate :: JobGroup Job -> JobGroup Job disableValidate = modifyValidateJobs (removeValidateJobRule FastCI . removeValidateJobRule FullCI) +--------------------------------------------------------------------- +-- NamedJob +--------------------------------------------------------------------- + data NamedJob a = NamedJob { name :: String, jobInfo :: a } deriving (Show, Functor) renameJob :: (String -> String) -> NamedJob a -> NamedJob a @@ -994,14 +1068,18 @@ instance ToJSON a => ToJSON (NamedJob a) where [ "name" A..= name nj , "jobInfo" A..= jobInfo nj ] - ---data NamedJobGroup a = NamedJobGroup { platform :: String, jg :: JobGroup a } +--------------------------------------------------------------------- +-- JobGroup +--------------------------------------------------------------------- -- Jobs are grouped into either triples or pairs depending on whether the -- job is just validate and nightly, or also release. -data JobGroup a = StandardTriple { v :: Maybe (NamedJob a) - , n :: Maybe (NamedJob a) - , r :: Maybe (NamedJob a) } deriving (Functor, Show) +data JobGroup a + = StandardTriple { v :: Maybe (NamedJob a) + , n :: Maybe (NamedJob a) + , r :: Maybe (NamedJob a) + } + deriving (Functor, Show) instance ToJSON a => ToJSON (JobGroup a) where toJSON StandardTriple{..} = object @@ -1039,16 +1117,19 @@ flattenJobGroup (StandardTriple a b c) = map flattenNamedJob (catMaybes [a,b,c]) flattenNamedJob :: NamedJob a -> (String, a) flattenNamedJob (NamedJob n i) = (n, i) - -- | Specification for all the jobs we want to build. jobs :: Map String Job -jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups +jobs = Map.fromList $ concatMap flattenJobGroup job_groups + +--------------------------------------------------------------------- +-- Job definitions +--------------------------------------------------------------------- debian_x86 :: [JobGroup Job] debian_x86 = [ -- Release configurations - -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 - -- not being at EOL until April 2023 and they still need tinfo5. + -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 + -- not being at EOL until April 2023 and they still need tinfo5. disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) , disableValidate (standardBuilds Amd64 (Linux Debian10)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) @@ -1056,15 +1137,15 @@ debian_x86 = , disableValidate (standardBuilds Amd64 (Linux Debian12)) - -- Validate only builds + -- Validate only builds , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) , validateBuilds Amd64 (Linux validate_debian) nativeInt , validateBuilds Amd64 (Linux validate_debian) unreg - -- More work is needed to address TSAN failures: #22520 + -- More work is needed to address TSAN failures: #22520 , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) , -- Nightly allowed to fail: #22343 modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) - -- Run the 'perf' profiling nightly job in the release config. + -- Run the 'perf' profiling nightly job in the release config. , perfProfilingJob Amd64 (Linux Debian12) releaseConfig , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) @@ -1095,7 +1176,7 @@ debian_aarch64 = [ disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) - -- LLVM backend bootstrap + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] @@ -1120,11 +1201,10 @@ rhel_x86 = fedora_x86 :: [JobGroup Job] fedora_x86 = - [ - -- Fedora33 job is always built with perf so there's one job in the normal - -- validate pipeline which is built with perf. + [ -- Fedora33 job is always built with perf so there's one job in the normal + -- validate pipeline which is built with perf. fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) - -- This job is only for generating head.hackage docs + -- This job is only for generating head.hackage docs , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) , disableValidate (standardBuilds Amd64 (Linux Fedora38)) @@ -1154,7 +1234,7 @@ alpine_x86 = [ -- Fully static build, in theory usable on any linux distribution. fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) - -- Dynamically linked build, suitable for building your own static executables on alpine + -- Dynamically linked build, suitable for building your own static executables on alpine , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) , allowFailureGroup (standardBuildsWithConfig I386 (Linux Alpine320) (splitSectionsBroken vanilla)) @@ -1173,16 +1253,16 @@ alpine_aarch64 = [ cross_jobs :: [JobGroup Job] cross_jobs = [ - -- x86 -> aarch64 + -- x86 -> aarch64 validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - -- x86_64 -> riscv + -- x86_64 -> riscv , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian12Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing)) - -- Javascript + -- Javascript , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) - -- Wasm + -- Wasm , make_wasm_jobs wasm_build_config , modifyValidateJobs manual $ make_wasm_jobs wasm_build_config {bignumBackend = Native} @@ -1203,10 +1283,9 @@ cross_jobs = [ wasm_build_config = (crossConfig "wasm32-wasi" NoEmulatorNeeded Nothing) - { - hostFullyStatic = True - , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet - , textWithSIMDUTF = True + { hostFullyStatic = True + , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet + , textWithSIMDUTF = True } job_groups :: [JobGroup Job] @@ -1224,6 +1303,9 @@ job_groups = ++ cross_jobs ++ freebsd_jobs +--------------------------------------------------------------------- +-- Platform mapping for GHCup metadata +--------------------------------------------------------------------- mkPlatform :: Arch -> Opsys -> String mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys @@ -1267,7 +1349,11 @@ platform_mapping = Map.map go combined_result , "release-x86_64-windows-release" ] - process sel = Map.fromListWith combine [ (uncurry mkPlatform (jobPlatform (jobInfo $ j)), j) | (sel -> Just j) <- job_groups ] + process sel = + Map.fromListWith combine + [ (uncurry mkPlatform (jobPlatform (jobInfo j)), j) + | (sel -> Just j) <- job_groups + ] vs = process v ns = process n @@ -1275,10 +1361,13 @@ platform_mapping = Map.map go combined_result all_platforms = Map.keysSet vs <> Map.keysSet ns <> Map.keysSet rs - combined_result = Map.fromList [ (p, StandardTriple { v = Map.lookup p vs - , n = Map.lookup p ns - , r = Map.lookup p rs }) - | p <- S.toList all_platforms ] + combined_result = + Map.fromList + [ (p, StandardTriple { v = Map.lookup p vs + , n = Map.lookup p ns + , r = Map.lookup p rs }) + | p <- S.toList all_platforms + ] combine a b | name a `elem` whitelist = a -- Explicitly selected @@ -1293,6 +1382,9 @@ data BindistInfo = BindistInfo { bindistName :: String } deriving Show instance ToJSON BindistInfo where toJSON (BindistInfo n) = object [ "bindistName" A..= n ] +--------------------------------------------------------------------- +-- Main entrypoint +--------------------------------------------------------------------- main :: IO () main = do ===================================== compiler/GHC/Rename/Module.hs ===================================== @@ -659,6 +659,7 @@ rnClsInstDecl (ClsInstDecl { cid_ext = (inst_warn_ps, _, _) rnFamEqn :: HsDocContext -> AssocTyFamInfo -> FamEqn GhcPs rhs + -> FreeKiTyVars -- Implicit binders of the rhs payload -> (HsDocContext -> rhs -> RnM (rhs', FreeVars)) -> RnM (FamEqn GhcRn rhs', FreeVars) rnFamEqn doc atfi @@ -666,7 +667,7 @@ rnFamEqn doc atfi , feqn_bndrs = outer_bndrs , feqn_pats = pats , feqn_fixity = fixity - , feqn_rhs = payload }) rn_payload + , feqn_rhs = payload }) payload_kvs rn_payload = do { tycon' <- lookupFamInstName mb_cls tycon -- all_imp_vars represent the implicitly bound type variables. This is @@ -697,7 +698,7 @@ rnFamEqn doc atfi -- -- For associated type family instances, exclude the type variables -- bound by the instance head with filterInScopeM (#19649). - ; all_imp_vars <- filterInScopeM $ pat_kity_vars + ; all_imp_vars <- filterInScopeM $ (pat_kity_vars ++ payload_kvs) ; bindHsOuterTyVarBndrs doc mb_cls all_imp_vars outer_bndrs $ \rn_outer_bndrs -> do { (pats', pat_fvs) <- rnLHsTypeArgs (FamPatCtx tycon) pats @@ -788,7 +789,7 @@ rnFamEqn doc atfi -- type instance F a b c = Either a b -- ^^^^^ lhs_loc = case map lhsTypeArgSrcSpan pats of - [] -> panic "rnFamEqn.lhs_loc" + [] -> getLocA tycon [loc] -> loc (loc:locs) -> loc `combineSrcSpans` last locs @@ -847,8 +848,9 @@ rnTyFamInstEqn :: AssocTyFamInfo -> TyFamInstEqn GhcPs -> RnM (TyFamInstEqn GhcRn, FreeVars) rnTyFamInstEqn atfi eqn@(FamEqn { feqn_tycon = tycon }) - = rnFamEqn (TySynCtx tycon) atfi eqn rnTySyn - + = rnFamEqn (TySynCtx tycon) atfi eqn + [{- No implicit vars on RHS of a type instance -}] + rnTySyn rnTyFamDefltDecl :: Name -> TyFamDefltDecl GhcPs @@ -859,9 +861,9 @@ rnDataFamInstDecl :: AssocTyFamInfo -> DataFamInstDecl GhcPs -> RnM (DataFamInstDecl GhcRn, FreeVars) rnDataFamInstDecl atfi (DataFamInstDecl { dfid_eqn = - eqn@(FamEqn { feqn_tycon = tycon })}) - = do { (eqn', fvs) <- - rnFamEqn (TyDataCtx tycon) atfi eqn rnDataDefn + eqn@(FamEqn { feqn_tycon = tycon, feqn_rhs = defn })}) + = do { let implicit_kvs = extractDataDefnKindVars defn + ; (eqn', fvs) <- rnFamEqn (TyDataCtx tycon) atfi eqn implicit_kvs rnDataDefn ; return (DataFamInstDecl { dfid_eqn = eqn' }, fvs) } -- Renaming of the associated types in instances. ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -2212,7 +2212,7 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- esp the bullet on nested forall types = do { kv_details <- newTauTvDetailsAtLevel hole_lvl ; kv_name <- newMetaTyVarName (fsLit "k") - ; wc_details <- newTauTvDetailsAtLevel hole_lvl + ; wc_details <- mk_wc_details hole_lvl ; wc_name <- newMetaTyVarName wc_nm ; let kv = mkTcTyVar kv_name liftedTypeKind kv_details wc_kind = mkTyVarTy kv @@ -2231,11 +2231,11 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } ; checkExpectedKind ty (mkTyVarTy wc_tv) wc_kind exp_kind } where -- See Note [Wildcard names] - wc_nm = case hole_mode of - HM_Sig -> fsLit "w" - HM_FamPat -> fsLit "_" - HM_VTA -> fsLit "w" - HM_TyAppPat -> fsLit "_" + (wc_nm, mk_wc_details) = case hole_mode of + HM_Sig -> (fsLit "w", newTauTvDetailsAtLevel) + HM_FamPat -> (fsLit "_", newWildCardTvDetailsAtLevel) + HM_VTA -> (fsLit "w", newTauTvDetailsAtLevel) + HM_TyAppPat -> (fsLit "_", newTauTvDetailsAtLevel) emit_holes = case hole_mode of HM_Sig -> True ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -3141,7 +3141,7 @@ tcDataDefn err_ctxt roles_info tc_name -- via inferInitialKinds , dd_cons = cons , dd_derivs = derivs }) - = bindTyClTyVars tc_name $ \ tc_bndrs res_kind -> + = bindTyClTyVars tc_name $ \ tc_bndrs tc_res_kind -> -- The TyCon tyvars must scope over -- - the stupid theta (dd_ctxt) -- - for H98 constructors only, the ConDecl @@ -3152,18 +3152,18 @@ tcDataDefn err_ctxt roles_info tc_name ; tcg_env <- getGblEnv ; let hsc_src = tcg_src tcg_env ; unless (mk_permissive_kind hsc_src cons) $ - checkDataKindSig (DataDeclSort (dataDefnConsNewOrData cons)) res_kind + checkDataKindSig (DataDeclSort (dataDefnConsNewOrData cons)) tc_res_kind - ; stupid_tc_theta <- pushLevelAndSolveEqualities skol_info tc_bndrs $ + ; tc_stupid_theta <- pushLevelAndSolveEqualities skol_info tc_bndrs $ tcHsContext ctxt -- See Note [Error on unconstrained meta-variables] in GHC.Tc.Utils.TcMType -- Example: (typecheck/should_fail/T17567StupidTheta) -- data (forall a. a b ~ a c) => T b c -- The kind of 'a' is unconstrained. - ; dvs <- candidateQTyVarsOfTypes stupid_tc_theta + ; dvs <- candidateQTyVarsOfTypes tc_stupid_theta ; let err_ctx tidy_env - = do { (tidy_env2, theta) <- zonkTidyTcTypes tidy_env stupid_tc_theta + = do { (tidy_env2, theta) <- zonkTidyTcTypes tidy_env tc_stupid_theta ; return (tidy_env2, UninfTyCtx_DataContext theta) } ; doNotQuantifyTyVars dvs err_ctx @@ -3177,12 +3177,12 @@ tcDataDefn err_ctxt roles_info tc_name ; (bndrs, stupid_theta, res_kind) <- initZonkEnv NoFlexi $ runZonkBndrT (zonkTyVarBindersX tc_bndrs) $ \ bndrs -> - do { stupid_theta <- zonkTcTypesToTypesX stupid_tc_theta - ; res_kind <- zonkTcTypeToTypeX res_kind + do { stupid_theta <- zonkTcTypesToTypesX tc_stupid_theta + ; res_kind <- zonkTcTypeToTypeX tc_res_kind ; return (bndrs, stupid_theta, res_kind) } ; tycon <- fixM $ \ rec_tycon -> do - { data_cons <- tcConDecls DDataType rec_tycon tc_bndrs res_kind cons + { data_cons <- tcConDecls DDataType rec_tycon tc_bndrs tc_res_kind cons ; tc_rhs <- mk_tc_rhs hsc_src rec_tycon data_cons ; tc_rep_nm <- newTyConRepName tc_name @@ -3360,24 +3360,52 @@ So, we use bindOuterFamEqnTKBndrs (which does not create an implication for the telescope), and generalise over /all/ the variables in the LHS, without treating the explicitly-quantified ones specially. Wrinkles: - - When generalising, include the explicit user-specified forall'd +(GT1) When generalising, include the explicit user-specified forall'd variables, so that we get an error from Validity.checkFamPatBinders if a forall'd variable is not bound on the LHS - - We still want to complain about a bad telescope among the user-specified +(GT2) We still want to complain about a bad telescope among the user-specified variables. So in checkFamTelescope we emit an implication constraint quantifying only over them, purely so that we get a good telescope error. - - Note that, unlike a type signature like +(GT3) Note that, unlike a type signature like f :: forall (a::k). blah we do /not/ care about the Inferred/Specified designation or order for the final quantified tyvars. Type-family instances are not invoked directly in Haskell source code, so visible type application etc plays no role. -See also Note [Re-quantify type variables in rules] in -GHC.Tc.Gen.Rule, which explains a /very/ similar design when -generalising over the type of a rewrite rule. +(GT4) Consider #25647 (with UnliftedNewtypes) + type N :: forall r. (TYPE r -> TYPE r) -> TYPE r + newtype N f where { MkN :: ff (N ff) -> N ff } + When kind-checking the type signature for MkN we'll start wtih + ff :: TYPE kappa -> TYPE kappa + MkN :: ff (N @kappa) ff -> N @kappa ff + Then we generalise /and default the RuntimeRep variable kappa/ + (via `kindGeneralizeAll` in `tcConDecl`), thus kappa := LiftedRep + + But now the newtype looks like a GADT and we get an error + A newtype must not be a GADT + + This seems OK. We are just following the rules. + + But this variant (the original report in #25647) + data family Fix2 :: (k -> Type) -> k + newtype instance Fix2 f where { In2 :: f (Fix2 f) -> Fix2 f } + At the `newtype instance`, we first + 1. Find the kind of the newtype instance in `tcDataFamInstHeader` + 2. Typecheck the newtype definitition itself in `tcConDecl` + In step 1 we do /not/ want to get + newtype instance forall r . Fix2 (f :: TYPE r -> TYPE r) :: TYPE r where + If we do, we'll get that same "newtype must not be GADT" error as for N above. + Rather, we want to default the RuntimeRep variable r := LiftedRep. Hence + the use of `DefaultNonStandardTyVars` in `tcDataFamInstHeader`. The key thing + is that we must make the /same/ choice here as we do in kind-checking the data + constructor's type. + +See also Note [Re-quantify type variables in rules] in GHC.Tc.Gen.Rule, which +explains a /very/ similar design when generalising over the type of a rewrite +rule. -} @@ -3423,7 +3451,7 @@ tcTyFamInstEqnGuts fam_tc mb_clsinfo outer_hs_bndrs hs_pats hs_rhs_ty -- See Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] @@ -3753,23 +3781,30 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs res_kind tag_map ; return (NE.singleton dc) } -tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map - -- NB: don't use res_kind here, as it's ill-scoped. Instead, +tcConDecl new_or_data dd_info rep_tycon tc_bndrs _tc_res_kind tag_map + -- NB: don't use _tc_res_kind here, as it's ill-scoped. Instead, -- we get the res_kind by typechecking the result type. (ConDeclGADT { con_names = names , con_bndrs = L _ outer_hs_bndrs , con_mb_cxt = cxt, con_g_args = hs_args , con_res_ty = hs_res_ty }) = addErrCtxt (DataConDefCtxt names) $ - do { traceTc "tcConDecl 1 gadt" (ppr names) + do { traceTc "tcConDecl 1 gadt" (ppr names $$ ppr _tc_res_kind) ; let L _ name :| _ = names ; skol_info <- mkSkolemInfo (DataConSkol name) - ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts))) + ; (tclvl, wanted, (outer_bndrs, (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind))) <- pushLevelAndSolveEqualitiesX "tcConDecl:GADT" $ tcOuterTKBndrs skol_info outer_hs_bndrs $ do { ctxt <- tcHsContext cxt + ; (res_ty, res_kind) <- tcInferLHsTypeKind hs_res_ty - -- See Note [GADT return kinds] + -- See Note [GADT return kinds] + + -- See Note [Datatype return kinds] + ; let exp_kind = getArgExpKind new_or_data res_kind + ; btys <- tcConGADTArgs exp_kind hs_args + + ; traceTc "tcConDecl 1a gadt" (ppr res_ty <+> dcolon <+> ppr res_kind) -- For data instances (only), ensure that the return type, -- res_ty, is a substitution instance of the header. @@ -3784,13 +3819,9 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map addErrCtxt (DataConResTyCtxt names) $ unifyType Nothing res_ty head_shape } - -- See Note [Datatype return kinds] - ; let exp_kind = getArgExpKind new_or_data res_kind - ; btys <- tcConGADTArgs exp_kind hs_args - ; let (arg_tys, stricts) = unzip btys ; field_lbls <- lookupConstructorFields name - ; return (ctxt, arg_tys, res_ty, field_lbls, stricts) + ; return (ctxt, arg_tys, res_ty, field_lbls, stricts, res_kind) } ; outer_bndrs <- scopedSortOuter outer_bndrs @@ -3801,7 +3832,10 @@ tcConDecl new_or_data dd_info rep_tycon tc_bndrs _res_kind tag_map tcMkPhiTy ctxt $ tcMkScaledFunTys arg_tys $ res_ty) - ; traceTc "tcConDecl:GADT" (ppr names $$ ppr res_ty $$ ppr tkvs) + ; traceTc "tcConDecl:GADT" (vcat [ text "names:" <+> ppr names + , text "tkvs:" <+> ppr tkvs + , text "res_ty:" <+> ppr res_ty + , text "res_kind:" <+> ppr res_kind ]) ; reportUnsolvedEqualities skol_info tkvs tclvl wanted ; let tvbndrs = mkTyVarBinders InferredSpec tkvs ++ outer_tv_bndrs ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -790,10 +790,10 @@ tcDataFamInstDecl mb_clsinfo tv_skol_env , text "eta_tcbs" <+> ppr eta_tcbs ] ; (rep_tc, (axiom, ax_rhs)) <- fixM $ \ ~(rec_rep_tc, _) -> do { data_cons <- tcExtendTyVarEnv (binderVars tc_ty_binders) $ - -- For H98 decls, the tyvars scope - -- over the data constructors - tcConDecls (DDataInstance orig_res_ty) rec_rep_tc tc_ty_binders tc_res_kind - hs_cons + -- tcExtendTyVarEnv: for H98 decls, the tyvars + -- scope over the data constructors + tcConDecls (DDataInstance orig_res_ty) rec_rep_tc + tc_ty_binders tc_res_kind hs_cons ; rep_tc_name <- newFamInstTyConName lfam_name pats ; axiom_name <- newFamInstAxiomName lfam_name [pats] @@ -943,11 +943,6 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- with its parent class ; addConsistencyConstraints mb_clsinfo lhs_ty - -- Add constraints from the data constructors - -- Fix #25611 - -- See DESIGN CHOICE in Note [Kind inference for data family instances] - ; when is_H98_or_newtype $ kcConDecls lhs_applied_kind hs_cons - -- Check that the result kind of the TyCon applied to its args -- is compatible with the explicit signature (or Type, if there -- is none) @@ -956,6 +951,11 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity ; res_kind <- tc_kind_sig m_ksig ; _ <- unifyKind (Just . HsTypeRnThing $ unLoc hs_lhs) lhs_applied_kind res_kind + -- Add constraints from the data constructors + -- Fix #25611 + -- See DESIGN CHOICE in Note [Kind inference for data family instances] + ; when is_H98_or_newtype $ kcConDecls lhs_applied_kind hs_cons + ; traceTc "tcDataFamInstHeader" $ vcat [ ppr fam_tc, ppr m_ksig, ppr lhs_applied_kind, ppr res_kind, ppr m_ksig] ; return ( stupid_theta @@ -975,7 +975,10 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs + -- DefaultNonStandardTyVars: see (GT4) in + -- GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] + ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] @@ -999,7 +1002,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- Split up the LHS type to get the type patterns -- For the scopedSort see Note [Generalising in tcTyFamInstEqnGuts] - ; let pats = unravelFamInstPats lhs_ty + ; let pats = unravelFamInstPats lhs_ty ; return (final_tvs, mkVarSet non_user_tvs, pats, master_res_kind, stupid_theta) } where ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -34,7 +34,8 @@ module GHC.Tc.Utils.TcMType ( newMultiplicityVar, readMetaTyVar, writeMetaTyVar, writeMetaTyVarRef, - newTauTvDetailsAtLevel, newMetaDetails, newMetaTyVarName, + newWildCardTvDetailsAtLevel, newTauTvDetailsAtLevel, + newMetaDetails, newMetaTyVarName, isFilledMetaTyVar_maybe, isFilledMetaTyVar, isUnfilledMetaTyVar, -------------------------------- @@ -692,6 +693,16 @@ the thinking. * * ********************************************************************* -} +{- Note [WildCardTv] +~~~~~~~~~~~~~~~~~ +A WildCardTv behaves like a TauTv, except that it can not be defaulted. + +It is used for a anonymous wildcard in a type signature, e.g. + f :: _ -> Int + f = ... + +-} + {- Note [TyVarTv] ~~~~~~~~~~~~~~~~~ A TyVarTv can unify with type *variables* only, including other TyVarTvs and @@ -740,6 +751,7 @@ metaInfoToTyVarName :: MetaInfo -> FastString metaInfoToTyVarName meta_info = case meta_info of TauTv -> fsLit "t" + WildCardTv -> fsLit "_" TyVarTv -> fsLit "a" RuntimeUnkTv -> fsLit "r" CycleBreakerTv -> fsLit "b" @@ -853,6 +865,13 @@ newTauTvDetailsAtLevel tclvl , mtv_ref = ref , mtv_tclvl = tclvl }) } +newWildCardTvDetailsAtLevel :: TcLevel -> TcM TcTyVarDetails +newWildCardTvDetailsAtLevel tclvl + = do { ref <- newMutVar Flexi + ; return (MetaTv { mtv_info = WildCardTv + , mtv_ref = ref + , mtv_tclvl = tclvl }) } + newConcreteTvDetailsAtLevel :: ConcreteTvOrigin -> TcLevel -> TcM TcTyVarDetails newConcreteTvDetailsAtLevel conc_orig tclvl = do { ref <- newMutVar Flexi @@ -1841,7 +1860,10 @@ defaultTyVar :: DefaultingStrategy -> TcTyVar -- If it's a MetaTyVar then it is unbound -> TcM Bool -- True <=> defaulted away altogether defaultTyVar def_strat tv - | not (isMetaTyVar tv) + | not (isMetaTyVar tv ) + || isWildCardMetaTyVar tv + -- do not default WildcardTvs, wildcardTvs are are only meant to be unified + -- or be on its own but never defaulted. || isTyVarTyVar tv -- Do not default TyVarTvs. Doing so would violate the invariants -- on TyVarTvs; see Note [TyVarTv] in GHC.Tc.Utils.TcMType. ===================================== compiler/GHC/Tc/Utils/TcType.hs ===================================== @@ -51,7 +51,8 @@ module GHC.Tc.Utils.TcType ( TcTyVarDetails(..), pprTcTyVarDetails, vanillaSkolemTvUnk, MetaDetails(Flexi, Indirect), MetaInfo(..), skolemSkolInfo, isImmutableTyVar, isSkolemTyVar, isMetaTyVar, isMetaTyVarTy, isTyVarTy, - tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar, isTyConableTyVar, + isWildCardMetaTyVar, tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar, + isTyConableTyVar, ConcreteTvOrigin(..), isConcreteTyVar_maybe, isConcreteTyVar, isConcreteTyVarTy, isConcreteTyVarTy_maybe, concreteInfo_maybe, ConcreteTyVars, noConcreteTyVars, @@ -640,7 +641,8 @@ data MetaInfo = TauTv -- ^ This MetaTv is an ordinary unification variable -- A TauTv is always filled in with a tau-type, which -- never contains any ForAlls. - + | WildCardTv -- ^ A variant of TauTv, except that it should not be + -- defaulted. | TyVarTv -- ^ A variant of TauTv, except that it should not be -- unified with a type, only with a type variable -- See Note [TyVarTv] in GHC.Tc.Utils.TcMType @@ -670,6 +672,8 @@ instance Outputable MetaInfo where ppr RuntimeUnkTv = text "rutv" ppr CycleBreakerTv = text "cbv" ppr (ConcreteTv {}) = text "conc" + ppr (WildCardTv) = text "wc" + -- | What caused us to create a 'ConcreteTv' metavariable? -- See Note [ConcreteTv] in GHC.Tc.Utils.Concrete. @@ -1179,7 +1183,7 @@ isImmutableTyVar :: TyVar -> Bool isImmutableTyVar tv = isSkolemTyVar tv isTyConableTyVar, isSkolemTyVar, isOverlappableTyVar, - isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar :: TcTyVar -> Bool + isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar, isWildCardMetaTyVar :: TcTyVar -> Bool isTyConableTyVar tv -- True of a meta-type variable that can be filled in @@ -1220,6 +1224,13 @@ isMetaTyVar tv _ -> False | otherwise = False +isWildCardMetaTyVar tv + | isTyVar tv -- See Note [Coercion variables in free variable lists] + = case tcTyVarDetails tv of + MetaTv { mtv_info = WildCardTv } -> True + _ -> False + | otherwise = False + -- isAmbiguousTyVar is used only when reporting type errors -- It picks out variables that are unbound, namely meta -- type variables and the RuntimeUnk variables created by ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2574,8 +2574,9 @@ lhsPriority tv CycleBreakerTv -> 0 TyVarTv -> 1 ConcreteTv {} -> 2 - TauTv -> 3 - RuntimeUnkTv -> 4 + WildCardTv -> 3 + TauTv -> 4 + RuntimeUnkTv -> 5 {- Note [Unification preconditions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/Language/Haskell/Syntax/Decls.hs ===================================== @@ -809,9 +809,11 @@ data HsDataDefn pass -- The payload of a data type defn -- *and* for data family instances = -- | Declares a data type or newtype, giving its constructors -- @ - -- data/newtype T a = - -- data/newtype instance T [a] = + -- data/newtype T a :: ksig = + -- data/newtype instance T [a] :: ksig = -- @ + -- The HsDataDefn describes the (optional) kind signature and the + -- but not the `data T a` or `newtype T [a]` headers HsDataDefn { dd_ext :: XCHsDataDefn pass, dd_ctxt :: Maybe (LHsContext pass), -- ^ Context dd_cType :: Maybe (XRec pass CType), ===================================== libraries/base/changelog.md ===================================== @@ -10,6 +10,13 @@ * `Data.List.NonEmpty` functions now have the same laziness as their `Data.List` counterparts (i.e. make them more strict than they currently are) ([CLC proposal #107](https://github.com/haskell/core-libraries-committee/issues/107)) * `instance Functor NonEmpty` is now specified using `map` (rather than duplicating code). ([CLC proposal #300](https://github.com/haskell/core-libraries-committee/issues/300)) * The `Data.Enum.enumerate` function was introduced ([CLC #306](https://github.com/haskell/core-libraries-committee/issues/306)) + * Worker threads used by various `base` facilities are now labelled with descriptive thread labels ([CLC proposal #305](https://github.com/haskell/core-libraries-committee/issues/305), [GHC #25452](https://gitlab.haskell.org/ghc/ghc/-/issues/25452)). Specifically, these include: + * `Control.Concurrent.threadWaitRead` + * `Control.Concurrent.threadWaitWrite` + * `Control.Concurrent.threadWaitReadSTM` + * `Control.Concurrent.threadWaitWriteSTM` + * `System.Timeout.timeout` + * `GHC.Conc.Signal.runHandlers` ## 4.21.0.0 *TBA* * Change `SrcLoc` to be a strict and unboxed (finishing [CLC proposal #55](https://github.com/haskell/core-libraries-committee/issues/55)) ===================================== libraries/base/src/Control/Concurrent.hs ===================================== @@ -265,7 +265,7 @@ threadWaitRead fd -- fdReady does the right thing, but we have to call it in a -- separate thread, otherwise threadWaitRead won't be interruptible, -- and this only works with -threaded. - | threaded = withThread (waitFd fd False) + | threaded = withThread "threadWaitRead worker" (waitFd fd False) | otherwise = case fd of 0 -> do _ <- hWaitForInput stdin (-1) return () @@ -286,7 +286,7 @@ threadWaitRead fd threadWaitWrite :: Fd -> IO () threadWaitWrite fd #if defined(mingw32_HOST_OS) - | threaded = withThread (waitFd fd True) + | threaded = withThread "threadWaitWrite worker" (waitFd fd True) | otherwise = errorWithoutStackTrace "threadWaitWrite requires -threaded on Windows" #else = Conc.threadWaitWrite fd @@ -302,8 +302,11 @@ threadWaitReadSTM :: Fd -> IO (STM (), IO ()) threadWaitReadSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd False) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitReadSTM worker" + result <- try (waitFd fd False) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -326,8 +329,11 @@ threadWaitWriteSTM :: Fd -> IO (STM (), IO ()) threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) | threaded = do v <- newTVarIO Nothing - mask_ $ void $ forkIO $ do result <- try (waitFd fd True) - atomically (writeTVar v $ Just result) + mask_ $ void $ forkIO $ do + tid <- myThreadId + labelThread tid "threadWaitWriteSTM worker" + result <- try (waitFd fd True) + atomically (writeTVar v $ Just result) let waitAction = do result <- readTVar v case result of Nothing -> retry @@ -343,10 +349,14 @@ threadWaitWriteSTM fd #if defined(mingw32_HOST_OS) foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool -withThread :: IO a -> IO a -withThread io = do +withThread :: String -> IO a -> IO a +withThread label io = do m <- newEmptyMVar - _ <- mask_ $ forkIO $ try io >>= putMVar m + _ <- mask_ $ forkIO $ do + tid <- myThreadId + labelThread tid label + result <- try io + putMVar m result x <- takeMVar m case x of Right a -> return a ===================================== libraries/base/src/System/Timeout.hs ===================================== @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE Safe #-} +{-# LANGUAGE Trustworthy #-} ------------------------------------------------------------------------------- -- | @@ -29,6 +29,7 @@ import GHC.Internal.Control.Exception (Exception(..), handleJust, bracket, asyncExceptionToException, asyncExceptionFromException) import GHC.Internal.Data.Unique (Unique, newUnique) +import GHC.Conc (labelThread) import Prelude -- $setup @@ -119,7 +120,9 @@ timeout n f let handleTimeout = do v <- isEmptyMVar lock when v $ void $ forkIOWithUnmask $ \unmask -> unmask $ do - v2 <- tryPutMVar lock =<< myThreadId + tid <- myThreadId + labelThread tid "timeout worker" + v2 <- tryPutMVar lock tid when v2 $ throwTo pid ex cleanupTimeout key = uninterruptibleMask_ $ do v <- tryPutMVar lock undefined @@ -136,7 +139,9 @@ timeout n f ex <- fmap Timeout newUnique handleJust (\e -> if e == ex then Just () else Nothing) (\_ -> return Nothing) - (bracket (forkIOWithUnmask $ \unmask -> + (bracket (forkIOWithUnmask $ \unmask -> do + tid <- myThreadId + labelThread tid "timeout worker" unmask $ threadDelay n >> throwTo pid ex) (uninterruptibleMask_ . killThread) (\_ -> fmap Just f)) ===================================== libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Internal.Foreign.Ptr (Ptr, castPtr) import GHC.Internal.Foreign.Marshal.Alloc (finalizerFree) import GHC.Internal.Arr (inRange) import GHC.Internal.Base -import GHC.Internal.Conc.Sync (forkIO) +import GHC.Internal.Conc.Sync (myThreadId, labelThread, forkIO) import GHC.Internal.IO (mask_, unsafePerformIO) import GHC.Internal.IOArray (IOArray, boundsIOArray, newIOArray, unsafeReadIOArray, unsafeWriteIOArray) @@ -69,7 +69,10 @@ runHandlers p_info sig = do else do handler <- unsafeReadIOArray arr int case handler of Nothing -> return () - Just (f,_) -> do _ <- forkIO (f p_info) + Just (f,_) -> do _ <- forkIO $ do + tid <- myThreadId + labelThread tid "signal handler" + f p_info return () -- It is our responsibility to free the memory buffer, so we create a ===================================== libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc ===================================== @@ -53,7 +53,10 @@ start_console_handler :: Word32 -> IO () start_console_handler r = case toWin32ConsoleEvent r of Just x -> withMVar win32ConsoleHandler $ \handler -> do - _ <- forkIO (handler x) + _ <- forkIO $ do + tid <- myThreadId + labelThread tid "console event handler" + handler x return () Nothing -> return () ===================================== libraries/ghci/GHCi/Run.hs ===================================== @@ -226,7 +226,10 @@ sandboxIO opts io = do let runIt = measureAlloc $ tryEval $ rethrow opts $ clearCCS io if useSandboxThread opts then do - tid <- forkIO $ do unsafeUnmask runIt >>= putMVar statusMVar + tid <- forkIO $ do + tid <- myThreadId + labelThread tid "GHCi sandbox" + unsafeUnmask runIt >>= putMVar statusMVar -- empty: can't block redirectInterrupts tid $ unsafeUnmask $ takeMVar statusMVar else ===================================== testsuite/tests/indexed-types/should_compile/T11450a.hs ===================================== @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} + +module T11450a where + +class C x where + type T x + +instance C (Either a b) where + type T (Either _ b) = b -> b ===================================== testsuite/tests/indexed-types/should_compile/T25611d.hs ===================================== @@ -20,7 +20,7 @@ data instance T p q where MkkV :: forall l. l Int# -> T l Int# type N :: TYPE r -> TYPE r -newtype N a = MkN a +newtype N (a::TYPE r) = MkN a f :: Int# -> N Int# f x = MkN x @@ -29,7 +29,7 @@ g :: Int -> N Int g x = MkN x data family D :: Type -> k -> k -newtype instance D Int a = MkD a +newtype instance D Int (a::TYPE r) = MkD a f1 :: Int# -> D Int Int# f1 x = MkD x ===================================== testsuite/tests/indexed-types/should_compile/all.T ===================================== @@ -315,3 +315,4 @@ test('T25611a', normal, compile, ['']) test('T25611b', normal, compile, ['']) test('T25611c', normal, compile, ['']) test('T25611d', normal, compile, ['']) +test('T11450a', normal, compile, ['']) ===================================== testsuite/tests/indexed-types/should_fail/T9357.stderr ===================================== @@ -1,4 +1,4 @@ T9357.hs:12:15: error: [GHC-91510] - • Illegal polymorphic type: forall (a :: TYPE t). a -> a + Illegal polymorphic type: forall a. a -> a • In the type family instance declaration for ‘F’ ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -13664,7 +13664,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -14770,7 +14770,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -15385,7 +15385,7 @@ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC. instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.JSException -- Defined in ‘GHC.Internal.JS.Prim’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.JS.Prim.WouldBlockException -- Defined in ‘GHC.Internal.JS.Prim’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -16235,7 +16235,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -10881,7 +10881,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11992,7 +11992,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12608,7 +12608,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13476,7 +13476,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10619,7 +10619,7 @@ module System.Posix.Types where module System.Timeout where - -- Safety: Safe + -- Safety: Trustworthy type Timeout :: * newtype Timeout = ... timeout :: forall a. GHC.Internal.Types.Int -> GHC.Internal.Types.IO a -> GHC.Internal.Types.IO (GHC.Internal.Maybe.Maybe a) @@ -11736,7 +11736,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Classes.Eq (GHC.Int instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Classes.Eq (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Classes.Eq GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Classes.Eq System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Classes.Eq GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’ @@ -12349,7 +12349,7 @@ instance GHC.Internal.Exception.Type.Exception GHC.Internal.Control.Exception.Ba instance GHC.Internal.Exception.Type.Exception GHC.Internal.Data.Dynamic.Dynamic -- Defined in ‘GHC.Internal.Data.Dynamic’ instance [safe] GHC.Internal.Exception.Type.Exception ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common.FileLockingNotSupported -- Defined in ‘ghc-internal-9.1300.0:GHC.Internal.IO.Handle.Lock.Common’ instance GHC.Internal.Exception.Type.Exception GHC.Internal.IOPort.IOPortException -- Defined in ‘GHC.Internal.IOPort’ -instance [safe] GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Exception.Type.Exception System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance forall a k (b :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.Functor.Const’ instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.Floating (Data.Complex.Complex a) -- Defined in ‘Data.Complex’ instance forall k1 k2 (f :: k1 -> *) (g :: k2 -> k1) (a :: k2). GHC.Internal.Float.Floating (f (g a)) => GHC.Internal.Float.Floating (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’ @@ -13204,7 +13204,7 @@ instance forall (c :: GHC.Internal.Types.Char). GHC.Internal.Show.Show (GHC.Inte instance forall (s :: GHC.Internal.Types.Symbol). GHC.Internal.Show.Show (GHC.Internal.TypeLits.SSymbol s) -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeChar -- Defined in ‘GHC.Internal.TypeLits’ instance GHC.Internal.Show.Show GHC.Internal.TypeLits.SomeSymbol -- Defined in ‘GHC.Internal.TypeLits’ -instance [safe] GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ +instance GHC.Internal.Show.Show System.Timeout.Timeout -- Defined in ‘System.Timeout’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Lexeme -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance GHC.Internal.Show.Show GHC.Internal.Text.Read.Lex.Number -- Defined in ‘GHC.Internal.Text.Read.Lex’ instance [safe] forall a b. GHC.Internal.Show.Show (a -> b) -- Defined in ‘Text.Show.Functions’ ===================================== testsuite/tests/rename/should_fail/T23512a.stderr ===================================== @@ -1,6 +1,3 @@ - T23512a.hs:6:31: error: [GHC-76037] Not in scope: type variable ‘j’ T23512a.hs:6:36: error: [GHC-76037] Not in scope: type variable ‘j’ - -T23512a.hs:9:20: error: [GHC-76037] Not in scope: type variable ‘k’ ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.hs ===================================== @@ -0,0 +1,21 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647_fail where + +import GHC.Exts +import Data.Kind + +-- Rejected because in the type signature for In2 we default +-- the runtime-rep variable to LiftedRep, and that makes In2 +-- into a GADT +newtype Fix2 f :: TYPE r where + In2 :: forall ff. ff (Fix2 ff) -> Fix2 ff + +-- Rejected for the same reason +type Fix4a :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4a f where + In4a :: ff (Fix4a ff) -> Fix4a ff + +data family Dix6 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix6 f where + DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/typecheck/should_compile/T25647_fail.stderr ===================================== @@ -0,0 +1,23 @@ +T25647_fail.hs:12:4: [GHC-89498] + A newtype must not be a GADT + In2 :: forall (ff :: * -> *). + ff (Fix2 @LiftedRep ff) -> Fix2 @LiftedRep ff + In the definition of data constructor ‘In2’ + In the newtype declaration for ‘Fix2’ + +T25647_fail.hs:17:3: [GHC-89498] + A newtype must not be a GADT + In4a :: forall (ff :: * -> *). + ff (Fix4a @LiftedRep ff) -> Fix4a @LiftedRep ff + In the definition of data constructor ‘In4a’ + In the newtype declaration for ‘Fix4a’ + +T25647_fail.hs:21:3: [GHC-18872] + Couldn't match a lifted type with an unlifted type + When matching types + ff :: TYPE IntRep -> TYPE IntRep + f0 :: * -> TYPE IntRep + Expected: Dix6 f0 + Actual: Dix6 ff + In the result type of data constructor ‘DIn6’ + In the newtype family instance declaration for ‘Dix6’ \ No newline at end of file ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -0,0 +1,92 @@ +{-# LANGUAGE DataKinds, UnliftedNewtypes, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647a where + +import GHC.Exts +import Data.Kind + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: forall r k. (k -> TYPE r) -> TYPE r +newtype Fix2 f :: TYPE r where + In2 :: forall r (ff :: TYPE r -> TYPE r). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In3 :: forall r (f :: TYPE r -> TYPE r). Fix3 @r f -> Fix3 @r f +type Fix3 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +-- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f +type Fix4 :: forall r. (TYPE r -> TYPE r) -> TYPE r +newtype Fix4 f where + In4 :: forall rr (ff :: TYPE rr -> TYPE rr). + ff (Fix4 ff) -> Fix4 @rr ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in GADT syntax +-- The newtype instance defaults to LiftedRep +data family Dix4 :: (k -> TYPE r) -> k +newtype instance Dix4 f where + DIn4 :: forall ff. ff (Dix4 ff) -> Dix4 ff + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +-- -- newtype instance that is not TYPE 'LiftedRep +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff + +data family Dix7 :: (k -> TYPE 'IntRep) -> k +newtype instance Dix7 f = DIn7 (f (Dix7 f)) + + + +-- anonymous wildcards +type Dix8 :: RuntimeRep -> Type +data family Dix8 r +newtype instance Dix8 _ = Dix8 Int + +dix8 :: Dix8 FloatRep -> Int +dix8 (Dix8 x) = x + + +-- named wildcards +type Dix9 :: RuntimeRep -> Type +data family Dix9 r +newtype instance Dix9 _r = Dix9 Int + +dix9 :: Dix9 FloatRep -> Int +dix9 (Dix9 x) = x ===================================== testsuite/tests/typecheck/should_compile/T25647b.hs ===================================== @@ -0,0 +1,65 @@ +{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, MagicHash #-} + +module T25647b where + +import GHC.Exts +import Data.Kind + +--------------------------- +-- without UnliftedNewtypes +--------------------------- + +-------------------- Plain newtypes ----------------- + +-- A plain newtype, H98 +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1a f = In1a (f (Fix1a f)) + +-- A plain newtype, GADT syntax +-- Defaulting happens; infers Fix1 :: forall k. (k -> Type) -> Type +newtype Fix1b f where + In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff + +-- A plain newtype, GADT syntax, with a return kind signature, +-- and runtime-rep quantification in the data constructor +-- Should infer Fix2 :: (Type -> Type) -> Type +newtype Fix2 f where + In2 :: forall (ff :: Type -> Type). ff (Fix2 ff) -> Fix2 ff + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix3 :: (Type -> Type) -> Type +newtype Fix3 f = In3 (f (Fix3 f)) + +-- Plain newtype, H98 syntax, standalone kind signature +type Fix4 :: (Type -> Type) -> Type +newtype Fix4 f where + In4 :: forall (ff :: Type -> Type). + ff (Fix4 ff) -> Fix4 ff + +-------------------- Data families with newtype instance ----------------- + +-- data instance in GADT sytntax +data family Dix1 :: (k -> Type) -> k +data instance Dix1 f where + DIn1 :: forall ff. ff (Dix1 ff) -> Dix1 ff + +-- newtype instance in GADT syntax +data family Dix2 :: (k -> Type) -> k +newtype instance Dix2 f where + DIn2 :: forall ff. ff (Dix2 ff) -> Dix2 ff + +data family Dix2a :: (k -> Type) -> k +newtype instance Dix2a f :: Type where + DIn2a :: forall ff. ff (Dix2a ff) -> Dix2a ff + +-- newtype instance in H98 syntax +data family Dix3 :: (k -> Type) -> k +newtype instance Dix3 f = DIn3 (f (Dix3 f)) + +-- newtype instance in H98 syntax +data family Dix5 :: (k -> TYPE r) -> k +newtype instance Dix5 f = DIn5 (f (Dix5 f)) + +-- data family Dix6 :: (k -> TYPE 'IntRep) -> k +-- newtype instance Dix6 f where +-- DIn6 :: forall ff. ff (Dix6 ff) -> Dix6 ff ===================================== testsuite/tests/typecheck/should_compile/T25725.hs ===================================== @@ -0,0 +1,17 @@ +{-# LANGUAGE TypeFamilies, PolyKinds #-} + +module T25725 where + +import Data.Kind +import GHC.Exts + +--This one was OK +data D :: TYPE r -> Type where + MkD :: p -> D p + +-- now this is OK too +data family Dix4 :: Type -> k +data instance Dix4 Int :: TYPE r -> Type where + DIn4 :: p -> Dix4 Int p + + ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -933,3 +933,7 @@ test('T25266', normal, compile, ['']) test('T25266a', normal, compile_fail, ['']) test('T25266b', normal, compile, ['']) test('T25597', normal, compile, ['']) +test('T25647a', normal, compile, ['']) +test('T25647b', normal, compile, ['']) +test('T25647_fail', normal, compile_fail, ['']) +test('T25725', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bfdbaffc3bdab06e453c4e067e6deeb89bdd28ad...88dfabaae0cf0492fbc23e9ddc352d47dc78f17d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bfdbaffc3bdab06e453c4e067e6deeb89bdd28ad...88dfabaae0cf0492fbc23e9ddc352d47dc78f17d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Feb 8 20:57:44 2025 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Sat, 08 Feb 2025 15:57:44 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/supersven/fix-aarch64-switch-table-jumps Message-ID: <67a7c5484453e_25d951338b49c51214@gitlab.mail> Sven Tennie pushed new branch wip/supersven/fix-aarch64-switch-table-jumps at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/supersven/fix-aarch64-switch-table-jumps You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 07:28:46 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sun, 09 Feb 2025 02:28:46 -0500 Subject: [Git][ghc/ghc][wip/T25647] rename WildCardTv to NoDefTauTv Message-ID: <67a8592ec52bf_8f59f10316901116@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: f43a47a7 by Patrick at 2025-02-09T15:28:36+08:00 rename WildCardTv to NoDefTauTv - - - - - 4 changed files: - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Tc/Utils/Unify.hs Changes: ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -2233,7 +2233,7 @@ tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) } -- See Note [Wildcard names] (wc_nm, mk_wc_details) = case hole_mode of HM_Sig -> (fsLit "w", newTauTvDetailsAtLevel) - HM_FamPat -> (fsLit "_", newWildCardTvDetailsAtLevel) + HM_FamPat -> (fsLit "_", newNoDefTauTvDetailsAtLevel) HM_VTA -> (fsLit "w", newTauTvDetailsAtLevel) HM_TyAppPat -> (fsLit "_", newTauTvDetailsAtLevel) ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -34,7 +34,7 @@ module GHC.Tc.Utils.TcMType ( newMultiplicityVar, readMetaTyVar, writeMetaTyVar, writeMetaTyVarRef, - newWildCardTvDetailsAtLevel, newTauTvDetailsAtLevel, + newNoDefTauTvDetailsAtLevel, newTauTvDetailsAtLevel, newMetaDetails, newMetaTyVarName, isFilledMetaTyVar_maybe, isFilledMetaTyVar, isUnfilledMetaTyVar, @@ -693,14 +693,20 @@ the thinking. * * ********************************************************************* -} -{- Note [WildCardTv] +{- Note [NoDefTauTv] ~~~~~~~~~~~~~~~~~ -A WildCardTv behaves like a TauTv, except that it can not be defaulted. - -It is used for a anonymous wildcard in a type signature, e.g. - f :: _ -> Int - f = ... - +A NoDefTauTv behaves like a TauTv, except that when it is not unified +with anything, it should not be defaulted. + +It is used for a anonymous wildcard in a type family, e.g. + type Dix8 :: RuntimeRep -> Type + data family Dix8 r + newtype instance Dix8 _ = Dix8 Int +We want to keep `_` polymorphic, so it behaves like a named wildcard. + +When unified other type, it should be replaced by the other type, since +the `not unified with anything` assumption is break. It's property no longer +holds. -} {- Note [TyVarTv] @@ -751,7 +757,7 @@ metaInfoToTyVarName :: MetaInfo -> FastString metaInfoToTyVarName meta_info = case meta_info of TauTv -> fsLit "t" - WildCardTv -> fsLit "_" + NoDefTauTv -> fsLit "n" TyVarTv -> fsLit "a" RuntimeUnkTv -> fsLit "r" CycleBreakerTv -> fsLit "b" @@ -865,10 +871,10 @@ newTauTvDetailsAtLevel tclvl , mtv_ref = ref , mtv_tclvl = tclvl }) } -newWildCardTvDetailsAtLevel :: TcLevel -> TcM TcTyVarDetails -newWildCardTvDetailsAtLevel tclvl +newNoDefTauTvDetailsAtLevel :: TcLevel -> TcM TcTyVarDetails +newNoDefTauTvDetailsAtLevel tclvl = do { ref <- newMutVar Flexi - ; return (MetaTv { mtv_info = WildCardTv + ; return (MetaTv { mtv_info = NoDefTauTv , mtv_ref = ref , mtv_tclvl = tclvl }) } @@ -1862,8 +1868,7 @@ defaultTyVar :: DefaultingStrategy defaultTyVar def_strat tv | not (isMetaTyVar tv ) || isWildCardMetaTyVar tv - -- do not default WildcardTvs, wildcardTvs are are only meant to be unified - -- or be on its own but never defaulted. + -- do not default NoDefTauTvs see Note [NoDefTauTv] || isTyVarTyVar tv -- Do not default TyVarTvs. Doing so would violate the invariants -- on TyVarTvs; see Note [TyVarTv] in GHC.Tc.Utils.TcMType. ===================================== compiler/GHC/Tc/Utils/TcType.hs ===================================== @@ -641,8 +641,8 @@ data MetaInfo = TauTv -- ^ This MetaTv is an ordinary unification variable -- A TauTv is always filled in with a tau-type, which -- never contains any ForAlls. - | WildCardTv -- ^ A variant of TauTv, except that it should not be - -- defaulted. + | NoDefTauTv -- ^ A variant of TauTv, except that it should not be + -- defaulted during generalization. See Note [NoDefTauTv] | TyVarTv -- ^ A variant of TauTv, except that it should not be -- unified with a type, only with a type variable -- See Note [TyVarTv] in GHC.Tc.Utils.TcMType @@ -672,7 +672,7 @@ instance Outputable MetaInfo where ppr RuntimeUnkTv = text "rutv" ppr CycleBreakerTv = text "cbv" ppr (ConcreteTv {}) = text "conc" - ppr (WildCardTv) = text "wc" + ppr (NoDefTauTv) = text "ndtau" -- | What caused us to create a 'ConcreteTv' metavariable? @@ -1227,7 +1227,7 @@ isMetaTyVar tv isWildCardMetaTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] = case tcTyVarDetails tv of - MetaTv { mtv_info = WildCardTv } -> True + MetaTv { mtv_info = NoDefTauTv } -> True _ -> False | otherwise = False ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2574,9 +2574,12 @@ lhsPriority tv CycleBreakerTv -> 0 TyVarTv -> 1 ConcreteTv {} -> 2 - WildCardTv -> 3 - TauTv -> 4 - RuntimeUnkTv -> 5 + TauTv -> 3 + RuntimeUnkTv -> 4 + NoDefTauTv -> 5 -- ^ when unifying with other, prefer to keep the other. + -- see Note [NoDefTauTv] for more details. + -- NB. it is not clear to me(soulomoon), RuntimeUnkTv should + -- be higher than NoDefTauTv or not. {- Note [Unification preconditions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f43a47a7efcf587f8211455b9dcdc691e8d6c4b5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f43a47a7efcf587f8211455b9dcdc691e8d6c4b5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 08:14:47 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sun, 09 Feb 2025 03:14:47 -0500 Subject: [Git][ghc/ghc][wip/T25647] update note Message-ID: <67a863f741e57_8f59f1e09f6018362@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 668ca485 by Patrick at 2025-02-09T16:14:37+08:00 update note - - - - - 2 changed files: - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/Unify.hs Changes: ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -695,18 +695,17 @@ the thinking. {- Note [NoDefTauTv] ~~~~~~~~~~~~~~~~~ -A NoDefTauTv behaves like a TauTv, except that when it is not unified -with anything, it should not be defaulted. +A NoDefTauTv behaves like a TauTv, except that it should not be defaulted. +Making it more polymorphic than a TauTv which can be defaulted. It is used for a anonymous wildcard in a type family, e.g. type Dix8 :: RuntimeRep -> Type data family Dix8 r newtype instance Dix8 _ = Dix8 Int -We want to keep `_` polymorphic, so it behaves like a named wildcard. -When unified other type, it should be replaced by the other type, since -the `not unified with anything` assumption is break. It's property no longer -holds. +We want to keep `_` polymorphic, so it behaves more like a named wildcard. + +NB. Should we default `_` if XNoPolyKind is on? -} {- Note [TyVarTv] ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2575,11 +2575,13 @@ lhsPriority tv TyVarTv -> 1 ConcreteTv {} -> 2 TauTv -> 3 - RuntimeUnkTv -> 4 - NoDefTauTv -> 5 -- ^ when unifying with other, prefer to keep the other. - -- see Note [NoDefTauTv] for more details. - -- NB. it is not clear to me(soulomoon), RuntimeUnkTv should - -- be higher than NoDefTauTv or not. + NoDefTauTv -> 4 -- ^ when unifying with other, prefer to keep the other. + -- Since NoDefTauTv is more polymorphic than tau, + -- see Note [NoDefTauTv] for more details. + + -- NB. it is not clear to me(soulomoon), RuntimeUnkTv should + -- be higher than NoDefTauTv or not. + RuntimeUnkTv -> 5 {- Note [Unification preconditions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/668ca48567d0f7d5ba2de90f5919827f30e19c86 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/668ca48567d0f7d5ba2de90f5919827f30e19c86 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 09:45:45 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sun, 09 Feb 2025 04:45:45 -0500 Subject: [Git][ghc/ghc][wip/T25647] rename isWildCardMetaTyVar to isNoDefTauMetaTyVar and fix defaultTyVarTcS Message-ID: <67a879496c1a9_8f59f32cae2c26475@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 1273d9a7 by Patrick at 2025-02-09T17:45:36+08:00 rename isWildCardMetaTyVar to isNoDefTauMetaTyVar and fix defaultTyVarTcS - - - - - 3 changed files: - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs Changes: ===================================== compiler/GHC/Tc/Solver/Default.hs ===================================== @@ -176,6 +176,8 @@ defaultTyVarTcS the_tv -- TyVarTvs should only be unified with a tyvar -- never with a type; c.f. GHC.Tc.Utils.TcMType.defaultTyVar -- and Note [Inferring kinds for type declarations] in GHC.Tc.TyCl + || isNoDefTauMetaTyVar the_tv + -- do not default NoDefTauTvs see Note [NoDefTauTv] = return noUnification | isRuntimeRepVar the_tv = do { traceTcS "defaultTyVarTcS RuntimeRep" (ppr the_tv) ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -1866,7 +1866,7 @@ defaultTyVar :: DefaultingStrategy -> TcM Bool -- True <=> defaulted away altogether defaultTyVar def_strat tv | not (isMetaTyVar tv ) - || isWildCardMetaTyVar tv + || isNoDefTauMetaTyVar tv -- do not default NoDefTauTvs see Note [NoDefTauTv] || isTyVarTyVar tv -- Do not default TyVarTvs. Doing so would violate the invariants ===================================== compiler/GHC/Tc/Utils/TcType.hs ===================================== @@ -51,7 +51,7 @@ module GHC.Tc.Utils.TcType ( TcTyVarDetails(..), pprTcTyVarDetails, vanillaSkolemTvUnk, MetaDetails(Flexi, Indirect), MetaInfo(..), skolemSkolInfo, isImmutableTyVar, isSkolemTyVar, isMetaTyVar, isMetaTyVarTy, isTyVarTy, - isWildCardMetaTyVar, tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar, + isNoDefTauMetaTyVar, tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar, isTyConableTyVar, ConcreteTvOrigin(..), isConcreteTyVar_maybe, isConcreteTyVar, isConcreteTyVarTy, isConcreteTyVarTy_maybe, concreteInfo_maybe, @@ -1183,7 +1183,7 @@ isImmutableTyVar :: TyVar -> Bool isImmutableTyVar tv = isSkolemTyVar tv isTyConableTyVar, isSkolemTyVar, isOverlappableTyVar, - isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar, isWildCardMetaTyVar :: TcTyVar -> Bool + isMetaTyVar, isAmbiguousTyVar, isCycleBreakerTyVar, isNoDefTauMetaTyVar :: TcTyVar -> Bool isTyConableTyVar tv -- True of a meta-type variable that can be filled in @@ -1224,7 +1224,7 @@ isMetaTyVar tv _ -> False | otherwise = False -isWildCardMetaTyVar tv +isNoDefTauMetaTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] = case tcTyVarDetails tv of MetaTv { mtv_info = NoDefTauTv } -> True View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1273d9a7dfbd906c800f48409c1c085bea8ed8e9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1273d9a7dfbd906c800f48409c1c085bea8ed8e9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 10:09:25 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sun, 09 Feb 2025 05:09:25 -0500 Subject: [Git][ghc/ghc][wip/T25647] fix comment Message-ID: <67a87ed552d2_8f59f3afdc0c3201f@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: b59de9ac by Patrick at 2025-02-09T18:09:16+08:00 fix comment - - - - - 1 changed file: - compiler/GHC/Tc/Utils/TcType.hs Changes: ===================================== compiler/GHC/Tc/Utils/TcType.hs ===================================== @@ -642,7 +642,7 @@ data MetaInfo -- A TauTv is always filled in with a tau-type, which -- never contains any ForAlls. | NoDefTauTv -- ^ A variant of TauTv, except that it should not be - -- defaulted during generalization. See Note [NoDefTauTv] + -- defaulted. See Note [NoDefTauTv] | TyVarTv -- ^ A variant of TauTv, except that it should not be -- unified with a type, only with a type variable -- See Note [TyVarTv] in GHC.Tc.Utils.TcMType View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b59de9acf1359f2cd8a0f4e97d9ddbac506300c5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b59de9acf1359f2cd8a0f4e97d9ddbac506300c5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 12:09:26 2025 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Sun, 09 Feb 2025 07:09:26 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/libffi-3.4.7 Message-ID: <67a89af6d31de_1411081343040389ad@gitlab.mail> Cheng Shao pushed new branch wip/libffi-3.4.7 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/libffi-3.4.7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 13:02:35 2025 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Sun, 09 Feb 2025 08:02:35 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/supersven/riscv-fix-switch-jump-tables Message-ID: <67a8a76bc68dd_14110820b7b7c44690@gitlab.mail> Sven Tennie pushed new branch wip/supersven/riscv-fix-switch-jump-tables at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/supersven/riscv-fix-switch-jump-tables You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 21:26:18 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Sun, 09 Feb 2025 16:26:18 -0500 Subject: [Git][ghc/ghc][wip/T25647] format Message-ID: <67a91d7ab11ba_28b5f413b01497837@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 4ad2c534 by Patrick at 2025-02-10T05:26:07+08:00 format - - - - - 1 changed file: - compiler/GHC/Tc/Utils/Unify.hs Changes: ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2575,9 +2575,9 @@ lhsPriority tv TyVarTv -> 1 ConcreteTv {} -> 2 TauTv -> 3 - NoDefTauTv -> 4 -- ^ when unifying with other, prefer to keep the other. + NoDefTauTv -> 4 -- when unifying with other, prefer to keep the other. -- Since NoDefTauTv is more polymorphic than tau, - -- see Note [NoDefTauTv] for more details. + -- see Note [NoDefTauTv] for more details. -- NB. it is not clear to me(soulomoon), RuntimeUnkTv should -- be higher than NoDefTauTv or not. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4ad2c534b9df73661a20d4efca5ffd67b7dffbad -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4ad2c534b9df73661a20d4efca5ffd67b7dffbad You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 21:40:43 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sun, 09 Feb 2025 16:40:43 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: base: Label threads forked by IO operations Message-ID: <67a920db41ec_28b5f45c4b6c10411d@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 52b6539b by M Farkas-Dyck at 2025-02-08T11:34:51-08:00 Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc. In particular, use `NonEmpty` where appropriate: - the argument of `FieldLabelString` - the argument of `HsMultiIf` - `grhssGRHSs` Decreases overall compile-time allocation by about 0.1% in the benchmark suite (min -0.8%, max +0.3%). Metric Decrease: T3294 - - - - - c37ce2aa by Ben Gamari at 2025-02-09T16:40:09-05:00 gitlab-ci: Bump docker images Closes #25693. - - - - - 3386af8d by Ben Gamari at 2025-02-09T16:40:09-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - dbc1108d by Ben Gamari at 2025-02-09T16:40:09-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 64 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Core/UsageEnv.hs - + compiler/GHC/Data/List/NonEmpty.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Error/Codes.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - + testsuite/tests/th/EmptyGuard.hs - + testsuite/tests/th/EmptyGuard.stderr - testsuite/tests/th/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Transform.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/aa0df0c5aa43d2e16040ad7911362e3bf4bb16ce...dbc1108daaf3e9bda66b1de51647431a2e2ce1e2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/aa0df0c5aa43d2e16040ad7911362e3bf4bb16ce...dbc1108daaf3e9bda66b1de51647431a2e2ce1e2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Feb 9 22:16:20 2025 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Sun, 09 Feb 2025 17:16:20 -0500 Subject: [Git][ghc/ghc][wip/az/ghc-cpp] 51 commits: interpreter: Fix INTERP_STATS profiling code Message-ID: <67a92934ca498_2a21874e6fec86962@gitlab.mail> Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 3b5b15e1 by Alan Zimmerman at 2025-02-08T09:36:31+00:00 GHC-CPP: first rough proof of concept Processes #define FOO #ifdef FOO x = 1 #endif Into [ITcppIgnored [L loc ITcppDefine] ,ITcppIgnored [L loc ITcppIfdef] ,ITvarid "x" ,ITequal ,ITinteger (IL {il_text = SourceText "1", il_neg = False, il_value = 1}) ,ITcppIgnored [L loc ITcppEndif] ,ITeof] In time, ITcppIgnored will be pushed into a comment - - - - - 46c2bafd by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Tidy up before re-visiting the continuation mechanic - - - - - a84c8454 by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Switch preprocessor to continuation passing style Proof of concept, needs tidying up - - - - - 13f1482f by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Small cleanup - - - - - 39ca42b8 by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Get rid of some cruft - - - - - 3cbc5d68 by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Starting to integrate. Need to get the pragma recognised and set - - - - - 61e2a7d7 by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Make cppTokens extend to end of line, and process CPP comments - - - - - fac69bc5 by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Remove unused ITcppDefined - - - - - 2757741b by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Allow spaces between # and keyword for preprocessor directive - - - - - cbebbd8f by Alan Zimmerman at 2025-02-08T09:36:31+00:00 Process CPP continuation lines They are emited as separate ITcppContinue tokens. Perhaps the processing should be more like a comment, and keep on going to the end. BUT, the last line needs to be slurped as a whole. - - - - - c9a7fd91 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Accumulate CPP continuations, process when ready Can be simplified further, we only need one CPP token - - - - - cbae76a4 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Simplify Lexer interface. Only ITcpp We transfer directive lines through it, then parse them from scratch in the preprocessor. - - - - - 67cccefe by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Deal with directive on last line, with no trailing \n - - - - - 51c06eca by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Start parsing and processing the directives - - - - - eed6c4a6 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Prepare for processing include files - - - - - 78e40f85 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Move PpState into PreProcess And initParserState, initPragState too - - - - - b908e27f by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Process nested include files Also move PpState out of Lexer.x, so it is easy to evolve it in a ghci session, loading utils/check-cpp/Main.hs - - - - - ddb9a0f8 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Split into separate files - - - - - 6747454c by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Starting on expression parser. But it hangs. Time for Text.Parsec.Expr - - - - - 051d8545 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Start integrating the ghc-cpp work >From https://github.com/alanz/ghc-cpp - - - - - c6763690 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 WIP - - - - - 0626b2a7 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Fixup after rebase - - - - - 1dc2c5de by Alan Zimmerman at 2025-02-08T09:36:32+00:00 WIP - - - - - 9c24c3af by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Fixup after rebase, including all tests pass - - - - - 3d1c7fa2 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Change pragma usage to GHC_CPP from GhcCPP - - - - - c0750678 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Some comments - - - - - 9ba99ece by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Reformat - - - - - e3bea5ac by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Delete unused file - - - - - 1308c9f3 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Rename module Parse to ParsePP - - - - - 30344e7e by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Clarify naming in the parser - - - - - f1c449b1 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 WIP. Switching to alex/happy to be able to work in-tree Since Parsec is not available - - - - - 6d2ebef1 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Layering is now correct - GHC lexer, emits CPP tokens - accumulated in Preprocessor state - Lexed by CPP lexer, CPP command extracted, tokens concated with spaces (to get rid of token pasting via comments) - if directive lexed and parsed by CPP lexer/parser, and evaluated - - - - - 820e0a6a by Alan Zimmerman at 2025-02-08T09:36:32+00:00 First example working Loading Example1.hs into ghci, getting the right results ``` {-# LANGUAGE GHC_CPP #-} module Example1 where y = 3 x = "hello" "bye now" foo = putStrLn x ``` - - - - - 131c2d6c by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Rebase, and all tests pass except whitespace for generated parser - - - - - 4ec42e20 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 More plumbing. Ready for testing tomorrow. - - - - - e64e6bb1 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Proress. Renamed module State from Types And at first blush it seems to handle preprocessor scopes properly. - - - - - 40e24b59 by Alan Zimmerman at 2025-02-08T09:36:32+00:00 Insert basic GHC version macros into parser __GLASGOW_HASKELL__ __GLASGOW_HASKELL_FULL_VERSION__ __GLASGOW_HASKELL_PATCHLEVEL1__ __GLASGOW_HASKELL_PATCHLEVEL2__ - - - - - 1b8ae7f7 by Alan Zimmerman at 2025-02-08T11:03:54+00:00 Re-sync check-cpp for easy ghci work - - - - - 7009479a by Alan Zimmerman at 2025-02-08T12:38:03+00:00 Get rid of warnings - - - - - 56c761d9 by Alan Zimmerman at 2025-02-09T20:18:49+00:00 Rework macro processing, in check-cpp Macros kept at the top level, looked up via name, multiple arity versions per name can be stored - - - - - c964606e by Alan Zimmerman at 2025-02-09T22:15:29+00:00 WIP. Can crack arguments for #define Next step it to crack out args in an expansion - - - - - 80 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Parser/Monad.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Config/Parser.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.hs-boot - compiler/GHC/Parser.y - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/HaddockLex.x - compiler/GHC/Parser/Header.hs - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - + compiler/GHC/Parser/PreProcess.hs - + compiler/GHC/Parser/PreProcess/Eval.hs - + compiler/GHC/Parser/PreProcess/Lexer.x - + compiler/GHC/Parser/PreProcess/Macro.hs - + compiler/GHC/Parser/PreProcess/ParsePP.hs - + compiler/GHC/Parser/PreProcess/Parser.y - + compiler/GHC/Parser/PreProcess/ParserM.hs - + compiler/GHC/Parser/PreProcess/State.hs - compiler/GHC/Parser/Utils.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/ghc.cabal.in - ghc/GHCi/UI.hs - hadrian/src/Rules/SourceDist.hs - hadrian/stack.yaml.lock - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs - libraries/ghci/GHCi/Run.hs - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/driver/T4437.hs - testsuite/tests/ghc-api/T11579.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/interface-stability/template-haskell-exports.stdout - testsuite/tests/linters/notes.stdout - + utils/check-cpp/.ghci - + utils/check-cpp/.gitignore - + utils/check-cpp/Eval.hs - + utils/check-cpp/Example1.hs - + utils/check-cpp/Example2.hs - + utils/check-cpp/Lexer.x - + utils/check-cpp/Macro.hs - + utils/check-cpp/Main.hs - + utils/check-cpp/ParsePP.hs - + utils/check-cpp/ParseSimulate.hs - + utils/check-cpp/Parser.y - + utils/check-cpp/ParserM.hs - + utils/check-cpp/PreProcess.hs - + utils/check-cpp/README.md - + utils/check-cpp/State.hs - + utils/check-cpp/run.sh - utils/check-exact/Main.hs - utils/check-exact/Parsers.hs - utils/check-exact/Preprocess.hs - utils/check-exact/Utils.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs - utils/haddock/haddock-api/src/Haddock/Parser.hs - utils/haddock/haddock-api/src/Haddock/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f2c26471cb9ae42192d7ee70c66a4251070817c3...c964606e494de5f11ae9838091af3760c8cf0eff -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f2c26471cb9ae42192d7ee70c66a4251070817c3...c964606e494de5f11ae9838091af3760c8cf0eff You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 02:31:04 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sun, 09 Feb 2025 21:31:04 -0500 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: gitlab-ci: Bump docker images Message-ID: <67a964e88400_2d81471d5c3741000b4@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 29dd8ff7 by Ben Gamari at 2025-02-09T21:30:54-05:00 gitlab-ci: Bump docker images Closes #25693. - - - - - 8bb6225d by Ben Gamari at 2025-02-09T21:30:54-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - a25e56da by Ben Gamari at 2025-02-09T21:30:54-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 5 changed files: - .gitlab-ci.yml - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: eb4d3389fd62e4f7321a0c8799014ec1f4da0708 + DOCKER_REV: 94df7d589f0ded990826bc7a4d7f5a40d6055a4f # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. ===================================== hadrian/src/Hadrian/Utilities.hs ===================================== @@ -149,7 +149,10 @@ as /c/foo, while it occasionally falls over on paths of the form C:\foo. -- -- See Note [Absolute paths and MSYS]. (-/-) :: FilePath -> FilePath -> FilePath -_ -/- b | isAbsolute b && not (isAbsolute $ tail b) = b +_ -/- b + | isAbsolute b + , _:b' <- b + , not (isAbsolute b') = b "" -/- b = b a -/- b | last a == '/' = a ++ b @@ -636,7 +639,8 @@ renderLibrary name lib synopsis = renderBox $ -- | ipsum | -- \----------/ renderBox :: [String] -> String -renderBox ls = tail $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) +renderBox ls = + drop 1 $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) where -- Minimum total width of the box in characters minimumBoxWidth = 32 ===================================== hadrian/src/Oracles/ModuleFiles.hs ===================================== @@ -169,10 +169,12 @@ moduleFilesOracle = void $ do let pairs = sort $ mainpairs ++ [ (encodeModule d f, f) | (fs, d) <- result, f <- fs ] multi = [ (m, f1, f2) | (m, f1):(n, f2):_ <- tails pairs, m == n ] - unless (null multi) $ do - let (m, f1, f2) = head multi - error $ "Module " ++ m ++ " has more than one source file: " - ++ f1 ++ " and " ++ f2 ++ "." + + case multi of + [] -> return () + (m, f1, f2) : _ -> + fail $ "Module " ++ m ++ " has more than one source file: " + ++ f1 ++ " and " ++ f2 ++ "." return $ lookupAll modules pairs -- Optimisation: we discard Haskell files here, because they are never used ===================================== hadrian/src/Rules/Dependencies.hs ===================================== @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wno-deprecations #-} +{-# OPTIONS_GHC -Wno-x-data-list-nonempty-unzip #-} module Rules.Dependencies (buildPackageDependencies) where ===================================== hadrian/src/Settings/Parser.hs ===================================== @@ -184,14 +184,11 @@ instance Match SettingsM where matchStringSettingsM :: String -> SettingsM () matchStringSettingsM s = do ks <- State.get - if null ks - then throwError $ "expected " ++ show s ++ ", got nothing" - else go (head ks) - - where go k - | k == s = State.modify tail - | otherwise = throwError $ - "expected " ++ show s ++ ", got " ++ show k + case ks of + [] -> throwError $ "expected " ++ show s ++ ", got nothing" + k:_ + | k == s -> State.modify (drop 1) + | otherwise -> throwError $ "expected " ++ show s ++ ", got " ++ show k matchOneOfSettingsM :: [SettingsM a] -> SettingsM a matchOneOfSettingsM acts = StateT $ \k -> do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dbc1108daaf3e9bda66b1de51647431a2e2ce1e2...a25e56da97cd9ad15b78e30b898aa230571c1df7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dbc1108daaf3e9bda66b1de51647431a2e2ce1e2...a25e56da97cd9ad15b78e30b898aa230571c1df7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 02:42:17 2025 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Sun, 09 Feb 2025 21:42:17 -0500 Subject: [Git][ghc/ghc][wip/spj-apporv-Oct24] Pass HsThingRn as an argument to splitHsApps for fixing the right AppCtx for... Message-ID: <67a96789443b6_2d81471d53328106648@gitlab.mail> Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC Commits: 1d2aeaa1 by Apoorv Ingle at 2025-02-09T20:41:30-06:00 Pass HsThingRn as an argument to splitHsApps for fixing the right AppCtx for arguments in application chain of an expanded expression - - - - - 5 changed files: - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Expr.hs-boot - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs Changes: ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -79,7 +79,6 @@ expand_do_stmts flav [stmt@(L _loc (LastStmt _ (L body_loc body) _ ret_expr))] | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt = return $ mkExpandedStmt stmt flav body - | SyntaxExprRn ret <- ret_expr -- -- ------------------------------------------------ @@ -92,7 +91,7 @@ expand_do_stmts doFlavour (stmt@(L _ (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ --- let x = e ; stmts ~~> let x = e in stmts'xo +-- let x = e ; stmts ~~> let x = e in stmts' do expand_stmts_expr <- expand_do_stmts doFlavour lstmts let expansion = genHsLet bs (genPopErrCtxtExpr expand_stmts_expr) return $ mkExpandedStmt stmt doFlavour expansion ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -129,7 +129,7 @@ tcPolyLExprNC (L loc expr) res_ty ----------------- tcPolyExpr :: HsExpr GhcRn -> ExpSigmaType -> TcM (HsExpr GhcTc) -tcPolyExpr e (Infer inf) = tcExpr e (Infer inf) +tcPolyExpr e (Infer inf) = tcExpr Nothing e (Infer inf) tcPolyExpr e (Check ty) = tcPolyExprCheck e (Left ty) ----------------- @@ -186,7 +186,7 @@ tcPolyExprCheck expr res_ty -- before handing off to tcExpr tc_body e = do { ds_flag <- getDeepSubsumptionFlag ; inner_skolemise ds_flag rho_ty $ \rho_ty' -> - tcExpr e (mkCheckExpType rho_ty') } + tcExpr Nothing e (mkCheckExpType rho_ty') } in tc_body expr where -- `outer_skolemise` is used always @@ -231,12 +231,12 @@ tcInferRho, tcInferRhoNC :: LHsExpr GhcRn -> TcM (LHsExpr GhcTc, TcRhoType) tcInferRho (L loc expr) = setSrcSpanA loc $ -- Set location /first/; see GHC.Tc.Utils.Monad addExprCtxt expr $ -- Note [Error contexts in generated code] - do { (expr', rho) <- tcInfer (tcExpr expr) + do { (expr', rho) <- tcInfer (tcExpr Nothing expr) ; return (L loc expr', rho) } tcInferRhoNC (L loc expr) = setSrcSpanA loc $ - do { (expr', rho) <- tcInfer (tcExpr expr) + do { (expr', rho) <- tcInfer (tcExpr Nothing expr) ; return (L loc expr', rho) } --------------- @@ -258,16 +258,17 @@ tcMonoExpr, tcMonoExprNC tcMonoExpr (L loc expr) res_ty = setSrcSpanA loc $ -- Set location /first/; see GHC.Tc.Utils.Monad addExprCtxt expr $ -- Note [Error contexts in generated code] - do { expr' <- tcExpr expr res_ty + do { expr' <- tcExpr Nothing expr res_ty ; return (L loc expr') } tcMonoExprNC (L loc expr) res_ty = setSrcSpanA loc $ - do { expr' <- tcExpr expr res_ty + do { expr' <- tcExpr Nothing expr res_ty ; return (L loc expr') } --------------- -tcExpr :: HsExpr GhcRn +tcExpr :: Maybe HsThingRn + -> HsExpr GhcRn -> ExpRhoType -- DeepSubsumption <=> when checking, this type -- is deeply skolemised -> TcM (HsExpr GhcTc) @@ -288,45 +289,45 @@ tcExpr :: HsExpr GhcRn -- - ones taken apart by GHC.Tc.Gen.Head.splitHsApps -- - ones understood by GHC.Tc.Gen.Head.tcInferAppHead_maybe -- See Note [Application chains and heads] in GHC.Tc.Gen.App -tcExpr e@(HsVar {}) res_ty = tcApp Nothing e res_ty -tcExpr e@(HsApp {}) res_ty = tcApp Nothing e res_ty -tcExpr e@(OpApp {}) res_ty = tcApp Nothing e res_ty -tcExpr e@(HsAppType {}) res_ty = tcApp Nothing e res_ty -tcExpr e@(ExprWithTySig {}) res_ty = tcApp Nothing e res_ty +tcExpr xern e@(HsVar {}) res_ty = tcApp xern e res_ty +tcExpr xern e@(HsApp {}) res_ty = tcApp xern e res_ty +tcExpr xern e@(OpApp {}) res_ty = tcApp xern e res_ty +tcExpr xern e@(HsAppType {}) res_ty = tcApp xern e res_ty +tcExpr xern e@(ExprWithTySig {}) res_ty = tcApp xern e res_ty -tcExpr (XExpr e) res_ty = tcXExpr e res_ty +tcExpr _ (XExpr e) res_ty = tcXExpr e res_ty -- Typecheck an occurrence of an unbound Id -- -- Some of these started life as a true expression hole "_". -- Others might simply be variables that accidentally have no binding site -tcExpr (HsUnboundVar _ occ) res_ty +tcExpr _ (HsUnboundVar _ occ) res_ty = do { ty <- expTypeToType res_ty -- Allow Int# etc (#12531) ; her <- emitNewExprHole occ ty ; tcEmitBindingUsage bottomUE -- Holes fit any usage environment -- (#18491) ; return (HsUnboundVar her occ) } -tcExpr e@(HsLit x lit) res_ty +tcExpr _ e@(HsLit x lit) res_ty = do { let lit_ty = hsLitType lit ; tcWrapResult e (HsLit x (convertLit lit)) lit_ty res_ty } -tcExpr (HsPar x expr) res_ty +tcExpr _ (HsPar x expr) res_ty = do { expr' <- tcMonoExprNC expr res_ty ; return (HsPar x expr') } -tcExpr (HsPragE x prag expr) res_ty +tcExpr _ (HsPragE x prag expr) res_ty = do { expr' <- tcMonoExpr expr res_ty ; return (HsPragE x (tcExprPrag prag) expr') } -tcExpr (NegApp x expr neg_expr) res_ty +tcExpr _ (NegApp x expr neg_expr) res_ty = do { (expr', neg_expr') <- tcSyntaxOp NegateOrigin neg_expr [SynAny] res_ty $ \[arg_ty] [arg_mult] -> tcScalingUsage arg_mult $ tcCheckMonoExpr expr arg_ty ; return (NegApp x expr' neg_expr') } -tcExpr e@(HsIPVar _ x) res_ty +tcExpr _ e@(HsIPVar _ x) res_ty = do { ip_ty <- newFlexiTyVarTy liftedTypeKind -- Create a unification type variable of kind 'Type'. -- (The type of an implicit parameter must have kind 'Type'.) @@ -342,7 +343,7 @@ tcExpr e@(HsIPVar _ x) res_ty unwrapIP $ mkClassPred ipClass [x,ty] origin = IPOccOrigin x -tcExpr e@(HsLam x lam_variant matches) res_ty +tcExpr _ e@(HsLam x lam_variant matches) res_ty = do { (wrap, matches') <- tcLambdaMatches e lam_variant matches [] res_ty ; return (mkHsWrap wrap $ HsLam x lam_variant matches') } @@ -354,7 +355,7 @@ tcExpr e@(HsLam x lam_variant matches) res_ty ************************************************************************ -} -tcExpr e@(HsOverLit _ lit) res_ty +tcExpr _ e@(HsOverLit _ lit) res_ty = -- See Note [Typechecking overloaded literals] do { mb_res <- tcShortCutLit lit res_ty -- See Note [Short cut for overloaded literals] in GHC.Tc.Utils.TcMType @@ -403,14 +404,14 @@ tricky: -- The expansion includes an ExplicitList, but it is always the built-in -- list type, so that's all we need concern ourselves with here. See -- GHC.Rename.Expr. Note [Handling overloaded and rebindable constructs] -tcExpr (ExplicitList _ exprs) res_ty +tcExpr _ (ExplicitList _ exprs) res_ty = do { res_ty <- expTypeToType res_ty ; (coi, elt_ty) <- matchExpectedListTy res_ty ; let tc_elt expr = tcCheckPolyExpr expr elt_ty ; exprs' <- mapM tc_elt exprs ; return $ mkHsWrapCo coi $ ExplicitList elt_ty exprs' } -tcExpr expr@(ExplicitTuple x tup_args boxity) res_ty +tcExpr _ expr@(ExplicitTuple x tup_args boxity) res_ty | all tupArgPresent tup_args = do { let arity = length tup_args tup_tc = tupleTyCon boxity arity @@ -441,7 +442,7 @@ tcExpr expr@(ExplicitTuple x tup_args boxity) res_ty ; tcWrapResultMono expr expr' act_res_ty res_ty } -tcExpr (ExplicitSum _ alt arity expr) res_ty +tcExpr _ (ExplicitSum _ alt arity expr) res_ty = do { let sum_tc = sumTyCon arity ; res_ty <- expTypeToType res_ty ; (coi, arg_tys) <- matchExpectedTyConApp sum_tc res_ty @@ -468,12 +469,12 @@ tcExpr (ExplicitSum _ alt arity expr) res_ty ************************************************************************ -} -tcExpr (HsLet x binds expr) res_ty +tcExpr _ (HsLet x binds expr) res_ty = do { (binds', expr') <- tcLocalBinds binds $ tcMonoExpr expr res_ty ; return (HsLet x binds' expr') } -tcExpr (HsCase ctxt scrut matches) res_ty +tcExpr _ (HsCase ctxt scrut matches) res_ty = do { -- We used to typecheck the case alternatives first. -- The case patterns tend to give good type info to use -- when typechecking the scrutinee. For example @@ -497,7 +498,7 @@ tcExpr (HsCase ctxt scrut matches) res_ty ; matches' <- tcCaseMatches tcBody (Scaled mult scrut_ty) matches res_ty ; return (HsCase ctxt scrut' matches') } -tcExpr (HsIf x pred b1 b2) res_ty +tcExpr _ (HsIf x pred b1 b2) res_ty = do { pred' <- tcCheckMonoExpr pred boolTy ; (u1,b1') <- tcCollectingUsage $ tcMonoExpr b1 res_ty ; (u2,b2') <- tcCollectingUsage $ tcMonoExpr b2 res_ty @@ -528,16 +529,16 @@ If we add linear guards, this code will have to be revisited. Not using 'sup' caused #23814. -} -tcExpr (HsMultiIf _ alts) res_ty +tcExpr _ (HsMultiIf _ alts) res_ty = do { alts' <- tcGRHSList IfAlt tcBody alts res_ty -- See Note [MultiWayIf linearity checking] ; res_ty <- readExpType res_ty ; return (HsMultiIf res_ty alts') } -tcExpr (HsDo _ do_or_lc stmts) res_ty +tcExpr _ (HsDo _ do_or_lc stmts) res_ty = tcDoStmts do_or_lc stmts res_ty -tcExpr (HsProc x pat cmd) res_ty +tcExpr _ (HsProc x pat cmd) res_ty = do { (pat', cmd', coi) <- tcProc pat cmd res_ty ; return $ mkHsWrapCo coi (HsProc x pat' cmd') } @@ -549,7 +550,7 @@ tcExpr (HsProc x pat cmd) res_ty -- and wrap (static e) in a call to -- fromStaticPtr :: IsStatic p => StaticPtr a -> p a -tcExpr (HsStatic fvs expr) res_ty +tcExpr _ (HsStatic fvs expr) res_ty = do { res_ty <- expTypeToType res_ty ; (co, (p_ty, expr_ty)) <- matchExpectedAppTy res_ty ; (expr', lie) <- captureConstraints $ @@ -586,10 +587,10 @@ tcExpr (HsStatic fvs expr) res_ty (L (noAnnSrcSpan loc) (HsStatic (fvs, mkTyConApp static_ptr_ty_con [expr_ty]) expr')) } -tcExpr (HsEmbTy _ _) _ = failWith (TcRnIllegalTypeExpr TypeKeywordSyntax) -tcExpr (HsQual _ _ _) _ = failWith (TcRnIllegalTypeExpr ContextArrowSyntax) -tcExpr (HsForAll _ _ _) _ = failWith (TcRnIllegalTypeExpr ForallTelescopeSyntax) -tcExpr (HsFunArr _ _ _ _) _ = failWith (TcRnIllegalTypeExpr FunctionArrowSyntax) +tcExpr _ (HsEmbTy _ _) _ = failWith (TcRnIllegalTypeExpr TypeKeywordSyntax) +tcExpr _ (HsQual _ _ _) _ = failWith (TcRnIllegalTypeExpr ContextArrowSyntax) +tcExpr _ (HsForAll _ _ _) _ = failWith (TcRnIllegalTypeExpr ForallTelescopeSyntax) +tcExpr _ (HsFunArr _ _ _ _) _ = failWith (TcRnIllegalTypeExpr FunctionArrowSyntax) {- ************************************************************************ @@ -599,7 +600,7 @@ tcExpr (HsFunArr _ _ _ _) _ = failWith (TcRnIllegalTypeExpr FunctionArrowSyntax) ************************************************************************ -} -tcExpr expr@(RecordCon { rcon_con = L loc con_name +tcExpr _ expr@(RecordCon { rcon_con = L loc con_name , rcon_flds = rbinds }) res_ty = do { con_like <- tcLookupConLike con_name @@ -640,7 +641,7 @@ tcExpr expr@(RecordCon { rcon_con = L loc con_name -- in the renamer. See Note [Overview of record dot syntax] in -- GHC.Hs.Expr. This is why we match on 'rupd_flds = Left rbnds' here -- and panic otherwise. -tcExpr expr@(RecordUpd { rupd_expr = record_expr +tcExpr _ expr@(RecordUpd { rupd_expr = record_expr , rupd_flds = RegularRecUpdFields { xRecUpdFields = possible_parents @@ -654,7 +655,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr -- Typecheck the expanded expression. ; expr' <- addErrCtxt err_ctxt $ - tcExpr (mkExpandedExpr expr ds_expr) (Check ds_res_ty) + tcExpr Nothing (mkExpandedExpr expr ds_expr) (Check ds_res_ty) -- NB: it's important to use ds_res_ty and not res_ty here. -- Test case: T18802b. @@ -666,7 +667,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr -- Test case: T10808. } -tcExpr e@(RecordUpd { rupd_flds = OverloadedRecUpdFields {}}) _ +tcExpr _ e@(RecordUpd { rupd_flds = OverloadedRecUpdFields {}}) _ = pprPanic "tcExpr: unexpected overloaded-dot RecordUpd" $ ppr e {- @@ -679,7 +680,7 @@ tcExpr e@(RecordUpd { rupd_flds = OverloadedRecUpdFields {}}) _ ************************************************************************ -} -tcExpr (ArithSeq _ witness seq) res_ty +tcExpr _ (ArithSeq _ witness seq) res_ty = tcArithSeq witness seq res_ty {- @@ -692,8 +693,8 @@ tcExpr (ArithSeq _ witness seq) res_ty -- These terms have been replaced by their expanded expressions in the renamer. See -- Note [Overview of record dot syntax]. -tcExpr (HsGetField _ _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsGetField: Not implemented" -tcExpr (HsProjection _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsProjection: Not implemented" +tcExpr _ (HsGetField _ _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsGetField: Not implemented" +tcExpr _ (HsProjection _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsProjection: Not implemented" {- ************************************************************************ @@ -705,11 +706,11 @@ tcExpr (HsProjection _ _) _ = panic "GHC.Tc.Gen.Expr: tcExpr: HsProjection: Not -- Here we get rid of it and add the finalizers to the global environment. -- See Note [Delaying modFinalizers in untyped splices] in GHC.Rename.Splice. -tcExpr (HsTypedSplice ext splice) res_ty = tcTypedSplice ext splice res_ty -tcExpr e@(HsTypedBracket _ body) res_ty = tcTypedBracket e body res_ty +tcExpr _ (HsTypedSplice ext splice) res_ty = tcTypedSplice ext splice res_ty +tcExpr _ e@(HsTypedBracket _ body) res_ty = tcTypedBracket e body res_ty -tcExpr e@(HsUntypedBracket ps body) res_ty = tcUntypedBracket e body ps res_ty -tcExpr (HsUntypedSplice splice _) res_ty +tcExpr _ e@(HsUntypedBracket ps body) res_ty = tcUntypedBracket e body ps res_ty +tcExpr _ (HsUntypedSplice splice _) res_ty -- Since `tcApp` deals with `HsUntypedSplice` (in `splitHsApps`), you might -- wonder why we don't delegate to `tcApp` as we do for `HsVar`, etc. -- (See the initial block of equations for `tcExpr`.) But we can't do this @@ -717,7 +718,7 @@ tcExpr (HsUntypedSplice splice _) res_ty -- Note [Looking through Template Haskell splices in splitHsApps] in -- GHC.Tc.Gen.Head. = do { expr <- getUntypedSpliceBody splice - ; tcExpr expr res_ty } + ; tcExpr Nothing expr res_ty } {- ************************************************************************ @@ -727,9 +728,9 @@ tcExpr (HsUntypedSplice splice _) res_ty ************************************************************************ -} -tcExpr (HsOverLabel {}) ty = pprPanic "tcExpr:HsOverLabel" (ppr ty) -tcExpr (SectionL {}) ty = pprPanic "tcExpr:SectionL" (ppr ty) -tcExpr (SectionR {}) ty = pprPanic "tcExpr:SectionR" (ppr ty) +tcExpr _ (HsOverLabel {}) ty = pprPanic "tcExpr:HsOverLabel" (ppr ty) +tcExpr _ (SectionL {}) ty = pprPanic "tcExpr:SectionL" (ppr ty) +tcExpr _ (SectionR {}) ty = pprPanic "tcExpr:SectionR" (ppr ty) {- @@ -744,14 +745,14 @@ tcXExpr :: XXExprGhcRn -> ExpRhoType -> TcM (HsExpr GhcTc) tcXExpr (PopErrCtxt e) res_ty = popErrCtxt $ -- See Part 3 of Note [Expanding HsDo with XXExprGhcRn] in `GHC.Tc.Gen.Do` - tcExpr e res_ty + tcExpr Nothing e res_ty tcXExpr (ExpandedThingRn o@(OrigStmt stmt flav) e) res_ty = addThingCtxt o $ mkExpandedStmtTc stmt flav <$> - tcApp (Just o) e res_ty + tcExpr (Just o) e res_ty --- For record selection +-- For record selection, etc tcXExpr xe res_ty = tcApp Nothing (XExpr xe) res_ty ===================================== compiler/GHC/Tc/Gen/Expr.hs-boot ===================================== @@ -1,6 +1,6 @@ module GHC.Tc.Gen.Expr where import GHC.Hs ( HsExpr, LHsExpr, SyntaxExprRn - , SyntaxExprTc ) + , SyntaxExprTc, HsThingRn ) import GHC.Tc.Utils.TcType ( TcRhoType, TcSigmaType, TcSigmaTypeFRR , SyntaxOpType , ExpType, ExpRhoType, ExpSigmaType ) @@ -9,7 +9,7 @@ import GHC.Tc.Types.BasicTypes( TcCompleteSig ) import GHC.Tc.Types.Origin ( CtOrigin ) import GHC.Core.Type ( Mult ) import GHC.Hs.Extension ( GhcRn, GhcTc ) - +import GHC.Prelude ( Maybe ) tcCheckPolyExpr, tcCheckPolyExprNC :: LHsExpr GhcRn -> TcSigmaType @@ -28,7 +28,7 @@ tcPolyLExpr :: LHsExpr GhcRn -> ExpSigmaType -> TcM (LHsExpr GhcTc) tcPolyLExprSig :: LHsExpr GhcRn -> TcCompleteSig -> TcM (LHsExpr GhcTc) tcPolyExpr :: HsExpr GhcRn -> ExpSigmaType -> TcM (HsExpr GhcTc) -tcExpr :: HsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc) +tcExpr :: Maybe HsThingRn -> HsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc) tcInferRho, tcInferRhoNC :: LHsExpr GhcRn -> TcM (LHsExpr GhcTc, TcRhoType) ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -545,7 +545,7 @@ tcInferAppHead (fun,ctxt) do { mb_tc_fun <- tcInferAppHead_maybe fun ; case mb_tc_fun of Just (fun', fun_sigma) -> return (fun', fun_sigma) - Nothing -> tcInfer (tcExpr fun) } + Nothing -> tcInfer (tcExpr Nothing fun) } tcInferAppHead_maybe :: HsExpr GhcRn -> TcM (Maybe (HsExpr GhcTc, TcSigmaType)) ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -340,12 +340,13 @@ tcDoStmts ListComp (L l stmts) res_ty tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty + ; traceTc "tcDoStmts" (ppr expanded_expr) + ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr Nothing expanded_expr res_ty } tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty } + ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr Nothing expanded_expr res_ty } tcDoStmts MonadComp (L l stmts) res_ty = do { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1d2aeaa17303e0b24decf525fe3340fec9e3404f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1d2aeaa17303e0b24decf525fe3340fec9e3404f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 04:16:56 2025 From: gitlab at gitlab.haskell.org (Luite Stegeman (@luite)) Date: Sun, 09 Feb 2025 23:16:56 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/ubxsumtag Message-ID: <67a97db86a537_33b785d8dbf01004af@gitlab.mail> Luite Stegeman pushed new branch wip/ubxsumtag at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/ubxsumtag You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 06:13:51 2025 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 10 Feb 2025 01:13:51 -0500 Subject: [Git][ghc/ghc][wip/spj-apporv-Oct24] 74 commits: Remove SDocs from ErrCtxt & ErrInfo Message-ID: <67a9991f27aed_33b78522cae00109720@gitlab.mail> Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC Commits: 2e7bf446 by sheaf at 2025-01-13T10:55:26+01:00 Remove SDocs from ErrCtxt & ErrInfo This commit: - turns the SDoc used in ErrCtxt into a proper error datatype, ErrCtxtMsg, which contains all the different error contexts that can be added, - replaces ErrInfo with [ErrCtxt]. ErrInfo used to contain two SDocs; the first is replaced with [ErrCtxt], and the second is removed, with the relevant information being put in the appropriate error message constructors. Fixes #23436 - - - - - 2d62b970 by Mike Pilgrem at 2025-01-13T12:59:10-05:00 Re CLC #300 - Specify fmap for NonEmpty as map See: * https://github.com/haskell/core-libraries-committee/issues/300 Seeks to: * move existing instances for NonEmpty (except of Eq and Ord) out of GHC.Internal.Base into new GHC.Internal.Data.NonEmpty (to avoid otherwise unavoidable cycles in the module graph); * move map out of Data.List.NonEmpty (base package) into GHC.Internal.Data.NonEmpty; * define fmap as map for NonEmpty instance of Functor, avoiding code duplication; * re-export map from existing GHC.Internal.Data.List.NonEmpty; and * re-export map from Data.List.NonEmpty (base package); without breaking anything in the GHC repository. Various tests *.stdout and *.stderr files are amended also. - - - - - ab3ab3e3 by Luite Stegeman at 2025-01-13T12:59:58-05:00 compiler/coreprep: Turn off dictionary speculation by default Speculative evaluation can cause performance regressions, therefore we turn it off by default. It can be enabled again with the -fspec-eval-dictfun flag See #25284 - - - - - 3d9cacd5 by Patrick at 2025-01-14T02:34:46+08:00 Enhance kind inference for data family instances This commit improves kind inference for data family instances by kind-checking the constructors, for H98 and newtype declarations (ONLY), as well as kind-checking the result kind signature (when using GADT syntax). This fixes #25611. Typechecker changes: In `tcDataFamInstHeader`, we now kind-check the constructors using `kcConDecls`, for H98-style decls and newtype decls ONLY. See Note [Kind inference for data family instances]. Testsuite changes: - The T25611{a,b,c,d} tests test the new kind inference implementation. - a,b: infer result kind from constructors (H98 case) - c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail, which now passes - d: GADT case, checking that we don't infer overly rigid kinds when kind-checking the constructors in data family instances. - DataInstanceKindsDefaults tests defaulting data instance kinds without UnliftedNewtypes or UnliftedDatatypes, as outlined in Note [Defaulting result kind of newtype/data family instance]. Also a few notes are updated to reflect the changes. Co-authored-by: default avatarSimon Peyton Jones - - - - - f6493dbc by amesgen at 2025-01-15T18:47:23-05:00 wasm: prevent bundlers from resolving import("node:timers") This fixes the following esbuild error: ✘ [ERROR] Could not resolve "node:timers" www/ghc_wasm_jsffi.js:66:25: 66 │ return (await import("node:timers")).setImmediate; ╵ ~~~~~~~~~~~~~ The package "node:timers" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "--platform=node" to do that, which will remove this error. Previously (i.e. after !13503), one had to work around this by passing `--external:node:timers`. - - - - - 87e82e2e by sheaf at 2025-01-16T14:51:45+01:00 Use checkTyEqRhs to make types concrete This commit refactors makeTypeConcrete to call checkTyEqRhs with the appropriate parameters. This avoids duplicating subtle logic in two places in the compiler. Changes: 1. Refactor of 'TyEqFlags'. Now 'TyEqFlags' stores a 'TEFTask', which is a description of which of the following checks we want to perform in 'checkTyEqRhs': - occurs check - level check - concreteness check In the process, the 'AreUnifying' datatype has been removed, as it is no longer needed. 2. Refactor of 'checkTyVar': a. Make use of the new 'TEFTask' data type to decide which checks to perform. In particular, this ensures that we perform **both** a concreteness check and a level check when both are required; previously we only did a concreteness check (that was a bug!). b. Recursively call 'checkTyVar' on the kind of unfilled metavariables. This deals with a bug in which we failed to uphold the invariant that the kind of a concrete type must itself be concrete. See test cases T23051, T23176. 3. Re-write of 'makeTypeConcrete', which now simply calls 'checkTyEqRhs' with appropriate 'TyEqFlags'/'TEFTask'. This gets rid of code duplication and risk for the two code paths going out-of-sync. Fixes #25616. See also #23883. - - - - - 5a8f35bd by ARATA Mizuki at 2025-01-17T11:17:49-05:00 x86 NCG: Use correct format for MOVD in the implementation of unpackInt64X2# MOVD takes the input format. Fixes #25658 - - - - - 14f8a7ec by Mateusz Goślinowski at 2025-01-17T22:49:09+00:00 Allow multiline strings in JS FFI (#25633) - - - - - 854c2f75 by Simon Peyton Jones at 2025-01-18T02:54:08-05:00 Fix a buglet in tcSplitForAllTyVarsReqTVBindersN The problem was that an equation in `split` had two guards (one about visiblity and one about `n_req`). So it fell thorugh if /either/ was False. But the next equation then assumed an invisible binder. Simple bug, easily fixed. Fixes #25661. - - - - - 264a1186 by sheaf at 2025-01-18T10:05:56+00:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - bf4f5ad3 by Jade at 2025-01-18T10:05:56+00:00 Add structured errors to GHCi (#23338) This patch creates the 'GhciCommandErrorMessage' data type which implents the 'Diagnostic' class and also provides error code for these error conditions. - - - - - b6f54188 by Ben Gamari at 2025-01-18T12:38:46-05:00 Revert "Division by constants optimization" This appears to be responsible for the regression described in #25653. This reverts commit daff1e30219d136977c71f42e82ccc58c9013cfb. - - - - - 0fd90de8 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Introduce div2 test This is a useful test from !8392 which is worth keeping around. - - - - - 32680979 by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Test shift correctness in mul2 test - - - - - 163aa50a by Ben Gamari at 2025-01-18T12:38:46-05:00 testsuite: Add regression test for #25653 - - - - - 44778963 by Matthew Pickering at 2025-01-20T11:23:08+00:00 driver: Store an ExternalModuleGraph in the EPS We now store an ExternalModuleGraph in the EPS. When an new interface is loaded, the module graph is extended with a node for the loaded interface. The result is a partial module graph. If you want to run a transitive closure query on the graph you must first force the transitive closure to be loaded by using `loadExternalGraphBelow`. The primary advantage (for now) is that the transitive dependency calculation does not have to be repeated in getLinkDeps. If your module had many dependencies and many splices, performing this calculation at every splice site took a significant amount of time. We might also want to use this module graph in future for considering questions such as reachability of rules or accessibilty of instance imported by levelled imported. This patch removes another place in the compiler where transitive dependency is calculated in an ad-hoc manner. In general, the transitive dependency calculation should be cached and computed using a ModuleGraph abstraction. The transitive dependency query required by getLinkDeps operates on a graph without hs-boot nodes. If a linkable from a module in a loop is needed, then all modules in the loop are necessary to be available to execute that module. Therefore there is a query in `ModuleGraph` and `ExternalModuleGraph` which allows a transitive closure query to be performed on a graph without loops. Fixes #25634 ------------------------- Metric Decrease: MultiLayerModulesTH_Make MultiLayerModulesTH_OneShot Metric Increase: mhu-perf ------------------------- Co-authored-by: Rodrigo Mesquita - - - - - b3c0acfc by Cheng Shao at 2025-01-20T11:53:10-05:00 hie: fix hie.yaml to use default hie-bios script !13778 accidentally changed hie.yaml to use hie-bios.bat as the default hie-bios script, which completely breaks hie support on non-Windows platforms. This patch reverts that change. - - - - - 595013d4 by Ben Gamari at 2025-01-21T09:57:23-05:00 compiler: Fix CPP guards around ghc_unique_counter64 The `ghc_unique_counter64` symbol was introduced in the RTS in the 64-bit unique refactor (!10568) which has been backported to %9.6.7 and %9.8.4. Update the CPP to reflect this. Fixes #25576. - - - - - 09ee3247 by Ryan Scott at 2025-01-21T09:58:00-05:00 Fix :info pretty-printing of UNPACKed fields This patch: * Ensures that we do not pretty-print a field like `foo :: {-# UNPACK #-} !Int` as `foo :: ! {-# UNPACK -#} Int` (as we were doing before) when running the `:info` command. * Prevents coercions that arise from `UNPACK`ed fields (e.g., such as when one unpacks a newtype) from being printed in `:info` output unless `-dppr-debug` is enabled. Fixes #25651. - - - - - 6b7ea592 by Rodrigo Mesquita at 2025-01-21T16:10:35-05:00 driver: Store the HomePackageTable in a mutable reference This commit refactors the HomePackageTable and HomeUnitGraph: (1) It fixes a quadratic-in-the-number-of-modules space leak in upsweep (#25511) (2) And it reworks these structures into their own modules to simplify the driver. The refactor is driven by the introduction of IO in the HPT interface, but is a bit more aggressive in simplifying the interfaces to enforce correct usage (ie to avoid performance pitfalls). Specifically: - The `HomeUnitGraph` (HUG) is now in `GHC.Unit.Home.Graph` - The `HomePackageTable` (HPT) is now in `GHC.Unit.Home.PackageTable` - The HPT now stores an `IORef` with the table of loaded home package modules. - The interface to the HPT now requires IO - The interface now enforces that the HPT is a datastructure that only grows - This is not enforced in the interface, but, clients of the HPT should never care about there being more or less entries in the HPT when these additional entries are not relevant to their result. - The exception to the invariant that the HPT is monotonically increasing is `restrictHpt`, a function which is called at a "barrier point" (during which there are no other threads inspecting or inserting in the HPT). The invariant can be temporarily broken at this point (currently, after upsweep). This is safe because a single thread holds control over the structure (thus the invariant being broken is never observed). The hug_var and associated structures in the driver, which aimed to improve memory usage in the driver by updating in place a HUG during upsweep, are no longer required as the HPT entries in the HUG are now themselves mutable by construction. This was previously explained in Note [ModuleNameSet, efficiency and space leaks], which is no longer relevant and was deleted. Fixes #25511 Co-authored-by: Matthew Pickering ------------------------- Metric Decrease: MultiComponentModulesRecomp MultiLayerModulesRecomp ------------------------- - - - - - f983a00f by Jens Petersen at 2025-01-21T16:11:12-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 Fix build with gcc-15 which defaults to C23 standard (-std=gnu23) Fixes #25662 ``` utils/hp2ps/Utilities.c:6:14: error: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c:5:1: error: note: ‘malloc’ is declared in header ‘’ 4 | #include "Error.h" +++ |+#include 5 | | 5 | | ^ utils/hp2ps/Utilities.c: In function ‘xmalloc’: utils/hp2ps/Utilities.c:80:17: error: error: too many arguments to function ‘malloc’; expected 0, have 1 80 | r = (void*) malloc(n); | ^~~~~~ ~ | 80 | r = (void*) malloc(n); | ^ utils/hp2ps/Utilities.c:6:14: error: note: declared here 6 | extern void* malloc(); | ^~~~~~ | 6 | extern void* malloc(); | ^ utils/hp2ps/Utilities.c: In function ‘xrealloc’: utils/hp2ps/Utilities.c:92:18: error: warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:92:18: error: note: ‘realloc’ is declared in header ‘’ | 92 | extern void *realloc(); | ^ utils/hp2ps/Utilities.c:94:9: error: error: too many arguments to function ‘realloc’; expected 0, have 2 94 | r = realloc(p, n); | ^~~~~~~ ~ | 94 | r = realloc(p, n); | ^ utils/hp2ps/Utilities.c:92:18: error: note: declared here 92 | extern void *realloc(); | ^~~~~~~ | 92 | extern void *realloc(); | ^ ``` - - - - - 51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00 Rework built-in and punned names (#25174, #25179, #25180, #25182) This patch rewrites part of the logic for dealing with built-in and punned names, making it more principled and fixing a few bugs. * Kill off filterCTuple. Its purpose was to improve pretty-printing of constraint tuples, and the appropriate place for this is namePun_maybe. * Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons. Their inclusion in the list was a workaround for shoddy logic in lookupOrigNameCache. Now we treat tuples of all arities uniformly. * In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN" shouldn't be there (#25174). Also take ListTuplePuns into account (#25179). * When matching OccNames, use the ShortByteString directly to avoid potentially costly conversions to ByteString and String. * Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for looking up tuples/sums in the OrigNameCache. This clears up the previously convoluted relation between the orig name cache and built-in syntax. * Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe. * Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module reexports (#25182). * Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums, up to a certain arity (#25180). * Drop the unnecessary special case for unary constraint tuples in the type checker (finish_tuple). It was a workaround for the lack of CSolo. * Update Notes and other comments, add tests. - - - - - 85c60aea by Teo Camarasu at 2025-01-23T18:06:21-05:00 doc: Add documentation for -XDoAndIfThenElse Resolves #18631 Co-authored-by: Richard Eisenberg - - - - - 4495e48f by Brandon Chinn at 2025-01-24T11:54:24-05:00 Break out GHC.Parser.Lexer.Interface - - - - - 4f8fc11e by Brandon Chinn at 2025-01-24T11:54:24-05:00 Fix lexing comments in multiline strings (#25609) Metric Decrease: MultiLayerModulesRecomp parsing001 - - - - - e7ab778f by Matthew Pickering at 2025-01-24T11:55:01-05:00 testsuite: Pass TEST_HC_OPTS to many more tests This passes `-dno-debug-output` to the test and `-dlint. - - - - - c3593101 by Sylvain Henry at 2025-01-24T23:12:20-05:00 Merge ghc-prim's modules into ghc-internal (#24453) ghc-internal becomes the only wired-in package exposing primitives. There are some minor GHC allocation regressions, but they barely cross the thresholds and only with the wasm backend. They're likely due to longer symbols (ghc-internal vs ghc-prim, GHC.Internal.X vs GHC.X). Metric Increase: T13035 T1969 T4801 T9961 - - - - - 70f7741a by Jens Petersen at 2025-01-24T23:12:58-05:00 hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23 use portable C types! - - - - - a1d92378 by Brandon Chinn at 2025-01-25T15:11:54-08:00 Fix for alex-3.5.2.0 (#25623) This INLINE pragma for alexScanUser was added in 9.12, but then I ported the change to alex in 3.5.2.0 (https://github.com/haskell/alex/pull/262). I didn't realize that GHC errors on duplicate INLINE pragmas, so this ended up being a breaking change. This change should be backported into 9.12 - - - - - 62760367 by ARATA Mizuki at 2025-01-27T16:23:06-05:00 x86 NCG: Make MOVD's output format explicit The old design led to inference of a wrong format, losing upper bits of a vector register. Fixes #25659 Co-authored-by: sheaf - - - - - f19ab490 by Simon Hengel at 2025-01-27T16:23:45-05:00 doc: Correct JSON schema for `-fdiagnostics-as-json` (fixes #25393) - - - - - e16eae65 by Cheng Shao at 2025-01-27T21:41:39+00:00 hadrian: fix bootstrap with 9.12.1 This patch bumps hadrian index-state to fix bootstrap with 9.12.1. - - - - - 8071bad8 by Jeffrey Young at 2025-01-28T21:45:32-05:00 base: add SrcLoc changes to changelog, 4.21.0.0 I accidentally dropped this in !13381 - closes #25614 See: - ea4587794b9e3a098f9c02bd6cea2294af2539ce (the 13381 commit) - Issue #25614 - - - - - 9dcc7e28 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Rename `cloneBndrs` and such — now all the monadic ones have an `M` suffix. We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint. - - - - - 643dd3d8 by Matthew Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in unique generation, and clean up some other partial uni patterns as well. Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns). - - - - - dd0acc3c by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Tc.Deriv.Functor`. Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - 4e9adedf by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Use `Infinite` in `GHC.Runtime.Debugger`. Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case. - - - - - bed812b7 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Cmm.DebugBlock`. We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`. - - - - - 27587df3 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.Types.Literal`. We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`. - - - - - 138de0ff by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Avoid incomplete-uni-patterns in `GHC.CmmToAsm.X86.CodeGen`. - Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable. - - - - - d8cb3d36 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Clean up more incomplete uni patterns. At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known. - - - - - f251bd22 by M Farkas-Dyck at 2025-01-29T02:27:48-05:00 Outline `expectJustPanic`. - - - - - a963a1a5 by Marc Scholten at 2025-01-29T02:28:35-05:00 base: Introduce Data.Enum.enumerate (CLC #306) https://github.com/haskell/core-libraries-committee/issues/306 - - - - - 944712da by Ben Gamari at 2025-01-29T02:29:13-05:00 base: Update description of locking behavior - - - - - 85abc69c by Ben Gamari at 2025-01-29T02:29:51-05:00 base: Fix @since annotation of Data.Bounded Fixes #25615. - - - - - 2ca41c62 by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Fix overly-broad handling of Addr# literals Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641. - - - - - ec26c54d by Ben Gamari at 2025-01-29T02:30:29-05:00 StgToByteCode: Assert that PUSH_G'd values are lifted We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf. - - - - - 8847125f by Ben Gamari at 2025-01-29T02:31:07-05:00 gitlab-ci: Run test-primops testsuite in ~"full-ci" pipeline Closes #25654. - - - - - bf8c7d6e by Matthew Pickering at 2025-01-29T02:31:44-05:00 bytecode: Do not generate `SLIDE x 0` instructions SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9% - - - - - 7bfc93a7 by Zubin Duggal at 2025-01-29T21:41:17-05:00 hackage-doc-tarball: Allow ghc-boot-th to be uploaded to hackage It can't refer to files outside its source directory, so patch that part out. This is OK because those files are only used while bootstrapping. Also add ghci to the list of packages to be uploaded Fixes #25687 - - - - - 704eeb02 by Roman S at 2025-01-29T21:42:05-05:00 Fix Control.Arrow (***) diagram (fixes #25698) - - - - - 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 6e34c0e2 by Apoorv Ingle at 2025-02-09T23:27:21-06:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - a287147e by Apoorv Ingle at 2025-02-09T23:28:04-06:00 simplify data structures. remove doTcApp and applicative stmt fail blocks do not refer stmts - - - - - 33487240 by Simon Peyton Jones at 2025-02-10T00:10:49-06:00 - Remove one `SrcSpan` field from `VAExpansion`. It is no longer needed. - Make `tcExpr` take a `Maybe HsThingRn` which will be passed on to tcApp and used by splitHsApps to determine a more accurate `AppCtx` - `tcXExpr` is less hacky now - - - - - 1053 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Uniques.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Cmm/Config.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Core/Opt/Pipeline.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/Core/Subst.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/TyCo/Tidy.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Data/FastString.hs - compiler/GHC/Data/IOEnv.hs - compiler/GHC/Data/List/Infinite.hs - compiler/GHC/Data/Maybe.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Config/Cmm.hs - compiler/GHC/Driver/Config/Core/Rules.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Errors.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Hooks.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Driver/Ppr.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Errors/Ppr.hs - compiler/GHC/HsToCore/Errors/Types.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Foreign/JavaScript.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/HsToCore/Usage.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Errors.hs - compiler/GHC/Iface/Errors/Ppr.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Recomp.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Iface/Tidy.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/ExtraObj.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Linker/Static.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Types.hs - compiler/GHC/Parser/HaddockLex.x - compiler/GHC/Parser/Header.hs - compiler/GHC/Parser/Lexer.x - + compiler/GHC/Parser/Lexer/Interface.hs - + compiler/GHC/Parser/Lexer/String.x - compiler/GHC/Plugins.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Splice.hs - compiler/GHC/Rename/Unbound.hs - compiler/GHC/Runtime/Debugger.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/JS.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/GHC/Runtime/Loader.hs - compiler/GHC/Stg/Unarise.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/StgToCmm/CgUtils.hs - compiler/GHC/StgToCmm/Expr.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Linker/Linker.hs - compiler/GHC/StgToJS/Linker/Utils.hs - compiler/GHC/SysTools/Cpp.hs - compiler/GHC/Tc/Deriv.hs - compiler/GHC/Tc/Deriv/Functor.hs - compiler/GHC/Tc/Deriv/Infer.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Hole.hs - compiler/GHC/Tc/Errors/Hole.hs-boot - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Errors/Types/PromotionErr.hs - compiler/GHC/Tc/Gen/Annotation.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Default.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Expr.hs-boot - compiler/GHC/Tc/Gen/Foreign.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/Gen/Rule.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Instance/Class.hs - compiler/GHC/Tc/Instance/Family.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Class.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/TyCl/Utils.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Types/ErrCtxt.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Utils/Backpack.hs - compiler/GHC/Tc/Utils/Concrete.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Instantiate.hs - compiler/GHC/Tc/Utils/Monad.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Tc/Utils/Unify.hs-boot - compiler/GHC/Tc/Validity.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Basic.hs - compiler/GHC/Types/Error.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Literal.hs - compiler/GHC/Types/Name.hs - compiler/GHC/Types/Name/Cache.hs - compiler/GHC/Types/Name/Ppr.hs - compiler/GHC/Types/Unique/FM.hs - compiler/GHC/Types/Unique/Supply.hs - compiler/GHC/Types/Var.hs - compiler/GHC/Types/Var/Env.hs - compiler/GHC/Unit/Env.hs - compiler/GHC/Unit/External.hs - compiler/GHC/Unit/Finder.hs - + compiler/GHC/Unit/Home/Graph.hs - compiler/GHC/Unit/Home/ModInfo.hs - + compiler/GHC/Unit/Home/PackageTable.hs - + compiler/GHC/Unit/Module/External/Graph.hs - compiler/GHC/Unit/Module/Graph.hs - + compiler/GHC/Unit/Module/ModNodeKey.hs - compiler/GHC/Unit/Module/ModSummary.hs - compiler/GHC/Unit/Module/Status.hs - compiler/GHC/Unit/Types.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/cbits/genSym.c - compiler/ghc.cabal.in - docs/users_guide/9.14.1-notes.rst - docs/users_guide/conf.py - docs/users_guide/diagnostics-as-json-schema-1_0.json - docs/users_guide/diagnostics-as-json-schema-1_1.json - docs/users_guide/expected-undocumented-flags.txt - + docs/users_guide/exts/doandifthenelse.rst - docs/users_guide/exts/syntax.rst - docs/users_guide/using-optimisation.rst - ghc/GHCi/Leak.hs - ghc/GHCi/UI.hs - ghc/GHCi/UI/Exception.hs - ghc/GHCi/UI/Info.hs - ghc/GHCi/UI/Monad.hs - + ghc/GHCi/UI/Print.hs - ghc/Main.hs - ghc/ghc-bin.cabal.in - hadrian/cabal.project - hadrian/src/Flavour.hs - hadrian/src/Packages.hs - hadrian/src/Rules/CabalReinstall.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/SourceDist.hs - hadrian/src/Settings/Packages.hs - hadrian/src/Settings/Warnings.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/Data/Bounded.hs - libraries/base/src/Data/Enum.hs - libraries/base/src/Data/List/NonEmpty.hs - libraries/base/src/Data/Semigroup.hs - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-boot-th/ghc-boot-th.cabal.in - libraries/ghc-boot/GHC/Data/SizedSeq.hs - libraries/ghc-experimental/ghc-experimental.cabal.in - libraries/ghc-experimental/src/Data/Sum/Experimental.hs - libraries/ghc-experimental/src/Data/Tuple/Experimental.hs - libraries/ghc-experimental/src/Prelude/Experimental.hs - libraries/ghc-heap/tests/stack_big_ret.hs - libraries/ghc-prim/cbits/atomic.c → libraries/ghc-internal/cbits/atomic.c - libraries/ghc-prim/cbits/bitrev.c → libraries/ghc-internal/cbits/bitrev.c - libraries/ghc-prim/cbits/bswap.c → libraries/ghc-internal/cbits/bswap.c - libraries/ghc-prim/cbits/clz.c → libraries/ghc-internal/cbits/clz.c - libraries/ghc-prim/cbits/ctz.c → libraries/ghc-internal/cbits/ctz.c - libraries/ghc-prim/cbits/debug.c → libraries/ghc-internal/cbits/debug.c - libraries/ghc-prim/cbits/longlong.c → libraries/ghc-internal/cbits/longlong.c - libraries/ghc-prim/cbits/mulIntMayOflo.c → libraries/ghc-internal/cbits/mulIntMayOflo.c - libraries/ghc-prim/cbits/pdep.c → libraries/ghc-internal/cbits/pdep.c - libraries/ghc-prim/cbits/pext.c → libraries/ghc-internal/cbits/pext.c - libraries/ghc-prim/cbits/popcnt.c → libraries/ghc-internal/cbits/popcnt.c - libraries/ghc-prim/cbits/word2float.c → libraries/ghc-internal/cbits/word2float.c - libraries/ghc-internal/ghc-internal.cabal.in - libraries/ghc-internal/src/GHC/Internal/ArrayArray.hs - libraries/ghc-internal/src/GHC/Internal/Base.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/Check.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/FFI.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/Native.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/BigNat.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/BigNat.hs-boot - libraries/ghc-internal/src/GHC/Internal/Bignum/Integer.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Integer.hs-boot - libraries/ghc-internal/src/GHC/Internal/Bignum/Natural.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Natural.hs-boot - libraries/ghc-internal/src/GHC/Internal/Bignum/Primitives.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/WordArray.hs - libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs-boot - libraries/ghc-prim/GHC/CString.hs → libraries/ghc-internal/src/GHC/Internal/CString.hs - libraries/ghc-internal/src/GHC/Internal/Char.hs - libraries/ghc-prim/GHC/Classes.hs → libraries/ghc-internal/src/GHC/Internal/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs - libraries/ghc-internal/src/GHC/Internal/ConsoleHandler.hsc - libraries/ghc-internal/src/GHC/Internal/Control/Arrow.hs - libraries/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs - libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs - libraries/ghc-internal/src/GHC/Internal/Control/Monad/Zip.hs - libraries/ghc-internal/src/GHC/Internal/Data/Coerce.hs - libraries/ghc-internal/src/GHC/Internal/Data/Data.hs - libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs - libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs - libraries/ghc-internal/src/GHC/Internal/Data/List/NonEmpty.hs - + libraries/ghc-internal/src/GHC/Internal/Data/NonEmpty.hs - libraries/ghc-internal/src/GHC/Internal/Data/Traversable.hs - libraries/ghc-internal/src/GHC/Internal/Data/Tuple.hs - libraries/ghc-internal/src/GHC/Internal/Data/Type/Ord.hs - libraries/ghc-internal/src/GHC/Internal/Data/Typeable/Internal.hs - libraries/ghc-internal/src/GHC/Internal/Data/Version.hs-boot - libraries/ghc-prim/GHC/Debug.hs → libraries/ghc-internal/src/GHC/Internal/Debug.hs - libraries/ghc-internal/src/GHC/Internal/Encoding/UTF8.hs - libraries/ghc-internal/src/GHC/Internal/Enum.hs - libraries/ghc-internal/src/GHC/Internal/Enum.hs-boot - libraries/ghc-internal/src/GHC/Internal/Err.hs - libraries/ghc-internal/src/GHC/Internal/Event.hs - libraries/ghc-internal/src/GHC/Internal/Event/Arr.hs - libraries/ghc-internal/src/GHC/Internal/Event/IntTable.hs - libraries/ghc-internal/src/GHC/Internal/Event/Thread.hs - libraries/ghc-internal/src/GHC/Internal/Event/TimerManager.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghc-internal/src/GHC/Internal/Exception.hs - libraries/ghc-internal/src/GHC/Internal/Exception.hs-boot - libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs-boot - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs-boot - libraries/ghc-internal/src/GHC/Internal/Exts.hs - libraries/ghc-internal/src/GHC/Internal/Float.hs - libraries/ghc-internal/src/GHC/Internal/Foreign/C/String/Encoding.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - libraries/ghc-internal/src/GHC/Internal/IO.hs-boot - libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage.hs - libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage/Table.hs - libraries/ghc-internal/src/GHC/Internal/IO/Encoding/Iconv.hs - libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock.hs - libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/Flock.hsc - libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/LinuxOFD.hsc - libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/Windows.hsc - libraries/ghc-internal/src/GHC/Internal/IO/Handle/Types.hs-boot - libraries/ghc-internal/src/GHC/Internal/InfoProv/Types.hsc - libraries/ghc-internal/src/GHC/Internal/Int.hs - libraries/ghc-internal/src/GHC/Internal/Integer.hs - libraries/ghc-internal/src/GHC/Internal/Integer/Logarithms.hs - libraries/ghc-internal/src/GHC/Internal/Ix.hs - libraries/ghc-internal/src/GHC/Internal/JS/Prim.hs - libraries/ghc-internal/src/GHC/Internal/JS/Prim/Internal/Build.hs - libraries/ghc-prim/GHC/Magic.hs → libraries/ghc-internal/src/GHC/Internal/Magic.hs - libraries/ghc-prim/GHC/Magic/Dict.hs → libraries/ghc-internal/src/GHC/Internal/Magic/Dict.hs - libraries/ghc-internal/src/GHC/Internal/Maybe.hs - libraries/ghc-internal/src/GHC/Internal/Natural.hs - libraries/ghc-prim/GHC/Prim/Exception.hs → libraries/ghc-internal/src/GHC/Internal/Prim/Exception.hs - libraries/ghc-prim/GHC/Prim/Ext.hs → libraries/ghc-internal/src/GHC/Internal/Prim/Ext.hs - libraries/ghc-prim/GHC/Prim/Panic.hs → libraries/ghc-internal/src/GHC/Internal/Prim/Panic.hs - libraries/ghc-prim/GHC/Prim/PtrEq.hs → libraries/ghc-internal/src/GHC/Internal/Prim/PtrEq.hs - libraries/ghc-internal/src/GHC/Internal/Read.hs - libraries/ghc-internal/src/GHC/Internal/Real.hs-boot - libraries/ghc-internal/src/GHC/Internal/Records.hs - libraries/ghc-internal/src/GHC/Internal/Show.hs - libraries/ghc-internal/src/GHC/Internal/Stack/Types.hs - libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs - libraries/ghc-internal/src/GHC/Internal/TH/Lift.hs - libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs - libraries/ghc-internal/src/GHC/Internal/Text/ParserCombinators/ReadP.hs - libraries/ghc-prim/GHC/Tuple.hs → libraries/ghc-internal/src/GHC/Internal/Tuple.hs - libraries/ghc-internal/src/GHC/Internal/TypeError.hs - libraries/ghc-internal/src/GHC/Internal/TypeLits.hs - libraries/ghc-internal/src/GHC/Internal/TypeLits/Internal.hs - libraries/ghc-internal/src/GHC/Internal/TypeNats.hs - libraries/ghc-prim/GHC/Types.hs → libraries/ghc-internal/src/GHC/Internal/Types.hs - libraries/ghc-internal/src/GHC/Internal/Unicode/Bits.hs - libraries/ghc-internal/src/GHC/Internal/Word.hs - + libraries/ghc-prim/Dummy.hs - − libraries/ghc-prim/Setup.hs - libraries/ghc-prim/changelog.md - libraries/ghc-prim/ghc-prim.cabal - libraries/ghci/GHCi/Run.hs - linters/lint-codes/LintCodes/Static.hs - linters/lint-codes/Main.hs - rts/Exception.cmm - rts/Interpreter.c - rts/Interpreter.h - rts/Prelude.h - rts/PrimOps.cmm - rts/RtsMain.c - rts/RtsSymbols.c - rts/StgCRunAsm.S - rts/StgMiscClosures.cmm - rts/StgStdThunks.cmm - rts/configure.ac - rts/external-symbols.list.in - rts/include/Stg.h - rts/include/stg/Prim.h - rts/js/environment.js - rts/js/mem.js - rts/js/verify.js - rts/rts.cabal - rts/wasm/scheduler.cmm - rts/win32/libHSghc-prim.def - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr - testsuite/tests/backpack/reexport/bkpreex02.stderr - testsuite/tests/backpack/reexport/bkpreex03.stdout - testsuite/tests/backpack/should_compile/bkp09.stderr - testsuite/tests/backpack/should_compile/bkp14.stderr - testsuite/tests/backpack/should_compile/bkp15.stderr - testsuite/tests/backpack/should_compile/bkp31.stderr - testsuite/tests/backpack/should_compile/bkp32.stderr - testsuite/tests/backpack/should_compile/bkp47.stderr - testsuite/tests/backpack/should_compile/bkp51.stderr - testsuite/tests/backpack/should_compile/bkp61.stderr - testsuite/tests/backpack/should_fail/T19244a.stderr - testsuite/tests/backpack/should_fail/T19244b.stderr - testsuite/tests/backpack/should_fail/bkpfail04.stderr - testsuite/tests/backpack/should_fail/bkpfail06.stderr - testsuite/tests/backpack/should_fail/bkpfail07.stderr - testsuite/tests/backpack/should_fail/bkpfail09.stderr - testsuite/tests/backpack/should_fail/bkpfail12.stderr - testsuite/tests/backpack/should_fail/bkpfail13.stderr - testsuite/tests/backpack/should_fail/bkpfail14.stderr - testsuite/tests/backpack/should_fail/bkpfail15.stderr - testsuite/tests/backpack/should_fail/bkpfail20.stderr - testsuite/tests/backpack/should_fail/bkpfail21.stderr - testsuite/tests/backpack/should_fail/bkpfail22.stderr - testsuite/tests/backpack/should_fail/bkpfail29.stderr - testsuite/tests/backpack/should_fail/bkpfail32.stderr - testsuite/tests/backpack/should_fail/bkpfail33.stderr - testsuite/tests/backpack/should_fail/bkpfail38.stderr - testsuite/tests/backpack/should_fail/bkpfail42.stderr - testsuite/tests/backpack/should_fail/bkpfail46.stderr - testsuite/tests/backpack/should_fail/bkpfail47.stderr - testsuite/tests/backpack/should_fail/bkpfail48.stderr - testsuite/tests/backpack/should_fail/bkpfail50.stderr - testsuite/tests/backpack/should_fail/bkpfail52.stderr - testsuite/tests/backpack/should_fail/bkpfail53.stderr - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/codeGen/should_compile/Makefile - testsuite/tests/codeGen/should_compile/T25166.stdout - testsuite/tests/codeGen/should_run/T23146/all.T - testsuite/tests/codeGen/should_run/T25364.hs - testsuite/tests/codeGen/should_run/T25364.stdout - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/cpranal/should_compile/T18109.stderr - testsuite/tests/cpranal/should_compile/T18174.stderr - testsuite/tests/deSugar/should_compile/T13208.stdout - testsuite/tests/deSugar/should_compile/T16615.stderr - testsuite/tests/deSugar/should_compile/T22719.stderr - testsuite/tests/deSugar/should_compile/T2431.stderr - testsuite/tests/default/default-fail01.stderr - testsuite/tests/default/default-fail02.stderr - testsuite/tests/default/default-fail04.stderr - testsuite/tests/default/default-fail07.stderr - testsuite/tests/dependent/ghci/T11786.stdout - testsuite/tests/dependent/should_fail/RAE_T32a.stderr - testsuite/tests/dependent/should_fail/T11407.stderr - testsuite/tests/dependent/should_fail/T13780a.stderr - testsuite/tests/dependent/should_fail/T14066c.stderr - testsuite/tests/dependent/should_fail/T14880.stderr - testsuite/tests/dependent/should_fail/TypeSkolEscape.stderr - testsuite/tests/deriving/should_compile/T11068_aggressive.stderr - testsuite/tests/deriving/should_compile/T14578.stderr - testsuite/tests/deriving/should_compile/T14579.stderr - testsuite/tests/deriving/should_compile/T14682.stderr - testsuite/tests/deriving/should_compile/T15798a.stderr - testsuite/tests/deriving/should_compile/T15798c.stderr - testsuite/tests/deriving/should_compile/T17240.stderr - testsuite/tests/deriving/should_compile/T20496.stderr - testsuite/tests/deriving/should_compile/deriving-inferred-ty-arg.stderr - testsuite/tests/deriving/should_compile/drv-empty-data.stderr - testsuite/tests/deriving/should_compile/drv-phantom.stderr - testsuite/tests/deriving/should_fail/T10598_fail1.stderr - testsuite/tests/deriving/should_fail/T10598_fail2.stderr - testsuite/tests/deriving/should_fail/T10684.stderr - testsuite/tests/deriving/should_fail/T12163.stderr - testsuite/tests/deriving/should_fail/T12801.stderr - testsuite/tests/deriving/should_fail/T14339.stderr - testsuite/tests/deriving/should_fail/T14365.stderr - testsuite/tests/deriving/should_fail/T14916.stderr - testsuite/tests/deriving/should_fail/T16181.stderr - testsuite/tests/deriving/should_fail/T16923.stderr - testsuite/tests/deriving/should_fail/T18127b.stderr - testsuite/tests/deriving/should_fail/T1830_1.stderr - testsuite/tests/deriving/should_fail/T19692.stderr - testsuite/tests/deriving/should_fail/T21302.stderr - testsuite/tests/deriving/should_fail/T22696b.stderr - testsuite/tests/deriving/should_fail/T23522.stderr - testsuite/tests/deriving/should_fail/T2701.stderr - testsuite/tests/deriving/should_fail/T2851.stderr - testsuite/tests/deriving/should_fail/T3101.stderr - testsuite/tests/deriving/should_fail/T3621.stderr - testsuite/tests/deriving/should_fail/T4846.stderr - testsuite/tests/deriving/should_fail/T5478.stderr - testsuite/tests/deriving/should_fail/T5686.stderr - testsuite/tests/deriving/should_fail/T5922.stderr - testsuite/tests/deriving/should_fail/T6147.stderr - testsuite/tests/deriving/should_fail/T7401_fail.stderr - testsuite/tests/deriving/should_fail/T7959.stderr - testsuite/tests/deriving/should_fail/T9071.stderr - testsuite/tests/deriving/should_fail/T9071_2.stderr - testsuite/tests/deriving/should_fail/deriving-via-fail.stderr - testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr - testsuite/tests/deriving/should_fail/deriving-via-fail5.stderr - testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.stderr - testsuite/tests/deriving/should_fail/drvfail-functor1.stderr - testsuite/tests/deriving/should_fail/drvfail-functor2.stderr - testsuite/tests/deriving/should_fail/drvfail001.stderr - testsuite/tests/deriving/should_fail/drvfail002.stderr - testsuite/tests/deriving/should_fail/drvfail003.stderr - testsuite/tests/deriving/should_fail/drvfail004.stderr - testsuite/tests/deriving/should_fail/drvfail005.stderr - testsuite/tests/deriving/should_fail/drvfail007.stderr - testsuite/tests/deriving/should_fail/drvfail012.stderr - testsuite/tests/deriving/should_fail/drvfail013.stderr - testsuite/tests/deriving/should_fail/drvfail016.stderr - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/dmdanal/should_compile/T10069.stderr - testsuite/tests/dmdanal/should_compile/T10482.stderr - testsuite/tests/dmdanal/should_compile/T10482a.stderr - testsuite/tests/dmdanal/should_compile/T13143.stderr - testsuite/tests/dmdanal/should_compile/T16029.stdout - testsuite/tests/dmdanal/should_compile/T18982.stderr - testsuite/tests/dmdanal/should_compile/T20510.stderr - testsuite/tests/dmdanal/should_compile/T20663.stderr - testsuite/tests/dmdanal/should_compile/T23398.stderr - testsuite/tests/driver/T20604/T20604.stdout - testsuite/tests/driver/fat-iface/fat001.stdout - testsuite/tests/driver/fat-iface/fat006.stdout - testsuite/tests/driver/j-space/jspace.hs - testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr - testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits002.stdout - testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits003.stdout - testsuite/tests/driver/recomp24656/recomp24656.stdout - testsuite/tests/gadt/CasePrune.stderr - testsuite/tests/gadt/gadt10.stderr - testsuite/tests/generics/GenCannotDoRep0_0.stderr - testsuite/tests/generics/GenCannotDoRep0_1.stderr - testsuite/tests/generics/GenCannotDoRep1_0.stderr - testsuite/tests/generics/GenCannotDoRep1_1.stderr - testsuite/tests/generics/GenCannotDoRep1_3.stderr - testsuite/tests/generics/GenCannotDoRep1_4.stderr - testsuite/tests/generics/GenCannotDoRep1_6.stderr - testsuite/tests/generics/GenCannotDoRep1_7.stderr - testsuite/tests/generics/GenCannotDoRep1_8.stderr - testsuite/tests/generics/GenDerivOutput.stderr - testsuite/tests/generics/GenDerivOutput1_0.stderr - testsuite/tests/generics/GenDerivOutput1_1.stderr - testsuite/tests/generics/T10030.stdout - testsuite/tests/generics/T10604/T10604_deriving.stderr - testsuite/tests/generics/T10604/T10604_no_PolyKinds.stderr - testsuite/tests/generics/T5462No1.stderr - testsuite/tests/generics/T8468.stderr - testsuite/tests/ghc-api/T18522-dbg-ppr.hs - testsuite/tests/ghc-api/downsweep/OldModLocation.hs - testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs - testsuite/tests/ghc-e/should_fail/T18441fail0.stderr - testsuite/tests/ghc-e/should_fail/T18441fail1.stderr - testsuite/tests/ghc-e/should_fail/T18441fail10.stderr - testsuite/tests/ghc-e/should_fail/T18441fail11.stderr - testsuite/tests/ghc-e/should_fail/T18441fail14.stderr - testsuite/tests/ghc-e/should_fail/T18441fail15.stderr - testsuite/tests/ghc-e/should_fail/T18441fail2.stderr - testsuite/tests/ghc-e/should_fail/T18441fail6.stderr - testsuite/tests/ghc-e/should_fail/T18441fail8.stderr - testsuite/tests/ghc-e/should_fail/T23663.stderr - testsuite/tests/ghc-e/should_fail/T24172.stderr - testsuite/tests/ghci.debugger/scripts/break016.stdout - testsuite/tests/ghci.debugger/scripts/break029.script - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/ghci.debugger/scripts/break030.stdout - testsuite/tests/ghci/T16793/T16793.stdout - testsuite/tests/ghci/T18060/T18060.stdout - testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout - testsuite/tests/ghci/scripts/T10059.stdout - testsuite/tests/ghci/scripts/T10508.stderr - testsuite/tests/ghci/scripts/T14676.stderr - testsuite/tests/ghci/scripts/T15941.stdout - testsuite/tests/ghci/scripts/T16575.stdout - testsuite/tests/ghci/scripts/T16804.stderr - testsuite/tests/ghci/scripts/T18755.stdout - testsuite/tests/ghci/scripts/T20150.stdout - testsuite/tests/ghci/scripts/T20627.stdout - testsuite/tests/ghci/scripts/T23686.stderr - testsuite/tests/ghci/scripts/T4127.stdout - testsuite/tests/ghci/scripts/T4127a.stderr - testsuite/tests/ghci/scripts/T4175.stdout - testsuite/tests/ghci/scripts/T7627.stdout - testsuite/tests/ghci/scripts/T8113.stdout - testsuite/tests/ghci/scripts/T8469.stdout - testsuite/tests/ghci/scripts/T8535.stdout - testsuite/tests/ghci/scripts/T9181.stdout - testsuite/tests/ghci/scripts/T9293.stderr - testsuite/tests/ghci/scripts/T9881.stdout - testsuite/tests/ghci/scripts/ghci005.stdout - testsuite/tests/ghci/scripts/ghci011.stdout - testsuite/tests/ghci/scripts/ghci020.stdout - testsuite/tests/ghci/scripts/ghci025.stdout - testsuite/tests/ghci/scripts/ghci057.stderr - testsuite/tests/ghci/scripts/ghci059.stdout - testsuite/tests/ghci/scripts/ghci064.stdout - testsuite/tests/ghci/scripts/ghci066.stdout - testsuite/tests/ghci/should_fail/T18027a.stderr - testsuite/tests/ghci/should_fail/T18052b.stderr - testsuite/tests/ghci/should_run/T10145.stdout - testsuite/tests/ghci/should_run/T13456.stdout - testsuite/tests/ghci/should_run/T15369.stdout - testsuite/tests/ghci/should_run/T16096.stdout - testsuite/tests/ghci/should_run/T18594.stdout - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/hiefile/should_run/T23540.stdout - + testsuite/tests/indexed-types/should_compile/DataInstanceKindsDefaults.hs - testsuite/tests/indexed-types/should_compile/T11361a.stderr - + testsuite/tests/indexed-types/should_compile/T25611a.hs - + testsuite/tests/indexed-types/should_compile/T25611b.hs - testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.hs → testsuite/tests/indexed-types/should_compile/T25611c.hs - + testsuite/tests/indexed-types/should_compile/T25611d.hs - testsuite/tests/indexed-types/should_compile/all.T - testsuite/tests/indexed-types/should_fail/BadFamInstDecl.stderr - testsuite/tests/indexed-types/should_fail/ExplicitForAllFams4a.stderr - testsuite/tests/indexed-types/should_fail/ExplicitForAllFams4b.stderr - testsuite/tests/indexed-types/should_fail/HsBootFam.stderr - testsuite/tests/indexed-types/should_fail/NotRelaxedExamples.stderr - testsuite/tests/indexed-types/should_fail/Overlap3.stderr - testsuite/tests/indexed-types/should_fail/Overlap7.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail12.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail13.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail1a.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail1b.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail2a.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail3a.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail4.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail7.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail9.stderr - testsuite/tests/indexed-types/should_fail/T10817.stderr - testsuite/tests/indexed-types/should_fail/T10899.stderr - testsuite/tests/indexed-types/should_fail/T11136.stderr - testsuite/tests/indexed-types/should_fail/T11450.stderr - testsuite/tests/indexed-types/should_fail/T12041.stderr - testsuite/tests/indexed-types/should_fail/T12867.stderr - testsuite/tests/indexed-types/should_fail/T13971.stderr - testsuite/tests/indexed-types/should_fail/T13971b.stderr - testsuite/tests/indexed-types/should_fail/T14230.stderr - testsuite/tests/indexed-types/should_fail/T14230a.stderr - testsuite/tests/indexed-types/should_fail/T15740.stderr - testsuite/tests/indexed-types/should_fail/T15870.stderr - testsuite/tests/indexed-types/should_fail/T16110_Fail2.stderr - testsuite/tests/indexed-types/should_fail/T16110_Fail3.stderr - testsuite/tests/indexed-types/should_fail/T16356_Fail1.stderr - testsuite/tests/indexed-types/should_fail/T16356_Fail2.stderr - testsuite/tests/indexed-types/should_fail/T16356_Fail3.stderr - testsuite/tests/indexed-types/should_fail/T17008a.stderr - testsuite/tests/indexed-types/should_fail/T18648.stderr - testsuite/tests/indexed-types/should_fail/T2157.stderr - testsuite/tests/indexed-types/should_fail/T2334A.stderr - testsuite/tests/indexed-types/should_fail/T3092.stderr - testsuite/tests/indexed-types/should_fail/T7536.stderr - testsuite/tests/indexed-types/should_fail/T7938.stderr - testsuite/tests/indexed-types/should_fail/T8368.stderr - testsuite/tests/indexed-types/should_fail/T8368a.stderr - testsuite/tests/indexed-types/should_fail/T9160.stderr - testsuite/tests/indexed-types/should_fail/T9357.stderr - testsuite/tests/indexed-types/should_fail/T9896.stderr - testsuite/tests/indexed-types/should_fail/TyFamArity1.stderr - testsuite/tests/indexed-types/should_fail/TyFamArity2.stderr - testsuite/tests/indexed-types/should_fail/TyFamUndec.stderr - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/interface-stability/ghc-experimental-exports.stdout - testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 - testsuite/tests/interface-stability/template-haskell-exports.stdout - testsuite/tests/javascript/Makefile - + testsuite/tests/javascript/T25633.hs - + testsuite/tests/javascript/T25633.stdout - testsuite/tests/javascript/all.T - testsuite/tests/linear/should_fail/LinearErrOrigin.stderr - testsuite/tests/linear/should_fail/LinearLet10.stderr - testsuite/tests/linear/should_fail/LinearPartialSig.stderr - testsuite/tests/linear/should_fail/LinearVar.stderr - testsuite/tests/linear/should_fail/T18888_datakinds.stderr - testsuite/tests/linear/should_fail/T20083.stderr - testsuite/tests/linear/should_fail/T21278.stderr - testsuite/tests/module/mod110.stderr - testsuite/tests/module/mod132.stderr - testsuite/tests/module/mod53.stderr - testsuite/tests/module/mod54.stderr - testsuite/tests/module/mod55.stderr - testsuite/tests/module/mod56.stderr - testsuite/tests/module/mod87.stderr - testsuite/tests/module/mod97.stderr - testsuite/tests/numeric/should_compile/T14170.stdout - testsuite/tests/numeric/should_compile/T14465.stdout - testsuite/tests/numeric/should_compile/T19892.stderr - testsuite/tests/numeric/should_compile/T7116.stdout - + testsuite/tests/numeric/should_run/T25653.hs - + testsuite/tests/numeric/should_run/T25653.stdout - testsuite/tests/numeric/should_run/all.T - testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.stderr - testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun04.stdout - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/T14189.stderr - testsuite/tests/parser/should_fail/ListTuplePunsFail2.stderr - testsuite/tests/parser/should_fail/ListTuplePunsFail3.stderr - testsuite/tests/parser/should_fail/ListTuplePunsFail4.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail8.stderr - testsuite/tests/parser/should_fail/T18251e.stderr - testsuite/tests/parser/should_fail/readFail035.stderr - testsuite/tests/parser/should_run/NumericUnderscores0.hs - testsuite/tests/parser/should_run/NumericUnderscores0.stdout - + testsuite/tests/parser/should_run/T25609.hs - + testsuite/tests/parser/should_run/T25609.stdout - testsuite/tests/parser/should_run/all.T - testsuite/tests/partial-sigs/should_compile/TypedSplice.stderr - testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInTypeSpliceUsed.stderr - testsuite/tests/partial-sigs/should_fail/NamedWildcardInTypeSplice.stderr - testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr - testsuite/tests/partial-sigs/should_fail/T10999.stderr - testsuite/tests/partial-sigs/should_fail/T13324_fail2.stderr - testsuite/tests/patsyn/should_compile/T13350/Makefile - testsuite/tests/perf/compiler/T11068.stdout - testsuite/tests/plugins/plugins02.stderr - testsuite/tests/plugins/plugins09.stdout - testsuite/tests/plugins/plugins10.stdout - testsuite/tests/plugins/plugins11.stdout - testsuite/tests/plugins/static-plugins.stdout - testsuite/tests/pmcheck/should_compile/T12957.stderr - testsuite/tests/polykinds/T10451.stderr - testsuite/tests/polykinds/T11203.stderr - testsuite/tests/polykinds/T11399.stderr - testsuite/tests/polykinds/T11821a.stderr - testsuite/tests/polykinds/T14110.stderr - testsuite/tests/polykinds/T14450.stderr - testsuite/tests/polykinds/T14555.stderr - testsuite/tests/polykinds/T14563.stderr - testsuite/tests/polykinds/T14580.stderr - testsuite/tests/polykinds/T15787.stderr - testsuite/tests/polykinds/T15795.stderr - testsuite/tests/polykinds/T15795a.stderr - testsuite/tests/polykinds/T16762.stderr - testsuite/tests/polykinds/T16762a.stderr - testsuite/tests/polykinds/T16762c.stderr - testsuite/tests/polykinds/T17963.stderr - testsuite/tests/polykinds/T18451.stderr - testsuite/tests/polykinds/T22742.stderr - + testsuite/tests/polykinds/T25661.hs - + testsuite/tests/polykinds/T25661.stderr - testsuite/tests/polykinds/T5716a.stderr - testsuite/tests/polykinds/T7805.stderr - testsuite/tests/polykinds/all.T - libraries/ghc-prim/tests/T6026.hs → testsuite/tests/primops/should_run/T6026.hs - libraries/ghc-prim/tests/T6026.stdout → testsuite/tests/primops/should_run/T6026.stdout - testsuite/tests/primops/should_run/all.T - testsuite/tests/printer/T15761.stderr - testsuite/tests/printer/T17697.stderr - testsuite/tests/printer/T18052a.stderr - testsuite/tests/profiling/should_run/callstack001.stdout - testsuite/tests/quantified-constraints/T25243.stderr - testsuite/tests/quotes/T10384.stderr - testsuite/tests/quotes/TH_double_splice.stderr - testsuite/tests/quotes/TH_ppr1.stdout - testsuite/tests/quotes/TTH_top_splice.stderr - + testsuite/tests/rename/should_compile/ReExportTuples.hs - + testsuite/tests/rename/should_compile/T25182.hs - testsuite/tests/rename/should_compile/all.T - testsuite/tests/rename/should_fail/T12686a.stderr - testsuite/tests/rename/should_fail/T12686c.stderr - testsuite/tests/rename/should_fail/T15828.stderr - testsuite/tests/rename/should_fail/T16635b.stderr - testsuite/tests/rename/should_fail/T18740a.stderr - testsuite/tests/rename/should_fail/T19843h.stderr - testsuite/tests/rename/should_fail/T23740i.stderr - testsuite/tests/rename/should_fail/T6148d.stderr - testsuite/tests/rep-poly/RepPolyBackpack1.stderr - testsuite/tests/rep-poly/RepPolyBackpack3.stderr - testsuite/tests/rep-poly/RepPolyInferPatBind.stderr - testsuite/tests/rep-poly/RepPolyInferPatSyn.stderr - testsuite/tests/rep-poly/RepPolyTuple3.stderr - testsuite/tests/rep-poly/T23153.stderr - testsuite/tests/rep-poly/T23154.stderr - testsuite/tests/roles/should_compile/Roles1.stderr - testsuite/tests/roles/should_compile/Roles13.stderr - testsuite/tests/roles/should_compile/Roles14.stderr - testsuite/tests/roles/should_compile/Roles2.stderr - testsuite/tests/roles/should_compile/Roles3.stderr - testsuite/tests/roles/should_compile/Roles4.stderr - testsuite/tests/roles/should_compile/T8958.stderr - testsuite/tests/roles/should_fail/Roles10.stderr - testsuite/tests/rts/Makefile - testsuite/tests/rts/T1791/Makefile - testsuite/tests/rts/cloneStackLib.c - testsuite/tests/rts/ipe/T24005/t24005.hs - testsuite/tests/safeHaskell/ghci/p12.stderr - testsuite/tests/safeHaskell/ghci/p5.stderr - testsuite/tests/safeHaskell/unsafeLibs/T21433.stderr - testsuite/tests/showIface/DocsInHiFile1.stdout - testsuite/tests/showIface/HaddockSpanIssueT24378.stdout - testsuite/tests/showIface/Orphans.stdout - + testsuite/tests/simd/should_run/T25658.hs - + testsuite/tests/simd/should_run/T25658.stdout - + testsuite/tests/simd/should_run/T25659.hs - + testsuite/tests/simd/should_run/T25659.stdout - testsuite/tests/simd/should_run/all.T - testsuite/tests/simplCore/should_compile/OpaqueNoCastWW.stderr - testsuite/tests/simplCore/should_compile/T13156.stdout - testsuite/tests/simplCore/should_compile/T14978.stdout - testsuite/tests/simplCore/should_compile/T15631.stdout - testsuite/tests/simplCore/should_compile/T17673.stderr - testsuite/tests/simplCore/should_compile/T18013.stderr - testsuite/tests/simplCore/should_compile/T18078.stderr - testsuite/tests/simplCore/should_compile/T18668.stderr - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T21851_2.stderr - testsuite/tests/simplCore/should_compile/T22375.stderr - testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplCore/should_compile/T24662.stderr - testsuite/tests/simplCore/should_compile/T3717.stderr - testsuite/tests/simplCore/should_compile/T3772.stdout - testsuite/tests/simplCore/should_compile/T4201.stdout - testsuite/tests/simplCore/should_compile/T4306.stdout - testsuite/tests/simplCore/should_compile/T4908.stderr - testsuite/tests/simplCore/should_compile/T4930.stderr - testsuite/tests/simplCore/should_compile/T5366.stdout - testsuite/tests/simplCore/should_compile/T7360.stderr - testsuite/tests/simplCore/should_compile/T7865.stdout - testsuite/tests/simplCore/should_compile/T8274.stdout - testsuite/tests/simplCore/should_compile/T8832.stdout - testsuite/tests/simplCore/should_compile/T9400.stderr - testsuite/tests/simplCore/should_compile/noinline01.stderr - testsuite/tests/simplCore/should_compile/par01.stderr - testsuite/tests/simplCore/should_compile/rule2.stderr - testsuite/tests/simplCore/should_compile/simpl016.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - testsuite/tests/th/ClosedFam1TH.stderr - + testsuite/tests/th/FunNameTH.hs - testsuite/tests/th/ListTuplePunsTH.stderr - testsuite/tests/th/T10734.stdout - testsuite/tests/th/T10828.stderr - testsuite/tests/th/T10891.stderr - testsuite/tests/th/T10945.stderr - testsuite/tests/th/T10946.stderr - testsuite/tests/th/T11145.stderr - testsuite/tests/th/T11341.stderr - testsuite/tests/th/T11345.stdout - testsuite/tests/th/T11452.stderr - testsuite/tests/th/T12045TH2.stderr - testsuite/tests/th/T12387a.stderr - testsuite/tests/th/T12403.stdout - testsuite/tests/th/T12478_1.stdout - testsuite/tests/th/T12478_4.stderr - testsuite/tests/th/T12646.stderr - testsuite/tests/th/T13776.hs - testsuite/tests/th/T13776.stderr - testsuite/tests/th/T13837.stderr - testsuite/tests/th/T13887.stdout - testsuite/tests/th/T14060.stdout - testsuite/tests/th/T14627.stderr - testsuite/tests/th/T15433a.stderr - testsuite/tests/th/T15738.stderr - testsuite/tests/th/T15792.stderr - testsuite/tests/th/T15843.stdout - testsuite/tests/th/T16976.stderr - testsuite/tests/th/T16976z.stderr - testsuite/tests/th/T17296.stderr - testsuite/tests/th/T17380.stderr - testsuite/tests/th/T17804.stderr - testsuite/tests/th/T17820d.stderr - testsuite/tests/th/T18102.stderr - testsuite/tests/th/T1835.stdout - testsuite/tests/th/T1849.stdout - testsuite/tests/th/T18740d.stderr - testsuite/tests/th/T19363.stdout - testsuite/tests/th/T19373.stdout - testsuite/tests/th/T19470.stderr - testsuite/tests/th/T20711.stdout - testsuite/tests/th/T20842.stdout - testsuite/tests/th/T20868.stdout - testsuite/tests/th/T20884.stderr - testsuite/tests/th/T21050.stderr - testsuite/tests/th/T21547.stderr - testsuite/tests/th/T2222.stderr - testsuite/tests/th/T22559a.stderr - testsuite/tests/th/T22559b.stderr - testsuite/tests/th/T22559c.stderr - testsuite/tests/th/T23829_hasty_b.stderr - testsuite/tests/th/T23927.stdout - testsuite/tests/th/T24111.stdout - testsuite/tests/th/T24997.stdout - + testsuite/tests/th/T25174.hs - + testsuite/tests/th/T25179.hs - testsuite/tests/th/T25256.stdout - testsuite/tests/th/T2700.stderr - testsuite/tests/th/T4135.stderr - testsuite/tests/th/T5037.stderr - testsuite/tests/th/T5358.stderr - testsuite/tests/th/T7064.stdout - testsuite/tests/th/T7477.stderr - testsuite/tests/th/T8577.stderr - testsuite/tests/th/T8625.stdout - testsuite/tests/th/T8761.stderr - testsuite/tests/th/T8953.stderr - testsuite/tests/th/T9262.stderr - testsuite/tests/th/T9692.stderr - testsuite/tests/th/TH_NestedSplicesFail1.stderr - testsuite/tests/th/TH_NestedSplicesFail2.stderr - testsuite/tests/th/TH_NestedSplicesFail3.stderr - testsuite/tests/th/TH_NestedSplicesFail4.stderr - testsuite/tests/th/TH_NestedSplicesFail5.stderr - testsuite/tests/th/TH_NestedSplicesFail6.stderr - testsuite/tests/th/TH_NestedSplicesFail7.stderr - testsuite/tests/th/TH_NestedSplicesFail8.stderr - testsuite/tests/th/TH_PromotedList.stderr - testsuite/tests/th/TH_PromotedTuple.stderr - testsuite/tests/th/TH_RichKinds.stderr - testsuite/tests/th/TH_RichKinds2.stderr - testsuite/tests/th/TH_Roles2.stderr - testsuite/tests/th/TH_TyInstWhere2.stderr - testsuite/tests/th/TH_foreignCallingConventions.stderr - testsuite/tests/th/TH_fun_par.stderr - testsuite/tests/th/TH_implicitParams.stdout - testsuite/tests/th/TH_reifyDecl1.stderr - testsuite/tests/th/TH_reifyInstances.stderr - testsuite/tests/th/TH_reifyLinear.stderr - testsuite/tests/th/TH_reifyLocalDefs.stderr - testsuite/tests/th/TH_reifyLocalDefs2.stderr - testsuite/tests/th/TH_reifyMkName.stderr - testsuite/tests/th/TH_repGuard.stderr - testsuite/tests/th/TH_repPatSigTVar.stderr - testsuite/tests/th/TH_repPrim.stderr - testsuite/tests/th/TH_repUnboxedTuples.stderr - testsuite/tests/th/TH_tuple1.stdout - testsuite/tests/th/TH_unresolvedInfix.stdout - testsuite/tests/th/all.T - testsuite/tests/th/overloaded/TH_overloaded_csp.stdout - testsuite/tests/th/overloaded/TH_overloaded_extract.stdout - testsuite/tests/typecheck/no_skolem_info/T10946_sk.stderr - testsuite/tests/typecheck/should_compile/T13032.stderr - testsuite/tests/typecheck/should_compile/T13050.stderr - testsuite/tests/typecheck/should_compile/T14273.stderr - testsuite/tests/typecheck/should_compile/T14590.stderr - testsuite/tests/typecheck/should_compile/T18406b.stderr - testsuite/tests/typecheck/should_compile/T18529.stderr - testsuite/tests/typecheck/should_compile/T22141c.stderr - testsuite/tests/typecheck/should_compile/T22141d.stderr - + testsuite/tests/typecheck/should_compile/T25180.hs - + testsuite/tests/typecheck/should_compile/T25180.stderr - testsuite/tests/typecheck/should_compile/all.T - testsuite/tests/typecheck/should_compile/holes.stderr - testsuite/tests/typecheck/should_compile/holes3.stderr - testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr - testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr - testsuite/tests/typecheck/should_fail/AssocTyDef02.stderr - testsuite/tests/typecheck/should_fail/AssocTyDef03.stderr - testsuite/tests/typecheck/should_fail/AssocTyDef04.stderr - testsuite/tests/typecheck/should_fail/AssocTyDef05.stderr - testsuite/tests/typecheck/should_fail/AssocTyDef06.stderr - testsuite/tests/typecheck/should_fail/ErrorIndexLinks.stderr - testsuite/tests/typecheck/should_fail/ExplicitSpecificity7.stderr - testsuite/tests/typecheck/should_fail/T11347.stderr - testsuite/tests/typecheck/should_fail/T11974b.stderr - testsuite/tests/typecheck/should_fail/T12966.stderr - testsuite/tests/typecheck/should_fail/T13292.stderr - testsuite/tests/typecheck/should_fail/T14048a.stderr - testsuite/tests/typecheck/should_fail/T14048c.stderr - testsuite/tests/typecheck/should_fail/T14884.stderr - testsuite/tests/typecheck/should_fail/T15067.stderr - testsuite/tests/typecheck/should_fail/T15474.stderr - testsuite/tests/typecheck/should_fail/T15648.stderr - testsuite/tests/typecheck/should_fail/T15648a.hs - testsuite/tests/typecheck/should_fail/T15807.stderr - testsuite/tests/typecheck/should_fail/T15816.stderr - testsuite/tests/typecheck/should_fail/T15883b.stderr - testsuite/tests/typecheck/should_fail/T15883c.stderr - testsuite/tests/typecheck/should_fail/T16829b.stderr - testsuite/tests/typecheck/should_fail/T17021b.stderr - testsuite/tests/typecheck/should_fail/T17567.stderr - testsuite/tests/typecheck/should_fail/T17567StupidTheta.stderr - testsuite/tests/typecheck/should_fail/T17940.stderr - testsuite/tests/typecheck/should_fail/T18640c.stderr - testsuite/tests/typecheck/should_fail/T18714.stderr - testsuite/tests/typecheck/should_fail/T18723a.stderr - testsuite/tests/typecheck/should_fail/T18723c.stderr - testsuite/tests/typecheck/should_fail/T18891a.stderr - testsuite/tests/typecheck/should_fail/T19978.stderr - testsuite/tests/typecheck/should_fail/T20043.stderr - testsuite/tests/typecheck/should_fail/T20768_fail.stderr - testsuite/tests/typecheck/should_fail/T20873c.stderr - testsuite/tests/typecheck/should_fail/T20873d.stderr - testsuite/tests/typecheck/should_fail/T21447.stderr - testsuite/tests/typecheck/should_fail/T22707.stderr - testsuite/tests/typecheck/should_fail/T23734.stderr - testsuite/tests/typecheck/should_fail/T23739b.stderr - testsuite/tests/typecheck/should_fail/T23739c.stderr - testsuite/tests/typecheck/should_fail/T23778.stderr - testsuite/tests/typecheck/should_fail/T24298.stderr - testsuite/tests/typecheck/should_fail/T24553.stderr - testsuite/tests/typecheck/should_fail/T24938.stderr - testsuite/tests/typecheck/should_fail/T5095.stderr - testsuite/tests/typecheck/should_fail/T7210.stderr - testsuite/tests/typecheck/should_fail/T8262.stderr - testsuite/tests/typecheck/should_fail/T8514.stderr - testsuite/tests/typecheck/should_fail/T9305.stderr - testsuite/tests/typecheck/should_fail/T9858a.stderr - testsuite/tests/typecheck/should_fail/UnliftedNewtypesFamilyKindFail2.stderr - testsuite/tests/typecheck/should_fail/UnliftedNewtypesInfinite.stderr - testsuite/tests/typecheck/should_fail/UnliftedNewtypesInstanceFail.stderr - testsuite/tests/typecheck/should_fail/UnliftedNewtypesNotEnabled.stderr - − testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.stderr - testsuite/tests/typecheck/should_fail/VisFlag2.stderr - testsuite/tests/typecheck/should_fail/VisFlag5.stderr - testsuite/tests/typecheck/should_fail/all.T - testsuite/tests/typecheck/should_fail/tcfail028.stderr - testsuite/tests/typecheck/should_fail/tcfail046.stderr - testsuite/tests/typecheck/should_fail/tcfail070.stderr - testsuite/tests/typecheck/should_fail/tcfail072.stderr - testsuite/tests/typecheck/should_fail/tcfail073.stderr - testsuite/tests/typecheck/should_fail/tcfail079.stderr - testsuite/tests/typecheck/should_fail/tcfail086.stderr - testsuite/tests/typecheck/should_fail/tcfail097.stderr - testsuite/tests/typecheck/should_fail/tcfail117.stderr - testsuite/tests/typecheck/should_fail/tcfail118.stderr - testsuite/tests/typecheck/should_fail/tcfail123.stderr - testsuite/tests/typecheck/should_fail/tcfail132.stderr - testsuite/tests/typecheck/should_fail/tcfail136.stderr - testsuite/tests/typecheck/should_fail/tcfail146.stderr - testsuite/tests/typecheck/should_fail/tcfail147.stderr - testsuite/tests/typecheck/should_fail/tcfail148.stderr - testsuite/tests/typecheck/should_fail/tcfail151.stderr - testsuite/tests/typecheck/should_fail/tcfail159.stderr - testsuite/tests/typecheck/should_fail/tcfail162.stderr - testsuite/tests/typecheck/should_fail/tcfail169.stderr - testsuite/tests/typecheck/should_fail/tcfail199.stderr - testsuite/tests/typecheck/should_fail/tcfail200.stderr - testsuite/tests/typecheck/should_fail/tcfail224.stderr - testsuite/tests/typecheck/should_run/T13838.stderr - testsuite/tests/typecheck/should_run/T22510.stdout - testsuite/tests/unboxedsums/T12711.stdout - testsuite/tests/unboxedsums/T20858.stdout - testsuite/tests/unboxedsums/T20858b.stdout - testsuite/tests/unlifted-datatypes/should_fail/UnlDataInvalidResKind1.stderr - testsuite/tests/unlifted-datatypes/should_run/all.T - testsuite/tests/unsatisfiable/T14339_Unsat.stderr - testsuite/tests/vdq-rta/should_compile/T22326_th_pprint1.stderr - testsuite/tests/warnings/should_compile/DerivingTypeable.stderr - testsuite/tests/warnings/should_compile/T15460.stderr-ws-32 - testsuite/tests/warnings/should_compile/T15460.stderr-ws-64 - testsuite/tests/warnings/should_compile/T19296.stderr - testsuite/tests/warnings/should_compile/T24396.stderr - testsuite/tests/wasm/should_run/control-flow/WasmControlFlow.hs - utils/genprimopcode/Main.hs - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/html-test/ref/Bug1004.html - utils/haddock/html-test/ref/Bug923.html - utils/haddock/html-test/ref/Instances.html - utils/hp2ps/Utilities.c - utils/jsffi/prelude.mjs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1d2aeaa17303e0b24decf525fe3340fec9e3404f...334872401112ac2e10002c4d73b845b221cdce1a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1d2aeaa17303e0b24decf525fe3340fec9e3404f...334872401112ac2e10002c4d73b845b221cdce1a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 06:29:00 2025 From: gitlab at gitlab.haskell.org (Luite Stegeman (@luite)) Date: Mon, 10 Feb 2025 01:29:00 -0500 Subject: [Git][ghc/ghc][wip/ubxsumtag] add some missing cases Message-ID: <67a99cac51200_33b78527690c41142a8@gitlab.mail> Luite Stegeman pushed to branch wip/ubxsumtag at Glasgow Haskell Compiler / GHC Commits: 91314118 by Luite Stegeman at 2025-02-10T15:28:34+09:00 add some missing cases - - - - - 1 changed file: - compiler/GHC/Cmm/Utils.hs Changes: ===================================== compiler/GHC/Cmm/Utils.hs ===================================== @@ -115,6 +115,9 @@ slotCmmType platform = \case PtrUnliftedSlot -> gcWord platform PtrLiftedSlot -> gcWord platform WordSlot -> bWord platform + Word8Slot -> b8 + Word16Slot -> b16 + Word32Slot -> b32 Word64Slot -> b64 FloatSlot -> f32 DoubleSlot -> f64 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/913141189720a2833db87bd66790323aa5f8221d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/913141189720a2833db87bd66790323aa5f8221d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 06:34:15 2025 From: gitlab at gitlab.haskell.org (Luite Stegeman (@luite)) Date: Mon, 10 Feb 2025 01:34:15 -0500 Subject: [Git][ghc/ghc][wip/ubxsumtag] remove some unused things Message-ID: <67a99de729d2_33b785293289c114522@gitlab.mail> Luite Stegeman pushed to branch wip/ubxsumtag at Glasgow Haskell Compiler / GHC Commits: 894c765f by Luite Stegeman at 2025-02-10T15:33:52+09:00 remove some unused things - - - - - 1 changed file: - compiler/GHC/Stg/Unarise.hs Changes: ===================================== compiler/GHC/Stg/Unarise.hs ===================================== @@ -404,7 +404,6 @@ import GHC.Stg.Syntax import GHC.Stg.Utils import GHC.Stg.Make import GHC.Core.Type -import GHC.Builtin.Types.Prim (intPrimTy) import GHC.Builtin.Types import GHC.Types.Unique.Supply import GHC.Types.Unique @@ -1195,9 +1194,6 @@ tagAltTy i tagTyArg :: StgArg -> Type tagTyArg x = stgArgType x -tagTy :: Id -> Type -tagTy i = idType i - voidArg :: StgArg voidArg = StgVarArg voidPrimId View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/894c765fc55bed150f32614ecd1042549a76c497 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/894c765fc55bed150f32614ecd1042549a76c497 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 08:21:41 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 10 Feb 2025 03:21:41 -0500 Subject: [Git][ghc/ghc][master] Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc. Message-ID: <67a9b7155e22f_33b7853a07aa0135241@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 52b6539b by M Farkas-Dyck at 2025-02-08T11:34:51-08:00 Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc. In particular, use `NonEmpty` where appropriate: - the argument of `FieldLabelString` - the argument of `HsMultiIf` - `grhssGRHSs` Decreases overall compile-time allocation by about 0.1% in the benchmark suite (min -0.8%, max +0.3%). Metric Decrease: T3294 - - - - - 48 changed files: - compiler/GHC/Core/UsageEnv.hs - + compiler/GHC/Data/List/NonEmpty.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Error/Codes.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - + testsuite/tests/th/EmptyGuard.hs - + testsuite/tests/th/EmptyGuard.stderr - testsuite/tests/th/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Transform.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/52b6539b5fbce27e0e8b4181bea333895e42128c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/52b6539b5fbce27e0e8b4181bea333895e42128c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 08:22:21 2025 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 10 Feb 2025 03:22:21 -0500 Subject: [Git][ghc/ghc][master] 3 commits: gitlab-ci: Bump docker images Message-ID: <67a9b73d58616_33b78539b22a813952b@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: a566da92 by Ben Gamari at 2025-02-10T03:21:49-05:00 gitlab-ci: Bump docker images Closes #25693. - - - - - a7e23f01 by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - 12752f0c by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 5 changed files: - .gitlab-ci.yml - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: eb4d3389fd62e4f7321a0c8799014ec1f4da0708 + DOCKER_REV: 94df7d589f0ded990826bc7a4d7f5a40d6055a4f # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. ===================================== hadrian/src/Hadrian/Utilities.hs ===================================== @@ -149,7 +149,10 @@ as /c/foo, while it occasionally falls over on paths of the form C:\foo. -- -- See Note [Absolute paths and MSYS]. (-/-) :: FilePath -> FilePath -> FilePath -_ -/- b | isAbsolute b && not (isAbsolute $ tail b) = b +_ -/- b + | isAbsolute b + , _:b' <- b + , not (isAbsolute b') = b "" -/- b = b a -/- b | last a == '/' = a ++ b @@ -636,7 +639,8 @@ renderLibrary name lib synopsis = renderBox $ -- | ipsum | -- \----------/ renderBox :: [String] -> String -renderBox ls = tail $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) +renderBox ls = + drop 1 $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot]) where -- Minimum total width of the box in characters minimumBoxWidth = 32 ===================================== hadrian/src/Oracles/ModuleFiles.hs ===================================== @@ -169,10 +169,12 @@ moduleFilesOracle = void $ do let pairs = sort $ mainpairs ++ [ (encodeModule d f, f) | (fs, d) <- result, f <- fs ] multi = [ (m, f1, f2) | (m, f1):(n, f2):_ <- tails pairs, m == n ] - unless (null multi) $ do - let (m, f1, f2) = head multi - error $ "Module " ++ m ++ " has more than one source file: " - ++ f1 ++ " and " ++ f2 ++ "." + + case multi of + [] -> return () + (m, f1, f2) : _ -> + fail $ "Module " ++ m ++ " has more than one source file: " + ++ f1 ++ " and " ++ f2 ++ "." return $ lookupAll modules pairs -- Optimisation: we discard Haskell files here, because they are never used ===================================== hadrian/src/Rules/Dependencies.hs ===================================== @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wno-deprecations #-} +{-# OPTIONS_GHC -Wno-x-data-list-nonempty-unzip #-} module Rules.Dependencies (buildPackageDependencies) where ===================================== hadrian/src/Settings/Parser.hs ===================================== @@ -184,14 +184,11 @@ instance Match SettingsM where matchStringSettingsM :: String -> SettingsM () matchStringSettingsM s = do ks <- State.get - if null ks - then throwError $ "expected " ++ show s ++ ", got nothing" - else go (head ks) - - where go k - | k == s = State.modify tail - | otherwise = throwError $ - "expected " ++ show s ++ ", got " ++ show k + case ks of + [] -> throwError $ "expected " ++ show s ++ ", got nothing" + k:_ + | k == s -> State.modify (drop 1) + | otherwise -> throwError $ "expected " ++ show s ++ ", got " ++ show k matchOneOfSettingsM :: [SettingsM a] -> SettingsM a matchOneOfSettingsM acts = StateT $ \k -> do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52b6539b5fbce27e0e8b4181bea333895e42128c...12752f0cfd8072cd6235f011bb22a5d3d6bc7dc6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52b6539b5fbce27e0e8b4181bea333895e42128c...12752f0cfd8072cd6235f011bb22a5d3d6bc7dc6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 09:47:32 2025 From: gitlab at gitlab.haskell.org (Luite Stegeman (@luite)) Date: Mon, 10 Feb 2025 04:47:32 -0500 Subject: [Git][ghc/ghc][wip/ubxsumtag] adjust T25166 and fixes for 32 bit Message-ID: <67a9cb3496c2c_131afacd3d4403e9@gitlab.mail> Luite Stegeman pushed to branch wip/ubxsumtag at Glasgow Haskell Compiler / GHC Commits: 3a1a1c90 by Luite Stegeman at 2025-02-10T10:46:41+01:00 adjust T25166 and fixes for 32 bit - - - - - 3 changed files: - compiler/GHC/Types/RepType.hs - testsuite/tests/codeGen/should_compile/T25166.stdout → testsuite/tests/codeGen/should_compile/T25166.stdout-ws-32 - + testsuite/tests/codeGen/should_compile/T25166.stdout-ws-64 Changes: ===================================== compiler/GHC/Types/RepType.hs ===================================== @@ -233,7 +233,8 @@ ubxSumRepType constrs0 -- constructors start at 1 (XXX is this correct?) tag_slot | length constrs0 < 256 = Word8Slot | length constrs0 < 65536 = Word16Slot - | length constrs0 < 4294967296 = Word32Slot +-- | length constrs0 < 4294967296 = Word32Slot + | length constrs0 < 2147483647 = Word32Slot -- XXX temporary for 32 bit platforms | otherwise = WordSlot sumRep = tag_slot :| combine_alts (map rep constrs0) ===================================== testsuite/tests/codeGen/should_compile/T25166.stdout → testsuite/tests/codeGen/should_compile/T25166.stdout-ws-32 ===================================== @@ -2,5 +2,7 @@ Test.foo_closure: const Test.D_con_info; const GHC.Internal.Types.True_closure+2; - const 2; + const 2 :: W8; + const 0 :: W16; + const 0 :: W8; const 3; ===================================== testsuite/tests/codeGen/should_compile/T25166.stdout-ws-64 ===================================== @@ -0,0 +1,9 @@ +[section ""data" . Test.foo_closure" { + Test.foo_closure: + const Test.D_con_info; + const GHC.Internal.Types.True_closure+2; + const 2 :: W8; + const 0 :: W32; + const 0 :: W16; + const 0 :: W8; + const 3; View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3a1a1c901cc537cec7d67c813f78e62c992a73c5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3a1a1c901cc537cec7d67c813f78e62c992a73c5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 10:36:50 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Mon, 10 Feb 2025 05:36:50 -0500 Subject: [Git][ghc/ghc][wip/T25647] remove NonStandardDefaultingStrategy Message-ID: <67a9d6c257be4_3ee18815768289ec@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: aa692f48 by Patrick at 2025-02-10T18:36:26+08:00 remove NonStandardDefaultingStrategy and update Note [NoDefTauTv] - - - - - 7 changed files: - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Rule.hs - compiler/GHC/Tc/Solver.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Types/Basic.hs Changes: ===================================== compiler/GHC/Tc/Gen/HsType.hs ===================================== @@ -2402,8 +2402,7 @@ kcCheckDeclHeader_cusk name flav -- skolemise and then quantify over. We do not include spec_req_tvs -- because they are /already/ skolems - ; inferred <- quantifyTyVars skol_info DefaultNonStandardTyVars $ - candidates `delCandidates` spec_req_tkvs + ; inferred <- quantifyTyVars skol_info $ candidates `delCandidates` spec_req_tkvs -- NB: 'inferred' comes back sorted in dependency order ; (scoped_kvs, tc_bndrs, res_kind) <- liftZonkM $ @@ -3765,7 +3764,7 @@ kindGeneralizeSome skol_info wanted kind_or_type vcat [ text "type:" <+> ppr kind_or_type , text "dvs:" <+> ppr dvs , text "filtered_dvs:" <+> ppr filtered_dvs ] - ; quantifyTyVars skol_info DefaultNonStandardTyVars filtered_dvs } + ; quantifyTyVars skol_info filtered_dvs } filterConstrainedCandidates :: WantedConstraints -- Don't quantify over variables free in these @@ -3793,7 +3792,7 @@ kindGeneralizeAll :: SkolemInfo -> TcType -> TcM [KindVar] kindGeneralizeAll skol_info kind_or_type = do { traceTc "kindGeneralizeAll" (ppr kind_or_type) ; dvs <- candidateQTyVarsOfKind kind_or_type - ; quantifyTyVars skol_info DefaultNonStandardTyVars dvs } + ; quantifyTyVars skol_info dvs } -- | Specialized version of 'kindGeneralizeSome', but where no variables -- can be generalized, but perhaps some may need to be promoted. ===================================== compiler/GHC/Tc/Gen/Rule.hs ===================================== @@ -35,7 +35,7 @@ import GHC.Core.Predicate import GHC.Types.Id import GHC.Types.Var( EvVar, tyVarName ) import GHC.Types.Var.Set -import GHC.Types.Basic ( RuleName, NonStandardDefaultingStrategy(..) ) +import GHC.Types.Basic ( RuleName ) import GHC.Types.SrcLoc import GHC.Utils.Outputable import GHC.Utils.Panic @@ -160,7 +160,7 @@ tcRule (HsRule { rd_ext = ext ; let weed_out = (`dVarSetMinusVarSet` dont_default) quant_cands = forall_tkvs { dv_kvs = weed_out (dv_kvs forall_tkvs) , dv_tvs = weed_out (dv_tvs forall_tkvs) } - ; qtkvs <- quantifyTyVars skol_info DefaultNonStandardTyVars quant_cands + ; qtkvs <- quantifyTyVars skol_info quant_cands ; traceTc "tcRule" (vcat [ pprFullRuleName (snd ext) rname , text "forall_tkvs:" <+> ppr forall_tkvs , text "quant_cands:" <+> ppr quant_cands ===================================== compiler/GHC/Tc/Solver.hs ===================================== @@ -909,7 +909,7 @@ simplifyInfer top_lvl rhs_tclvl infer_mode sigs name_taus wanteds ; dep_vars <- candidateQTyVarsOfTypes (psig_tv_tys ++ psig_theta ++ map snd name_taus) ; skol_info <- mkSkolemInfo (InferSkol name_taus) - ; qtkvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dep_vars + ; qtkvs <- quantifyTyVars skol_info dep_vars ; traceTc "simplifyInfer: empty WC" (ppr name_taus $$ ppr qtkvs) ; return (qtkvs, [], emptyTcEvBinds, False) } @@ -1795,7 +1795,7 @@ defaultTyVarsAndSimplify rhs_tclvl candidates ; poly_kinds <- xoptM LangExt.PolyKinds ; let default_kv | poly_kinds = default_tv | otherwise = defaultTyVar DefaultKindVars - default_tv = defaultTyVar (NonStandardDefaulting DefaultNonStandardTyVars) + default_tv = defaultTyVar NonStandardDefaulting ; mapM_ default_kv (dVarSetElems cand_kvs) ; mapM_ default_tv (dVarSetElems (cand_tvs `minusDVarSet` cand_kvs)) @@ -1857,7 +1857,7 @@ decideQuantifiedTyVars skol_info name_taus psigs candidates , text "grown_tcvs =" <+> ppr grown_tcvs , text "dvs =" <+> ppr dvs_plus]) - ; quantifyTyVars skol_info DefaultNonStandardTyVars dvs_plus } + ; quantifyTyVars skol_info dvs_plus } ------------------ getSeedTys :: [(Name,TcType)] -- The type of each RHS in the group ===================================== compiler/GHC/Tc/TyCl.hs ===================================== @@ -1101,7 +1101,7 @@ generaliseTcTyCon (tc, skol_info, scoped_prs, tc_res_kind) -- Step 2b: quantify, mainly meaning skolemise the free variables -- Returned 'inferred' are scope-sorted and skolemised - ; inferred <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs2 + ; inferred <- quantifyTyVars skol_info dvs2 ; traceTc "generaliseTcTyCon: pre zonk" (vcat [ text "tycon =" <+> ppr tc @@ -3451,7 +3451,7 @@ tcTyFamInstEqnGuts fam_tc mb_clsinfo outer_hs_bndrs hs_pats hs_rhs_ty -- See Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info dvs ; let final_tvs = scopedSort (qtvs ++ outer_tvs) -- This scopedSort is important: the qtvs may be /interleaved/ with -- the outer_tvs. See Note [Generalising in tcTyFamInstEqnGuts] ===================================== compiler/GHC/Tc/TyCl/Instance.hs ===================================== @@ -975,7 +975,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty - ; qtvs <- quantifyTyVars skol_info DefaultNonStandardTyVars dvs + ; qtvs <- quantifyTyVars skol_info dvs -- DefaultNonStandardTyVars: see (GT4) in -- GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -141,8 +141,7 @@ import GHC.Builtin.Types import GHC.Types.Var.Env import GHC.Types.Unique.Set import GHC.Types.Basic ( TypeOrKind(..) - , NonStandardDefaultingStrategy(..) - , DefaultingStrategy(..), defaultNonStandardTyVars ) + , DefaultingStrategy(..)) import GHC.Data.FastString import GHC.Data.Bag @@ -694,18 +693,50 @@ the thinking. ********************************************************************* -} {- Note [NoDefTauTv] -~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~ A NoDefTauTv behaves like a TauTv, except that it should not be defaulted. Making it more polymorphic than a TauTv which can be defaulted. -It is used for a anonymous wildcard in a type family, e.g. +It is used for a anonymous wildcard in a type family, e.g. from T25647a + + -- anonymous wildcards type Dix8 :: RuntimeRep -> Type data family Dix8 r newtype instance Dix8 _ = Dix8 Int - -We want to keep `_` polymorphic, so it behaves more like a named wildcard. - -NB. Should we default `_` if XNoPolyKind is on? + dix8 :: Dix8 FloatRep -> Int + dix8 (Dix8 x) = x + + -- named wildcards + type Dix9 :: RuntimeRep -> Type + data family Dix9 r + newtype instance Dix9 _r = Dix9 Int + dix9 :: Dix9 FloatRep -> Int + dix9 (Dix9 x) = x + +We would expect we accept both `Dix8 FloatRep` and `Dix9 FloatRep`, +when type checking data family instance header in `tcDataFamInstHeader`, +`_r` would be bind by bindOuterFamEqnTKBndrs as a skolem, while a `_` +is not in the bndrs and left to be handled by `tcAnonWildCardOcc` and +a fresh meta var would be introduced. But a TauTv would be defaulted +to `LiftedRep`, which is not what we want. + +Previously we are branching the defaulting strategy in `defaultTyVar` +in `tcDataFamInstHeader`, to avoid such defaulting. +(`TryNotToDefaultNonStandardTyVars` verse `DefaultNonStandardTyVars`). + +Such branching is too coarse, as we may want to default other type variables +while simultaneously preventing `_` from being defaulted. See (GT4) in GHC.Tc.TyCl, +Note [Generalising in tcTyFamInstEqnGuts]. + +A more philosophical perspective is that, in general, a TauTv is both defaultable +and unifiable. Defaultability makes it less polymorphic, while unifiability makes +it more polymorphic. In contrast, a skolem is neither defaultable nor unifiable. +In this sense, TauTv is simultaneously less polymorphic and more polymorphic than +a skolem. Meanwhile, NoDefTauTv can be strictly more polymorphic than a skolem. + +NoDefTauTv is introduced to solve this problem. + +NB. Should we default `_` in general if XNoPolyKind is on? -} {- Note [TyVarTv] @@ -1765,7 +1796,6 @@ Note [Deterministic UniqFM] in GHC.Types.Unique.DFM. -} quantifyTyVars :: SkolemInfo - -> NonStandardDefaultingStrategy -> CandidatesQTvs -- See Note [Dependent type variables] -- Already zonked -> TcM [TcTyVar] @@ -1776,7 +1806,7 @@ quantifyTyVars :: SkolemInfo -- invariants on CandidateQTvs, we do not have to filter out variables -- free in the environment here. Just quantify unconditionally, subject -- to the restrictions in Note [quantifyTyVars]. -quantifyTyVars skol_info ns_strat dvs +quantifyTyVars skol_info dvs -- short-circuit common case | isEmptyCandidates dvs = do { traceTc "quantifyTyVars has nothing to quantify" empty @@ -1784,10 +1814,9 @@ quantifyTyVars skol_info ns_strat dvs | otherwise = do { traceTc "quantifyTyVars {" - ( vcat [ text "ns_strat =" <+> ppr ns_strat - , text "dvs =" <+> ppr dvs ]) + ( vcat [ text "dvs =" <+> ppr dvs ]) - ; undefaulted <- defaultTyVars ns_strat dvs + ; undefaulted <- defaultTyVars dvs ; final_qtvs <- liftZonkM $ mapMaybeM zonk_quant undefaulted ; traceTc "quantifyTyVars }" @@ -1876,19 +1905,16 @@ defaultTyVar def_strat tv = return False | isRuntimeRepVar tv - , default_ns_vars = do { traceTc "Defaulting a RuntimeRep var to LiftedRep" (ppr tv) ; liftZonkM $ writeMetaTyVar tv liftedRepTy ; return True } | isLevityVar tv - , default_ns_vars = do { traceTc "Defaulting a Levity var to Lifted" (ppr tv) ; liftZonkM $ writeMetaTyVar tv liftedDataConTy ; return True } | isMultiplicityVar tv - , default_ns_vars = do { traceTc "Defaulting a Multiplicity var to Many" (ppr tv) ; liftZonkM $ writeMetaTyVar tv manyDataConTy ; return True } @@ -1911,8 +1937,6 @@ defaultTyVar def_strat tv = return False where - default_ns_vars :: Bool - default_ns_vars = defaultNonStandardTyVars def_strat default_kind_var :: TyVar -> TcM Bool -- defaultKindVar is used exclusively with -XNoPolyKinds -- See Note [Defaulting with -XNoPolyKinds] @@ -1943,14 +1967,13 @@ defaultTyVar def_strat tv -- - 'Multiplicity' tyvars default to 'Many' -- - 'Type' tyvars from dv_kvs default to 'Type', when -XNoPolyKinds -- (under -XNoPolyKinds, non-defaulting vars in dv_kvs is an error) -defaultTyVars :: NonStandardDefaultingStrategy - -> CandidatesQTvs -- ^ all candidates for quantification +defaultTyVars :: CandidatesQTvs -- ^ all candidates for quantification -> TcM [TcTyVar] -- ^ those variables not defaulted -defaultTyVars ns_strat dvs +defaultTyVars dvs = do { poly_kinds <- xoptM LangExt.PolyKinds ; let def_tvs, def_kvs :: DefaultingStrategy - def_tvs = NonStandardDefaulting ns_strat + def_tvs = NonStandardDefaulting def_kvs | poly_kinds = def_tvs | otherwise = DefaultKindVars -- As -XNoPolyKinds precludes polymorphic kind variables, we default them. @@ -2132,7 +2155,7 @@ doNotQuantifyTyVars dvs where_found | otherwise = do { traceTc "doNotQuantifyTyVars" (ppr dvs) - ; undefaulted <- defaultTyVars DefaultNonStandardTyVars dvs + ; undefaulted <- defaultTyVars dvs -- could have regular TyVars here, in an associated type RHS, or -- bound by a type declaration head. So filter looking only for -- metavars. e.g. b and c in `class (forall a. a b ~ a c) => C b c` ===================================== compiler/GHC/Types/Basic.hs ===================================== @@ -116,8 +116,7 @@ module GHC.Types.Basic ( TyConFlavour(..), TypeOrData(..), NewOrData(..), tyConFlavourAssoc_maybe, - NonStandardDefaultingStrategy(..), - DefaultingStrategy(..), defaultNonStandardTyVars, + DefaultingStrategy(..), ForeignSrcLang (..) ) where @@ -2334,19 +2333,6 @@ GHC.Iface.Type.defaultIfaceTyVarsOfKind -} --- | Specify whether to default type variables of kind 'RuntimeRep'/'Levity'/'Multiplicity'. -data NonStandardDefaultingStrategy - -- | Default type variables of the given kinds: - -- - -- - default 'RuntimeRep' variables to 'LiftedRep' - -- - default 'Levity' variables to 'Lifted' - -- - default 'Multiplicity' variables to 'Many' - = DefaultNonStandardTyVars - -- | Try not to default type variables of the kinds 'RuntimeRep'/'Levity'/'Multiplicity'. - -- - -- Note that these might get defaulted anyway, if they are kind variables - -- and `-XNoPolyKinds` is enabled. - | TryNotToDefaultNonStandardTyVars -- | Specify whether to default kind variables, and type variables -- of kind 'RuntimeRep'/'Levity'/'Multiplicity'. @@ -2362,19 +2348,12 @@ data DefaultingStrategy -- -- Usually, we pass this option when -XNoPolyKinds is enabled. = DefaultKindVars - -- | Default (or don't default) non-standard variables, of kinds + -- | Default non-standard variables, of kinds -- 'RuntimeRep', 'Levity' and 'Multiplicity'. - | NonStandardDefaulting NonStandardDefaultingStrategy + | NonStandardDefaulting -defaultNonStandardTyVars :: DefaultingStrategy -> Bool -defaultNonStandardTyVars DefaultKindVars = True -defaultNonStandardTyVars (NonStandardDefaulting DefaultNonStandardTyVars) = True -defaultNonStandardTyVars (NonStandardDefaulting TryNotToDefaultNonStandardTyVars) = False -instance Outputable NonStandardDefaultingStrategy where - ppr DefaultNonStandardTyVars = text "DefaultOnlyNonStandardTyVars" - ppr TryNotToDefaultNonStandardTyVars = text "TryNotToDefaultNonStandardTyVars" instance Outputable DefaultingStrategy where ppr DefaultKindVars = text "DefaultKindVars" - ppr (NonStandardDefaulting ns) = text "NonStandardDefaulting" <+> ppr ns + ppr NonStandardDefaulting = text "NonStandardDefaulting" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aa692f482f1b78783b19490fa34af084746773c2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aa692f482f1b78783b19490fa34af084746773c2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 10:50:50 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 10 Feb 2025 05:50:50 -0500 Subject: [Git][ghc/ghc][wip/specialise-assembler] 18 commits: perf: Replace uses of genericLength with strictGenericLength Message-ID: <67a9da0a26985_3ee18a84a6c33818@gitlab.mail> Matthew Pickering pushed to branch wip/specialise-assembler at Glasgow Haskell Compiler / GHC Commits: db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 52b6539b by M Farkas-Dyck at 2025-02-08T11:34:51-08:00 Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc. In particular, use `NonEmpty` where appropriate: - the argument of `FieldLabelString` - the argument of `HsMultiIf` - `grhssGRHSs` Decreases overall compile-time allocation by about 0.1% in the benchmark suite (min -0.8%, max +0.3%). Metric Decrease: T3294 - - - - - a566da92 by Ben Gamari at 2025-02-10T03:21:49-05:00 gitlab-ci: Bump docker images Closes #25693. - - - - - a7e23f01 by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - 12752f0c by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 151fc8ea by Sven Tennie at 2025-02-10T10:50:30+00:00 Do not deallocate stack for jump/switch table jumps Though the name is misleading, we consider them to be branching. For branch instructions we do not deallocate (parts of) the stack, but keep the stack pointer (sp) intact. - - - - - 02a02983 by Matthew Pickering at 2025-02-10T10:50:30+00:00 perf: Speed up the bytecode assembler This commit contains a number of optimisations to the bytecode assembler. In programs which generate a large amount of bytecode, the assembler is called a lot of times on many instructions. 1. Specialise the assembleI function for the two intepreters to avoid having to materialise the intermediate free-monad like structure. 2. Directly compute the UArray and SmallArray needed rather than going via the intermediate SizedSeq 3. Use optimised monads 4. Define unrolled "any" and "mapM6" functions which can be inlined and avoid calling recursive functions. The resulting generated code is much more direct. Before: ./ByteCodeAsm /home/matt/ghc-profiling-light/_build/stage1/lib/ +RTS -s 48,923,125,664 bytes allocated in the heap 678,221,152 bytes copied during GC 395,648 bytes maximum residency (2 sample(s)) 50,040 bytes maximum slop 6 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 11731 colls, 0 par 0.419s 0.425s 0.0000s 0.0004s Gen 1 2 colls, 0 par 0.001s 0.001s 0.0007s 0.0012s INIT time 0.000s ( 0.000s elapsed) MUT time 6.466s ( 6.484s elapsed) GC time 0.421s ( 0.426s elapsed) EXIT time 0.000s ( 0.000s elapsed) Total time 6.887s ( 6.910s elapsed) After: 1,518,321,200 bytes allocated in the heap 4,299,552 bytes copied during GC 322,288 bytes maximum residency (2 sample(s)) 50,280 bytes maximum slop 6 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 369 colls, 0 par 0.003s 0.003s 0.0000s 0.0002s Gen 1 2 colls, 0 par 0.001s 0.001s 0.0007s 0.0012s INIT time 0.001s ( 0.001s elapsed) MUT time 0.465s ( 0.466s elapsed) GC time 0.004s ( 0.004s elapsed) EXIT time 0.000s ( 0.000s elapsed) Total time 0.470s ( 0.471s elapsed) - - - - - 84 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - compiler/GHC.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/Core/UsageEnv.hs - compiler/GHC/Data/FlatBag.hs - + compiler/GHC/Data/List/NonEmpty.hs - compiler/GHC/Data/SmallArray.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Error/Codes.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/perf/compiler/hard_hole_fits.stderr - + testsuite/tests/perf/should_run/ByteCodeAsm.hs - testsuite/tests/perf/should_run/all.T - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - + testsuite/tests/th/EmptyGuard.hs - + testsuite/tests/th/EmptyGuard.stderr - testsuite/tests/th/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Transform.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2ec5a1a6079a96472af98d56d3bffaef85eabebf...02a0298369636c1a90e1d5199a58c51abc0df63d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2ec5a1a6079a96472af98d56d3bffaef85eabebf...02a0298369636c1a90e1d5199a58c51abc0df63d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 17:51:23 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 10 Feb 2025 12:51:23 -0500 Subject: [Git][ghc/ghc][wip/T25675] 25 commits: compiler: Always load GHC.Data.FastString optimised into GHCi Message-ID: <67aa3c9bd4169_13c48293e0b81073ca@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25675 at Glasgow Haskell Compiler / GHC Commits: 662645f0 by Matthew Pickering at 2025-02-03T11:44:41-05:00 compiler: Always load GHC.Data.FastString optimised into GHCi The FastString table is shared between the boot compiler and interpreted compiler. Therefore it's very important the representation of `FastString` matches in both cases. Otherwise, the interpreter will read a FastString from the shared variable but place the fields in the wrong place which leads to segfaults. Ideally this state would not be shared, but for now we can always compile both with `-O2` and this leads to a working interpreter. - - - - - 05e5785a by Peter Trommler at 2025-02-03T11:45:17-05:00 RTS: Fix compile on powerpc64 ELF v1 Cabal does not know about the different ABIs for powerpc64 and compiles StgCRunAsm.S unconditionally. The old make-based build system excluded this file from the build and it was OK to signal an error when it was compiled accidentally. With this patch we compile StgCRunAsm.S to an empty file, which fixes the build. Fixes #25700 - - - - - cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 52b6539b by M Farkas-Dyck at 2025-02-08T11:34:51-08:00 Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc. In particular, use `NonEmpty` where appropriate: - the argument of `FieldLabelString` - the argument of `HsMultiIf` - `grhssGRHSs` Decreases overall compile-time allocation by about 0.1% in the benchmark suite (min -0.8%, max +0.3%). Metric Decrease: T3294 - - - - - a566da92 by Ben Gamari at 2025-02-10T03:21:49-05:00 gitlab-ci: Bump docker images Closes #25693. - - - - - a7e23f01 by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - 12752f0c by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 15ea168b by Simon Peyton Jones at 2025-02-10T17:51:15+00:00 Deal correctly with Given CallStack constraints As #25675 showed, the CallStack solving mechanism was failing to account for Given CallStack constraints. This small patch fixes it and improves the Notes. - - - - - 95 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Core/UsageEnv.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Data/FastString.hs - + compiler/GHC/Data/List/NonEmpty.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Solver/Types.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Error/Codes.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c - rts/StgCRunAsm.S - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - + testsuite/tests/profiling/should_run/T25675.hs - + testsuite/tests/profiling/should_run/T25675.stdout - testsuite/tests/profiling/should_run/all.T - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - + testsuite/tests/th/EmptyGuard.hs - + testsuite/tests/th/EmptyGuard.stderr - testsuite/tests/th/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Transform.hs - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bcb23bb07d85b83ba055218c63a1c959ccc0e9db...15ea168bb642ad0bcf17776faf7a314be9fc70be -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bcb23bb07d85b83ba055218c63a1c959ccc0e9db...15ea168bb642ad0bcf17776faf7a314be9fc70be You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Feb 10 21:05:26 2025 From: gitlab at gitlab.haskell.org (Oleg Grenrus (@phadej)) Date: Mon, 10 Feb 2025 16:05:26 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/fix-whitespace Message-ID: <67aa6a16a41e8_1a1da6578cbc3597e@gitlab.mail> Oleg Grenrus pushed new branch wip/fix-whitespace at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/fix-whitespace You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 07:41:02 2025 From: gitlab at gitlab.haskell.org (Patrick (@soulomoon)) Date: Tue, 11 Feb 2025 02:41:02 -0500 Subject: [Git][ghc/ghc][wip/T25647] add DixC10 to T25647a Message-ID: <67aaff0e90968_33c0c19df4e01125f@gitlab.mail> Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC Commits: 724b546d by Patrick at 2025-02-11T15:40:52+08:00 add DixC10 to T25647a - - - - - 1 changed file: - testsuite/tests/typecheck/should_compile/T25647a.hs Changes: ===================================== testsuite/tests/typecheck/should_compile/T25647a.hs ===================================== @@ -90,3 +90,9 @@ newtype instance Dix9 _r = Dix9 Int dix9 :: Dix9 FloatRep -> Int dix9 (Dix9 x) = x + +-- anonymous wildcard should work +class DixC10 a where + type Dix10 a +instance DixC10 Int where + type Dix10 _ = Bool View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/724b546df82046b3d3cadcc93d8e53516cfe307b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/724b546df82046b3d3cadcc93d8e53516cfe307b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 08:06:01 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 11 Feb 2025 03:06:01 -0500 Subject: [Git][ghc/ghc][wip/specialise-assembler] perf: Speed up the bytecode assembler Message-ID: <67ab04e983fc_33c0c1e6f4c4136be@gitlab.mail> Matthew Pickering pushed to branch wip/specialise-assembler at Glasgow Haskell Compiler / GHC Commits: 0cffb607 by Matthew Pickering at 2025-02-11T08:05:43+00:00 perf: Speed up the bytecode assembler This commit contains a number of optimisations to the bytecode assembler. In programs which generate a large amount of bytecode, the assembler is called a lot of times on many instructions. 1. Specialise the assembleI function for the two intepreters to avoid having to materialise the intermediate free-monad like structure. 2. Directly compute the UArray and SmallArray needed rather than going via the intermediate SizedSeq 3. Use optimised monads 4. Define unrolled "any" and "mapM6" functions which can be inlined and avoid calling recursive functions. The resulting generated code is much more direct. Before: ./ByteCodeAsm /home/matt/ghc-profiling-light/_build/stage1/lib/ +RTS -s 48,923,125,664 bytes allocated in the heap 678,221,152 bytes copied during GC 395,648 bytes maximum residency (2 sample(s)) 50,040 bytes maximum slop 6 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 11731 colls, 0 par 0.419s 0.425s 0.0000s 0.0004s Gen 1 2 colls, 0 par 0.001s 0.001s 0.0007s 0.0012s INIT time 0.000s ( 0.000s elapsed) MUT time 6.466s ( 6.484s elapsed) GC time 0.421s ( 0.426s elapsed) EXIT time 0.000s ( 0.000s elapsed) Total time 6.887s ( 6.910s elapsed) After: 1,518,321,200 bytes allocated in the heap 4,299,552 bytes copied during GC 322,288 bytes maximum residency (2 sample(s)) 50,280 bytes maximum slop 6 MiB total memory in use (0 MiB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 369 colls, 0 par 0.003s 0.003s 0.0000s 0.0002s Gen 1 2 colls, 0 par 0.001s 0.001s 0.0007s 0.0012s INIT time 0.001s ( 0.001s elapsed) MUT time 0.465s ( 0.466s elapsed) GC time 0.004s ( 0.004s elapsed) EXIT time 0.000s ( 0.000s elapsed) Total time 0.470s ( 0.471s elapsed) - - - - - 7 changed files: - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Data/FlatBag.hs - compiler/GHC/Data/SmallArray.hs - + testsuite/tests/perf/should_run/ByteCodeAsm.hs - testsuite/tests/perf/should_run/all.T Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -1,8 +1,12 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +{-# LANGUAGE PatternSynonyms #-} {-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-} -- +-- -- (c) The University of Glasgow 2002-2006 -- @@ -12,10 +16,14 @@ module GHC.ByteCode.Asm ( bcoFreeNames, SizedSeq, sizeSS, ssElts, iNTERP_STACK_CHECK_THRESH, - mkNativeCallInfoLit + mkNativeCallInfoLit, + + -- * For testing + assembleBCO ) where -import GHC.Prelude +import GHC.Prelude hiding ( any ) + import GHC.ByteCode.Instr import GHC.ByteCode.InfoTable @@ -29,12 +37,14 @@ import GHC.Types.Name.Set import GHC.Types.Literal import GHC.Types.Unique.DSet import GHC.Types.SptEntry +import GHC.Types.Unique.FM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Core.TyCon import GHC.Data.SizedSeq +import GHC.Data.SmallArray import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.Cmm.Expr @@ -44,19 +54,25 @@ import GHC.Platform import GHC.Platform.Profile import Control.Monad -import Control.Monad.Trans.Class -import Control.Monad.Trans.State.Strict +import qualified Control.Monad.Trans.State.Strict as MTL import qualified Data.Array.Unboxed as Array -import Data.Array.Base ( UArray(..) ) +import qualified Data.Array.IO as Array +import Data.Array.Base ( UArray(..), numElements, unsafeFreeze ) + +#if ! defined(DEBUG) +import Data.Array.Base ( unsafeWrite ) +#endif import Foreign hiding (shiftL, shiftR) -import Data.Char ( ord ) -import Data.Map.Strict (Map) +import Data.Char (ord) import Data.Maybe (fromMaybe) -import qualified Data.Map.Strict as Map import GHC.Float (castFloatToWord32, castDoubleToWord64) +import qualified Data.List as List ( any ) +import GHC.Exts + + -- ----------------------------------------------------------------------------- -- Unlinked BCOs @@ -133,9 +149,9 @@ assembleBCOs interp profile proto_bcos tycons top_strs modbreaks spt_entries = d -- mallocStrings :: Interp -> FlatBag UnlinkedBCO -> IO (FlatBag UnlinkedBCO) mallocStrings interp ulbcos = do - let bytestrings = reverse (execState (mapM_ collect ulbcos) []) + let bytestrings = reverse (MTL.execState (mapM_ collect ulbcos) []) ptrs <- interpCmd interp (MallocStrings bytestrings) - return (evalState (mapM splice ulbcos) ptrs) + return (MTL.evalState (mapM splice ulbcos) ptrs) where splice bco at UnlinkedBCO{..} = do lits <- mapM spliceLit unlinkedBCOLits @@ -143,10 +159,10 @@ mallocStrings interp ulbcos = do return bco { unlinkedBCOLits = lits, unlinkedBCOPtrs = ptrs } spliceLit (BCONPtrStr _) = do - rptrs <- get + rptrs <- MTL.get case rptrs of (RemotePtr p : rest) -> do - put rest + MTL.put rest return (BCONPtrWord (fromIntegral p)) _ -> panic "mallocStrings:spliceLit" spliceLit other = return other @@ -159,13 +175,61 @@ mallocStrings interp ulbcos = do mapM_ collectPtr unlinkedBCOPtrs collectLit (BCONPtrStr bs) = do - strs <- get - put (bs:strs) + strs <- MTL.get + MTL.put (bs:strs) collectLit _ = return () collectPtr (BCOPtrBCO bco) = collect bco collectPtr _ = return () +data RunAsmReader = RunAsmReader { isn_array :: {-# UNPACK #-} !(Array.IOUArray Int Word16) + , ptr_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCOPtr) + , lit_array :: {-# UNPACK #-} !(SmallMutableArrayIO BCONPtr ) + } + +data RunAsmResult = RunAsmResult { final_isn_array :: !(Array.UArray Int Word16) + , final_ptr_array :: !(SmallArray BCOPtr) + , final_lit_array :: !(SmallArray BCONPtr) } + +-- How many words we have written so far. +data AsmState = AsmState { nisn :: !Int, nptr :: !Int, nlit :: !Int } + + +{-# NOINLINE inspectInstrs #-} +-- | Perform analysis of the bytecode to determine +-- 1. How many instructions we will produce +-- 2. If we are going to need long jumps. +-- 3. The offsets that labels refer to +inspectInstrs :: Platform -> Bool -> Word -> [BCInstr] -> InspectState +inspectInstrs platform long_jump e instrs = + inspectAsm long_jump e (mapM_ (assembleInspectAsm platform) instrs) + +{-# NOINLINE runInstrs #-} +-- | Assemble the bytecode from the instructions. +runInstrs :: Platform -> Bool -> InspectState -> [BCInstr] -> IO RunAsmResult +runInstrs platform long_jumps is_state instrs = do + -- Produce arrays of exactly the right size, corresponding to the result of inspectInstrs. + isn_array <- Array.newArray_ (0, (fromIntegral $ instrCount is_state) - 1) + ptr_array <- newSmallArrayIO (fromIntegral $ ptrCount is_state) undefined + lit_array <- newSmallArrayIO (fromIntegral $ litCount is_state) undefined + let env :: LocalLabel -> Word + env lbl = fromMaybe + (pprPanic "assembleBCO.findLabel" (ppr lbl)) + (lookupUFM (lblEnv is_state) lbl) + let initial_state = AsmState 0 0 0 + let initial_reader = RunAsmReader{..} + runAsm long_jumps env initial_reader initial_state (mapM_ (\i -> assembleRunAsm platform i) instrs) + final_isn_array <- unsafeFreeze isn_array + final_ptr_array <- unsafeFreezeSmallArrayIO ptr_array + final_lit_array <- unsafeFreezeSmallArrayIO lit_array + return $ RunAsmResult {..} + +assembleRunAsm :: Platform -> BCInstr -> RunAsm () +assembleRunAsm p i = assembleI @RunAsm p i + +assembleInspectAsm :: Platform -> BCInstr -> InspectAsm () +assembleInspectAsm p i = assembleI @InspectAsm p i + assembleBCO :: Platform -> ProtoBCO Name -> IO UnlinkedBCO assembleBCO platform (ProtoBCO { protoBCOName = nm @@ -174,9 +238,7 @@ assembleBCO platform , protoBCOBitmapSize = bsize , protoBCOArity = arity }) = do -- pass 1: collect up the offsets of the local labels. - let asm = mapM_ (assembleI platform) instrs - - initial_offset = 0 + let initial_offset = 0 -- Jump instructions are variable-sized, there are long and short variants -- depending on the magnitude of the offset. However, we can't tell what @@ -186,30 +248,25 @@ assembleBCO platform -- and if the final size is indeed small enough for short jumps, we are -- done. Otherwise, we repeat the calculation, and we force all jumps in -- this BCO to be long. - (n_insns0, lbl_map0) = inspectAsm platform False initial_offset asm - ((n_insns, lbl_map), long_jumps) - | isLargeW (fromIntegral $ Map.size lbl_map0) - || isLargeW n_insns0 - = (inspectAsm platform True initial_offset asm, True) - | otherwise = ((n_insns0, lbl_map0), False) - - env :: LocalLabel -> Word - env lbl = fromMaybe - (pprPanic "assembleBCO.findLabel" (ppr lbl)) - (Map.lookup lbl lbl_map) + is0 = inspectInstrs platform False initial_offset instrs + (is1, long_jumps) + | isLargeInspectState is0 + = (inspectInstrs platform True initial_offset instrs, True) + | otherwise = (is0, False) + -- pass 2: run assembler and generate instructions, literals and pointers - let initial_state = (emptySS, emptySS, emptySS) - (final_insns, final_lits, final_ptrs) <- flip execStateT initial_state $ runAsm platform long_jumps env asm + RunAsmResult{..} <- runInstrs platform long_jumps is1 instrs -- precomputed size should be equal to final size - massertPpr (n_insns == sizeSS final_insns) + massertPpr (fromIntegral (instrCount is1) == numElements final_isn_array + && fromIntegral (ptrCount is1) == sizeofSmallArray final_ptr_array + && fromIntegral (litCount is1) == sizeofSmallArray final_lit_array) (text "bytecode instruction count mismatch") - let asm_insns = ssElts final_insns - !insns_arr = mkBCOByteArray $ Array.listArray (0 :: Int, fromIntegral n_insns - 1) asm_insns + let !insns_arr = mkBCOByteArray $ final_isn_array !bitmap_arr = mkBCOByteArray $ mkBitmapArray bsize bitmap - ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSizedSeq final_lits) (fromSizedSeq final_ptrs) + ul_bco = UnlinkedBCO nm arity insns_arr bitmap_arr (fromSmallArray final_lit_array) (fromSmallArray final_ptr_array) -- 8 Aug 01: Finalisers aren't safe when attached to non-primitive -- objects, since they might get run too early. Disable this until @@ -226,10 +283,6 @@ mkBitmapArray bsize bitmap = Array.listArray (0, length bitmap) $ fromIntegral bsize : map (fromInteger . fromStgWord) bitmap --- instrs nonptrs ptrs -type AsmState = (SizedSeq Word16, - SizedSeq BCONPtr, - SizedSeq BCOPtr) data Operand = Op Word @@ -249,39 +302,9 @@ truncHalfWord platform w = case platformWordSize platform of PW8 | w <= 4294967295 -> Op (fromIntegral w) _ -> pprPanic "GHC.ByteCode.Asm.truncHalfWord" (ppr w) -data Assembler a - = AllocPtr (IO BCOPtr) (Word -> Assembler a) - | AllocLit [BCONPtr] (Word -> Assembler a) - | AllocLabel LocalLabel (Assembler a) - | Emit Word16 [Operand] (Assembler a) - | NullAsm a - deriving (Functor) - -instance Applicative Assembler where - pure = NullAsm - (<*>) = ap - -instance Monad Assembler where - NullAsm x >>= f = f x - AllocPtr p k >>= f = AllocPtr p (k >=> f) - AllocLit l k >>= f = AllocLit l (k >=> f) - AllocLabel lbl k >>= f = AllocLabel lbl (k >>= f) - Emit w ops k >>= f = Emit w ops (k >>= f) - -ioptr :: IO BCOPtr -> Assembler Word -ioptr p = AllocPtr p return - -ptr :: BCOPtr -> Assembler Word -ptr = ioptr . return - -lit :: [BCONPtr] -> Assembler Word -lit l = AllocLit l return -label :: LocalLabel -> Assembler () -label w = AllocLabel w (return ()) - -emit :: Word16 -> [Operand] -> Assembler () -emit w ops = Emit w ops (return ()) +ptr :: MonadAssembler m => BCOPtr -> m Word +ptr = ioptr . return type LabelEnv = LocalLabel -> Word @@ -292,38 +315,142 @@ largeOp long_jumps op = case op of IOp i -> isLargeI i LabelOp _ -> long_jumps -runAsm :: Platform -> Bool -> LabelEnv -> Assembler a -> StateT AsmState IO a -runAsm platform long_jumps e = go +newtype RunAsm a = RunAsm' { runRunAsm :: Bool + -> LabelEnv + -> RunAsmReader + -> AsmState + -> IO (AsmState, a) } + +pattern RunAsm :: (Bool -> LabelEnv -> RunAsmReader -> AsmState -> IO (AsmState, a)) + -> RunAsm a +pattern RunAsm m <- RunAsm' m where - go (NullAsm x) = return x - go (AllocPtr p_io k) = do - p <- lift p_io - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_p1 = addToSS st_p0 p - in (sizeSS st_p0, (st_i0,st_l0,st_p1)) - go $ k w - go (AllocLit lits k) = do - w <- state $ \(st_i0,st_l0,st_p0) -> - let st_l1 = addListToSS st_l0 lits - in (sizeSS st_l0, (st_i0,st_l1,st_p0)) - go $ k w - go (AllocLabel _ k) = go k - go (Emit w ops k) = do - let largeArgs = any (largeOp long_jumps) ops - opcode - | largeArgs = largeArgInstr w - | otherwise = w - words = concatMap expand ops - expand (SmallOp w) = [w] - expand (LabelOp w) = expand (Op (e w)) - expand (Op w) = if largeArgs then largeArg platform (fromIntegral w) else [fromIntegral w] - expand (IOp i) = if largeArgs then largeArg platform (fromIntegral i) else [fromIntegral i] - state $ \(st_i0,st_l0,st_p0) -> - let st_i1 = addListToSS st_i0 (opcode : words) - in ((), (st_i1,st_l0,st_p0)) - go k - -type LabelEnvMap = Map LocalLabel Word + RunAsm m = RunAsm' (oneShot $ \a -> oneShot $ \b -> oneShot $ \c -> oneShot $ \d -> m a b c d) +{-# COMPLETE RunAsm #-} + +instance Functor RunAsm where + fmap f (RunAsm x) = RunAsm (\a b c !s -> fmap (fmap f) (x a b c s)) + +instance Applicative RunAsm where + pure x = RunAsm $ \_ _ _ !s -> pure (s, x) + (RunAsm f) <*> (RunAsm x) = RunAsm $ \a b c !s -> do + (!s', f') <- f a b c s + (!s'', x') <- x a b c s' + return (s'', f' x') + {-# INLINE (<*>) #-} + + +instance Monad RunAsm where + return = pure + (RunAsm m) >>= f = RunAsm $ \a b c !s -> m a b c s >>= \(s', r) -> runRunAsm (f r) a b c s' + {-# INLINE (>>=) #-} + +runAsm :: Bool -> LabelEnv -> RunAsmReader -> AsmState -> RunAsm a -> IO a +runAsm long_jumps e r s (RunAsm'{runRunAsm}) = fmap snd $ runRunAsm long_jumps e r s + +expand :: PlatformWordSize -> Bool -> Operand -> RunAsm () +expand word_size largeArgs o = do + e <- askEnv + case o of + (SmallOp w) -> writeIsn w + (LabelOp w) -> let !r = e w in handleLargeArg r + (Op w) -> handleLargeArg w + (IOp i) -> handleLargeArg i + + where + handleLargeArg :: Integral a => a -> RunAsm () + handleLargeArg w = + if largeArgs + then largeArg word_size (fromIntegral w) + else writeIsn (fromIntegral w) + +lift :: IO a -> RunAsm a +lift io = RunAsm $ \_ _ _ s -> io >>= \a -> pure (s, a) + +askLongJumps :: RunAsm Bool +askLongJumps = RunAsm $ \a _ _ s -> pure (s, a) + +askEnv :: RunAsm LabelEnv +askEnv = RunAsm $ \_ b _ s -> pure (s, b) + +writePtr :: BCOPtr -> RunAsm Word +writePtr w + = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO ptr_array (nptr asm) w + let !n' = nptr asm + 1 + let !asm' = asm { nptr = n' } + return (asm', fromIntegral (nptr asm)) + +writeLit :: BCONPtr -> RunAsm Word +writeLit w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do + writeSmallArrayIO lit_array (nlit asm) w + let !n' = nlit asm + 1 + let !asm' = asm { nlit = n' } + return (asm', fromIntegral (nlit asm)) + +writeLits :: OneOrTwo BCONPtr -> RunAsm Word +writeLits (OnlyOne l) = writeLit l +writeLits (OnlyTwo l1 l2) = writeLit l1 <* writeLit l2 + +writeIsn :: Word16 -> RunAsm () +writeIsn w = RunAsm $ \_ _ (RunAsmReader{..}) asm -> do +#if defined(DEBUG) + Array.writeArray isn_array (nisn asm) w +#else + unsafeWrite isn_array (nisn asm) w +#endif + let !n' = nisn asm + 1 + let !asm' = asm { nisn = n' } + return (asm', ()) + +{-# INLINE any #-} +-- Any is unrolled manually so that the call in `emit` can be eliminated without +-- relying on SpecConstr (which does not work across modules). +any :: (a -> Bool) -> [a] -> Bool +any _ [] = False +any f [x] = f x +any f [x,y] = f x || f y +any f [x,y,z] = f x || f y || f z +any f [x1,x2,x3,x4] = f x1 || f x2 || f x3 || f x4 +any f [x1,x2,x3,x4, x5] = f x1 || f x2 || f x3 || f x4 || f x5 +any f [x1,x2,x3,x4,x5,x6] = f x1 || f x2 || f x3 || f x4 || f x5 || f x6 +any f xs = List.any f xs + +{-# INLINE mapM6_ #-} +mapM6_ :: Monad m => (a -> m b) -> [a] -> m () +mapM6_ _ [] = return () +mapM6_ f [x] = () <$ f x +mapM6_ f [x,y] = () <$ f x <* f y +mapM6_ f [x,y,z] = () <$ f x <* f y <* f z +mapM6_ f [a1,a2,a3,a4] = () <$ f a1 <* f a2 <* f a3 <* f a4 +mapM6_ f [a1,a2,a3,a4,a5] = () <$ f a1 <* f a2 <* f a3 <* f a4 <* f a5 +mapM6_ f [a1,a2,a3,a4,a5,a6] = () <$ f a1 <* f a2 <* f a3 <* f a4 <* f a5 <* f a6 +mapM6_ f xs = mapM_ f xs + +instance MonadAssembler RunAsm where + ioptr p_io = do + p <- lift p_io + writePtr p + lit lits = writeLits lits + + label _ = return () + + emit pwordsize w ops = do + long_jumps <- askLongJumps + -- See the definition of `any` above + let largeArgs = any (largeOp long_jumps) ops + let opcode + | largeArgs = largeArgInstr w + | otherwise = w + writeIsn opcode + mapM6_ (expand pwordsize largeArgs) ops + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + +type LabelEnvMap = UniqFM LocalLabel Word data InspectState = InspectState { instrCount :: !Word @@ -332,27 +459,105 @@ data InspectState = InspectState , lblEnv :: LabelEnvMap } +instance Outputable InspectState where + ppr (InspectState i p l m) = text "InspectState" <+> ppr [ppr i, ppr p, ppr l, ppr (sizeUFM m)] + +isLargeInspectState :: InspectState -> Bool +isLargeInspectState InspectState{..} = + isLargeW (fromIntegral $ sizeUFM lblEnv) + || isLargeW instrCount -inspectAsm :: Platform -> Bool -> Word -> Assembler a -> (Word, LabelEnvMap) -inspectAsm platform long_jumps initial_offset - = go (InspectState initial_offset 0 0 Map.empty) +newtype InspectEnv = InspectEnv { _inspectLongJumps :: Bool + } + +newtype InspectAsm a = InspectAsm' { runInspectAsm :: InspectEnv -> InspectState -> (# InspectState, a #) } + +pattern InspectAsm :: (InspectEnv -> InspectState -> (# InspectState, a #)) + -> InspectAsm a +pattern InspectAsm m <- InspectAsm' m where - go s (NullAsm _) = (instrCount s, lblEnv s) - go s (AllocPtr _ k) = go (s { ptrCount = n + 1 }) (k n) - where n = ptrCount s - go s (AllocLit ls k) = go (s { litCount = n + strictGenericLength ls }) (k n) - where n = litCount s - go s (AllocLabel lbl k) = go s' k - where s' = s { lblEnv = Map.insert lbl (instrCount s) (lblEnv s) } - go s (Emit _ ops k) = go s' k - where - s' = s { instrCount = instrCount s + size } - size = sum (map count ops) + 1 + InspectAsm m = InspectAsm' (oneShot $ \a -> oneShot $ \b -> m a b) +{-# COMPLETE InspectAsm #-} + +instance Functor InspectAsm where + fmap f (InspectAsm k) = InspectAsm $ \a b -> case k a b of + (# b', c #) -> (# b', f c #) + +instance Applicative InspectAsm where + pure x = InspectAsm $ \_ s -> (# s, x #) + (InspectAsm f) <*> (InspectAsm x) = InspectAsm $ \a b -> case f a b of + (# s', f' #) -> + case x a s' of + (# s'', x' #) -> (# s'', f' x' #) + +instance Monad InspectAsm where + return = pure + (InspectAsm m) >>= f = InspectAsm $ \ a b -> case m a b of + (# s', a' #) -> runInspectAsm (f a') a s' + +get_ :: InspectAsm InspectState +get_ = InspectAsm $ \_ b -> (# b, b #) + +put_ :: InspectState -> InspectAsm () +put_ !s = InspectAsm $ \_ _ -> (# s, () #) + +modify_ :: (InspectState -> InspectState) -> InspectAsm () +modify_ f = InspectAsm $ \_ s -> let !s' = f s in (# s', () #) + +ask_ :: InspectAsm InspectEnv +ask_ = InspectAsm $ \a b -> (# b, a #) + +inspectAsm :: Bool -> Word -> InspectAsm () -> InspectState +inspectAsm long_jumps initial_offset (InspectAsm s) = + case s (InspectEnv long_jumps) (InspectState initial_offset 0 0 emptyUFM) of + (# res, () #) -> res +{-# INLINE inspectAsm #-} + + + +instance MonadAssembler InspectAsm where + ioptr _ = do + s <- get_ + let n = ptrCount s + put_ (s { ptrCount = n + 1 }) + return n + + lit ls = do + s <- get_ + let n = litCount s + put_ (s { litCount = n + oneTwoLength ls }) + return n + + label lbl = modify_ (\s -> let !count = instrCount s in let !env' = addToUFM (lblEnv s) lbl count in s { lblEnv = env' }) + + emit pwordsize _ ops = do + InspectEnv long_jumps <- ask_ + -- Size is written in this way as `mapM6_` is also used by RunAsm, and guaranteed + -- to unroll for arguments up to size 6. + let size = (MTL.execState (mapM6_ (\x -> MTL.modify (count' x +)) ops) 0) + 1 largeOps = any (largeOp long_jumps) ops - count (SmallOp _) = 1 - count (LabelOp _) = count (Op 0) - count (Op _) = if largeOps then largeArg16s platform else 1 - count (IOp _) = if largeOps then largeArg16s platform else 1 + bigSize = largeArg16s pwordsize + count' = if largeOps then countLarge bigSize else countSmall bigSize + + s <- get_ + put_ (s { instrCount = instrCount s + size }) + + {-# INLINE emit #-} + {-# INLINE label #-} + {-# INLINE lit #-} + {-# INLINE ioptr #-} + +count :: Word -> Bool -> Operand -> Word +count _ _ (SmallOp _) = 1 +count big largeOps (LabelOp _) = if largeOps then big else 1 +count big largeOps (Op _) = if largeOps then big else 1 +count big largeOps (IOp _) = if largeOps then big else 1 +{-# INLINE count #-} + +countSmall, countLarge :: Word -> Operand -> Word +countLarge big x = count big True x +countSmall big x = count big False x + -- Bring in all the bci_ bytecode constants. #include "Bytecodes.h" @@ -360,47 +565,67 @@ inspectAsm platform long_jumps initial_offset largeArgInstr :: Word16 -> Word16 largeArgInstr bci = bci_FLAG_LARGE_ARGS .|. bci -largeArg :: Platform -> Word64 -> [Word16] -largeArg platform w = case platformWordSize platform of - PW8 -> [fromIntegral (w `shiftR` 48), - fromIntegral (w `shiftR` 32), - fromIntegral (w `shiftR` 16), - fromIntegral w] +{-# INLINE largeArg #-} +largeArg :: PlatformWordSize -> Word64 -> RunAsm () +largeArg wsize w = case wsize of + PW8 -> do writeIsn (fromIntegral (w `shiftR` 48)) + writeIsn (fromIntegral (w `shiftR` 32)) + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) PW4 -> assertPpr (w < fromIntegral (maxBound :: Word32)) - (text "largeArg too big:" <+> ppr w) $ - [fromIntegral (w `shiftR` 16), - fromIntegral w] + (text "largeArg too big:" <+> ppr w) $ do + writeIsn (fromIntegral (w `shiftR` 16)) + writeIsn (fromIntegral w) -largeArg16s :: Platform -> Word -largeArg16s platform = case platformWordSize platform of +largeArg16s :: PlatformWordSize -> Word +largeArg16s pwordsize = case pwordsize of PW8 -> 4 PW4 -> 2 -assembleI :: Platform +data OneOrTwo a = OnlyOne a | OnlyTwo a a deriving (Functor) + +oneTwoLength :: OneOrTwo a -> Word +oneTwoLength (OnlyOne {}) = 1 +oneTwoLength (OnlyTwo {}) = 2 + +class Monad m => MonadAssembler m where + ioptr :: IO BCOPtr -> m Word + lit :: OneOrTwo BCONPtr -> m Word + label :: LocalLabel -> m () + emit :: PlatformWordSize -> Word16 -> [Operand] -> m () + +lit1 :: MonadAssembler m => BCONPtr -> m Word +lit1 p = lit (OnlyOne p) + +{-# SPECIALISE assembleI :: Platform -> BCInstr -> InspectAsm () #-} +{-# SPECIALISE assembleI :: Platform -> BCInstr -> RunAsm () #-} + +assembleI :: forall m . MonadAssembler m + => Platform -> BCInstr - -> Assembler () + -> m () assembleI platform i = case i of - STKCHECK n -> emit bci_STKCHECK [Op n] - PUSH_L o1 -> emit bci_PUSH_L [wOp o1] - PUSH_LL o1 o2 -> emit bci_PUSH_LL [wOp o1, wOp o2] - PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] - PUSH8 o1 -> emit bci_PUSH8 [bOp o1] - PUSH16 o1 -> emit bci_PUSH16 [bOp o1] - PUSH32 o1 -> emit bci_PUSH32 [bOp o1] - PUSH8_W o1 -> emit bci_PUSH8_W [bOp o1] - PUSH16_W o1 -> emit bci_PUSH16_W [bOp o1] - PUSH32_W o1 -> emit bci_PUSH32_W [bOp o1] + STKCHECK n -> emit_ bci_STKCHECK [Op n] + PUSH_L o1 -> emit_ bci_PUSH_L [wOp o1] + PUSH_LL o1 o2 -> emit_ bci_PUSH_LL [wOp o1, wOp o2] + PUSH_LLL o1 o2 o3 -> emit_ bci_PUSH_LLL [wOp o1, wOp o2, wOp o3] + PUSH8 o1 -> emit_ bci_PUSH8 [bOp o1] + PUSH16 o1 -> emit_ bci_PUSH16 [bOp o1] + PUSH32 o1 -> emit_ bci_PUSH32 [bOp o1] + PUSH8_W o1 -> emit_ bci_PUSH8_W [bOp o1] + PUSH16_W o1 -> emit_ bci_PUSH16_W [bOp o1] + PUSH32_W o1 -> emit_ bci_PUSH32_W [bOp o1] PUSH_G nm -> do p <- ptr (BCOPtrName nm) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_BCO proto -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit bci_PUSH_G [Op p] + emit_ bci_PUSH_G [Op p] PUSH_ALTS proto pk -> do let ul_bco = assembleBCO platform proto p <- ioptr (liftM BCOPtrBCO ul_bco) - emit (push_alts pk) [Op p] + emit_ (push_alts pk) [Op p] PUSH_ALTS_TUPLE proto call_info tuple_proto -> do let ul_bco = assembleBCO platform proto ul_tuple_bco = assembleBCO platform @@ -409,127 +634,131 @@ assembleI platform i = case i of p_tup <- ioptr (liftM BCOPtrBCO ul_tuple_bco) info <- word (fromIntegral $ mkNativeCallInfoSig platform call_info) - emit bci_PUSH_ALTS_T + emit_ bci_PUSH_ALTS_T [Op p, Op info, Op p_tup] - PUSH_PAD8 -> emit bci_PUSH_PAD8 [] - PUSH_PAD16 -> emit bci_PUSH_PAD16 [] - PUSH_PAD32 -> emit bci_PUSH_PAD32 [] + PUSH_PAD8 -> emit_ bci_PUSH_PAD8 [] + PUSH_PAD16 -> emit_ bci_PUSH_PAD16 [] + PUSH_PAD32 -> emit_ bci_PUSH_PAD32 [] PUSH_UBX8 lit -> do np <- literal lit - emit bci_PUSH_UBX8 [Op np] + emit_ bci_PUSH_UBX8 [Op np] PUSH_UBX16 lit -> do np <- literal lit - emit bci_PUSH_UBX16 [Op np] + emit_ bci_PUSH_UBX16 [Op np] PUSH_UBX32 lit -> do np <- literal lit - emit bci_PUSH_UBX32 [Op np] + emit_ bci_PUSH_UBX32 [Op np] PUSH_UBX lit nws -> do np <- literal lit - emit bci_PUSH_UBX [Op np, wOp nws] - + emit_ bci_PUSH_UBX [Op np, wOp nws] -- see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode - PUSH_ADDR nm -> do np <- lit [BCONPtrAddr nm] - emit bci_PUSH_UBX [Op np, SmallOp 1] - - PUSH_APPLY_N -> emit bci_PUSH_APPLY_N [] - PUSH_APPLY_V -> emit bci_PUSH_APPLY_V [] - PUSH_APPLY_F -> emit bci_PUSH_APPLY_F [] - PUSH_APPLY_D -> emit bci_PUSH_APPLY_D [] - PUSH_APPLY_L -> emit bci_PUSH_APPLY_L [] - PUSH_APPLY_P -> emit bci_PUSH_APPLY_P [] - PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP [] - PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP [] - PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP [] - PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP [] - PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP [] - - SLIDE n by -> emit bci_SLIDE [wOp n, wOp by] - ALLOC_AP n -> emit bci_ALLOC_AP [truncHalfWord platform n] - ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [truncHalfWord platform n] - ALLOC_PAP arity n -> emit bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] - MKAP off sz -> emit bci_MKAP [wOp off, truncHalfWord platform sz] - MKPAP off sz -> emit bci_MKPAP [wOp off, truncHalfWord platform sz] - UNPACK n -> emit bci_UNPACK [wOp n] - PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)] - emit bci_PACK [Op itbl_no, wOp sz] + PUSH_ADDR nm -> do np <- lit1 (BCONPtrAddr nm) + emit_ bci_PUSH_UBX [Op np, SmallOp 1] + + PUSH_APPLY_N -> emit_ bci_PUSH_APPLY_N [] + PUSH_APPLY_V -> emit_ bci_PUSH_APPLY_V [] + PUSH_APPLY_F -> emit_ bci_PUSH_APPLY_F [] + PUSH_APPLY_D -> emit_ bci_PUSH_APPLY_D [] + PUSH_APPLY_L -> emit_ bci_PUSH_APPLY_L [] + PUSH_APPLY_P -> emit_ bci_PUSH_APPLY_P [] + PUSH_APPLY_PP -> emit_ bci_PUSH_APPLY_PP [] + PUSH_APPLY_PPP -> emit_ bci_PUSH_APPLY_PPP [] + PUSH_APPLY_PPPP -> emit_ bci_PUSH_APPLY_PPPP [] + PUSH_APPLY_PPPPP -> emit_ bci_PUSH_APPLY_PPPPP [] + PUSH_APPLY_PPPPPP -> emit_ bci_PUSH_APPLY_PPPPPP [] + + SLIDE n by -> emit_ bci_SLIDE [wOp n, wOp by] + ALLOC_AP n -> emit_ bci_ALLOC_AP [truncHalfWord platform n] + ALLOC_AP_NOUPD n -> emit_ bci_ALLOC_AP_NOUPD [truncHalfWord platform n] + ALLOC_PAP arity n -> emit_ bci_ALLOC_PAP [truncHalfWord platform arity, truncHalfWord platform n] + MKAP off sz -> emit_ bci_MKAP [wOp off, truncHalfWord platform sz] + MKPAP off sz -> emit_ bci_MKPAP [wOp off, truncHalfWord platform sz] + UNPACK n -> emit_ bci_UNPACK [wOp n] + PACK dcon sz -> do itbl_no <- lit1 (BCONPtrItbl (getName dcon)) + emit_ bci_PACK [Op itbl_no, wOp sz] LABEL lbl -> label lbl TESTLT_I i l -> do np <- int i - emit bci_TESTLT_I [Op np, LabelOp l] + emit_ bci_TESTLT_I [Op np, LabelOp l] TESTEQ_I i l -> do np <- int i - emit bci_TESTEQ_I [Op np, LabelOp l] + emit_ bci_TESTEQ_I [Op np, LabelOp l] TESTLT_W w l -> do np <- word w - emit bci_TESTLT_W [Op np, LabelOp l] + emit_ bci_TESTLT_W [Op np, LabelOp l] TESTEQ_W w l -> do np <- word w - emit bci_TESTEQ_W [Op np, LabelOp l] + emit_ bci_TESTEQ_W [Op np, LabelOp l] TESTLT_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTLT_I64 [Op np, LabelOp l] + emit_ bci_TESTLT_I64 [Op np, LabelOp l] TESTEQ_I64 i l -> do np <- word64 (fromIntegral i) - emit bci_TESTEQ_I64 [Op np, LabelOp l] + emit_ bci_TESTEQ_I64 [Op np, LabelOp l] TESTLT_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I32 [Op np, LabelOp l] + emit_ bci_TESTLT_I32 [Op np, LabelOp l] TESTEQ_I32 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I32 [Op np, LabelOp l] + emit_ bci_TESTEQ_I32 [Op np, LabelOp l] TESTLT_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I16 [Op np, LabelOp l] + emit_ bci_TESTLT_I16 [Op np, LabelOp l] TESTEQ_I16 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I16 [Op np, LabelOp l] + emit_ bci_TESTEQ_I16 [Op np, LabelOp l] TESTLT_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTLT_I8 [Op np, LabelOp l] + emit_ bci_TESTLT_I8 [Op np, LabelOp l] TESTEQ_I8 i l -> do np <- word (fromIntegral i) - emit bci_TESTEQ_I8 [Op np, LabelOp l] + emit_ bci_TESTEQ_I8 [Op np, LabelOp l] TESTLT_W64 w l -> do np <- word64 w - emit bci_TESTLT_W64 [Op np, LabelOp l] + emit_ bci_TESTLT_W64 [Op np, LabelOp l] TESTEQ_W64 w l -> do np <- word64 w - emit bci_TESTEQ_W64 [Op np, LabelOp l] + emit_ bci_TESTEQ_W64 [Op np, LabelOp l] TESTLT_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W32 [Op np, LabelOp l] + emit_ bci_TESTLT_W32 [Op np, LabelOp l] TESTEQ_W32 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W32 [Op np, LabelOp l] + emit_ bci_TESTEQ_W32 [Op np, LabelOp l] TESTLT_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W16 [Op np, LabelOp l] + emit_ bci_TESTLT_W16 [Op np, LabelOp l] TESTEQ_W16 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W16 [Op np, LabelOp l] + emit_ bci_TESTEQ_W16 [Op np, LabelOp l] TESTLT_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTLT_W8 [Op np, LabelOp l] + emit_ bci_TESTLT_W8 [Op np, LabelOp l] TESTEQ_W8 w l -> do np <- word (fromIntegral w) - emit bci_TESTEQ_W8 [Op np, LabelOp l] + emit_ bci_TESTEQ_W8 [Op np, LabelOp l] TESTLT_F f l -> do np <- float f - emit bci_TESTLT_F [Op np, LabelOp l] + emit_ bci_TESTLT_F [Op np, LabelOp l] TESTEQ_F f l -> do np <- float f - emit bci_TESTEQ_F [Op np, LabelOp l] + emit_ bci_TESTEQ_F [Op np, LabelOp l] TESTLT_D d l -> do np <- double d - emit bci_TESTLT_D [Op np, LabelOp l] + emit_ bci_TESTLT_D [Op np, LabelOp l] TESTEQ_D d l -> do np <- double d - emit bci_TESTEQ_D [Op np, LabelOp l] - TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l] - TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l] - CASEFAIL -> emit bci_CASEFAIL [] - SWIZZLE stkoff n -> emit bci_SWIZZLE [wOp stkoff, IOp n] - JMP l -> emit bci_JMP [LabelOp l] - ENTER -> emit bci_ENTER [] - RETURN rep -> emit (return_non_tuple rep) [] - RETURN_TUPLE -> emit bci_RETURN_T [] + emit_ bci_TESTEQ_D [Op np, LabelOp l] + TESTLT_P i l -> emit_ bci_TESTLT_P [SmallOp i, LabelOp l] + TESTEQ_P i l -> emit_ bci_TESTEQ_P [SmallOp i, LabelOp l] + CASEFAIL -> emit_ bci_CASEFAIL [] + SWIZZLE stkoff n -> emit_ bci_SWIZZLE [wOp stkoff, IOp n] + JMP l -> emit_ bci_JMP [LabelOp l] + ENTER -> emit_ bci_ENTER [] + RETURN rep -> emit_ (return_non_tuple rep) [] + RETURN_TUPLE -> emit_ bci_RETURN_T [] CCALL off m_addr i -> do np <- addr m_addr - emit bci_CCALL [wOp off, Op np, SmallOp i] - PRIMCALL -> emit bci_PRIMCALL [] + emit_ bci_CCALL [wOp off, Op np, SmallOp i] + PRIMCALL -> emit_ bci_PRIMCALL [] BRK_FUN arr tick_mod tickx info_mod infox cc -> do p1 <- ptr (BCOPtrBreakArray arr) tick_addr <- addr tick_mod info_addr <- addr info_mod np <- addr cc - emit bci_BRK_FUN [ Op p1 + emit_ bci_BRK_FUN [ Op p1 , Op tick_addr, Op info_addr , SmallOp tickx, SmallOp infox , Op np ] #if MIN_VERSION_rts(1,0,3) - BCO_NAME name -> do np <- lit [BCONPtrStr name] - emit bci_BCO_NAME [Op np] + BCO_NAME name -> do np <- lit1 (BCONPtrStr name) + emit_ bci_BCO_NAME [Op np] #endif + + where + emit_ = emit word_size + + literal :: Literal -> m Word literal (LitLabel fs _) = litlabel fs literal LitNullAddr = word 0 literal (LitFloat r) = float (fromRational r) literal (LitDouble r) = double (fromRational r) literal (LitChar c) = int (ord c) - literal (LitString bs) = lit [BCONPtrStr bs] + literal (LitString bs) = lit1 (BCONPtrStr bs) -- LitString requires a zero-terminator when emitted literal (LitNumber nt i) = case nt of LitNumInt -> word (fromIntegral i) @@ -549,10 +778,11 @@ assembleI platform i = case i of -- analysis messed up. literal (LitRubbish {}) = word 0 - litlabel fs = lit [BCONPtrLbl fs] - addr (RemotePtr a) = words [fromIntegral a] - words ws = lit (map BCONPtrWord ws) - word w = words [w] + litlabel fs = lit1 (BCONPtrLbl fs) + addr (RemotePtr a) = word (fromIntegral a) + words ws = lit (fmap BCONPtrWord ws) + word w = words (OnlyOne w) + word2 w1 w2 = words (OnlyTwo w1 w2) word_size = platformWordSize platform word_size_bits = platformWordSizeInBits platform @@ -563,36 +793,36 @@ assembleI platform i = case i of -- Note that we only support host endianness == target endianness for now, -- even with the external interpreter. This would need to be fixed to -- support host endianness /= target endianness - int :: Int -> Assembler Word + int :: Int -> m Word int i = word (fromIntegral i) - float :: Float -> Assembler Word + float :: Float -> m Word float f = word32 (castFloatToWord32 f) - double :: Double -> Assembler Word + double :: Double -> m Word double d = word64 (castDoubleToWord64 d) - word64 :: Word64 -> Assembler Word + word64 :: Word64 -> m Word word64 ww = case word_size of PW4 -> let !wl = fromIntegral ww !wh = fromIntegral (ww `unsafeShiftR` 32) in case platformByteOrder platform of - LittleEndian -> words [wl,wh] - BigEndian -> words [wh,wl] + LittleEndian -> word2 wl wh + BigEndian -> word2 wh wl PW8 -> word (fromIntegral ww) - word8 :: Word8 -> Assembler Word + word8 :: Word8 -> m Word word8 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 8)) - word16 :: Word16 -> Assembler Word + word16 :: Word16 -> m Word word16 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> word (fromIntegral x `unsafeShiftL` (word_size_bits - 16)) - word32 :: Word32 -> Assembler Word + word32 :: Word32 -> m Word word32 x = case platformByteOrder platform of LittleEndian -> word (fromIntegral x) BigEndian -> case word_size of ===================================== compiler/GHC/ByteCode/Instr.hs ===================================== @@ -36,6 +36,7 @@ import GHC.Stack.CCS (CostCentre) import GHC.Stg.Syntax import GHCi.BreakArray (BreakArray) import Language.Haskell.Syntax.Module.Name (ModuleName) +import GHC.Types.Unique -- ---------------------------------------------------------------------------- -- Bytecode instructions @@ -58,6 +59,10 @@ data ProtoBCO a newtype LocalLabel = LocalLabel { getLocalLabel :: Word32 } deriving (Eq, Ord) +-- Just so we can easily juse UniqFM. +instance Uniquable LocalLabel where + getUnique (LocalLabel w) = mkUniqueGrimily $ fromIntegral w + instance Outputable LocalLabel where ppr (LocalLabel lbl) = text "lbl:" <> ppr lbl ===================================== compiler/GHC/ByteCode/Types.hs ===================================== @@ -21,7 +21,7 @@ module GHC.ByteCode.Types , CgBreakInfo(..) , ModBreaks (..), BreakIndex, emptyModBreaks , CCostCentre - , FlatBag, sizeFlatBag, fromSizedSeq, elemsFlatBag + , FlatBag, sizeFlatBag, fromSmallArray, elemsFlatBag ) where import GHC.Prelude ===================================== compiler/GHC/Data/FlatBag.hs ===================================== @@ -8,13 +8,11 @@ module GHC.Data.FlatBag , mappendFlatBag -- * Construction , fromList - , fromSizedSeq + , fromSmallArray ) where import GHC.Prelude -import GHC.Data.SizedSeq (SizedSeq, ssElts, sizeSS) - import Control.DeepSeq import GHC.Data.SmallArray @@ -125,5 +123,10 @@ fromList n elts = -- | Convert a 'SizedSeq' into its flattened representation. -- A 'FlatBag a' is more memory efficient than '[a]', if no further modification -- is necessary. -fromSizedSeq :: SizedSeq a -> FlatBag a -fromSizedSeq s = fromList (sizeSS s) (ssElts s) +fromSmallArray :: SmallArray a -> FlatBag a +fromSmallArray s = case sizeofSmallArray s of + 0 -> EmptyFlatBag + 1 -> UnitFlatBag (indexSmallArray s 0) + 2 -> TupleFlatBag (indexSmallArray s 0) (indexSmallArray s 1) + _ -> FlatBag s + ===================================== compiler/GHC/Data/SmallArray.hs ===================================== @@ -16,11 +16,18 @@ module GHC.Data.SmallArray , mapSmallArray , foldMapSmallArray , rnfSmallArray + + -- * IO Operations + , SmallMutableArrayIO + , newSmallArrayIO + , writeSmallArrayIO + , unsafeFreezeSmallArrayIO ) where import GHC.Exts import GHC.Prelude +import GHC.IO import GHC.ST import Control.DeepSeq @@ -28,6 +35,8 @@ data SmallArray a = SmallArray (SmallArray# a) data SmallMutableArray s a = SmallMutableArray (SmallMutableArray# s a) +type SmallMutableArrayIO a = SmallMutableArray RealWorld a + newSmallArray :: Int -- ^ size -> a -- ^ initial contents @@ -37,6 +46,9 @@ newSmallArray newSmallArray (I# sz) x s = case newSmallArray# sz x s of (# s', a #) -> (# s', SmallMutableArray a #) +newSmallArrayIO :: Int -> a -> IO (SmallMutableArrayIO a) +newSmallArrayIO sz x = IO $ \s -> newSmallArray sz x s + writeSmallArray :: SmallMutableArray s a -- ^ array -> Int -- ^ index @@ -46,6 +58,12 @@ writeSmallArray {-# INLINE writeSmallArray #-} writeSmallArray (SmallMutableArray a) (I# i) x = writeSmallArray# a i x +writeSmallArrayIO :: SmallMutableArrayIO a + -> Int + -> a + -> IO () +writeSmallArrayIO a ix v = IO $ \s -> (# writeSmallArray a ix v s, () #) + -- | Copy and freeze a slice of a mutable array. freezeSmallArray @@ -69,6 +87,9 @@ unsafeFreezeSmallArray (SmallMutableArray ma) s = case unsafeFreezeSmallArray# ma s of (# s', a #) -> (# s', SmallArray a #) +unsafeFreezeSmallArrayIO :: SmallMutableArrayIO a -> IO (SmallArray a) +unsafeFreezeSmallArrayIO arr = IO $ \s -> unsafeFreezeSmallArray arr s + -- | Get the size of a 'SmallArray' sizeofSmallArray :: SmallArray a ===================================== testsuite/tests/perf/should_run/ByteCodeAsm.hs ===================================== @@ -0,0 +1,66 @@ +module Main where + +import GHC.Driver.Session +import GHC +import qualified GHC.LanguageExtensions as LangExt + +import Control.Monad (forM_) +import Control.Monad.IO.Class (liftIO) +import System.Environment (getArgs) + +import GHC.ByteCode.Asm ( assembleBCO ) +import GHC.ByteCode.Instr +import Control.Monad +import GHC.Builtin.Names + +-- Testing the performance of the bytecode assembler + +-- A nonsensical byte-code program +instrs = [ STKCHECK 1234 + , PUSH_L 1 + , PUSH_LL 1 2 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH_LLL 2 3 4 + , PUSH8 0 + , PUSH16 15 + , PUSH32 29 + , PUSH_PAD8 + , PUSH_APPLY_N + , PUSH_APPLY_V + , PUSH_APPLY_F + , PUSH_APPLY_D + , PUSH_APPLY_L + , PUSH_APPLY_P + , PUSH_APPLY_PP + , PUSH_APPLY_PPP + , PUSH_APPLY_PPPP + , PUSH_APPLY_PPPPP + , PUSH_APPLY_PPPPPP + , TESTLT_I 100 (LocalLabel 0) + , TESTEQ_I 100 (LocalLabel 0) + ] + ++ [ LABEL (LocalLabel n) | n <- [0..50] ] + ++ [ TESTEQ_I64 n (LocalLabel 49) | n <- [1243 .. 1253 + 50 ]] + ++ [ ENTER ] + ++ [ SLIDE x n | x <- [0..5], n <- [0..10] ] + ++ [ PUSH_G appAName | _ <- [0..100] ] + ++ [ PUSH_BCO fake_proto2 ] + +fake_proto = ProtoBCO appAName instrs [] 0 0 (Left []) [] + +instrs2 = [ STKCHECK 77, UNPACK 4, SLIDE 0 4, ENTER ] + +fake_proto2 = ProtoBCO appAName instrs2 [] 0 0 (Left []) [] + +main :: IO () +main = do + [libdir] <- getArgs + runGhc (Just libdir) $ do + dflags <- getSessionDynFlags + let platform = targetPlatform dflags + + -- ~1s on my machine + liftIO $ replicateM_ 100000 (assembleBCO platform fake_proto) ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -415,3 +415,11 @@ test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], com test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) test('T17949', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) + +test('ByteCodeAsm', + [ extra_run_opts('"' + config.libdir + '"') + , js_broken(22261) + , collect_stats('bytes allocated', 10), + ], + compile_and_run, + ['-package ghc']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0cffb607895eb8a3d6fa4de74920cecbc8a950a8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0cffb607895eb8a3d6fa4de74920cecbc8a950a8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 11:25:30 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 11 Feb 2025 06:25:30 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] 2 commits: Inline join points for rhs without free vars Message-ID: <67ab33aa9977_3e6ca35b76c4238b1@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: 9727002b by Rodrigo Mesquita at 2025-02-11T11:01:17+00:00 Inline join points for rhs without free vars While investigating #25170, we ran into a program (T16473) that allocated 67% more because of a join point that failed to inline. Note [Duplicating join points] explains why we want to be conservative when inlining join points, using as an example a join point that captures a free variable `f` that becomes available in the continuation `blah` for further optimisations, as opposed to being lambda-abstracted. However, when the RHS of the join point has no free variables and is trivial, the same argument does not apply, and there's nothing to gain from preserving it. On the contrary, not inlining these trivial join points such as $j f x = K f x |> co can be actively harmful as they prevent useful optimisations from firing on the known constructor application. #25723 is such an example. Therefore, we've extended `uncondInlineJoin` to allow duplicating such closed trivial join points. See the updated Note [Duplicating join points] for further details. Co-authored-by: Simon Peyton Jones Fixes #25723 - - - - - 32fa7b45 by Rodrigo Mesquita at 2025-02-11T11:23:02+00:00 uncondInlineJoin: merge (DJ3)(b) and (DJ3)(c) guards Merge the guards in uncondInlineJoin for point DJ3(b) anad DJ3(c) of Note [Duplicating join points] to avoid an unnecessary traversal in the call to `collectArgs`; it's also more uniform. - - - - - 7 changed files: - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Unfold.hs - + testsuite/tests/perf/compiler/T16473b.hs - + testsuite/tests/perf/compiler/T16473b.stdout - testsuite/tests/perf/compiler/all.T - testsuite/tests/simplCore/should_compile/T24229a.stderr - testsuite/tests/simplCore/should_compile/T24229b.stderr Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -4172,17 +4172,40 @@ application (K f x). So we might inline it to get K g y -> blah[g,y] But now we have to make `blah` into a join point, /abstracted/ -over `g` and `y`. In contrast, if we /don't/ inline $j we -don't need a join point for `blah` and we'll get - join $j x = let g=f, y=x in blah[g,y] +over `g` and `y`. We get + join $j2 g y = blah in case v of - p1 -> $j x1 - p2 -> $j x2 - p3 -> $j x3 + p1 -> $j2 f x1 + p2 -> $j2 f x2 + p3 -> $j2 f x3 +So now we can't see that `g` is always `f` in `blah`. + +In contrast, if we /don't/ inline $j we +don't need a new join point for `blah` and we'll get + join $j' x = let g=f, y=x in blah[g,y] + in case v of + p1 -> $j' x1 + p2 -> $j' x2 + p3 -> $j' x3 This can make a /massive/ difference, because `blah` can see what `f` is, instead of lambda-abstracting over it. +If instead the RHS of the join point is a simple application that has no free +variables, as in + + case (join $j x f = K f x ) + (in case v of ) + ( p1 -> $j x1 f1 ) of + ( p2 -> $j x2 f2 ) + ( p3 -> $j x3 f3 ) + K g y -> blah[g,y] + +then no information can be gained by preserving the join point (c.f. `f` being +free in the join point above and being useful to `blah`). In this case, it's +more beneficial to inline the join point (see (DJ3)(c)) to allow further +optimisations to fire. An example where failing to do this went wrong is #25723. + Beyond this, not-inlining join points reduces duplication. In the above example, if `blah` was small enough we'd inline it, but that duplicates code, for no gain. Best just to keep not-inline the join point in the first place. @@ -4207,12 +4230,27 @@ unconditional-inlining for join points. case-of-case friendly. (DJ3) When should `uncondInlineJoin` return True? - * (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see + (a) (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see the defn of exprIsTrivial. Also nullary constructors. - * The RHS is a call ($j x y z), where the arguments are all trivial and $j + (b) The RHS is a call ($j x y z), where the arguments are all trivial and $j is a join point: there is no point in creating an indirection. + (c) The RHS is a data constructor application (K x y z) where + + - all the args x,y,z are trivial + - the free LocalIds of `f x y z` are a subset of the join point binders + + Examples that return True + $j x y = K y (x |> co) + $j x y = x (y @Int) + Examples that return False + $j x = K y x -- y is free + $j y = f y -- f is free + + Not duplicating these join points has no benefits and blocks other important + optimisations from firing (see #25723) + (DJ4) By the same token we want to use Plan B in Note [Duplicating StrictArg] when the RHS of the new join point is a data constructor application. See the call to isDataConId in the StrictArg case of mkDupableContWithDmds. ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,18 +434,50 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body + + -- (DJ3)(a) | exprIsTrivial body = True -- Nullary constructors, literals - | (Var v, args) <- collectArgs body - , all exprIsTrivial args - , isJoinId v -- Indirection to another join point; always inline + -- (DJ3)(b) and (DJ3)(c) combined + | indirectionOrAppWithoutFVs = True | otherwise = False + where + -- (DJ3)(b): + -- - $j1 x = $j2 y x |> co -- YES, inline indirection regardless of free vars + -- (DJ3)(c): + -- - $j1 x y = K y x |> co -- YES, inline! + -- - $j2 x = K f x -- No, don't! (because f is free) + indirectionOrAppWithoutFVs = go False body + + go !seen_fv (App f a) + | Just has_fv <- go_arg a + = go (seen_fv || has_fv) f + | otherwise = False -- Not trivial + go seen_fv (Var v) + | isJoinId v = True -- Indirection to another join point; always inline + | isDataConId v = not seen_fv -- e.g. $j a b = K a b + | v `elem` bndrs = not seen_fv -- e.g. $j a b = b a + go seen_fv (Cast e _) = go seen_fv e + go seen_fv (Tick _ e) = go seen_fv e + go _ _ = False + + -- go_arg returns: + -- - `Nothing` if arg is not trivial + -- - `Just True` if arg is trivial and contains free var + -- - `Just False` if arg is trivial without free vars + go_arg (Type {}) = Just False + go_arg (Coercion {}) = Just False + go_arg (App f a) + | isTyCoArg a = go_arg f -- e.g. $j f = K (f @a) + go_arg (Var f) = Just $ f `notElem` bndrs + go_arg _ = Just False + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this ===================================== testsuite/tests/perf/compiler/T16473b.hs ===================================== @@ -0,0 +1,102 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeOperators #-} + +{-# OPTIONS_GHC -flate-specialise -O2 #-} + +module Main (main) where + +import qualified Control.Monad.State.Strict as S +import Data.Foldable +import Data.Functor.Identity +import Data.Kind +import Data.Monoid +import Data.Tuple + +main :: IO () +main = print $ badCore 100 + +badCore :: Int -> Int +badCore n = getSum $ fst $ run $ runState mempty $ for_ [0..n] $ \i -> modify (<> Sum i) + +data Union (r :: [Type -> Type]) a where + Union :: e a -> Union '[e] a + +decomp :: Union (e ': r) a -> e a +decomp (Union a) = a +{-# INLINE decomp #-} + +absurdU :: Union '[] a -> b +absurdU = absurdU + +newtype Semantic r a = Semantic + { runSemantic + :: forall m + . Monad m + => (forall x. Union r x -> m x) + -> m a + } + +instance Functor (Semantic f) where + fmap f (Semantic m) = Semantic $ \k -> fmap f $ m k + {-# INLINE fmap #-} + +instance Applicative (Semantic f) where + pure a = Semantic (\x -> const (pure a) x) + {-# INLINE pure #-} + Semantic f <*> Semantic a = Semantic $ \k -> f k <*> a k + {-# INLINE (<*>) #-} + +instance Monad (Semantic f) where + return = pure + {-# INLINE return #-} + Semantic ma >>= f = Semantic $ \k -> do + z <- ma k + runSemantic (f z) k + {-# INLINE (>>=) #-} + +data State s a + = Get (s -> a) + | Put s a + deriving Functor + +get :: Semantic '[State s] s +get = Semantic $ \k -> k $ Union $ Get id +{-# INLINE get #-} + +put :: s -> Semantic '[State s] () +put !s = Semantic $ \k -> k $ Union $! Put s () +{-# INLINE put #-} + +modify :: (s -> s) -> Semantic '[State s] () +modify f = do + !s <- get + put $! f s +{-# INLINE modify #-} + +runState :: s -> Semantic (State s ': r) a -> Semantic r (s, a) +runState = interpretInStateT $ \case + Get k -> fmap k S.get + Put s k -> S.put s >> pure k +{-# INLINE[3] runState #-} + +run :: Semantic '[] a -> a +run (Semantic m) = runIdentity $ m absurdU +{-# INLINE run #-} + +interpretInStateT + :: (forall x. e x -> S.StateT s (Semantic r) x) + -> s + -> Semantic (e ': r) a + -> Semantic r (s, a) +interpretInStateT f s (Semantic m) = Semantic $ \k -> + fmap swap $ flip S.runStateT s $ m $ \u -> + S.mapStateT (\z -> runSemantic z k) $ f $ decomp u +{-# INLINE interpretInStateT #-} + ===================================== testsuite/tests/perf/compiler/T16473b.stdout ===================================== @@ -0,0 +1 @@ +5050 ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -612,6 +612,17 @@ test ('T16473', compile_and_run, ['-O2 -flate-specialise']) +# Run this program. If inlining the join point fails, it'll start to allocate much more. +# The join point is only created when -fno-local-float-out +test ('T16473b', + [ collect_stats('bytes allocated',5) + , only_ways(['normal']) + , js_broken(22261) + ], + compile_and_run, + ['-O2 -fno-local-float-out']) + + test('T17516', [ collect_compiler_runtime(5), ], ===================================== testsuite/tests/simplCore/should_compile/T24229a.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 83, types: 113, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 79, types: 106, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } ===================================== testsuite/tests/simplCore/should_compile/T24229b.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 64, types: 90, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 60, types: 83, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/23af5dd4311d420c11e995e5647906ab002c78f4...32fa7b4554d7ed6d4a438604efb15c4a7a09dc11 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/23af5dd4311d420c11e995e5647906ab002c78f4...32fa7b4554d7ed6d4a438604efb15c4a7a09dc11 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 12:58:32 2025 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Tue, 11 Feb 2025 07:58:32 -0500 Subject: [Git][ghc/ghc][wip/andreask/9.10-backports] 20 commits: Hadrian: use / when making filepaths absolute Message-ID: <67ab497850de7_1ad996dd2106265f@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC Commits: 1b3dc557 by sheaf at 2025-02-06T14:50:22+01:00 Hadrian: use / when making filepaths absolute In Hadrian, we are careful to use -/- rather than , in order to use / instead of \ in filepaths. However, this gets ruined by the use of makeAbsolute from System.Directory, which, on Windows, changes back forward slashes to backslashes. (cherry picked from commit f813c8d70e41f0d4663d894db2fee593c71a9772) - - - - - ec264a6a by Andreas Klebinger at 2025-02-07T12:22:26+01:00 Revert "AArch64: Implement switch/jump tables (#19912)" This reverts commit 9b4326cf4180eb70f7474aa143b46a49cb69306f. - - - - - 19e75b80 by Ben Gamari at 2025-02-07T13:09:55+01:00 rts/linker: Fix out-of-bounds mapping logic Previously the structure of `mmapInRegion` concealed a subtle bug concerning handling of `mmap` returning mappings below the beginning of the desired region. Specifically, we would reset `p = result + bytes` and then again reset `p = region->start` before looping around for another iteration. This resulted in an infinite loop on FreeBSD. Fixes #25492. (cherry picked from commit 292ed74ea908b64490e91346b890cbebdcde37d0) - - - - - 2bfa796f by Ben Gamari at 2025-02-07T13:10:04+01:00 rts/linker: Clarify debug output (cherry picked from commit 20912f5bac6fe4146172accc1849d9b762eb45e3) - - - - - 26c4086e by Ben Gamari at 2025-02-07T13:10:50+01:00 hadrian: Mitigate mktexfmt race At least some versions of Texlive's `mktexfmt` utility cannot be invoked concurrently in their initial run since they fail to handle failure of `mkdir` due to racing. Specifically, we see ``` | Run Xelatex: users_guide.tex => /tmp/extra-dir-9616886274866 | Run Xelatex: Haddock.tex => /tmp/extra-dir-9616886274869 This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex) restricted \write18 enabled. kpathsea: Running mktexfmt xelatex.fmt mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order): mktexfmt: /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes: mktexfmt: /builds/ghc/ghc/tmp-home/.texlive2020/texmf-config/web2c/fmtutil.cnf /usr/bin/mktexfmt: mkdir(/builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c/) failed for tree /builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c: File exists at /usr/share/texlive/tlpkg/TeXLive/TLUtils.pm line 937. I can't find the format file `xelatex.fmt'! ``` That is two `mktexfmt` invocations (for the user's guide and haddock builds) attempted to create `$HOME/texlive2020/texmf-var/web2c` and raced. One of the two `mkdir`'s consequently failed, bringing down the entire build. We avoid this by ensuring that the first `xelatex` invocation is always performed serially. Fixes #25564. (cherry picked from commit 41dae5b86955094aa4c5647f63f1f52f1a8a5519) - - - - - fb9948f2 by Ben Gamari at 2025-02-07T13:11:04+01:00 rts/CheckUnload: Reset old_objects if unload is skipped Previously `checkUnload` failed to reset `old_objects` when it decided not to unload (e.g. due to heap profiling being enabled). Fixes #24935. (cherry picked from commit 9efbc51f99118e8f9c3abf2bcb6dc3295893ded6) - - - - - 6f89c0b7 by Ben Gamari at 2025-02-07T13:12:01+01:00 rts(setNumCapabilities): Assert that n_caps < MAX_N_CAPS It was noticed in #25560 that this would previously be allowed, resulting in a segfault. I will add a proper exception in `base` in a future commit. (cherry picked from commit f08a72eb484193934c56e34366b277f4d7247a24) - - - - - b0bdc3d9 by Ben Gamari at 2025-02-07T13:12:08+01:00 ghc-internal: Fix inconsistent FFI import types The foreign imports of `enabled_capabilities` and `getNumberOfProcessors` were declared as `CInt` whereas they are defined as `uint32_t`. (cherry picked from commit e10d31ad849b5f7c1f052e7c93f7c7aaf85918c9) - - - - - 859a4300 by Ben Gamari at 2025-02-07T13:12:14+01:00 rts: Mention maximum capability count in users guide Addresses #25560. (cherry picked from commit 06265655bfe6b48cde6923a933d81c9889a443a3) - - - - - e683e293 by Ben Gamari at 2025-02-07T13:12:22+01:00 rts/Capability: Move induction variable declaration into `for`s Just a stylistic change. (cherry picked from commit d488470ba302760cfd2f3515d9338d1d75f84dd5) - - - - - 47a4ff98 by Ben Gamari at 2025-02-07T13:12:28+01:00 rts: Determine max_n_capabilities at RTS startup Previously the maximum number of capabilities supported by the RTS was statically capped at 256. However, this bound is uncomfortably low given the size of today's machine. While supporting unbounded, fully-dynamic adjustment would be nice, it is complex and so instead we do something simpler: Probe the logical core count at RTS startup and use this as the static bound for the rest of our execution. This should avoid users running into the capability limit on large machines while avoiding wasting memory on a large capabilities array for most users and keeping complexity at bay. Addresses #25560. (cherry picked from commit 71f050b74eaa2fdc2ca5da53f85497ac94ab6a2a) - - - - - 482c1f86 by Ben Gamari at 2025-02-07T13:12:36+01:00 testsuite: Introduce req_c_rts As suggested by @hsyl20, this is intended to mark tests that rely on the behavior of the C RTS. (cherry picked from commit 1e84b41108d96cb721dd11281105fdf621105a12) - - - - - d70eafac by Ben Gamari at 2025-02-07T13:13:57+01:00 testsuite: Add test for #25560 (cherry picked from commit 683115a40fd989a287fa51efe140af9448526098) - - - - - fadf2fb3 by Ben Gamari at 2025-02-07T13:14:09+01:00 rts/CheckUnload: Don't prepare to unload if we can't unload Previously `prepareUnloadCheck` would move the `objects` list to `old_objects` even when profiling (where we cannot unload). This caused us to vacate the `objects` list during major GCs, losing track of loaded objects. Fix this by ensuring that `prepareUnloadCheck` and `checkUnload` both use the same short-cutting logic. (cherry picked from commit 34d3e8e69b62b92cc438514f7fb8e37ce639efea) - - - - - 2d8c8094 by Matthew Pickering at 2025-02-07T13:14:37+01:00 typechecker: Perform type family consistency checks in topological order Consider a module M importing modules A, B and C. We can waste a lot of work depending on the order that the modules are checked for family consistency. Consider that C imports A and B. When compiling C we must have already checked A and B for consistency, therefore if C is processed first then A and B will not need to be checked for consistency again. If A and B are compared first, then the consistency checks will be performed against (wasted as we already performed them for C). At the moment the order which modules are checked is non-deterministic. Clearly we should engineer that C is checked before B and A, but by what scheme? A simple one is to observe that if a module M is in the transitive closure of X then the size of the consistent family set of M is less than or equal to size of the consistent family set of X. Therefore by sorting the imports by the size of the consistent family set and processing the largest first, you make sure to process modules in topological order. In practice we have observed that this strategy has reduced the amount of consistency checks performed. One solution to #25554 (cherry picked from commit 13fe48d40004d9cdf3c73300a18f144bdc5191d9) - - - - - f5265c6c by Ben Gamari at 2025-02-07T13:17:08+01:00 rts: Fix incorrect format specifiers in era profiling Fixes #25581. (cherry picked from commit 430d965a176d6c9e629d169fa0606923275c8332) - - - - - 73ed2394 by Cheng Shao at 2025-02-11T13:34:51+01:00 ci: minor nix-in-docker improvements This patch makes some minor improvements re nix-in-docker logic in the ci configuration: - Update `nixos/nix` to the latest version - Apply $CPUS to `cores`/`max-jobs` to avoid oversubscribing while allowing a reasonable degree of parallelism - Remove redundant `--extra-experimental-features nix-command` in later `nix shell` invocations, it's already configured in `/etc/nix/nix.conf` (cherry picked from commit 291388e18b5b61a02a43cc153a642fd67d6127c4) - - - - - bebda0d8 by Zubin Duggal at 2025-02-11T13:34:57+01:00 ghcup metadata: output metadata fragment in CI (cherry picked from commit 52b58a660e735b20961d792d8fa9267f01247a50) (cherry picked from commit 04433916cdedab80114cbed1dc399ae816bada91) - - - - - 77af77d5 by Zubin Duggal at 2025-02-11T13:34:57+01:00 ghcup metatdata: use fedora33 for redhat Redhat 9 doesn't have libtinfo.so.5 anymore (cherry picked from commit dc86785eb43afd1bd292287c064fb5ad94fe8c7f) (cherry picked from commit 7c78804e3b25d2c0246cd1f3ce0d4015431e5831) - - - - - 459075c5 by Zubin Duggal at 2025-02-11T13:34:57+01:00 ghcup metadata: still use centos for redhat <9 (cherry picked from commit 1d72cfb2c1054bc8a399855d5c68443c969d2f66) - - - - - 28 changed files: - .gitlab-ci.yml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Tc/Instance/Family.hs - compiler/GHC/Tc/Module.hs - docs/users_guide/using-concurrent.rst - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Rules/CabalReinstall.hs - hadrian/src/Rules/Documentation.hs - hadrian/src/Rules/Test.hs - hadrian/src/Settings/Builders/Cabal.hs - hadrian/src/Settings/Builders/Ghc.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs - rts/Capability.c - rts/Capability.h - rts/CheckUnload.c - rts/Linker.c - rts/ProfHeap.c - rts/RtsSymbols.c - rts/Schedule.c - rts/include/rts/Config.h - rts/include/rts/Threads.h - rts/linker/MMap.c - testsuite/driver/testlib.py - + testsuite/tests/rts/T25560.hs - testsuite/tests/rts/all.T Changes: ===================================== .gitlab-ci.yml ===================================== @@ -289,7 +289,7 @@ lint-author: - *drafts-can-fail-lint lint-ci-config: - image: nixos/nix:2.14.1 + image: nixos/nix:2.25.2 extends: .lint # We don't need history/submodules in this job variables: @@ -297,6 +297,18 @@ lint-ci-config: GIT_SUBMODULE_STRATEGY: none before_script: - echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf + # Note [Nix-in-Docker] + # ~~~~~~~~~~~~~~~~~~~~ + # The nixos/nix default config is max-jobs=1 and cores=$(logical + # cores num) which doesn't play nice with our $CPUS convention. We + # fix it before invoking any nix build to avoid oversubscribing + # while allowing a reasonable degree of parallelism. + # FIXME: Disabling build-users-group=nixbld is a workaround for a Nix-in-Docker issue. See + # https://gitlab.haskell.org/ghc/head.hackage/-/issues/38#note_560487 for + # discussion. + - echo "cores = $CPUS" >> /etc/nix/nix.conf + - echo "max-jobs = $CPUS" >> /etc/nix/nix.conf + - nix run nixpkgs#gnused -- -i -e 's/ nixbld//' /etc/nix/nix.conf script: - nix run .gitlab/generate-ci#generate-jobs # 1 if .gitlab/generate_jobs changed the output of the generated config @@ -1096,7 +1108,7 @@ project-version: .ghcup-metadata: stage: deploy - image: nixos/nix:2.14.1 + image: nixos/nix:2.25.2 dependencies: null tags: - x86_64-linux @@ -1105,6 +1117,10 @@ project-version: GIT_SUBMODULE_STRATEGY: "none" before_script: - echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf + # FIXME: See Note [Nix-in-Docker] + - echo "cores = $CPUS" >> /etc/nix/nix.conf + - echo "max-jobs = $CPUS" >> /etc/nix/nix.conf + - nix run nixpkgs#gnused -- -i -e 's/ nixbld//' /etc/nix/nix.conf - nix-channel --update - cat version.sh # Calculate the project version @@ -1157,7 +1173,7 @@ ghcup-metadata-nightly: artifacts: false - job: project-version script: - - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%m-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml" + - nix shell -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%m-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml" rules: - if: $NIGHTLY @@ -1195,7 +1211,8 @@ ghcup-metadata-release: # No explicit needs for release pipeline as we assume we need everything and everything will pass. extends: .ghcup-metadata script: - - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --release-mode --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%m-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml" + - nix shell -f .gitlab/rel_eng -c ghcup-metadata --release-mode --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%m-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" --fragment + - nix shell -f .gitlab/rel_eng -c ghcup-metadata --release-mode --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%m-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml" rules: - if: '$RELEASE_JOB == "yes"' ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -232,7 +232,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "unknown_versioning" : centos7 } , "Linux_Fedora" : { ">= 33": fedora33 , "unknown_versioning": centos7 } - , "Linux_RedHat" : { "unknown_versioning": centos7 } + , "Linux_RedHat" : { "< 9": centos7 + , ">= 9": fedora33 + , "unknown_versioning": fedora33 } , "Linux_UnknownLinux" : { "unknown_versioning": rocky8 } , "Darwin" : { "unknown_versioning" : darwin_x86 } , "Windows" : { "unknown_versioning" : windows } ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -23,7 +23,7 @@ import GHC.Cmm.DebugBlock import GHC.CmmToAsm.Monad ( NatM, getNewRegNat , getPicBaseMaybeNat, getPlatform, getConfig - , getDebugBlock, getFileId, getNewLabelNat + , getDebugBlock, getFileId ) -- import GHC.CmmToAsm.Instr import GHC.CmmToAsm.PIC @@ -50,7 +50,7 @@ import GHC.Types.Unique.Supply import GHC.Data.OrdList import GHC.Utils.Outputable -import Control.Monad ( mapAndUnzipM ) +import Control.Monad ( mapAndUnzipM, foldM ) import Data.Maybe import GHC.Float @@ -210,79 +210,43 @@ annExpr e instr {- debugIsOn -} = ANN (text . show $ e) instr -- ----------------------------------------------------------------------------- -- Generating a table-branch --- | Generate jump to jump table target +-- TODO jump tables would be a lot faster, but we'll use bare bones for now. +-- this is usually done by sticking the jump table ids into an instruction +-- and then have the @generateJumpTableForInstr@ callback produce the jump +-- table as a static. -- --- The index into the jump table is calulated by evaluating @expr at . The --- corresponding table entry contains the relative address to jump to (relative --- to the jump table's first entry / the table's own label). -genSwitch :: NCGConfig -> CmmExpr -> SwitchTargets -> NatM InstrBlock -genSwitch config expr targets = do - (reg, fmt1, e_code) <- getSomeReg indexExpr - let fmt = II64 - targetReg <- getNewRegNat fmt - lbl <- getNewLabelNat - dynRef <- cmmMakeDynamicReference config DataReference lbl - (tableReg, fmt2, t_code) <- getSomeReg dynRef - let code = - toOL - [ COMMENT (text "indexExpr" <+> (text . show) indexExpr), - COMMENT (text "dynRef" <+> (text . show) dynRef) - ] - `appOL` e_code - `appOL` t_code - `appOL` toOL - [ COMMENT (ftext "Jump table for switch"), - -- index to offset into the table (relative to tableReg) - annExpr expr (LSL (OpReg (formatToWidth fmt1) reg) (OpReg (formatToWidth fmt1) reg) (OpImm (ImmInt 3))), - -- calculate table entry address - ADD (OpReg W64 targetReg) (OpReg (formatToWidth fmt1) reg) (OpReg (formatToWidth fmt2) tableReg), - -- load table entry (relative offset from tableReg (first entry) to target label) - LDR II64 (OpReg W64 targetReg) (OpAddr (AddrRegImm targetReg (ImmInt 0))), - -- calculate absolute address of the target label - ADD (OpReg W64 targetReg) (OpReg W64 targetReg) (OpReg W64 tableReg), - -- prepare jump to target label - J_TBL ids (Just lbl) targetReg - ] - return code - where - -- See Note [Sub-word subtlety during jump-table indexing] in - -- GHC.CmmToAsm.X86.CodeGen for why we must first offset, then widen. - indexExpr0 = cmmOffset platform expr offset - -- We widen to a native-width register to sanitize the high bits - indexExpr = - CmmMachOp - (MO_UU_Conv expr_w (platformWordWidth platform)) - [indexExpr0] - expr_w = cmmExprWidth platform expr - (offset, ids) = switchTargetsToTable targets - platform = ncgPlatform config - --- | Generate jump table data (if required) +-- See Ticket 19912 +-- +-- data SwitchTargets = +-- SwitchTargets +-- Bool -- Signed values +-- (Integer, Integer) -- Range +-- (Maybe Label) -- Default value +-- (M.Map Integer Label) -- The branches -- --- The idea is to emit one table entry per case. The entry is the relative --- address of the block to jump to (relative to the table's first entry / --- table's own label.) The calculation itself is done by the linker. -generateJumpTableForInstr :: - NCGConfig -> - Instr -> - Maybe (NatCmmDecl RawCmmStatics Instr) -generateJumpTableForInstr config (J_TBL ids (Just lbl) _) = - let jumpTable = - map jumpTableEntryRel ids - where - jumpTableEntryRel Nothing = - CmmStaticLit (CmmInt 0 (ncgWordWidth config)) - jumpTableEntryRel (Just blockid) = - CmmStaticLit - ( CmmLabelDiffOff - blockLabel - lbl - 0 - (ncgWordWidth config) - ) - where - blockLabel = blockLbl blockid - in Just (CmmData (Section ReadOnlyData lbl) (CmmStaticsRaw lbl jumpTable)) +-- Non Jumptable plan: +-- xE <- expr +-- +genSwitch :: CmmExpr -> SwitchTargets -> NatM InstrBlock +genSwitch expr targets = do -- pprPanic "genSwitch" (ppr expr) + (reg, format, code) <- getSomeReg expr + let w = formatToWidth format + let mkbranch acc (key, bid) = do + (keyReg, _format, code) <- getSomeReg (CmmLit (CmmInt key w)) + return $ code `appOL` + toOL [ CMP (OpReg w reg) (OpReg w keyReg) + , BCOND EQ (TBlock bid) + ] `appOL` acc + def_code = case switchTargetsDefault targets of + Just bid -> unitOL (B (TBlock bid)) + Nothing -> nilOL + + switch_code <- foldM mkbranch nilOL (switchTargetsCases targets) + return $ code `appOL` switch_code `appOL` def_code + +-- We don't do jump tables for now, see Ticket 19912 +generateJumpTableForInstr :: NCGConfig -> Instr + -> Maybe (NatCmmDecl RawCmmStatics Instr) generateJumpTableForInstr _ _ = Nothing -- ----------------------------------------------------------------------------- @@ -314,7 +278,6 @@ stmtToInstrs :: BlockId -- ^ Basic block this statement will start to be placed stmtToInstrs bid stmt = do -- traceM $ "-- -------------------------- stmtToInstrs -------------------------- --\n" -- ++ showSDocUnsafe (ppr stmt) - config <- getConfig platform <- getPlatform case stmt of CmmUnsafeForeignCall target result_regs args @@ -343,7 +306,7 @@ stmtToInstrs bid stmt = do CmmCondBranch arg true false _prediction -> genCondBranch bid true false arg - CmmSwitch arg ids -> genSwitch config arg ids + CmmSwitch arg ids -> genSwitch arg ids CmmCall { cml_target = arg } -> genJump arg @@ -388,6 +351,12 @@ getRegisterReg platform (CmmGlobal reg@(GlobalRegUse mid _)) -- ones which map to a real machine register on this -- platform. Hence if it's not mapped to a registers something -- went wrong earlier in the pipeline. +-- | Convert a BlockId to some CmmStatic data +-- TODO: Add JumpTable Logic, see Ticket 19912 +-- jumpTableEntry :: NCGConfig -> Maybe BlockId -> CmmStatic +-- jumpTableEntry config Nothing = CmmStaticLit (CmmInt 0 (ncgWordWidth config)) +-- jumpTableEntry _ (Just blockid) = CmmStaticLit (CmmLabel blockLabel) +-- where blockLabel = blockLbl blockid -- ----------------------------------------------------------------------------- -- General things for putting together code sequences ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -27,7 +27,7 @@ import GHC.Types.Unique.Supply import GHC.Utils.Panic -import Data.Maybe (fromMaybe, catMaybes) +import Data.Maybe (fromMaybe) import GHC.Stack @@ -118,7 +118,6 @@ regUsageOfInstr platform instr = case instr of ORR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) -- 4. Branch Instructions ---------------------------------------------------- J t -> usage (regTarget t, []) - J_TBL _ _ t -> usage ([t], []) B t -> usage (regTarget t, []) BCOND _ t -> usage (regTarget t, []) BL t ps -> usage (regTarget t ++ ps, callerSavedRegisters) @@ -265,11 +264,10 @@ patchRegsOfInstr instr env = case instr of ORR o1 o2 o3 -> ORR (patchOp o1) (patchOp o2) (patchOp o3) -- 4. Branch Instructions -------------------------------------------------- - J t -> J (patchTarget t) - J_TBL ids mbLbl t -> J_TBL ids mbLbl (env t) - B t -> B (patchTarget t) - BL t rs -> BL (patchTarget t) rs - BCOND c t -> BCOND c (patchTarget t) + J t -> J (patchTarget t) + B t -> B (patchTarget t) + BL t rs -> BL (patchTarget t) rs + BCOND c t -> BCOND c (patchTarget t) -- 5. Atomic Instructions -------------------------------------------------- -- 6. Conditional Instructions --------------------------------------------- @@ -320,7 +318,6 @@ isJumpishInstr instr = case instr of CBZ{} -> True CBNZ{} -> True J{} -> True - J_TBL{} -> True B{} -> True BL{} -> True BCOND{} -> True @@ -334,7 +331,6 @@ jumpDestsOfInstr (ANN _ i) = jumpDestsOfInstr i jumpDestsOfInstr (CBZ _ t) = [ id | TBlock id <- [t]] jumpDestsOfInstr (CBNZ _ t) = [ id | TBlock id <- [t]] jumpDestsOfInstr (J t) = [id | TBlock id <- [t]] -jumpDestsOfInstr (J_TBL ids _mbLbl _r) = catMaybes ids jumpDestsOfInstr (B t) = [id | TBlock id <- [t]] jumpDestsOfInstr (BL t _) = [ id | TBlock id <- [t]] jumpDestsOfInstr (BCOND _ t) = [ id | TBlock id <- [t]] @@ -343,11 +339,6 @@ jumpDestsOfInstr _ = [] canFallthroughTo :: Instr -> BlockId -> Bool canFallthroughTo (ANN _ i) bid = canFallthroughTo i bid canFallthroughTo (J (TBlock target)) bid = bid == target -canFallthroughTo (J_TBL targets _ _) bid = all isTargetBid targets - where - isTargetBid target = case target of - Nothing -> True - Just target -> target == bid canFallthroughTo (B (TBlock target)) bid = bid == target canFallthroughTo _ _ = False @@ -361,7 +352,6 @@ patchJumpInstr instr patchF CBZ r (TBlock bid) -> CBZ r (TBlock (patchF bid)) CBNZ r (TBlock bid) -> CBNZ r (TBlock (patchF bid)) J (TBlock bid) -> J (TBlock (patchF bid)) - J_TBL ids mbLbl r -> J_TBL (map (fmap patchF) ids) mbLbl r B (TBlock bid) -> B (TBlock (patchF bid)) BL (TBlock bid) ps -> BL (TBlock (patchF bid)) ps BCOND c (TBlock bid) -> BCOND c (TBlock (patchF bid)) @@ -525,7 +515,6 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do insert_dealloc insn r = case insn of J _ -> dealloc ++ (insn : r) - J_TBL {} -> dealloc ++ (insn : r) ANN _ (J _) -> dealloc ++ (insn : r) _other | jumpDestsOfInstr insn /= [] -> patchJumpInstr insn retarget : r @@ -654,7 +643,6 @@ data Instr | CBNZ Operand Target -- if op /= 0, then branch. -- Branching. | J Target -- like B, but only generated from genJump. Used to distinguish genJumps from others. - | J_TBL [Maybe BlockId] (Maybe CLabel) Reg -- A jump instruction with data for switch/jump tables | B Target -- unconditional branching b/br. (To a blockid, label or register) | BL Target [Reg] -- branch and link (e.g. set x30 to next pc, and branch) | BCOND Cond Target -- branch with condition. b. @@ -736,7 +724,6 @@ instrCon i = CBZ{} -> "CBZ" CBNZ{} -> "CBNZ" J{} -> "J" - J_TBL {} -> "J_TBL" B{} -> "B" BL{} -> "BL" BCOND{} -> "BCOND" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -426,7 +426,6 @@ pprInstr platform instr = case instr of -- 4. Branch Instructions ---------------------------------------------------- J t -> pprInstr platform (B t) - J_TBL _ _ r -> pprInstr platform (B (TReg r)) B (TBlock bid) -> line $ text "\tb" <+> pprAsmLabel platform (mkLocalBlockLabel (getUnique bid)) B (TLabel lbl) -> line $ text "\tb" <+> pprAsmLabel platform lbl B (TReg r) -> line $ text "\tbr" <+> pprReg W64 r ===================================== compiler/GHC/Tc/Instance/Family.hs ===================================== @@ -58,6 +58,7 @@ import Data.Function ( on ) import qualified GHC.LanguageExtensions as LangExt import GHC.Unit.Env (unitEnv_hpts) +import Data.List (sortOn) {- Note [The type family instance consistency story] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -239,6 +240,49 @@ That situation should be pretty common in practice, there's usually a set of utility modules that every module imports directly or indirectly. This is basically the idea from #13092, comment:14. + +Note [Order of type family consistency checks] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Consider a module M which imports modules A, B and C, all defining (open) type +family instances. + +We can waste a lot of work in type family consistency checking depending on the +order in which the modules are processed. + +Suppose for example that C imports A and B. When we compiled C, we will have +checked A and B for consistency against eachother. This means that, when +processing the imports of M to check type family instance consistency: + +* if C is processed first, then A and B will not need to be checked for + consistency against eachother again, +* if we process A and B before C,then the + consistency checks between A and B will be performed again. This is wasted + work, as we already performed them for C. + +This can make a significant difference. Keeping the nomenclature of the above +example for illustration, we have observed situations in practice in which the +compilation time of M goes from 1 second (the "processing A and B first" case) +down to 80 milliseconds (the "processing C first" case). + +Clearly we should engineer that C is checked before B and A, but by what scheme? + +A simple one is to observe that if a module M is in the transitive closure of X +then the size of the consistent family set of M is less than or equal to size +of the consistent family set of X. + +Therefore, by sorting the imports by the size of the consistent family set and +processing the largest first, we make sure to process modules in topological +order. + +For a particular project, without this change we did 40 million checks and with +this change we did 22.9 million checks. This is significant as before this change +type family consistency checks accounted for 26% of total type checker allocations which +was reduced to 15%. + +See tickets #25554 for discussion about this exact issue and #25555 for +why we still do redundant checks. + -} -- We don't need to check the current module, this is done in @@ -267,6 +311,12 @@ checkFamInstConsistency directlyImpMods where deps = dep_finsts . mi_deps . modIface $ mod + ; debug_consistent_set = map (\x -> (x, length (modConsistent x))) directlyImpMods + + -- Sorting the list by size has the effect of performing a topological sort. + -- See Note [Order of type family consistency checks] + ; init_consistent_set = reverse (sortOn (length . modConsistent) directlyImpMods) + ; hmiModule = mi_module . hm_iface ; hmiFamInstEnv = extendFamInstEnvList emptyFamInstEnv . md_fam_insts . hm_details @@ -276,7 +326,8 @@ checkFamInstConsistency directlyImpMods } - ; checkMany hpt_fam_insts modConsistent directlyImpMods + ; traceTc "init_consistent_set" (ppr debug_consistent_set) + ; checkMany hpt_fam_insts modConsistent init_consistent_set } where -- See Note [Checking family instance optimization] @@ -294,6 +345,11 @@ checkFamInstConsistency directlyImpMods -> TcM () go _ _ [] = return () go consistent consistent_set (mod:mods) = do + traceTc "checkManySize" (vcat [text "mod:" <+> ppr mod + , text "m1:" <+> ppr (length to_check_from_mod) + , text "m2:" <+> ppr (length (to_check_from_consistent)) + , text "product:" <+> ppr (length to_check_from_mod * length to_check_from_consistent) + ]) sequence_ [ check hpt_fam_insts m1 m2 | m1 <- to_check_from_mod ===================================== compiler/GHC/Tc/Module.hs ===================================== @@ -434,7 +434,9 @@ tcRnImports hsc_env import_decls ; let { dir_imp_mods = moduleEnvKeys . imp_mods $ imports } - ; checkFamInstConsistency dir_imp_mods + ; logger <- getLogger + ; withTiming logger (text "ConsistencyCheck"<+>brackets (ppr this_mod)) (const ()) + $ checkFamInstConsistency dir_imp_mods ; traceRn "rn1: } checking family instance consistency" empty ; getGblEnv } } ===================================== docs/users_guide/using-concurrent.rst ===================================== @@ -153,6 +153,14 @@ use the RTS :rts-flag:`-N ⟨x⟩` options. changed while the program is running by calling ``Control.Concurrent.setNumCapabilities``. + +.. note:: + + The maximum number of capabilities supported by the GHC runtime system is + determined when at RTS startup to be either 256, the value given by + :rts-flag:`-N ⟨x⟩`, or the number of logical CPU cores, whichever is + greater. + The following options affect the way the runtime schedules threads on CPUs: ===================================== hadrian/src/Hadrian/Utilities.hs ===================================== @@ -7,7 +7,7 @@ module Hadrian.Utilities ( quote, yesNo, parseYesNo, zeroOne, -- * FilePath manipulation - unifyPath, (-/-), makeRelativeNoSysLink, + unifyPath, (-/-), makeRelativeNoSysLink, makeAbsolute, -- * Accessing Shake's type-indexed map insertExtra, lookupExtra, userSetting, @@ -56,6 +56,7 @@ import qualified System.Directory.Extra as IO import qualified System.Info.Extra as IO import qualified System.IO as IO import System.IO.Error (isPermissionError) +import qualified System.FilePath.Posix as Posix -- | Extract a value from a singleton list, or terminate with an error message -- if the list does not contain exactly one value. @@ -135,7 +136,17 @@ zeroOne True = "1" unifyPath :: FilePath -> FilePath unifyPath = toStandard . normaliseEx +{- Note [Absolute paths and MSYS] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When dealing with absolute paths in Hadrian, we opt to always use Unix-style +forward slashes for separating paths. +This is because, on Windows, the MSYS toolchain can reliably handle paths such +as /c/foo, while it occasionally falls over on paths of the form C:\foo. +-} + -- | Combine paths with a forward slash regardless of platform. +-- +-- See Note [Absolute paths and MSYS]. (-/-) :: FilePath -> FilePath -> FilePath _ -/- b | isAbsolute b && not (isAbsolute $ tail b) = b "" -/- b = b @@ -145,6 +156,16 @@ a -/- b infixr 6 -/- +-- | Like 'System.Directory.makeAbsolute' from @directory@, but always +-- using forward slashes. +-- +-- See Note [Absolute paths and MSYS]. +makeAbsolute :: FilePath -> IO FilePath +makeAbsolute fp = do + cwd <- IO.getCurrentDirectory + let fp' = cwd -/- fp + return $ Posix.normalise fp' + -- | This is like Posix makeRelative, but assumes no sys links in the input -- paths. This allows the result to start with possibly many "../"s. Input -- paths must both be relative, or be on the same drive ===================================== hadrian/src/Rules/CabalReinstall.hs ===================================== @@ -61,10 +61,10 @@ cabalBuildRules = do rtsIncludeDir = ghcBuildDir -/- "lib" -/- distDir -/- rtsDir -/- "include" - libdir <- liftIO . IO.makeAbsolute =<< stageLibPath Stage1 - work_dir <- liftIO $ IO.makeAbsolute $ root -/- "stage-cabal" + libdir <- liftIO . makeAbsolute =<< stageLibPath Stage1 + work_dir <- liftIO $ makeAbsolute $ root -/- "stage-cabal" let outputDir = work_dir -/- "bin" - includeDir <- liftIO $ IO.makeAbsolute rtsIncludeDir + includeDir <- liftIO $ makeAbsolute rtsIncludeDir createDirectory outputDir @@ -101,7 +101,7 @@ cabalBuildRules = do -- Just symlink these for now -- TODO: build these with cabal as well forM_ iserv_targets $ \(_bin_pkg,bin_path') -> do - bin_path <- liftIO $ IO.makeAbsolute bin_path' + bin_path <- liftIO $ makeAbsolute bin_path' let orig_filename = takeFileName bin_path output_file = outputDir -/- orig_filename liftIO $ do ===================================== hadrian/src/Rules/Documentation.hs ===================================== @@ -334,11 +334,27 @@ getPkgDocTarget root path = -- | Build all PDF documentation buildPdfDocumentation :: Rules () -buildPdfDocumentation = mapM_ buildSphinxPdf docPaths +buildPdfDocumentation = do + -- Note [Avoiding mktexfmt race] + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + -- We must ensure that the *first* xelatex invocation in the + -- build is performed serially (that is, not concurrently with + -- any other xelatex invocations) as mktexfmt does not handle + -- racing `mkdir` calls gracefully. However, we assume that + -- subsequent invocations are safe to run concurrently since the + -- initial call will have created the requisite directories (namely + -- $HOME/.texlive2020/texmf-var/web2c). + -- + -- Fixes #25564. + let maxConcurrentReaders = 1000 + xelatexMutex <- newResource "xelatex-mutex" maxConcurrentReaders + let rs = [(xelatexMutex, 1)] + + mapM_ (buildSphinxPdf rs) docPaths -- | Compile a Sphinx ReStructured Text package to LaTeX -buildSphinxPdf :: FilePath -> Rules () -buildSphinxPdf path = do +buildSphinxPdf :: [(Resource, Int)] -> FilePath -> Rules () +buildSphinxPdf rs path = do root <- buildRootRules root -/- pdfRoot -/- path <.> "pdf" %> \file -> do @@ -352,7 +368,8 @@ buildSphinxPdf path = do checkSphinxWarnings dir -- LaTeX "fixed point" - build $ target docContext Xelatex [path <.> "tex"] [dir] + -- See Note [Avoiding mktexfmt race] above. + buildWithResources rs $ target docContext Xelatex [path <.> "tex"] [dir] build $ target docContext Xelatex [path <.> "tex"] [dir] build $ target docContext Xelatex [path <.> "tex"] [dir] build $ target docContext Makeindex [path <.> "idx"] [dir] ===================================== hadrian/src/Rules/Test.hs ===================================== @@ -217,7 +217,7 @@ testRules = do -- get relative path for the given program in the given stage let relative_path_stage s p = programPath =<< programContext s p let make_absolute rel_path = do - abs_path <- liftIO (IO.makeAbsolute rel_path) + abs_path <- liftIO (makeAbsolute rel_path) fixAbsolutePathOnWindows abs_path rel_ghc_pkg <- relative_path_stage Stage1 ghcPkg ===================================== hadrian/src/Settings/Builders/Cabal.hs ===================================== @@ -11,7 +11,6 @@ import Settings.Builders.Common import qualified Settings.Builders.Common as S import Control.Exception (assert) import qualified Data.Set as Set -import System.Directory import Settings.Program (programContext) import GHC.Toolchain (ccLinkProgram, tgtCCompilerLink) import GHC.Toolchain.Program (prgFlags) ===================================== hadrian/src/Settings/Builders/Ghc.hs ===================================== @@ -12,7 +12,6 @@ import Settings.Warnings import qualified Context as Context import Rules.Libffi (libffiName) import qualified Data.Set as Set -import System.Directory import Data.Version.Extra ghcBuilderArgs :: Args ===================================== libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs ===================================== @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} @@ -394,13 +393,14 @@ getNumProcessors :: IO Int getNumProcessors = fmap fromIntegral c_getNumberOfProcessors foreign import ccall unsafe "getNumberOfProcessors" - c_getNumberOfProcessors :: IO CUInt + c_getNumberOfProcessors :: IO Word32 -- | Returns the number of sparks currently in the local spark pool numSparks :: IO Int numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) -foreign import ccall "&enabled_capabilities" enabled_capabilities :: Ptr CInt +foreign import ccall "&enabled_capabilities" + enabled_capabilities :: Ptr Word32 childHandler :: SomeException -> IO () childHandler err = catch (real_handler err) childHandler ===================================== rts/Capability.c ===================================== @@ -16,6 +16,7 @@ * * --------------------------------------------------------------------------*/ +#include "rts/Config.h" #include "rts/PosixSource.h" #include "Rts.h" @@ -40,12 +41,16 @@ Capability MainCapability; uint32_t n_capabilities = 0; uint32_t enabled_capabilities = 0; +// The size of the `capabilities` array initialized at RTS startup. Referenced +// by GHC.Internal.Conc.Sync +uint32_t max_n_capabilities = MAX_N_CAPABILITIES; + // The array of Capabilities. It's important that when we need // to allocate more Capabilities we don't have to move the existing // Capabilities, because there may be pointers to them in use // (e.g. threads in waitForCapability(), see #8209), so this is // an array of Capability* rather than an array of Capability. -Capability *capabilities[MAX_N_CAPABILITIES]; +Capability **capabilities; // Holds the Capability which last became free. This is used so that // an in-call has a chance of quickly finding a free Capability. @@ -344,8 +349,6 @@ initCapability (Capability *cap, uint32_t i) * ------------------------------------------------------------------------- */ void initCapabilities (void) { - uint32_t i; - /* Declare a couple capability sets representing the process and clock domain. Each capability will get added to these capsets. */ traceCapsetCreate(CAPSET_OSPROCESS_DEFAULT, CapsetTypeOsProcess); @@ -354,7 +357,7 @@ void initCapabilities (void) // Initialise NUMA if (!RtsFlags.GcFlags.numa) { n_numa_nodes = 1; - for (i = 0; i < MAX_NUMA_NODES; i++) { + for (uint32_t i = 0; i < MAX_NUMA_NODES; i++) { numa_map[i] = 0; } } else if (RtsFlags.DebugFlags.numa) { @@ -388,12 +391,30 @@ void initCapabilities (void) } #endif - if (RtsFlags.ParFlags.nCapabilities > MAX_N_CAPABILITIES) { - errorBelch("warning: this GHC runtime system only supports up to %d capabilities", - MAX_N_CAPABILITIES); - RtsFlags.ParFlags.nCapabilities = MAX_N_CAPABILITIES; + /* + * Note [Capabilities array sizing] + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Determine the size of the capabilities array as the maximum of: + * * the static lower bound, `MAX_N_CAPABILITIES` + * * the logical core count + * * the users's choice of `+RTS -N` + * This will serve as the upper bound on the capability count for the rest + * of execution. Calls to `setNumCapabilities` exceeding this bound will + * issue a warning and otherwise have no effect. + * + * See #25560. + */ + uint32_t core_count = getNumberOfProcessors(); + if (core_count > max_n_capabilities) { + max_n_capabilities = core_count; } + if (RtsFlags.ParFlags.nCapabilities > max_n_capabilities) { + max_n_capabilities = RtsFlags.ParFlags.nCapabilities; + } + + capabilities = stgMallocBytes(sizeof(Capability) * max_n_capabilities, "initCapabilities"); + n_capabilities = 0; moreCapabilities(0, RtsFlags.ParFlags.nCapabilities); n_capabilities = RtsFlags.ParFlags.nCapabilities; @@ -401,6 +422,7 @@ void initCapabilities (void) #else /* !THREADED_RTS */ n_capabilities = 1; + capabilities = stgMallocBytes(sizeof(Capability), "initCapabilities"); capabilities[0] = &MainCapability; initCapability(&MainCapability, 0); @@ -412,7 +434,7 @@ void initCapabilities (void) // There are no free capabilities to begin with. We will start // a worker Task to each Capability, which will quickly put the // Capability on the free list when it finds nothing to do. - for (i = 0; i < n_numa_nodes; i++) { + for (uint32_t i = 0; i < n_numa_nodes; i++) { last_free_capability[i] = getCapability(0); } } ===================================== rts/Capability.h ===================================== @@ -266,11 +266,13 @@ INLINE_HEADER void releaseCapability_ (Capability* cap STG_UNUSED, // extern Capability MainCapability; // declared in rts/include/rts/Threads.h: +// extern uint32_t max_n_capabilities; // extern uint32_t n_capabilities; // extern uint32_t enabled_capabilities; -// Array of all the capabilities -extern Capability *capabilities[MAX_N_CAPABILITIES]; +// Array of all the capabilities, of size max_n_capabilities +// See Note [Capabilities array sizing] in rts/Capability.c. +extern Capability **capabilities; INLINE_HEADER Capability *getCapability(uint32_t i) { ===================================== rts/CheckUnload.c ===================================== @@ -166,7 +166,7 @@ ObjectCode *loaded_objects; static OCSectionIndices *global_s_indices = NULL; // Is it safe for us to unload code? -static bool safeToUnload(void) +static bool tryToUnload(void) { if (RtsFlags.ProfFlags.doHeapProfile != NO_HEAP_PROFILING) { // We mustn't unload anything as the heap census may contain @@ -174,7 +174,8 @@ static bool safeToUnload(void) // See #24512. return false; } - return true; + + return global_s_indices != NULL; } static OCSectionIndices *createOCSectionIndices(void) @@ -432,7 +433,7 @@ static bool markObjectLive(void *data STG_UNUSED, StgWord key, const void *value void markObjectCode(const void *addr) { - if (global_s_indices == NULL) { + if (!tryToUnload()) { return; } @@ -450,7 +451,7 @@ void markObjectCode(const void *addr) // unloading. bool prepareUnloadCheck(void) { - if (global_s_indices == NULL) { + if (!tryToUnload()) { return false; } @@ -467,48 +468,44 @@ bool prepareUnloadCheck(void) void checkUnload(void) { - if (global_s_indices == NULL) { - return; - } else if (!safeToUnload()) { - return; - } - // At this point we've marked all dynamically loaded static objects // (including their dependencies) during GC, but not the root set of object // code (loaded_objects). Mark the roots first, then unload any unmarked // objects. - OCSectionIndices *s_indices = global_s_indices; - ASSERT(s_indices->sorted); + if (tryToUnload()) { + OCSectionIndices *s_indices = global_s_indices; + ASSERT(s_indices->sorted); - // Mark roots - for (ObjectCode *oc = loaded_objects; oc != NULL; oc = oc->next_loaded_object) { - markObjectLive(NULL, (W_)oc, NULL); - } + // Mark roots + for (ObjectCode *oc = loaded_objects; oc != NULL; oc = oc->next_loaded_object) { + markObjectLive(NULL, (W_)oc, NULL); + } - // Free unmarked objects - ObjectCode *next = NULL; - for (ObjectCode *oc = old_objects; oc != NULL; oc = next) { - next = oc->next; - ASSERT(oc->status == OBJECT_UNLOADED); - - // Symbols should be removed by unloadObj_. - // NB (osa): If this assertion doesn't hold then freeObjectCode below - // will corrupt symhash as keys of that table live in ObjectCodes. If - // you see a segfault in a hash table operation in linker (in non-debug - // RTS) then it's probably because this assertion did not hold. - ASSERT(oc->symbols == NULL); - - if (oc->unloadable) { - removeOCSectionIndices(s_indices, oc); - freeObjectCode(oc); - n_unloaded_objects -= 1; - } else { - // If we don't have enough information to - // accurately determine the reachability of - // the object then hold onto it. - oc->next = objects; - objects = oc; + // Free unmarked objects + ObjectCode *next = NULL; + for (ObjectCode *oc = old_objects; oc != NULL; oc = next) { + next = oc->next; + ASSERT(oc->status == OBJECT_UNLOADED); + + // Symbols should be removed by unloadObj_. + // NB (osa): If this assertion doesn't hold then freeObjectCode below + // will corrupt symhash as keys of that table live in ObjectCodes. If + // you see a segfault in a hash table operation in linker (in non-debug + // RTS) then it's probably because this assertion did not hold. + ASSERT(oc->symbols == NULL); + + if (oc->unloadable) { + removeOCSectionIndices(s_indices, oc); + freeObjectCode(oc); + n_unloaded_objects -= 1; + } else { + // If we don't have enough information to + // accurately determine the reachability of + // the object then hold onto it. + oc->next = objects; + objects = oc; + } } } ===================================== rts/Linker.c ===================================== @@ -1076,7 +1076,7 @@ freePreloadObjectFile (ObjectCode *oc) */ void freeObjectCode (ObjectCode *oc) { - IF_DEBUG(linker, ocDebugBelch(oc, "start\n")); + IF_DEBUG(linker, ocDebugBelch(oc, "freeObjectCode: start\n")); // Run finalizers if (oc->type == STATIC_OBJECT && ===================================== rts/ProfHeap.c ===================================== @@ -958,9 +958,9 @@ dumpCensus( Census *census ) count * sizeof(W_)); break; case HEAP_BY_ERA: - fprintf(hp_file, "%lu", (StgWord)ctr->identity); + fprintf(hp_file, "%" FMT_Word, (StgWord)ctr->identity); char str_era[100]; - sprintf(str_era, "%lu", (StgWord)ctr->identity); + sprintf(str_era, "%" FMT_Word, (StgWord)ctr->identity); traceHeapProfSampleString(0, str_era, count * sizeof(W_)); break; case HEAP_BY_MOD: ===================================== rts/RtsSymbols.c ===================================== @@ -911,6 +911,7 @@ extern char **environ; SymI_NeedsDataProto(rts_stop_on_exception) \ SymI_HasProto(stopTimer) \ SymI_HasProto(n_capabilities) \ + SymI_HasProto(max_n_capabilities) \ SymI_HasProto(enabled_capabilities) \ SymI_HasDataProto(stg_traceEventzh) \ SymI_HasDataProto(stg_traceMarkerzh) \ ===================================== rts/Schedule.c ===================================== @@ -2276,9 +2276,12 @@ setNumCapabilities (uint32_t new_n_capabilities USED_IF_THREADS) } else if (new_n_capabilities <= 0) { errorBelch("setNumCapabilities: Capability count must be positive"); return; + } else if (new_n_capabilities > max_n_capabilities) { + // See Note [Capabilities array sizing] in rts/Capability.c. + errorBelch("setNumCapabilities: Attempt to increase capability count beyond maximum capability count %" PRIu32 "; clamping...\n", max_n_capabilities); + new_n_capabilities = max_n_capabilities; } - debugTrace(DEBUG_sched, "changing the number of Capabilities from %d to %d", enabled_capabilities, new_n_capabilities); ===================================== rts/include/rts/Config.h ===================================== @@ -78,6 +78,10 @@ code. #endif #if defined(THREADED_RTS) +/* + * See Note [Capabilities array sizing] in rts/Capability.c. + * Update the note in docs/users_guide/using-concurrent.rst when updating this. + */ #define MAX_N_CAPABILITIES 256 #else #define MAX_N_CAPABILITIES 1 ===================================== rts/include/rts/Threads.h ===================================== @@ -69,7 +69,7 @@ HsBool rtsSupportsBoundThreads (void); // The number of Capabilities. // TODO: Ideally we would only provide getNumCapabilities // but this is used in compiler/cbits/genSym.c -extern unsigned int n_capabilities; +extern uint32_t n_capabilities; INLINE_HEADER unsigned int getNumCapabilities(void) { return RELAXED_LOAD(&n_capabilities); } @@ -77,6 +77,10 @@ INLINE_HEADER unsigned int getNumCapabilities(void) // The number of Capabilities that are not disabled extern uint32_t enabled_capabilities; +// The maximum number of Capabilities supported by the RTS. +// See Note [Capabilities array sizing] in rts/Capability.c. +extern uint32_t max_n_capabilities; + #if !IN_STG_CODE extern Capability MainCapability; #endif ===================================== rts/linker/MMap.c ===================================== @@ -344,12 +344,7 @@ mmapInRegion ( if (result == NULL) { // The mapping failed return NULL; - } else if (result < region->start) { - // Uh oh, we assume that mmap() will only give us a - // an address at or after the requested address. - // Try again. - p = (uint8_t *) result + bytes; - } else if (result < region->end) { + } else if (result >= region->start && result < region->end) { // Success! region->last = (uint8_t *) result + bytes; return result; @@ -357,17 +352,23 @@ mmapInRegion ( // We failed to find a suitable mapping munmap(result, bytes); reportMemoryMap(); - errorBelch("mmapForLinker: failed to mmap() memory below 2Gb; " + errorBelch("mmapForLinker: failed to mmap() memory between %p and %p; " "asked for %zu bytes at %p. " "Try specifying an address with +RTS -xm -RTS", - bytes, p); + region->start, region->end, bytes, p); return NULL; - } + } else if (result < region->start) { + // Uh oh, we assume that mmap() will only give us a + // an address at or after the requested address. + // Try bump forward by a bit and try again. + p = (uint8_t *) p + bytes; + } else if (result >= region->end) { + // mmap() gave us too high an address; wrap around and try again + wrapped = true; + p = region->start; + } - // mmap() gave us too high an address; wrap around and try again munmap(result, bytes); - wrapped = true; - p = region->start; } } ===================================== testsuite/driver/testlib.py ===================================== @@ -275,6 +275,10 @@ def req_bco( name, opts ): # JS backend doesn't support ByteCode js_skip(name, opts) +def req_c_rts( name, opts ): + """ Require the C runtime system (rather than, e.g. the Javascript RTS). """ + js_skip(name, opts) + def req_rts_linker( name, opts ): if not config.have_RTS_linker: opts.expect = 'fail' ===================================== testsuite/tests/rts/T25560.hs ===================================== @@ -0,0 +1,4 @@ +import GHC.Conc + +main :: IO () +main = setNumCapabilities 100000 ===================================== testsuite/tests/rts/all.T ===================================== @@ -616,3 +616,7 @@ test('T23400', [], compile_and_run, ['-with-rtsopts -A8k']) test('IOManager', [js_skip, when(arch('wasm32'), skip), when(opsys('mingw32'), skip), pre_cmd('$MAKE -s --no-print-directory IOManager.hs')], compile_and_run, ['']) + +# N.B. This will likely issue a warning on stderr but we merely care that the +# program doesn't crash. +test('T25560', [req_c_rts, ignore_stderr], compile_and_run, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/15ca7b2c06f9727b7a8c5ca663c3b6779489daa6...459075c552d7d1f3d06658c5ab0d4fba096aa819 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/15ca7b2c06f9727b7a8c5ca663c3b6779489daa6...459075c552d7d1f3d06658c5ab0d4fba096aa819 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 13:45:22 2025 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Tue, 11 Feb 2025 08:45:22 -0500 Subject: [Git][ghc/ghc][wip/bytecode-serialize] 25 commits: interpreter: Always print unit and module name in BCO_NAME instruction Message-ID: <67ab54723d89b_1ad99136675c7243f@gitlab.mail> Cheng Shao pushed to branch wip/bytecode-serialize at Glasgow Haskell Compiler / GHC Commits: cbbb64fb by Matthew Pickering at 2025-02-03T23:40:33-05:00 interpreter: Always print unit and module name in BCO_NAME instruction Currently the BCO_Name instruction is a bit difficult to use since the names are not qualified by the module they come from. When you have a very generic name such as "wildX4", it becomes impossible to work out which module the identifier comes from. Fixes #25694 - - - - - 764a43ac by Ben Gamari at 2025-02-03T23:41:10-05:00 upload-ghc-libs: Drop more references to ghc-internal from ghc-boot-th (cherry picked from commit afec4b75c2d0e9f5c462a86d9f3697acf30355c7) Co-authored-by: Ben Gamari - - - - - 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 52b6539b by M Farkas-Dyck at 2025-02-08T11:34:51-08:00 Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc. In particular, use `NonEmpty` where appropriate: - the argument of `FieldLabelString` - the argument of `HsMultiIf` - `grhssGRHSs` Decreases overall compile-time allocation by about 0.1% in the benchmark suite (min -0.8%, max +0.3%). Metric Decrease: T3294 - - - - - a566da92 by Ben Gamari at 2025-02-10T03:21:49-05:00 gitlab-ci: Bump docker images Closes #25693. - - - - - a7e23f01 by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - 12752f0c by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 015f2d5b by Cheng Shao at 2025-02-10T13:11:45+00:00 WIP - - - - - 9df508c1 by Cheng Shao at 2025-02-10T13:11:45+00:00 WIP - - - - - bba788d8 by Cheng Shao at 2025-02-11T13:44:59+00:00 IT WORKSgit status! - - - - - 91 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/rel_eng/upload_ghc_libs.py - compiler/GHC.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Linker.hs - + compiler/GHC/ByteCode/Serialize.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Core/UsageEnv.hs - compiler/GHC/CoreToStg/Prep.hs - + compiler/GHC/Data/List/NonEmpty.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Binary.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Name.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - + testsuite/tests/th/EmptyGuard.hs - + testsuite/tests/th/EmptyGuard.stderr - testsuite/tests/th/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Transform.hs - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/94e3652f700fcdfd2356b6954f46318e9159d601...bba788d851160653349461dc846700de0f36a536 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/94e3652f700fcdfd2356b6954f46318e9159d601...bba788d851160653349461dc846700de0f36a536 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 15:25:27 2025 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 11 Feb 2025 10:25:27 -0500 Subject: [Git][ghc/ghc][wip/T24359] 2 commits: approach from Feb 10 Message-ID: <67ab6be7cf95_9c608c6660569a7@gitlab.mail> sheaf pushed to branch wip/T24359 at Glasgow Haskell Compiler / GHC Commits: 6a9aee22 by sheaf at 2025-02-11T16:20:57+01:00 approach from Feb 10 - - - - - 62a55f97 by sheaf at 2025-02-11T16:25:06+01:00 account for skolem escape in mightEqualLater - - - - - 4 changed files: - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Solver/Solve.hs - testsuite/tests/typecheck/should_compile/TcSpecPragmas.hs Changes: ===================================== compiler/GHC/Tc/Gen/Sig.hs ===================================== @@ -57,7 +57,6 @@ import GHC.Tc.Zonk.TcType import GHC.Tc.Zonk.Type import GHC.Core( hasSomeUnfolding ) -import GHC.Core.FVs (exprSomeFreeVars) import GHC.Core.Type import GHC.Core.Multiplicity import GHC.Core.Predicate @@ -72,7 +71,6 @@ import GHC.Types.Basic import GHC.Types.Name import GHC.Types.Name.Env import GHC.Types.SrcLoc -import GHC.Types.Unique.Set import GHC.Builtin.Names( mkUnboundName ) import GHC.Unit.Module( Module, getModule ) @@ -82,15 +80,12 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Data.Bag -import GHC.Data.Maybe( orElse, whenIsJust, expectJust ) +import GHC.Data.Maybe( orElse, whenIsJust ) import Control.Monad( unless ) import Data.Foldable ( toList ) -import qualified Data.Graph as Graph import qualified Data.List.NonEmpty as NE import Data.Maybe( mapMaybe ) -import qualified Data.Semigroup as S - {- ------------------------------------------------------------- Note [Overview of type signatures] @@ -1048,57 +1043,41 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) <- tcRuleBndrs skol_info rule_bndrs $ tcInferRho spec_e - -- (2) Solve the Wanteds that arose from typechecking spec_e, but - -- in a special way: every original Wanted should be either fully solved - -- or left untouched. + -- (2) Clone these Wanteds, solve them, and zonk the original + -- Wanteds, in order to benefit from any unifications. -- - -- See Note [Fully solving constraints for specialisation]. + -- SLD TODO: write short note about this, including possible + -- shortcoming of too many unifications from instances. - -- (2.1) Clone the Wanteds. ; ev_binds_var_clone <- newTcEvBinds ; spec_e_wanted_clone <- cloneWC spec_e_wanted - - -- (2.2) Solve the cloned Wanteds. - ; simpl_spec_e_wanted_clone <- setTcLevel rhs_tclvl $ - runTcSWithEvBinds ev_binds_var_clone $ - solveWanteds spec_e_wanted_clone - - -- (2.3) Determine which cloned Wanteds were fully solved. - ; not_fully_solved_ev_ids <- - notFullySolvedWanteds ev_binds_var_clone simpl_spec_e_wanted_clone - - -- (2.4) Zonk the original Wanteds to benefit from any unifications in (2.2) + ; _ <- setTcLevel rhs_tclvl $ + runTcSWithEvBinds ev_binds_var_clone $ + solveWanteds spec_e_wanted_clone ; spec_e_wanted <- liftZonkM $ zonkWC spec_e_wanted - -- (2.5) Partition the original Wanteds into fully soluble Wanteds and the rest. - ; let (other_wanteds, fully_soluble_wanteds) = - partitionWC (`elemVarSet` not_fully_solved_ev_ids) spec_e_wanted - - -- (2.6) Fully solve the fully-soluble Wanteds. + -- (3) Compute which constraints we can plausibly quantify over. ; ev_binds_var <- newTcEvBinds - ; simpl_fully_soluble <- setTcLevel rhs_tclvl $ - runTcSWithEvBinds ev_binds_var $ - solveWanteds fully_soluble_wanteds - ; massertPpr (isSolvedWC simpl_fully_soluble) $ - vcat [ text "tcSpecPrag (SpecSigE): unexpected unsolved constraints for" <+> quotes (ppr nm) <> colon - , ppr simpl_fully_soluble - , text "original Wanteds:" <+> ppr spec_e_wanted - , text "supposedly soluble Wanteds:" <+> ppr fully_soluble_wanteds - , text "not_fully_solved_ev_ids:" <+> ppr not_fully_solved_ev_ids - , text "spec_e:" <+> ppr spec_e - ] - - -- (3) Quantify other constraints. The quantification candidates - -- are the non-fully-soluble constraints computed in (2.5). - ; (quant_cts, residual_wc) <- getRuleQuantCts other_wanteds - ; let qevs = map ctEvId $ bagToList quant_cts - - -- (4) Emit the residual constraints, and wrap the expression - -- in the evidence let bindings + ; (simple_cts, residual_wc) <- getRuleQuantCts spec_e_wanted + + -- (4) Figure out which of the simple_cts we can fully solve using + -- instances (and thus specialise away) + ; traceTc "tcSpecPrag SpecSigE: computing fully soluble Wanteds {" empty + ; fully_soluble_evids <- + setTcLevel rhs_tclvl $ + mkVarSet <$> + mapMaybeM fullySolveCt_maybe (bagToList simple_cts) + ; let (fully_soluble_cts, other_cts) = partitionBag ((`elemVarSet` fully_soluble_evids) . ctEvId) simple_cts + quant_cts = mkMinimalBySCs ctPred $ bagToList other_cts + qevs = map ctEvId quant_cts + non_quant_cts = filterBag (not . (`elemVarSet` mkVarSet qevs) . ctEvId) other_cts + ; traceTc "tcSpecPrag SpecSigE: computed fully soluble Wanteds }" (ppr fully_soluble_cts) + + -- (5) Emit the residual constraints (that we are not quantifying over) ; let tv_bndrs = filter isTyVar rule_bndrs' ; emitResidualConstraints rhs_tclvl skol_info_anon ev_binds_var emptyVarSet tv_bndrs qevs - residual_wc + (residual_wc `addSimples` fully_soluble_cts `addSimples` non_quant_cts) ; let lhs_call = mkLHsWrap (WpLet (TcEvBinds ev_binds_var)) tc_spec_e ; traceTc "tcSpecPrag SpecSigE }" $ @@ -1107,14 +1086,14 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) , text "qevs:" <+> ppr qevs , text "spec_e:" <+> ppr tc_spec_e , text "inl:" <+> ppr inl - , text "not_fully_solved_ev_ids:" <+> ppr not_fully_solved_ev_ids - , text "fully_soluble_wanteds:" <+> ppr fully_soluble_wanteds - , text "other_wanteds:" <+> ppr other_wanteds + , text "spec_e_wanted:" <+> ppr spec_e_wanted , text "quant_cts:" <+> ppr quant_cts , text "residual_wc:" <+> ppr residual_wc + , text "fully_soluble_wanteds:" <+> ppr fully_soluble_cts + , text "non_quant_cts:" <+> ppr non_quant_cts ] - -- (5) Store the results in a SpecPragE record, which will be + -- (6) Store the results in a SpecPragE record, which will be -- zonked and then consumed by the desugarer. ; return [SpecPragE { spe_fn_nm = nm @@ -1126,77 +1105,23 @@ tcSpecPrag poly_id (SpecSigE nm rule_bndrs spec_e inl) tcSpecPrag _ prag = pprPanic "tcSpecPrag" (ppr prag) --- | Figure out the 'EvId's of all the Wanted constraints that --- are not fully solved, by inspecting their evidence terms. -notFullySolvedWanteds :: EvBindsVar -> WantedConstraints -> TcM VarSet -notFullySolvedWanteds ev_binds_var wc - = do { (unsolved_ids, ev_deps_edges) <- ev_binds_edges ev_binds_var wc - ; let - (ev_graph, node_from_vertex, vertex_from_key) = Graph.graphFromEdges ev_deps_edges - evid_from_vertex v = case node_from_vertex v of (ev_id, _, _) -> ev_id - reachable = concatMap (map evid_from_vertex . toList) - $ Graph.dfs - (Graph.transposeG ev_graph) - (map (expectJust "tcSpecPrag (computing fully solved)" . vertex_from_key) unsolved_ids) - ; return (mkVarSet reachable) - } - -ev_binds_edges :: EvBindsVar -> WantedConstraints -> TcM ([EvId], [(EvId, EvId, [EvId])]) -ev_binds_edges ev_binds_var0 ( WC { wc_simple = cts, wc_impl = implics } ) - = do { ev_binds <- getTcEvBindsMap ev_binds_var0 - ; edges1 <- foldMapM ev_bind_edges (evBindMapBinds ev_binds) - ; let edges2 = foldMap (\ ct -> let i = ctEvId ct in ([i], [(i,i,[])])) cts - ; (insols3, edges3) <- foldMapM go_implic implics - ; return $ - edges2 S.<> ( insols3, edges1 S.<> edges3 ) - } - where - ev_bind_edges :: EvBind -> TcM [(EvId, EvId, [EvId])] - ev_bind_edges (EvBind { eb_lhs = ev_id, eb_rhs = body }) = do - ev_deps <- evVarsOfTerm' body - return [(ev_id, ev_id, nonDetEltsUniqSet ev_deps)] - go_implic :: Implication -> TcM ([EvId], [(EvId, EvId, [EvId])]) - go_implic ( Implic { ic_binds = ev_binds_var, ic_wanted = wc }) = - ev_binds_edges ev_binds_var wc - --- Like 'GHC.Tc.Types.Evidence.evVarsOfTerm', except that it properly computes --- the 'VarSet' for an 'EvFun'. -evVarsOfTerm' :: EvTerm -> TcM VarSet -evVarsOfTerm' (EvExpr e) = return $ exprSomeFreeVars isEvVar e -evVarsOfTerm' (EvTypeable _ ev) = - case ev of - EvTypeableTyCon _ e -> foldMapM evVarsOfTerm' e - EvTypeableTyApp e1 e2 -> foldMapM evVarsOfTerm' [e1,e2] - EvTypeableTrFun e1 e2 e3 -> foldMapM evVarsOfTerm' [e1,e2,e3] - EvTypeableTyLit e -> evVarsOfTerm' e -evVarsOfTerm' (EvFun { et_given = givens, et_binds = tcev_binds, et_body = body_id }) = do - ev_binds <- - bagToList <$> - case tcev_binds of - TcEvBinds var -> evBindMapBinds <$> getTcEvBindsMap var - EvBinds binds -> return binds - let lhs_evvars = map evBindVar ev_binds - rhs_evvars <- foldMapM (evVarsOfTerm' . eb_rhs) ev_binds +-- | Try to fully solve a constraint. +fullySolveCt_maybe :: Ct -> TcM (Maybe EvId) +fullySolveCt_maybe ct = do + throwaway_ev_binds_var <- newTcEvBinds + res_wc <- + runTcSWithEvBinds throwaway_ev_binds_var $ + solveWanteds $ emptyWC { wc_simple = unitBag ct } + -- NB: don't use 'solveSimpleWanteds', as this will not + -- fully solve quantified constraints. + traceTc "fullySolveCt_maybe" $ + vcat [ text "ct:" <+> ppr ct + , text "res_wc:" <+> ppr res_wc + ] return $ - ( ( rhs_evvars `extendVarSet` body_id ) - `delVarSetList` lhs_evvars - ) `delVarSetList` givens - -partitionWC :: (EvId -> Bool) -> WantedConstraints -> (WantedConstraints, WantedConstraints) -partitionWC f wc@(WC { wc_simple = cts, wc_impl = implics }) = - let (yes_cts, no_cts) = partitionBag (f . ctEvId) cts - (yes_impls, no_impls) = unzipBag $ mapBag f_impl implics - in ( wc { wc_simple = yes_cts, wc_impl = mapMaybeBag prune yes_impls } - , wc { wc_simple = no_cts, wc_impl = mapMaybeBag prune no_impls } ) - where - f_impl i@(Implic { ic_wanted = wc' }) = - let (yes, no) = partitionWC f wc' - in (i { ic_wanted = yes }, i { ic_wanted = no }) - prune :: Implication -> Maybe Implication - prune i = - if isEmptyWC ( ic_wanted i ) - then Nothing - else Just i + if isSolvedWC res_wc + then Just $ ctEvId ct + else Nothing -------------- tcSpecWrapper :: UserTypeCtxt -> TcType -> TcType -> TcM HsWrapper ===================================== compiler/GHC/Tc/Solver/InertSet.hs ===================================== @@ -1903,6 +1903,8 @@ mightEqualLater inert_set given_pred given_loc wanted_pred wanted_loc , can_unify tv (metaTyVarInfo tv) rhs_ty -- this checks for CycleBreakerTvs and TyVarTvs; forgetting -- the latter was #19106. + , all ((metaTyVarTcLevel tv `deeperThanOrSame`) . tcTyVarLevel) + (filter isSkolemTyVar (tyCoVarsOfTypeList rhs_ty)) = BindMe -- See Examples 4, 5, and 6 from the Note ===================================== compiler/GHC/Tc/Solver/Solve.hs ===================================== @@ -924,20 +924,20 @@ solveSimpleWanteds simples go n limit wc | n `intGtLimit` limit = failWithTcS $ TcRnSimplifierTooManyIterations simples limit wc - | isEmptyBag (wc_simple wc) - = return (n,wc) + | isEmptyBag (wc_simple wc) + = return (n,wc) - | otherwise - = do { -- Solve - wc1 <- solve_simple_wanteds wc + | otherwise + = do { -- Solve + wc1 <- solve_simple_wanteds wc - -- Run plugins - ; (rerun_plugin, wc2) <- runTcPluginsWanted wc1 + -- Run plugins + ; (rerun_plugin, wc2) <- runTcPluginsWanted wc1 - ; if rerun_plugin - then do { traceTcS "solveSimple going round again:" (ppr rerun_plugin) - ; go (n+1) limit wc2 } -- Loop - else return (n, wc2) } -- Done + ; if rerun_plugin + then do { traceTcS "solveSimple going round again:" (ppr rerun_plugin) + ; go (n+1) limit wc2 } -- Loop + else return (n, wc2) } -- Done solve_simple_wanteds :: WantedConstraints -> TcS WantedConstraints ===================================== testsuite/tests/typecheck/should_compile/TcSpecPragmas.hs ===================================== @@ -50,7 +50,7 @@ tyEq ( _ :: Proxy a ) ( _ :: Proxy b ) = Just HRefl -> 1.1 -- Check that we don't emit a "useless specialisation" warning, as the --- specialisation allows us to drop dead code in the body of 'f7'. +-- specialisation allows us to drop dead code in the body of 'tyEq'. {-# SPECIALISE tyEq :: Typeable c => Proxy c -> Proxy c -> Float #-} -------------------------------------------------------------------------------- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2d65f88fb38d577e9001053501ad5881f407134c...62a55f97b4be925ad8f738898abe893f8c0499a8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2d65f88fb38d577e9001053501ad5881f407134c...62a55f97b4be925ad8f738898abe893f8c0499a8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 15:36:39 2025 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 11 Feb 2025 10:36:39 -0500 Subject: [Git][ghc/ghc][wip/romes/no-simple-joinpoints] 2 commits: Inline join points for rhs without free vars Message-ID: <67ab6e87d12d0_9c60828b23459849@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/no-simple-joinpoints at Glasgow Haskell Compiler / GHC Commits: 918da786 by Rodrigo Mesquita at 2025-02-11T15:30:57+00:00 Inline join points for rhs without free vars While investigating #25170, we ran into a program (T16473) that allocated 67% more because of a join point that failed to inline. Note [Duplicating join points] explains why we want to be conservative when inlining join points, using as an example a join point that captures a free variable `f` that becomes available in the continuation `blah` for further optimisations, as opposed to being lambda-abstracted. However, when the RHS of the join point has no free variables and is trivial, the same argument does not apply, and there's nothing to gain from preserving it. On the contrary, not inlining these trivial join points such as $j f x = K f x |> co can be actively harmful as they prevent useful optimisations from firing on the known constructor application. #25723 is such an example. Therefore, we've extended `uncondInlineJoin` to allow duplicating such closed trivial join points. See the updated Note [Duplicating join points] for further details. Co-authored-by: Simon Peyton Jones Fixes #25723 - - - - - 05e456bc by Rodrigo Mesquita at 2025-02-11T15:36:20+00:00 uncondInlineJoin: merge (DJ3)(b) and (DJ3)(c) guards Merge the guards in uncondInlineJoin for point DJ3(b) anad DJ3(c) of Note [Duplicating join points] to avoid an unnecessary traversal in the call to `collectArgs`; it's also more uniform. - - - - - 7 changed files: - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Unfold.hs - + testsuite/tests/perf/compiler/T16473b.hs - + testsuite/tests/perf/compiler/T16473b.stdout - testsuite/tests/perf/compiler/all.T - testsuite/tests/simplCore/should_compile/T24229a.stderr - testsuite/tests/simplCore/should_compile/T24229b.stderr Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -4172,17 +4172,40 @@ application (K f x). So we might inline it to get K g y -> blah[g,y] But now we have to make `blah` into a join point, /abstracted/ -over `g` and `y`. In contrast, if we /don't/ inline $j we -don't need a join point for `blah` and we'll get - join $j x = let g=f, y=x in blah[g,y] +over `g` and `y`. We get + join $j2 g y = blah in case v of - p1 -> $j x1 - p2 -> $j x2 - p3 -> $j x3 + p1 -> $j2 f x1 + p2 -> $j2 f x2 + p3 -> $j2 f x3 +So now we can't see that `g` is always `f` in `blah`. + +In contrast, if we /don't/ inline $j we +don't need a new join point for `blah` and we'll get + join $j' x = let g=f, y=x in blah[g,y] + in case v of + p1 -> $j' x1 + p2 -> $j' x2 + p3 -> $j' x3 This can make a /massive/ difference, because `blah` can see what `f` is, instead of lambda-abstracting over it. +If instead the RHS of the join point is a simple application that has no free +variables, as in + + case (join $j x f = K f x ) + (in case v of ) + ( p1 -> $j x1 f1 ) of + ( p2 -> $j x2 f2 ) + ( p3 -> $j x3 f3 ) + K g y -> blah[g,y] + +then no information can be gained by preserving the join point (c.f. `f` being +free in the join point above and being useful to `blah`). In this case, it's +more beneficial to inline the join point (see (DJ3)(c)) to allow further +optimisations to fire. An example where failing to do this went wrong is #25723. + Beyond this, not-inlining join points reduces duplication. In the above example, if `blah` was small enough we'd inline it, but that duplicates code, for no gain. Best just to keep not-inline the join point in the first place. @@ -4207,12 +4230,27 @@ unconditional-inlining for join points. case-of-case friendly. (DJ3) When should `uncondInlineJoin` return True? - * (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see + (a) (exprIsTrivial rhs); this includes uses of unsafeEqualityProof etc; see the defn of exprIsTrivial. Also nullary constructors. - * The RHS is a call ($j x y z), where the arguments are all trivial and $j + (b) The RHS is a call ($j x y z), where the arguments are all trivial and $j is a join point: there is no point in creating an indirection. + (c) The RHS is a data constructor application (K x y z) where + + - all the args x,y,z are trivial + - the free LocalIds of `f x y z` are a subset of the join point binders + + Examples that return True + $j x y = K y (x |> co) + $j x y = x (y @Int) + Examples that return False + $j x = K y x -- y is free + $j y = f y -- f is free + + Not duplicating these join points has no benefits and blocks other important + optimisations from firing (see #25723) + (DJ4) By the same token we want to use Plan B in Note [Duplicating StrictArg] when the RHS of the new join point is a data constructor application. See the call to isDataConId in the StrictArg case of mkDupableContWithDmds. ===================================== compiler/GHC/Core/Unfold.hs ===================================== @@ -434,18 +434,50 @@ uncondInline is_join rhs bndrs arity body size uncondInlineJoin :: [Var] -> CoreExpr -> Bool -- See Note [Duplicating join points] point (DJ3) in GHC.Core.Opt.Simplify.Iteration -uncondInlineJoin _bndrs body +uncondInlineJoin bndrs body + + -- (DJ3)(a) | exprIsTrivial body = True -- Nullary constructors, literals - | (Var v, args) <- collectArgs body - , all exprIsTrivial args - , isJoinId v -- Indirection to another join point; always inline + -- (DJ3)(b) and (DJ3)(c) combined + | indirectionOrAppWithoutFVs = True | otherwise = False + where + -- (DJ3)(b): + -- - $j1 x = $j2 y x |> co -- YES, inline indirection regardless of free vars + -- (DJ3)(c): + -- - $j1 x y = K y x |> co -- YES, inline! + -- - $j2 x = K f x -- No, don't! (because f is free) + indirectionOrAppWithoutFVs = go False body + + go !seen_fv (App f a) + | Just has_fv <- go_arg a + = go (seen_fv || has_fv) f + | otherwise = False -- Not trivial + go seen_fv (Var v) + | isJoinId v = True -- Indirection to another join point; always inline + | isDataConId v = not seen_fv -- e.g. $j a b = K a b + | v `elem` bndrs = not seen_fv -- e.g. $j a b = b a + go seen_fv (Cast e _) = go seen_fv e + go seen_fv (Tick _ e) = go seen_fv e + go _ _ = False + + -- go_arg returns: + -- - `Nothing` if arg is not trivial + -- - `Just True` if arg is trivial and contains free var + -- - `Just False` if arg is trivial without free vars + go_arg (Type {}) = Just False + go_arg (Coercion {}) = Just False + go_arg (App f a) + | isTyCoArg a = go_arg f -- e.g. $j f = K (f @a) + go_arg (Var f) = Just $! f `notElem` bndrs + go_arg _ = Nothing + sizeExpr :: UnfoldingOpts -> Int -- Bomb out if it gets bigger than this ===================================== testsuite/tests/perf/compiler/T16473b.hs ===================================== @@ -0,0 +1,102 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeOperators #-} + +{-# OPTIONS_GHC -flate-specialise -O2 #-} + +module Main (main) where + +import qualified Control.Monad.State.Strict as S +import Data.Foldable +import Data.Functor.Identity +import Data.Kind +import Data.Monoid +import Data.Tuple + +main :: IO () +main = print $ badCore 100 + +badCore :: Int -> Int +badCore n = getSum $ fst $ run $ runState mempty $ for_ [0..n] $ \i -> modify (<> Sum i) + +data Union (r :: [Type -> Type]) a where + Union :: e a -> Union '[e] a + +decomp :: Union (e ': r) a -> e a +decomp (Union a) = a +{-# INLINE decomp #-} + +absurdU :: Union '[] a -> b +absurdU = absurdU + +newtype Semantic r a = Semantic + { runSemantic + :: forall m + . Monad m + => (forall x. Union r x -> m x) + -> m a + } + +instance Functor (Semantic f) where + fmap f (Semantic m) = Semantic $ \k -> fmap f $ m k + {-# INLINE fmap #-} + +instance Applicative (Semantic f) where + pure a = Semantic (\x -> const (pure a) x) + {-# INLINE pure #-} + Semantic f <*> Semantic a = Semantic $ \k -> f k <*> a k + {-# INLINE (<*>) #-} + +instance Monad (Semantic f) where + return = pure + {-# INLINE return #-} + Semantic ma >>= f = Semantic $ \k -> do + z <- ma k + runSemantic (f z) k + {-# INLINE (>>=) #-} + +data State s a + = Get (s -> a) + | Put s a + deriving Functor + +get :: Semantic '[State s] s +get = Semantic $ \k -> k $ Union $ Get id +{-# INLINE get #-} + +put :: s -> Semantic '[State s] () +put !s = Semantic $ \k -> k $ Union $! Put s () +{-# INLINE put #-} + +modify :: (s -> s) -> Semantic '[State s] () +modify f = do + !s <- get + put $! f s +{-# INLINE modify #-} + +runState :: s -> Semantic (State s ': r) a -> Semantic r (s, a) +runState = interpretInStateT $ \case + Get k -> fmap k S.get + Put s k -> S.put s >> pure k +{-# INLINE[3] runState #-} + +run :: Semantic '[] a -> a +run (Semantic m) = runIdentity $ m absurdU +{-# INLINE run #-} + +interpretInStateT + :: (forall x. e x -> S.StateT s (Semantic r) x) + -> s + -> Semantic (e ': r) a + -> Semantic r (s, a) +interpretInStateT f s (Semantic m) = Semantic $ \k -> + fmap swap $ flip S.runStateT s $ m $ \u -> + S.mapStateT (\z -> runSemantic z k) $ f $ decomp u +{-# INLINE interpretInStateT #-} + ===================================== testsuite/tests/perf/compiler/T16473b.stdout ===================================== @@ -0,0 +1 @@ +5050 ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -612,6 +612,17 @@ test ('T16473', compile_and_run, ['-O2 -flate-specialise']) +# Run this program. If inlining the join point fails, it'll start to allocate much more. +# The join point is only created when -fno-local-float-out +test ('T16473b', + [ collect_stats('bytes allocated',5) + , only_ways(['normal']) + , js_broken(22261) + ], + compile_and_run, + ['-O2 -fno-local-float-out']) + + test('T17516', [ collect_compiler_runtime(5), ], ===================================== testsuite/tests/simplCore/should_compile/T24229a.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 83, types: 113, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 79, types: 106, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } ===================================== testsuite/tests/simplCore/should_compile/T24229b.stderr ===================================== @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 64, types: 90, coercions: 8, joins: 1/1} +Result size of Tidy Core = {terms: 60, types: 83, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo @@ -14,10 +14,9 @@ end Rec } foo = \ @a ds ds1 -> case ds of { I# ww -> - join { $j ww1 = Just ww1 } in case ww of ds2 { - __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> jump $j ww1 } }; - 0# -> jump $j (ds1 `cast` :: ...) + __DEFAULT -> case ds1 `cast` :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + 0# -> Just (ds1 `cast` :: ...) } } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/32fa7b4554d7ed6d4a438604efb15c4a7a09dc11...05e456bc55d4033a6b5a3932ebefb0e392aa8095 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/32fa7b4554d7ed6d4a438604efb15c4a7a09dc11...05e456bc55d4033a6b5a3932ebefb0e392aa8095 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 16:04:56 2025 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 11 Feb 2025 11:04:56 -0500 Subject: [Git][ghc/ghc] Pushed new branch wip/ghc-persistent-worker Message-ID: <67ab75288f446_9c60895130c61412@gitlab.mail> Matthew Pickering pushed new branch wip/ghc-persistent-worker at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/ghc-persistent-worker You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 16:22:25 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 11 Feb 2025 11:22:25 -0500 Subject: [Git][ghc/ghc][wip/T25675] Deal correctly with Given CallStack constraints Message-ID: <67ab79419b0ad_9c6089515646407e@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25675 at Glasgow Haskell Compiler / GHC Commits: e22a14fc by Simon Peyton Jones at 2025-02-11T16:21:10+00:00 Deal correctly with Given CallStack constraints As #25675 showed, the CallStack solving mechanism was failing to account for Given CallStack constraints. This small patch fixes it and improves the Notes. Small improvement to GHCi debugger output in break011, break024, which is discussed on the MR !13883 - - - - - 9 changed files: - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Solver/Types.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Types/Origin.hs - testsuite/tests/ghci.debugger/scripts/break011.stdout - testsuite/tests/ghci.debugger/scripts/break024.stdout - + testsuite/tests/profiling/should_run/T25675.hs - + testsuite/tests/profiling/should_run/T25675.stdout - testsuite/tests/profiling/should_run/all.T Changes: ===================================== compiler/GHC/Tc/Solver/Dict.hs ===================================== @@ -140,7 +140,7 @@ canDictCt ev cls tys | CtWanted { ctev_rewriters = rewriters } <- ev , Just ip_name <- isCallStackPred cls tys - , isPushCallStackOrigin orig + , Just fun_fs <- isPushCallStackOrigin_maybe orig -- If we're given a CallStack constraint that arose from a function -- call, we need to push the current call-site onto the stack instead -- of solving it directly from a given. @@ -159,8 +159,7 @@ canDictCt ev cls tys -- Then we solve the wanted by pushing the call-site -- onto the newly emitted CallStack - ; let ev_cs = EvCsPushCall (callStackOriginFS orig) - (ctLocSpan loc) (ctEvExpr new_ev) + ; let ev_cs = EvCsPushCall fun_fs (ctLocSpan loc) (ctEvExpr new_ev) ; solveCallStack ev ev_cs ; continueWith (DictCt { di_ev = new_ev, di_cls = cls ===================================== compiler/GHC/Tc/Solver/Types.hs ===================================== @@ -134,7 +134,7 @@ emptyDictMap = emptyTcAppMap findDict :: DictMap a -> CtLoc -> Class -> [Type] -> Maybe a findDict m loc cls tys | Just {} <- isCallStackPred cls tys - , isPushCallStackOrigin (ctLocOrigin loc) + , Just {} <- isPushCallStackOrigin_maybe (ctLocOrigin loc) = Nothing -- See Note [Solving CallStack constraints] | otherwise @@ -156,7 +156,7 @@ foldDicts = foldTcAppMap {- Note [Solving CallStack constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -See also Note [Overview of implicit CallStacks] in GHc.Tc.Types.Evidence. +See Note [Overview of implicit CallStacks] in GHc.Tc.Types.Evidence. Suppose f :: HasCallStack => blah. Then ===================================== compiler/GHC/Tc/Types/Evidence.hs ===================================== @@ -655,7 +655,6 @@ Conclusion: a new wanted coercion variable should be made mutable. [Notice though that evidence variables that bind coercion terms from super classes will be "given" and hence rigid] - Note [Overview of implicit CallStacks] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (See https://gitlab.haskell.org/ghc/ghc/wikis/explicit-call-stack/implicit-locations) @@ -667,12 +666,13 @@ to constraints of type GHC.Stack.Types.HasCallStack, an alias type HasCallStack = (?callStack :: CallStack) -Implicit parameters of type GHC.Stack.Types.CallStack (the name is not -important) are solved in three steps: +Implicit parameters of type GHC.Stack.Types.CallStack (the /name/ of the +implicit parameter is not important, see (CS5) below) are solved as follows: -1. Explicit, user-written occurrences of `?stk :: CallStack` - which have IPOccOrigin, are solved directly from the given IP, - just like a regular IP; see GHC.Tc.Solver.Dict.tryInertDicts. +1. Plan NORMAL. Explicit, user-written occurrences of `?stk :: CallStack`, which + have IPOccOrigin, are solved directly from the given IP, just like any other + implicit-parameter constraint; see GHC.Tc.Solver.Dict.tryInertDicts. We can + solve it from a Given or from another Wanted, if the two have the same type. For example, the occurrence of `?stk` in @@ -681,44 +681,35 @@ important) are solved in three steps: will be solved for the `?stk` in `error`s context as before. -2. In a function call, instead of simply passing the given IP, we first - append the current call-site to it. For example, consider a - call to the callstack-aware `error` above. - - foo :: (?stk :: CallStack) => a - foo = error "undefined!" - - Here we want to take the given `?stk` and append the current - call-site, before passing it to `error`. In essence, we want to - rewrite `foo "undefined!"` to +2. Plan PUSH. A /function call/ with a CallStack constraint, such as + a call to `foo` where + foo :: (?stk :: CallStack) => a + will give rise to a Wanted constraint + [W] d :: (?stk :: CallStack) CtOrigin = OccurrenceOf "foo" - let ?stk = pushCallStack ?stk - in foo "undefined!" + We do /not/ solve this constraint from Givens, or from other + Wanteds. Rather, have a built-in mechanism in that solves it thus: + d := EvCsPushCall "foo"
d2 + [W] d2 :: (?stk :: CallStack) CtOrigin = IPOccOrigin - We achieve this as follows: + That is, `d` is a call-stack that has the `foo` call-site pushed on top of + `d2`, which can now be solved normally (as in (1) above). This is done in two + places: + - In GHC.Tc.Solver.Dict.canDictNC we do the pushing. + - In GHC.Tc.Solver.Types.findDict we arrrange /not/ to solve a plan-PUSH + constraint by forcing a "miss" in the lookup in the inert set - * At a call of foo :: (?stk :: CallStack) => blah - we emit a Wanted - [W] d1 : IP "stk" CallStack - with CtOrigin = OccurrenceOf "foo" +3. For a CallStack constraint, we choose how to solve it based on its CtOrigin: - * We /solve/ this constraint, in GHC.Tc.Solver.Dict.canDictNC - by emitting a NEW Wanted - [W] d2 :: IP "stk" CallStack - with CtOrigin = IPOccOrigin + * solve it normally (plan NORMAL above) + - IPOccOrigin (discussed above) + - GivenOrigin (see (CS1) below) - and solve d1 = EvCsPushCall "foo" (EvId d1) + * push an item on the stack and emit a new constraint (plan PUSH above) + - OccurrenceOf "foo" (discused above) + - anything else (see (CS1) below) - * The new Wanted, for `d2` will be solved per rule (1), ie as a regular IP. - -3. We use the predicate isPushCallStackOrigin to identify whether we - want to do (1) solve directly, or (2) push and then solve directly. - Key point (see #19918): the CtOrigin where we want to push an item on the - call stack can include IfThenElseOrigin etc, when RebindableSyntax is - involved. See the defn of fun_orig in GHC.Tc.Gen.App.tcInstFun; it is - this CtOrigin that is pinned on the constraints generated by functions - in the "expansion" for rebindable syntax. c.f. GHC.Rename.Expr - Note [Handling overloaded and rebindable constructs] + This choice is by the predicate isPushCallStackOrigin_maybe 4. We default any insoluble CallStacks to the empty CallStack. Suppose `undefined` did not request a CallStack, ie @@ -754,21 +745,38 @@ and the call to `error` in `undefined`, but *not* the call to `head` in `g`, because `head` did not explicitly request a CallStack. -Important Details: -- GHC should NEVER report an insoluble CallStack constraint. +Wrinkles + +(CS1) Which CtOrigins should qualify for plan PUSH? Certainly ones that arise + from a function call like (f a b). -- GHC should NEVER infer a CallStack constraint unless one was requested + But (see #19918) when RebindableSyntax is involved we can function call whose + CtOrigin is somethign like `IfThenElseOrigin`. See the defn of fun_orig in + GHC.Tc.Gen.App.tcInstFun; it is this CtOrigin that is pinned on the + constraints generated by functions in the "expansion" for rebindable + syntax. c.f. GHC.Rename.Expr Note [Handling overloaded and rebindable + constructs]. + + So isPushCallStackOrigin_maybe has a fall-through for "anything else", and + assumes that we should adopt plan PUSH for it. + + However we should /not/ take this fall-through for Given constraints + (#25675). So isPushCallStackOrigin_maybe identifies Givens as plan NORMAL. + +(CS2) GHC should NEVER report an insoluble CallStack constraint. + +(CS3) GHC should NEVER infer a CallStack constraint unless one was requested with a partial type signature (See GHC.Tc.Solver..pickQuantifiablePreds). -- A CallStack (defined in GHC.Stack.Types) is a [(String, SrcLoc)], +(CS4)- A CallStack (defined in GHC.Stack.Types) is a [(String, SrcLoc)], where the String is the name of the binder that is used at the SrcLoc. SrcLoc is also defined in GHC.Stack.Types and contains the package/module/file name, as well as the full source-span. Both CallStack and SrcLoc are kept abstract so only GHC can construct new values. -- We will automatically solve any wanted CallStack regardless of the - name of the IP, i.e. +(CS5) We will automatically solve any wanted CallStack regardless of the + /name/ of the IP, i.e. f = show (?stk :: CallStack) g = show (?loc :: CallStack) @@ -782,17 +790,16 @@ Important Details: the printed CallStack will NOT include head's call-site. This reflects the standard scoping rules of implicit-parameters. -- An EvCallStack term desugars to a CoreExpr of type `IP "some str" CallStack`. +(CS6) An EvCallStack term desugars to a CoreExpr of type `IP "some str" CallStack`. The desugarer will need to unwrap the IP newtype before pushing a new call-site onto a given stack (See GHC.HsToCore.Binds.dsEvCallStack) -- When we emit a new wanted CallStack from rule (2) we set its origin to +(CS7) When we emit a new wanted CallStack in plan PUSH we set its origin to `IPOccOrigin ip_name` instead of the original `OccurrenceOf func` (see GHC.Tc.Solver.Dict.tryInertDicts). This is a bit shady, but is how we ensure that the new wanted is solved like a regular IP. - -} mkEvCast :: EvExpr -> TcCoercion -> EvTerm ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -27,7 +27,7 @@ module GHC.Tc.Types.Origin ( TypedThing(..), TyVarBndrs(..), -- * CallStack - isPushCallStackOrigin, callStackOriginFS, + isPushCallStackOrigin_maybe, -- * FixedRuntimeRep origin FixedRuntimeRepOrigin(..), @@ -984,18 +984,22 @@ pprNonLinearPatternReason OtherPatternReason = empty * * ********************************************************************* -} -isPushCallStackOrigin :: CtOrigin -> Bool --- Do we want to solve this IP constraint directly (return False) --- or push the call site (return True) --- See Note [Overview of implicit CallStacks] in GHc.Tc.Types.Evidence -isPushCallStackOrigin (IPOccOrigin {}) = False -isPushCallStackOrigin _ = True - - -callStackOriginFS :: CtOrigin -> FastString --- This is the string that appears in the CallStack -callStackOriginFS (OccurrenceOf fun) = occNameFS (getOccName fun) -callStackOriginFS orig = mkFastString (showSDocUnsafe (pprCtO orig)) +isPushCallStackOrigin_maybe :: CtOrigin -> Maybe FastString +-- Do we want to solve this IP constraint normally (return Nothing) +-- or push the call site (returning the name of the function being called) +-- See Note [Overview of implicit CallStacks] esp (CS1) in GHC.Tc.Types.Evidence +isPushCallStackOrigin_maybe (GivenOrigin {}) = Nothing +isPushCallStackOrigin_maybe (GivenSCOrigin {}) = Nothing +isPushCallStackOrigin_maybe (IPOccOrigin {}) = Nothing +isPushCallStackOrigin_maybe (OccurrenceOf fun) = Just (occNameFS (getOccName fun)) +isPushCallStackOrigin_maybe orig = Just orig_fs + -- This fall-through case is important to deal with call stacks + -- that arise from rebindable syntax (#19919) + -- Here the "name of the function being called" is approximated as + -- the result of prettty-printing the CtOrigin; a bit messy, + -- but we can perhaps improve it in the light of user feedback + where + orig_fs = mkFastString (showSDocUnsafe (pprCtO orig)) {- ************************************************************************ ===================================== testsuite/tests/ghci.debugger/scripts/break011.stdout ===================================== @@ -29,9 +29,9 @@ HasCallStack backtrace: error, called at Test7.hs:2:18 in main:Main Stopped in , -_exception :: e = _ +_exception :: e = SomeException (ErrorCall "foo") Stopped in , -_exception :: e = _ +_exception :: e = SomeException (ErrorCall "foo") *** Exception: foo HasCallStack backtrace: ===================================== testsuite/tests/ghci.debugger/scripts/break024.stdout ===================================== @@ -17,7 +17,9 @@ _exception = SomeException Nothing GHC.Internal.IO.Exception.UserError [] "error" Nothing Nothing) Stopped in , -_exception :: e = _ +_exception :: e = SomeException + (GHC.Internal.IO.Exception.IOError + Nothing GHC.Internal.IO.Exception.UserError ....) Stopped in , _exception :: e = _ _exception = SomeException ===================================== testsuite/tests/profiling/should_run/T25675.hs ===================================== @@ -0,0 +1,21 @@ +{-# LANGUAGE ImplicitParams #-} + +module Main where + +import Data.Maybe +import Debug.Trace +import GHC.IsList +import GHC.Stack + +hd (c:cs) = c +hd [] = error "urk" + +what :: (HasCallStack) => Int +what = + let cs = getCallStack callStack + in srcLocStartCol (snd (hd cs)) + +main :: IO () +main = + let ?callStack = fromList [] + in print (what, what) ===================================== testsuite/tests/profiling/should_run/T25675.stdout ===================================== @@ -0,0 +1 @@ +(14,20) ===================================== testsuite/tests/profiling/should_run/all.T ===================================== @@ -232,3 +232,5 @@ test('scc-prof-overloaded-calls002', # Need optimizations to get rid of unwanted overloaded calls ['-O -fno-prof-auto -fprof-late-overloaded-calls'] ) + +test('T25675', [], compile_and_run, ['-dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e22a14fc163552a257ee2273b35dd42f665066c5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e22a14fc163552a257ee2273b35dd42f665066c5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 16:33:25 2025 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 11 Feb 2025 11:33:25 -0500 Subject: [Git][ghc/ghc][wip/T23109] 50 commits: gitlab-ci: Don't use .full-ci to run test-primops Message-ID: <67ab7bd58a65f_9c608100851070571@gitlab.mail> Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: 9a59b026 by Ben Gamari at 2025-02-04T10:00:18-05:00 gitlab-ci: Don't use .full-ci to run test-primops test-primops depends upon the existence of validate jobs, yet these do not exist in the context of nightly jobs, which .full-ci includes. - - - - - 7cc08550 by Ben Gamari at 2025-02-04T18:34:49-05:00 CorePrep: Name `sat` binders more descriptively - - - - - fb40981d by Ben Gamari at 2025-02-04T18:35:26-05:00 ghc-toolchain: Parse i686 triples This is a moniker used for later 32-bit x86 implementations (Pentium Pro and later). Fixes #25691. - - - - - 02794411 by Cheng Shao at 2025-02-04T18:36:03-05:00 compiler: remove unused assembleOneBCO function This patch removes the unused assembleOneBCO function from the bytecode assembler. - - - - - db19c8a9 by Matthew Pickering at 2025-02-05T23:16:50-05:00 perf: Replace uses of genericLength with strictGenericLength genericLength is a recursive function and marked NOINLINE. It is not going to specialise. In profiles, it can be seen that 3% of total compilation time when computing bytecode is spend calling this non-specialised function. In addition, we can simplify `addListToSS` to avoid traversing the input list twice and also allocating an intermediate list (after the call to reverse). Overall these changes reduce the time spend in 'assembleBCOs' from 5.61s to 3.88s. Allocations drop from 8GB to 5.3G. Fixes #25706 - - - - - 5622a14a by Matthew Pickering at 2025-02-05T23:17:27-05:00 perf: nameToCLabel: Directly manipulate ByteString rather than going via strings `nameToCLabel` is called from `lookupHsSymbol` many times during bytecode linking. We can save a lot of allocations and time by directly manipulating the bytestrings rather than going via intermediate lists. Before: 2GB allocation, 1.11s After: 260MB allocation, 375ms Fixes #25719 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot ------------------------- - - - - - 66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00 interpreter: Fix INTERP_STATS profiling code The profiling code had slightly bitrotted since the last time it was used. This just fixes things so that if you toggle the INTERP_STATS macro then it just works and prints out the stats. Fixes #25695 - - - - - f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00 perf: Key the interpreter symbol cache by Name rather than FastString Profiles showed that about 0.2s was being spend constructing the keys before looking up values in the old symbol cache. The performance of this codepath is critical as it translates directly to a delay when a user evaluates a function like `main` in the interpreter. Therefore we implement a solution which keys the cache(s) by `Name` rather than the symbol directly, so the cache can be consulted before the symbol is constructed. Fixes #25731 - - - - - 8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by IO operations Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label threads forked by System.Timeout Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label signal handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Label Windows console event handling threads Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00 ghci: Label evaluation sandbox thread Addresses part of #25452. Addresses core-libraries-committee#305. - - - - - 38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00 base: Add changelog entry for addition of thread labels Addresses #25452. Addresses core-libraries-committee#305. - - - - - c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Clean up style This cleans up a number of stylistic inconsistencies although it's still far from perfect. - - - - - c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00 gen-ci: Properly encapsulate GitLab predicates - - - - - 52b6539b by M Farkas-Dyck at 2025-02-08T11:34:51-08:00 Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc. In particular, use `NonEmpty` where appropriate: - the argument of `FieldLabelString` - the argument of `HsMultiIf` - `grhssGRHSs` Decreases overall compile-time allocation by about 0.1% in the benchmark suite (min -0.8%, max +0.3%). Metric Decrease: T3294 - - - - - a566da92 by Ben Gamari at 2025-02-10T03:21:49-05:00 gitlab-ci: Bump docker images Closes #25693. - - - - - a7e23f01 by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Drop uses of head/tail To silence warnings with GHC 9.10 - - - - - 12752f0c by Ben Gamari at 2025-02-10T03:21:49-05:00 hadrian: Disable x-data-list-nonempty-unzip warning - - - - - 46f89882 by Simon Peyton Jones at 2025-02-11T13:56:21+00:00 Make newtype instances opaque I think this will help with #23109 Wibbles Allow SelCo for newtype classes Experimental change Wibble Furher wibbles Further improvments Further wibbles esp exprIsConLike Run classop rule first Newtype classops are small needs comments - - - - - e3969c24 by Simon Peyton Jones at 2025-02-11T13:56:21+00:00 Wibble imports - - - - - 8d1bc5e4 by Simon Peyton Jones at 2025-02-11T13:56:21+00:00 Wibbles Notably: define and use mkNewTypeDictApp - - - - - ad0aa6a8 by Simon Peyton Jones at 2025-02-11T13:58:09+00:00 Make newtype-class data constructors not inline This variant tries * Making the data constructor for a newtype class not inline * exprIsConApp_maybe treats it like a normal data constructor * CoreToStg discards it (perhaps CorePrep should do that instead) * Some as-it-turns-out unforced changes to corePrepPgm that makes it pass all TyCons, not just the data tycons * Significantly simpler story in mkNewTypeDictApp - - - - - c9479535 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Wibble - - - - - 30cde81a by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Get rid of newtype classes in CorePrep not CoreToStg - - - - - 3b34c5ea by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Comment out bits that I think are no longer necessary * Extra field in ClassOpId, and classOpDictApp_maybe in Simplify.Iteration * Newtype classes being injective * Don't preInlineUnconditionally Dfuns * mkNewTypeDictApp * Zonking of unfoldings (only necessary for those local dfuns) - - - - - b0da8945 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Wibble - - - - - acc205e0 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Allow pushDataCon on ClassTyCon newtypes The fact that there is no *actual* data constructor in the end i kind-of-irrelevant, and we turn out to get quite a lot of class-op (d |> co) where co : C t1 ~R C t2 - - - - - 42be7541 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Wibbles to merge - - - - - fb5eaadf by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Make newtype classes pretend to be injective - - - - - 1148b425 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Make class datacons be have-no-unfolding Fixes the problem reported in #20689 @Mikolaj - - - - - ee65554c by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 wibble - - - - - 720ea842 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Don't make a closure table for type data decls - - - - - 4ffd6329 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Make UanaryClass a new AlgTyConRhs work in progress, won't compile - - - - - aa6fdfb2 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 More wibbles - - - - - afbc9779 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 More wibbbles - - - - - 4258fc18 by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 More wibbles - - - - - 6f6a63bc by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Unused bindings - - - - - c21f886d by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Unused import - - - - - f8d45b8c by Simon Peyton Jones at 2025-02-11T13:58:10+00:00 Wibbles - - - - - 46d31a92 by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 Wibbles - - - - - cfe728f7 by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 Wibble - - - - - f0349afb by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 Wibbles Remove tyConAlgDataCons_maybe, and tyConSingleAlgDataCon_maybe Rename dontUnbox to canUnboxType (flippping sign) - - - - - 2882688c by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 Rebase wibbles - - - - - 547dbf95 by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 More rebase wibbles - - - - - ed8cd4af by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 Yet more rebase wibbles - - - - - a6ab2047 by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 Wibble imports - - - - - 50d804c5 by Simon Peyton Jones at 2025-02-11T13:58:11+00:00 Import wibble - - - - - 660c4b1d by Simon Peyton Jones at 2025-02-11T16:33:02+00:00 Adjust type of evCast ..to avoid gratuitous breakage - - - - - 136 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - compiler/GHC.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/InfoTable.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/Simplify/Env.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/Core/SimpleOpt.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unfold.hs - compiler/GHC/Core/UsageEnv.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/CoreToStg.hs - compiler/GHC/CoreToStg/Prep.hs - + compiler/GHC/Data/List/NonEmpty.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Foreign/Call.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Decl.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Iface/Tidy.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Interpreter.hs - compiler/GHC/Runtime/Interpreter/Types.hs - + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Instance/Class.hs - compiler/GHC/Tc/Instance/Family.hs - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl/Build.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - − compiler/GHC/Tc/Types/EvTerm.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Make.hs - compiler/GHC/Types/RepType.hs - compiler/GHC/Types/TyThing.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Oracles/ModuleFiles.hs - hadrian/src/Rules/Dependencies.hs - hadrian/src/Settings/Parser.hs - libraries/base/changelog.md - libraries/base/src/Control/Concurrent.hs - libraries/base/src/System/Timeout.hs - libraries/ghc-boot/GHC/Data/SizedSeq.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc - libraries/ghci/GHCi/Run.hs - rts/Interpreter.c - rts/Interpreter.h - rts/RtsMain.c - testsuite/tests/core-to-stg/T14895.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/dmdanal/sigs/T21888.stderr - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/ghci/should_run/T21052.stdout - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/module/mod185.stderr - testsuite/tests/numeric/should_compile/T15547.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - testsuite/tests/simplCore/should_compile/T17366.stderr - testsuite/tests/simplCore/should_compile/T17966.stderr - testsuite/tests/simplCore/should_compile/T20040.stderr - testsuite/tests/simplCore/should_compile/T23083.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/simplStg/should_compile/T19717.stderr - testsuite/tests/tcplugins/CtIdPlugin.hs - + testsuite/tests/th/EmptyGuard.hs - + testsuite/tests/th/EmptyGuard.stderr - testsuite/tests/th/all.T - testsuite/tests/wasm/should_run/control-flow/LoadCmmGroup.hs - utils/check-exact/ExactPrint.hs - utils/check-exact/Transform.hs - utils/ghc-toolchain/src/GHC/Toolchain/ParseTriple.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ff1f263c3a453f84d69aef83b1e115e6b9c089bc...660c4b1d5aaa730a7b54bf3ad443ab0b7829b33b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ff1f263c3a453f84d69aef83b1e115e6b9c089bc...660c4b1d5aaa730a7b54bf3ad443ab0b7829b33b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Feb 11 21:26:30 2025 From: gitlab at gitlab.haskell.org (Richard Eisenberg (@rae)) Date: Tue, 11 Feb 2025 16:26:30 -0500 Subject: [Git][ghc/ghc][wip/T23162] 6135 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <67abc0861a698_1759cba38450321f5@gitlab.mail> Richard Eisenberg pushed to branch wip/T23162 at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css specifies the style sheet to use - new option: -o specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel ) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in
..
, just use .. to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory
" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The and
 environments seem to use a font that is a little
too small in IE.  Compensate.

(suggestion from Daan Leijen).

- - - - -
8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00
[haddock @ 2002-08-02 09:25:20 by simonmar]
Remove 

..

from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh . - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh . - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh . - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a