diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2021-10-13 19:43:42 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-14 08:41:52 -0400 |
commit | 7f2ce0d6bc1404d6d91b3d8560efddc208f46a24 (patch) | |
tree | d0b39a5b6afb7a96635401ed2a51e7414f0654e0 /compiler | |
parent | df016e4e74dbc9c0181b9fb28c29cec08a743ade (diff) | |
download | haskell-7f2ce0d6bc1404d6d91b3d8560efddc208f46a24.tar.gz |
Move BreakInfo into own module
while working on GHCi stuff, e.g. `GHC.Runtime.Eval.Types`, I observed a
fair amount of modules being recompiled that I didn’t expect to depend
on this, from byte code interpreters to linkers. Turns out that the
rather simple `BreakInfo` type is all these modules need from the
`GHC.Runtime.Eval.*` hierarchy, so by moving that into its own file we
make the dependency tree wider and shallower, which is probably worth
it.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Eval.hs | 1 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Eval/Types.hs | 10 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Interpreter.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Types/BreakInfo.hs | 12 | ||||
-rw-r--r-- | compiler/ghc.cabal.in | 1 |
6 files changed, 18 insertions, 10 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs index 0e4f781a29..0488ccad11 100644 --- a/compiler/GHC.hs +++ b/compiler/GHC.hs @@ -321,7 +321,6 @@ import GHC.ByteCode.Types import qualified GHC.Linker.Loader as Loader import GHC.Runtime.Loader import GHC.Runtime.Eval -import GHC.Runtime.Eval.Types import GHC.Runtime.Interpreter import GHC.Runtime.Context import GHCi.RemoteTypes @@ -387,6 +386,7 @@ import GHC.Types.TyThing import GHC.Types.Name.Env import GHC.Types.Name.Ppr import GHC.Types.TypeEnv +import GHC.Types.BreakInfo import GHC.Unit import GHC.Unit.Env diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs index bceb9a4159..a4ddbbfd4a 100644 --- a/compiler/GHC/Runtime/Eval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -106,6 +106,7 @@ import GHC.Types.SrcLoc import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Types.TyThing +import GHC.Types.BreakInfo import GHC.Unit import GHC.Unit.Module.Graph diff --git a/compiler/GHC/Runtime/Eval/Types.hs b/compiler/GHC/Runtime/Eval/Types.hs index c72c5c89ff..5706c037de 100644 --- a/compiler/GHC/Runtime/Eval/Types.hs +++ b/compiler/GHC/Runtime/Eval/Types.hs @@ -8,8 +8,7 @@ module GHC.Runtime.Eval.Types ( Resume(..), History(..), ExecResult(..), - SingleStep(..), isStep, ExecOptions(..), - BreakInfo(..) + SingleStep(..), isStep, ExecOptions(..) ) where import GHC.Prelude @@ -19,7 +18,7 @@ import GHCi.Message (EvalExpr, ResumeContext) import GHC.Types.Id import GHC.Types.Name import GHC.Types.TyThing -import GHC.Unit.Module +import GHC.Types.BreakInfo import GHC.Types.Name.Reader import GHC.Types.SrcLoc import GHC.Utils.Exception @@ -54,11 +53,6 @@ data ExecResult , breakInfo :: Maybe BreakInfo } -data BreakInfo = BreakInfo - { breakInfo_module :: Module - , breakInfo_number :: Int - } - data Resume = Resume { resumeStmt :: String -- the original statement , resumeContext :: ForeignRef (ResumeContext [HValueRef]) diff --git a/compiler/GHC/Runtime/Interpreter.hs b/compiler/GHC/Runtime/Interpreter.hs index 7dcc5fcd82..29c5592299 100644 --- a/compiler/GHC/Runtime/Interpreter.hs +++ b/compiler/GHC/Runtime/Interpreter.hs @@ -66,7 +66,7 @@ import GHCi.Message import GHCi.RemoteTypes import GHCi.ResolvedBCO import GHCi.BreakArray (BreakArray) -import GHC.Runtime.Eval.Types(BreakInfo(..)) +import GHC.Types.BreakInfo (BreakInfo(..)) import GHC.ByteCode.Types import GHC.Linker.Types diff --git a/compiler/GHC/Types/BreakInfo.hs b/compiler/GHC/Types/BreakInfo.hs new file mode 100644 index 0000000000..d08ccda0bf --- /dev/null +++ b/compiler/GHC/Types/BreakInfo.hs @@ -0,0 +1,12 @@ +-- | A module for the BreakInfo type. Used by both the GHC.Runtime.Eval and +-- GHC.Runtime.Interpreter hierarchy, so put here to have a less deep module +-- dependency tree +module GHC.Types.BreakInfo (BreakInfo(..)) where + +import GHC.Prelude +import GHC.Unit.Module + +data BreakInfo = BreakInfo + { breakInfo_module :: Module + , breakInfo_number :: Int + } diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 25833017d1..668642af80 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -679,6 +679,7 @@ Library GHC.Types.Annotations GHC.Types.Avail GHC.Types.Basic + GHC.Types.BreakInfo GHC.Types.CompleteMatch GHC.Types.CostCentre GHC.Types.CostCentre.State |