Rodrigo Mesquita pushed to branch wip/romes/step-out-9 at Glasgow Haskell Compiler / GHC
Commits:
-
674a1380
by Rodrigo Mesquita at 2025-06-30T18:13:57+01:00
21 changed files:
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Map/Expr.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/Tidy.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/CoreToStg.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Stg/BcPrep.hs
- compiler/GHC/Stg/FVs.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/Types/Breakpoint.hs
- compiler/GHC/Types/Tickish.hs
Changes:
... | ... | @@ -287,7 +287,7 @@ exprs_fvs :: [CoreExpr] -> FV |
287 | 287 | exprs_fvs exprs = mapUnionFV expr_fvs exprs
|
288 | 288 | |
289 | 289 | tickish_fvs :: CoreTickish -> FV
|
290 | -tickish_fvs (Breakpoint _ _ ids _) = FV.mkFVs ids
|
|
290 | +tickish_fvs (Breakpoint _ _ ids) = FV.mkFVs ids
|
|
291 | 291 | tickish_fvs _ = emptyFV
|
292 | 292 | |
293 | 293 | {- **********************************************************************
|
... | ... | @@ -759,8 +759,8 @@ freeVars = go |
759 | 759 | , AnnTick tickish expr2 )
|
760 | 760 | where
|
761 | 761 | expr2 = go expr
|
762 | - tickishFVs (Breakpoint _ _ ids _) = mkDVarSet ids
|
|
763 | - tickishFVs _ = emptyDVarSet
|
|
762 | + tickishFVs (Breakpoint _ _ ids) = mkDVarSet ids
|
|
763 | + tickishFVs _ = emptyDVarSet
|
|
764 | 764 | |
765 | 765 | go (Type ty) = (tyCoVarsOfTypeDSet ty, AnnType ty)
|
766 | 766 | go (Coercion co) = (tyCoVarsOfCoDSet co, AnnCoercion co) |
... | ... | @@ -897,8 +897,8 @@ lintCoreExpr (Cast expr co) |
897 | 897 | |
898 | 898 | lintCoreExpr (Tick tickish expr)
|
899 | 899 | = do { case tickish of
|
900 | - Breakpoint _ _ ids _ -> forM_ ids $ \id -> lintIdOcc id 0
|
|
901 | - _ -> return ()
|
|
900 | + Breakpoint _ _ ids -> forM_ ids $ \id -> lintIdOcc id 0
|
|
901 | + _ -> return ()
|
|
902 | 902 | ; markAllJoinsBadIf block_joins $ lintCoreExpr expr }
|
903 | 903 | where
|
904 | 904 | block_joins = not (tickish `tickishScopesLike` SoftScope)
|
... | ... | @@ -198,11 +198,10 @@ eqDeBruijnExpr (D env1 e1) (D env2 e2) = go e1 e2 where |
198 | 198 | |
199 | 199 | eqDeBruijnTickish :: DeBruijn CoreTickish -> DeBruijn CoreTickish -> Bool
|
200 | 200 | eqDeBruijnTickish (D env1 t1) (D env2 t2) = go t1 t2 where
|
201 | - go (Breakpoint lext lid lids lmod) (Breakpoint rext rid rids rmod)
|
|
201 | + go (Breakpoint lext lid lids) (Breakpoint rext rid rids)
|
|
202 | 202 | = lid == rid
|
203 | 203 | && D env1 lids == D env2 rids
|
204 | 204 | && lext == rext
|
205 | - && lmod == rmod
|
|
206 | 205 | go l r = l == r
|
207 | 206 | |
208 | 207 | -- Compares for equality, modulo alpha
|
... | ... | @@ -2501,7 +2501,7 @@ occAnal env (Tick tickish body) |
2501 | 2501 | -- For a non-soft tick scope, we can inline lambdas only, so we
|
2502 | 2502 | -- abandon tail calls, and do markAllInsideLam too: usage_lam
|
2503 | 2503 | |
2504 | - | Breakpoint _ _ ids _ <- tickish
|
|
2504 | + | Breakpoint _ _ ids <- tickish
|
|
2505 | 2505 | = -- Never substitute for any of the Ids in a Breakpoint
|
2506 | 2506 | addManyOccs usage_lam (mkVarSet ids)
|
2507 | 2507 |
... | ... | @@ -1461,8 +1461,8 @@ simplTick env tickish expr cont |
1461 | 1461 | |
1462 | 1462 | |
1463 | 1463 | simplTickish env tickish
|
1464 | - | Breakpoint ext n ids modl <- tickish
|
|
1465 | - = Breakpoint ext n (mapMaybe (getDoneId . substId env) ids) modl
|
|
1464 | + | Breakpoint ext bid ids <- tickish
|
|
1465 | + = Breakpoint ext bid (mapMaybe (getDoneId . substId env) ids)
|
|
1466 | 1466 | | otherwise = tickish
|
1467 | 1467 | |
1468 | 1468 | -- Push type application and coercion inside a tick
|
... | ... | @@ -31,6 +31,7 @@ import GHC.Prelude |
31 | 31 | |
32 | 32 | import GHC.Core
|
33 | 33 | import GHC.Core.Stats (exprStats)
|
34 | +import GHC.Types.Breakpoint
|
|
34 | 35 | import GHC.Types.Fixity (LexicalFixity(..))
|
35 | 36 | import GHC.Types.Literal( pprLiteral )
|
36 | 37 | import GHC.Types.Name( pprInfixName, pprPrefixName )
|
... | ... | @@ -694,10 +695,10 @@ instance Outputable (XTickishId pass) => Outputable (GenTickish pass) where |
694 | 695 | ppr modl, comma,
|
695 | 696 | ppr ix,
|
696 | 697 | text ">"]
|
697 | - ppr (Breakpoint _ext ix vars modl) =
|
|
698 | + ppr (Breakpoint _ext bid vars) =
|
|
698 | 699 | hcat [text "break<",
|
699 | - ppr modl, comma,
|
|
700 | - ppr ix,
|
|
700 | + ppr (bi_tick_mod bid), comma,
|
|
701 | + ppr (bi_tick_index bid),
|
|
701 | 702 | text ">",
|
702 | 703 | parens (hcat (punctuate comma (map ppr vars)))]
|
703 | 704 | ppr (ProfNote { profNoteCC = cc,
|
... | ... | @@ -602,8 +602,8 @@ substDVarSet subst@(Subst _ _ tv_env cv_env) fvs |
602 | 602 | ------------------
|
603 | 603 | -- | Drop free vars from the breakpoint if they have a non-variable substitution.
|
604 | 604 | substTickish :: Subst -> CoreTickish -> CoreTickish
|
605 | -substTickish subst (Breakpoint ext n ids modl)
|
|
606 | - = Breakpoint ext n (mapMaybe do_one ids) modl
|
|
605 | +substTickish subst (Breakpoint ext bid ids)
|
|
606 | + = Breakpoint ext bid (mapMaybe do_one ids)
|
|
607 | 607 | where
|
608 | 608 | do_one = getIdFromTrivialExpr_maybe . lookupIdSubst subst
|
609 | 609 |
... | ... | @@ -235,8 +235,8 @@ tidyAlt env (Alt con vs rhs) |
235 | 235 | |
236 | 236 | ------------ Tickish --------------
|
237 | 237 | tidyTickish :: TidyEnv -> CoreTickish -> CoreTickish
|
238 | -tidyTickish env (Breakpoint ext ix ids modl)
|
|
239 | - = Breakpoint ext ix (map (tidyVarOcc env) ids) modl
|
|
238 | +tidyTickish env (Breakpoint ext bid ids)
|
|
239 | + = Breakpoint ext bid (map (tidyVarOcc env) ids)
|
|
240 | 240 | tidyTickish _ other_tickish = other_tickish
|
241 | 241 | |
242 | 242 | ------------ Rules --------------
|
... | ... | @@ -2492,11 +2492,10 @@ cheapEqExpr' ignoreTick e1 e2 |
2492 | 2492 | |
2493 | 2493 | -- Used by diffBinds, which is itself only used in GHC.Core.Lint.lintAnnots
|
2494 | 2494 | eqTickish :: RnEnv2 -> CoreTickish -> CoreTickish -> Bool
|
2495 | -eqTickish env (Breakpoint lext lid lids lmod) (Breakpoint rext rid rids rmod)
|
|
2495 | +eqTickish env (Breakpoint lext lid lids) (Breakpoint rext rid rids)
|
|
2496 | 2496 | = lid == rid &&
|
2497 | 2497 | map (rnOccL env) lids == map (rnOccR env) rids &&
|
2498 | - lext == rext &&
|
|
2499 | - lmod == rmod
|
|
2498 | + lext == rext
|
|
2500 | 2499 | eqTickish _ l r = l == r
|
2501 | 2500 | |
2502 | 2501 | -- | Finds differences between core bindings, see @diffExpr@.
|
... | ... | @@ -586,8 +586,8 @@ toIfaceTickish (ProfNote cc tick push) = IfaceSCC cc tick push |
586 | 586 | toIfaceTickish (HpcTick modl ix) = IfaceHpcTick modl ix
|
587 | 587 | toIfaceTickish (SourceNote src (LexicalFastString names)) =
|
588 | 588 | IfaceSource src names
|
589 | -toIfaceTickish (Breakpoint _ ix fv m) =
|
|
590 | - IfaceBreakpoint ix (toIfaceVar <$> fv) m
|
|
589 | +toIfaceTickish (Breakpoint _ ix fv) =
|
|
590 | + IfaceBreakpoint ix (toIfaceVar <$> fv)
|
|
591 | 591 | |
592 | 592 | ---------------------
|
593 | 593 | toIfaceBind :: Bind Id -> IfaceBinding IfaceLetBndr
|
... | ... | @@ -643,10 +643,10 @@ coreToStgArgs (arg : args) = do -- Non-type argument |
643 | 643 | coreToStgTick :: Type -- type of the ticked expression
|
644 | 644 | -> CoreTickish
|
645 | 645 | -> StgTickish
|
646 | -coreToStgTick _ty (HpcTick m i) = HpcTick m i
|
|
647 | -coreToStgTick _ty (SourceNote span nm) = SourceNote span nm
|
|
648 | -coreToStgTick _ty (ProfNote cc cnt scope) = ProfNote cc cnt scope
|
|
649 | -coreToStgTick !ty (Breakpoint _ bid fvs modl) = Breakpoint ty bid fvs modl
|
|
646 | +coreToStgTick _ty (HpcTick m i) = HpcTick m i
|
|
647 | +coreToStgTick _ty (SourceNote span nm) = SourceNote span nm
|
|
648 | +coreToStgTick _ty (ProfNote cc cnt scope) = ProfNote cc cnt scope
|
|
649 | +coreToStgTick !ty (Breakpoint _ bid fvs) = Breakpoint ty bid fvs
|
|
650 | 650 | |
651 | 651 | -- ---------------------------------------------------------------------------
|
652 | 652 | -- The magic for lets:
|
... | ... | @@ -842,9 +842,9 @@ cpeRhsE env (Tick tickish expr) |
842 | 842 | = do { body <- cpeBodyNF env expr
|
843 | 843 | ; return (emptyFloats, mkTick tickish' body) }
|
844 | 844 | where
|
845 | - tickish' | Breakpoint ext n fvs modl <- tickish
|
|
845 | + tickish' | Breakpoint ext bid fvs <- tickish
|
|
846 | 846 | -- See also 'substTickish'
|
847 | - = Breakpoint ext n (map (getIdFromTrivialExpr . lookupCorePrepEnv env) fvs) modl
|
|
847 | + = Breakpoint ext bid (map (getIdFromTrivialExpr . lookupCorePrepEnv env) fvs)
|
|
848 | 848 | | otherwise
|
849 | 849 | = tickish
|
850 | 850 |
... | ... | @@ -35,6 +35,7 @@ import GHC.Driver.Flags (DumpFlag(..)) |
35 | 35 | import GHC.Utils.Outputable as Outputable
|
36 | 36 | import GHC.Utils.Panic
|
37 | 37 | import GHC.Utils.Logger
|
38 | +import GHC.Types.Breakpoint
|
|
38 | 39 | import GHC.Types.SrcLoc
|
39 | 40 | import GHC.Types.Basic
|
40 | 41 | import GHC.Types.Id
|
... | ... | @@ -1235,7 +1236,7 @@ mkTickish boxLabel countEntries topOnly pos fvs decl_path = do |
1235 | 1236 | |
1236 | 1237 | Breakpoints -> do
|
1237 | 1238 | i <- addMixEntry me
|
1238 | - pure (Breakpoint noExtField i ids (this_mod env))
|
|
1239 | + pure (Breakpoint noExtField (BreakpointId (this_mod env) i) ids)
|
|
1239 | 1240 | |
1240 | 1241 | SourceNotes | RealSrcSpan pos' _ <- pos ->
|
1241 | 1242 | return $ SourceNote pos' $ LexicalFastString cc_name
|
... | ... | @@ -56,6 +56,7 @@ import GHC.Data.BooleanFormula (pprBooleanFormula, isTrue) |
56 | 56 | |
57 | 57 | import GHC.Builtin.Names ( unrestrictedFunTyConKey, liftedTypeKindTyConKey,
|
58 | 58 | constraintKindTyConKey )
|
59 | +import GHC.Types.Breakpoint
|
|
59 | 60 | import GHC.Types.Unique ( hasKey )
|
60 | 61 | import GHC.Iface.Type
|
61 | 62 | import GHC.Iface.Recomp.Binary
|
... | ... | @@ -699,7 +700,7 @@ data IfaceTickish |
699 | 700 | = IfaceHpcTick Module Int -- from HpcTick x
|
700 | 701 | | IfaceSCC CostCentre Bool Bool -- from ProfNote
|
701 | 702 | | IfaceSource RealSrcSpan FastString -- from SourceNote
|
702 | - | IfaceBreakpoint Int [IfaceExpr] Module -- from Breakpoint
|
|
703 | + | IfaceBreakpoint BreakpointId [IfaceExpr] -- from Breakpoint
|
|
703 | 704 | |
704 | 705 | data IfaceAlt = IfaceAlt IfaceConAlt [IfLclName] IfaceExpr
|
705 | 706 | -- Note: IfLclName, not IfaceBndr (and same with the case binder)
|
... | ... | @@ -1848,7 +1849,7 @@ pprIfaceTickish (IfaceSCC cc tick scope) |
1848 | 1849 | = braces (pprCostCentreCore cc <+> ppr tick <+> ppr scope)
|
1849 | 1850 | pprIfaceTickish (IfaceSource src _names)
|
1850 | 1851 | = braces (pprUserRealSpan True src)
|
1851 | -pprIfaceTickish (IfaceBreakpoint m ix fvs)
|
|
1852 | +pprIfaceTickish (IfaceBreakpoint (BreakpointId m ix) fvs)
|
|
1852 | 1853 | = braces (text "break" <+> ppr m <+> ppr ix <+> ppr fvs)
|
1853 | 1854 | |
1854 | 1855 | ------------------
|
... | ... | @@ -2198,7 +2199,7 @@ freeNamesIfaceTyConParent (IfDataInstance ax tc tys) |
2198 | 2199 | = unitNameSet ax &&& freeNamesIfTc tc &&& freeNamesIfAppArgs tys
|
2199 | 2200 | |
2200 | 2201 | freeNamesIfTickish :: IfaceTickish -> NameSet
|
2201 | -freeNamesIfTickish (IfaceBreakpoint _ fvs _) =
|
|
2202 | +freeNamesIfTickish (IfaceBreakpoint _ fvs) =
|
|
2202 | 2203 | fnList freeNamesIfExpr fvs
|
2203 | 2204 | freeNamesIfTickish _ = emptyNameSet
|
2204 | 2205 | |
... | ... | @@ -2919,7 +2920,7 @@ instance Binary IfaceTickish where |
2919 | 2920 | put_ bh (srcSpanEndLine src)
|
2920 | 2921 | put_ bh (srcSpanEndCol src)
|
2921 | 2922 | put_ bh name
|
2922 | - put_ bh (IfaceBreakpoint m ix fvs) = do
|
|
2923 | + put_ bh (IfaceBreakpoint (BreakpointId m ix) fvs) = do
|
|
2923 | 2924 | putByte bh 3
|
2924 | 2925 | put_ bh m
|
2925 | 2926 | put_ bh ix
|
... | ... | @@ -2947,7 +2948,7 @@ instance Binary IfaceTickish where |
2947 | 2948 | 3 -> do m <- get bh
|
2948 | 2949 | ix <- get bh
|
2949 | 2950 | fvs <- get bh
|
2950 | - return (IfaceBreakpoint m ix fvs)
|
|
2951 | + return (IfaceBreakpoint (BreakpointId m ix) fvs)
|
|
2951 | 2952 | _ -> panic ("get IfaceTickish " ++ show h)
|
2952 | 2953 | |
2953 | 2954 | instance Binary IfaceConAlt where
|
... | ... | @@ -3206,7 +3207,7 @@ instance NFData IfaceTickish where |
3206 | 3207 | IfaceHpcTick m i -> rnf m `seq` rnf i
|
3207 | 3208 | IfaceSCC cc b1 b2 -> rnf cc `seq` rnf b1 `seq` rnf b2
|
3208 | 3209 | IfaceSource src str -> rnf src `seq` rnf str
|
3209 | - IfaceBreakpoint m i fvs -> rnf m `seq` rnf i `seq` rnf fvs
|
|
3210 | + IfaceBreakpoint i fvs -> rnf i `seq` rnf fvs
|
|
3210 | 3211 | |
3211 | 3212 | instance NFData IfaceConAlt where
|
3212 | 3213 | rnf = \case
|
... | ... | @@ -955,7 +955,7 @@ dffvExpr :: CoreExpr -> DFFV () |
955 | 955 | dffvExpr (Var v) = insert v
|
956 | 956 | dffvExpr (App e1 e2) = dffvExpr e1 >> dffvExpr e2
|
957 | 957 | dffvExpr (Lam v e) = extendScope v (dffvExpr e)
|
958 | -dffvExpr (Tick (Breakpoint _ _ ids _) e) = mapM_ insert ids >> dffvExpr e
|
|
958 | +dffvExpr (Tick (Breakpoint _ _ ids) e) = mapM_ insert ids >> dffvExpr e
|
|
959 | 959 | dffvExpr (Tick _other e) = dffvExpr e
|
960 | 960 | dffvExpr (Cast e _) = dffvExpr e
|
961 | 961 | dffvExpr (Let (NonRec x r) e) = dffvBind (x,r) >> extendScope x (dffvExpr e)
|
... | ... | @@ -1732,9 +1732,9 @@ tcIfaceTickish :: IfaceTickish -> IfL CoreTickish |
1732 | 1732 | tcIfaceTickish (IfaceHpcTick modl ix) = return (HpcTick modl ix)
|
1733 | 1733 | tcIfaceTickish (IfaceSCC cc tick push) = return (ProfNote cc tick push)
|
1734 | 1734 | tcIfaceTickish (IfaceSource src name) = return (SourceNote src (LexicalFastString name))
|
1735 | -tcIfaceTickish (IfaceBreakpoint ix fvs modl) = do
|
|
1735 | +tcIfaceTickish (IfaceBreakpoint bid fvs) = do
|
|
1736 | 1736 | fvs' <- mapM tcIfaceExpr fvs
|
1737 | - return (Breakpoint NoExtField ix [f | Var f <- fvs'] modl)
|
|
1737 | + return (Breakpoint NoExtField bid [f | Var f <- fvs'])
|
|
1738 | 1738 | |
1739 | 1739 | -------------------------
|
1740 | 1740 | tcIfaceLit :: Literal -> IfL Literal
|
... | ... | @@ -49,7 +49,7 @@ bcPrepRHS con@StgRhsCon{} = pure con |
49 | 49 | |
50 | 50 | bcPrepExpr :: StgExpr -> BcPrepM StgExpr
|
51 | 51 | -- explicitly match all constructors so we get a warning if we miss any
|
52 | -bcPrepExpr (StgTick bp@(Breakpoint tick_ty _ _ _) rhs)
|
|
52 | +bcPrepExpr (StgTick bp@(Breakpoint tick_ty _ _) rhs)
|
|
53 | 53 | | isLiftedTypeKind (typeKind tick_ty) = do
|
54 | 54 | id <- newId tick_ty
|
55 | 55 | rhs' <- bcPrepExpr rhs
|
... | ... | @@ -257,8 +257,8 @@ exprFVs env = go |
257 | 257 | , let lcl_fvs' = unionDVarSet (tickish tick) lcl_fvs
|
258 | 258 | = (StgTick tick e', imp_fvs, top_fvs, lcl_fvs')
|
259 | 259 | where
|
260 | - tickish (Breakpoint _ _ ids _) = mkDVarSet ids
|
|
261 | - tickish _ = emptyDVarSet
|
|
260 | + tickish (Breakpoint _ _ ids) = mkDVarSet ids
|
|
261 | + tickish _ = emptyDVarSet
|
|
262 | 262 | |
263 | 263 | go_bind dc bind body = (dc bind' body', imp_fvs, top_fvs, lcl_fvs)
|
264 | 264 | where
|
... | ... | @@ -33,6 +33,7 @@ import GHC.Platform.Profile |
33 | 33 | import GHC.Runtime.Interpreter
|
34 | 34 | import GHCi.FFI
|
35 | 35 | import GHC.Types.Basic
|
36 | +import GHC.Types.Breakpoint
|
|
36 | 37 | import GHC.Utils.Outputable
|
37 | 38 | import GHC.Types.Name
|
38 | 39 | import GHC.Types.Id
|
... | ... | @@ -388,7 +389,7 @@ schemeR_wrk fvs nm original_body (args, body) |
388 | 389 | -- | Introduce break instructions for ticked expressions.
|
389 | 390 | -- If no breakpoint information is available, the instruction is omitted.
|
390 | 391 | schemeER_wrk :: StackDepth -> BCEnv -> CgStgExpr -> BcM BCInstrList
|
391 | -schemeER_wrk d p (StgTick (Breakpoint tick_ty tick_no fvs tick_mod) rhs) = do
|
|
392 | +schemeER_wrk d p (StgTick (Breakpoint tick_ty (BreakpointId tick_mod tick_no) fvs) rhs) = do
|
|
392 | 393 | code <- schemeE d 0 p rhs
|
393 | 394 | hsc_env <- getHscEnv
|
394 | 395 | current_mod <- getCurrentModule
|
... | ... | @@ -640,10 +641,9 @@ schemeE d s p (StgLet _ext binds body) = do |
640 | 641 | thunk_codes <- sequence compile_binds
|
641 | 642 | return (alloc_code `appOL` concatOL thunk_codes `appOL` body_code)
|
642 | 643 | |
643 | -schemeE _d _s _p (StgTick (Breakpoint _ bp_id _ _) _rhs)
|
|
644 | - = panic ("schemeE: Breakpoint without let binding: " ++
|
|
645 | - show bp_id ++
|
|
646 | - " forgot to run bcPrep?")
|
|
644 | +schemeE _d _s _p (StgTick (Breakpoint _ bp_id _) _rhs)
|
|
645 | + = pprPanic "schemeE: Breakpoint without let binding: " $
|
|
646 | + ppr bp_id <> text " forgot to run bcPrep?"
|
|
647 | 647 | |
648 | 648 | -- ignore other kinds of tick
|
649 | 649 | schemeE d s p (StgTick _ rhs) = schemeE d s p rhs
|
... | ... | @@ -8,6 +8,9 @@ where |
8 | 8 | |
9 | 9 | import GHC.Prelude
|
10 | 10 | import GHC.Unit.Module
|
11 | +import GHC.Utils.Outputable
|
|
12 | +import Control.DeepSeq
|
|
13 | +import Data.Data (Data)
|
|
11 | 14 | |
12 | 15 | -- | Breakpoint identifier.
|
13 | 16 | --
|
... | ... | @@ -16,7 +19,7 @@ data BreakpointId = BreakpointId |
16 | 19 | { bi_tick_mod :: !Module -- ^ Breakpoint tick module
|
17 | 20 | , bi_tick_index :: !Int -- ^ Breakpoint tick index
|
18 | 21 | }
|
19 | - deriving (Eq, Ord)
|
|
22 | + deriving (Eq, Ord, Data)
|
|
20 | 23 | |
21 | 24 | -- | Internal breakpoint identifier
|
22 | 25 | --
|
... | ... | @@ -53,3 +56,11 @@ toBreakpointId ibi = BreakpointId |
53 | 56 | -- So every breakpoint occurrence gets assigned a module-unique *info index* and
|
54 | 57 | -- we store it alongside the occurrence module (*info module*) in the
|
55 | 58 | -- InternalBreakpointId datatype.
|
59 | + |
|
60 | +instance Outputable BreakpointId where
|
|
61 | + ppr BreakpointId{bi_tick_mod, bi_tick_index} =
|
|
62 | + text "BreakpointId" <+> ppr bi_tick_mod <+> ppr bi_tick_index
|
|
63 | + |
|
64 | +instance NFData BreakpointId where
|
|
65 | + rnf BreakpointId{bi_tick_mod, bi_tick_index} =
|
|
66 | + rnf bi_tick_mod `seq` rnf bi_tick_index |
... | ... | @@ -31,6 +31,7 @@ import GHC.Core.Type |
31 | 31 | |
32 | 32 | import GHC.Unit.Module
|
33 | 33 | |
34 | +import GHC.Types.Breakpoint
|
|
34 | 35 | import GHC.Types.CostCentre
|
35 | 36 | import GHC.Types.SrcLoc ( RealSrcSpan, containsSpan )
|
36 | 37 | import GHC.Types.Var
|
... | ... | @@ -128,7 +129,7 @@ data GenTickish pass = |
128 | 129 | -- and (b) substituting (don't substitute for them)
|
129 | 130 | | Breakpoint
|
130 | 131 | { breakpointExt :: XBreakpoint pass
|
131 | - , breakpointId :: !Int
|
|
132 | + , breakpointId :: !BreakpointId
|
|
132 | 133 | , breakpointFVs :: [XTickishId pass]
|
133 | 134 | -- ^ the order of this list is important:
|
134 | 135 | -- it matches the order of the lists in the
|
... | ... | @@ -136,7 +137,6 @@ data GenTickish pass = |
136 | 137 | --
|
137 | 138 | -- Careful about substitution! See
|
138 | 139 | -- Note [substTickish] in "GHC.Core.Subst".
|
139 | - , breakpointModule :: Module
|
|
140 | 140 | }
|
141 | 141 | |
142 | 142 | -- | A source note.
|