summaryrefslogtreecommitdiff
path: root/compiler/GHC/Stg
diff options
context:
space:
mode:
authorLuite Stegeman <stegeman@gmail.com>2020-12-10 14:19:02 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-20 07:49:15 -0400
commitdd11f2d5e87ba83ca16510e3e1ac6c41c1df1647 (patch)
tree66550e7e66b679ae9ec31cab237d7bbced67b2ee /compiler/GHC/Stg
parentceef490b25dbff93860b121c58b0191b1a0c07bf (diff)
downloadhaskell-dd11f2d5e87ba83ca16510e3e1ac6c41c1df1647.tar.gz
Save the type of breakpoints in the Breakpoint tick in STG
GHCi needs to know the types of all breakpoints, but it's not possible to get the exprType of any expression in STG. This is preparation for the upcoming change to make GHCi bytecode from STG instead of Core.
Diffstat (limited to 'compiler/GHC/Stg')
-rw-r--r--compiler/GHC/Stg/FVs.hs6
-rw-r--r--compiler/GHC/Stg/Syntax.hs8
2 files changed, 7 insertions, 7 deletions
diff --git a/compiler/GHC/Stg/FVs.hs b/compiler/GHC/Stg/FVs.hs
index ce40307420..3385f2e275 100644
--- a/compiler/GHC/Stg/FVs.hs
+++ b/compiler/GHC/Stg/FVs.hs
@@ -47,7 +47,7 @@ import GHC.Prelude
import GHC.Stg.Syntax
import GHC.Types.Id
import GHC.Types.Var.Set
-import GHC.Core ( Tickish(Breakpoint) )
+import GHC.Core ( GenTickish(Breakpoint) )
import GHC.Utils.Misc
import Data.Maybe ( mapMaybe )
@@ -139,8 +139,8 @@ expr env = go
where
(e', fvs) = go e
fvs' = unionDVarSet (tickish tick) fvs
- tickish (Breakpoint _ ids) = mkDVarSet ids
- tickish _ = emptyDVarSet
+ tickish (Breakpoint _ _ ids) = mkDVarSet ids
+ tickish _ = emptyDVarSet
go_bind dc bind body = (dc bind' body', fvs)
where
diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs
index 53e4b07c69..0f2dd258e2 100644
--- a/compiler/GHC/Stg/Syntax.hs
+++ b/compiler/GHC/Stg/Syntax.hs
@@ -68,7 +68,7 @@ module GHC.Stg.Syntax (
import GHC.Prelude
-import GHC.Core ( AltCon, Tickish )
+import GHC.Core ( AltCon, StgTickish )
import GHC.Types.CostCentre ( CostCentreStack )
import Data.ByteString ( ByteString )
import Data.Data ( Data )
@@ -175,13 +175,13 @@ stgArgType (StgLitArg lit) = literalType lit
-- | Strip ticks of a given type from an STG expression.
-stripStgTicksTop :: (Tickish Id -> Bool) -> GenStgExpr p -> ([Tickish Id], GenStgExpr p)
+stripStgTicksTop :: (StgTickish Id -> Bool) -> GenStgExpr p -> ([StgTickish Id], GenStgExpr p)
stripStgTicksTop p = go []
where go ts (StgTick t e) | p t = go (t:ts) e
go ts other = (reverse ts, other)
-- | Strip ticks of a given type from an STG expression returning only the expression.
-stripStgTicksTopE :: (Tickish Id -> Bool) -> GenStgExpr p -> GenStgExpr p
+stripStgTicksTopE :: (StgTickish Id -> Bool) -> GenStgExpr p -> GenStgExpr p
stripStgTicksTopE p = go
where go (StgTick t e) | p t = go e
go other = other
@@ -368,7 +368,7 @@ Finally for @hpc@ expressions we introduce a new STG construct.
-}
| StgTick
- (Tickish Id)
+ (StgTickish Id)
(GenStgExpr pass) -- sub expression
-- END of GenStgExpr