diff options
74 files changed, 190 insertions, 182 deletions
diff --git a/compiler/ghci/ByteCodeAsm.hs b/compiler/GHC/ByteCode/Asm.hs index adf701b7e5..db5c14b806 100644 --- a/compiler/ghci/ByteCodeAsm.hs +++ b/compiler/GHC/ByteCode/Asm.hs @@ -4,8 +4,8 @@ -- (c) The University of Glasgow 2002-2006 -- --- | ByteCodeLink: Bytecode assembler and linker -module ByteCodeAsm ( +-- | Bytecode assembler and linker +module GHC.ByteCode.Asm ( assembleBCOs, assembleOneBCO, bcoFreeNames, @@ -17,11 +17,11 @@ module ByteCodeAsm ( import GhcPrelude -import ByteCodeInstr -import ByteCodeItbls -import ByteCodeTypes +import GHC.ByteCode.Instr +import GHC.ByteCode.InfoTable +import GHC.ByteCode.Types import GHCi.RemoteTypes -import GHCi +import GHC.Runtime.Interpreter import HscTypes import Name @@ -30,7 +30,7 @@ import Literal import TyCon import FastString import GHC.StgToCmm.Layout ( ArgRep(..) ) -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import DynFlags import Outputable import GHC.Platform @@ -460,8 +460,8 @@ assembleI dflags i = case i of LitNumWord -> int (fromIntegral i) LitNumInt64 -> int64 (fromIntegral i) LitNumWord64 -> int64 (fromIntegral i) - LitNumInteger -> panic "ByteCodeAsm.literal: LitNumInteger" - LitNumNatural -> panic "ByteCodeAsm.literal: LitNumNatural" + LitNumInteger -> panic "GHC.ByteCode.Asm.literal: LitNumInteger" + LitNumNatural -> panic "GHC.ByteCode.Asm.literal: LitNumNatural" -- We can lower 'LitRubbish' to an arbitrary constant, but @NULL@ is most -- likely to elicit a crash (rather than corrupt memory) in case absence -- analysis messed up. diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/GHC/ByteCode/InfoTable.hs index 2138482051..40a107756d 100644 --- a/compiler/ghci/ByteCodeItbls.hs +++ b/compiler/GHC/ByteCode/InfoTable.hs @@ -4,15 +4,15 @@ -- (c) The University of Glasgow 2002-2006 -- --- | ByteCodeItbls: Generate infotables for interpreter-made bytecodes -module ByteCodeItbls ( mkITbls ) where +-- | Generate infotables for interpreter-made bytecodes +module GHC.ByteCode.InfoTable ( mkITbls ) where #include "HsVersions.h" import GhcPrelude -import ByteCodeTypes -import GHCi +import GHC.ByteCode.Types +import GHC.Runtime.Interpreter import DynFlags import HscTypes import Name ( Name, getName ) diff --git a/compiler/ghci/ByteCodeInstr.hs b/compiler/GHC/ByteCode/Instr.hs index 9cdd297dbd..d6c9cd5391 100644 --- a/compiler/ghci/ByteCodeInstr.hs +++ b/compiler/GHC/ByteCode/Instr.hs @@ -4,8 +4,8 @@ -- (c) The University of Glasgow 2002-2006 -- --- | ByteCodeInstrs: Bytecode instruction definitions -module ByteCodeInstr ( +-- | Bytecode instruction definitions +module GHC.ByteCode.Instr ( BCInstr(..), ProtoBCO(..), bciStackUse, ) where @@ -13,7 +13,7 @@ module ByteCodeInstr ( import GhcPrelude -import ByteCodeTypes +import GHC.ByteCode.Types import GHCi.RemoteTypes import GHCi.FFI (C_ffi_cif) import GHC.StgToCmm.Layout ( ArgRep(..) ) @@ -28,7 +28,7 @@ import Literal import DataCon import VarSet import PrimOp -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import Data.Word import GHC.Stack.CCS (CostCentre) diff --git a/compiler/ghci/ByteCodeLink.hs b/compiler/GHC/ByteCode/Linker.hs index 9138d1c125..69bdb63a91 100644 --- a/compiler/ghci/ByteCodeLink.hs +++ b/compiler/GHC/ByteCode/Linker.hs @@ -8,8 +8,8 @@ -- (c) The University of Glasgow 2002-2006 -- --- | ByteCodeLink: Bytecode assembler and linker -module ByteCodeLink ( +-- | Bytecode assembler and linker +module GHC.ByteCode.Linker ( ClosureEnv, emptyClosureEnv, extendClosureEnv, linkBCO, lookupStaticPtr, lookupIE, @@ -25,8 +25,8 @@ import GHCi.ResolvedBCO import GHCi.BreakArray import SizedSeq -import GHCi -import ByteCodeTypes +import GHC.Runtime.Interpreter +import GHC.ByteCode.Types import HscTypes import Name import NameEnv @@ -90,7 +90,7 @@ lookupStaticPtr hsc_env addr_of_label_string = do m <- lookupSymbol hsc_env addr_of_label_string case m of Just ptr -> return ptr - Nothing -> linkFail "ByteCodeLink: can't find label" + Nothing -> linkFail "GHC.ByteCode.Linker: can't find label" (unpackFS addr_of_label_string) lookupIE :: HscEnv -> ItblEnv -> Name -> IO (Ptr ()) @@ -108,7 +108,7 @@ lookupIE hsc_env ie con_nm = n <- lookupSymbol hsc_env sym_to_find2 case n of Just addr -> return addr - Nothing -> linkFail "ByteCodeLink.lookupIE" + Nothing -> linkFail "GHC.ByteCode.Linker.lookupIE" (unpackFS sym_to_find1 ++ " or " ++ unpackFS sym_to_find2) @@ -118,7 +118,7 @@ lookupPrimOp hsc_env primop = do m <- lookupSymbol hsc_env (mkFastString sym_to_find) case m of Just p -> return (toRemotePtr p) - Nothing -> linkFail "ByteCodeLink.lookupCE(primop)" sym_to_find + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find resolvePtr :: HscEnv -> ItblEnv -> ClosureEnv -> NameEnv Int -> RemoteRef BreakArray @@ -135,7 +135,7 @@ resolvePtr hsc_env _ie ce bco_ix _ (BCOPtrName nm) m <- lookupSymbol hsc_env sym_to_find case m of Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p)) - Nothing -> linkFail "ByteCodeLink.lookupCE" (unpackFS sym_to_find) + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find) resolvePtr hsc_env _ _ _ _ (BCOPtrPrimOp op) = ResolvedBCOStaticPtr <$> lookupPrimOp hsc_env op resolvePtr hsc_env ie ce bco_ix breakarray (BCOPtrBCO bco) = diff --git a/compiler/ghci/ByteCodeTypes.hs b/compiler/GHC/ByteCode/Types.hs index 0c0c34ad64..ce80c53279 100644 --- a/compiler/ghci/ByteCodeTypes.hs +++ b/compiler/GHC/ByteCode/Types.hs @@ -4,7 +4,7 @@ -- -- | Bytecode assembler types -module ByteCodeTypes +module GHC.ByteCode.Types ( CompiledByteCode(..), seqCompiledByteCode, FFIInfo(..) , UnlinkedBCO(..), BCOPtr(..), BCONPtr(..) , ItblEnv, ItblPtr(..) @@ -114,7 +114,7 @@ data CgBreakInfo { cgb_vars :: [Maybe (Id,Word16)] , cgb_resty :: Type } --- See Note [Syncing breakpoint info] in compiler/main/InteractiveEval.hs +-- See Note [Syncing breakpoint info] in GHC.Runtime.Eval -- Not a real NFData instance because we can't rnf Id or Type seqCgBreakInfo :: CgBreakInfo -> () diff --git a/compiler/GHC/Cmm.hs b/compiler/GHC/Cmm.hs index 8850f2e19a..f8cf5789d7 100644 --- a/compiler/GHC/Cmm.hs +++ b/compiler/GHC/Cmm.hs @@ -31,7 +31,7 @@ import CostCentre import GHC.Cmm.CLabel import GHC.Cmm.BlockId import GHC.Cmm.Node -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm.Expr import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Collections diff --git a/compiler/GHC/Cmm/CallConv.hs b/compiler/GHC/Cmm/CallConv.hs index 9200daec57..db9603c524 100644 --- a/compiler/GHC/Cmm/CallConv.hs +++ b/compiler/GHC/Cmm/CallConv.hs @@ -8,7 +8,7 @@ module GHC.Cmm.CallConv ( import GhcPrelude import GHC.Cmm.Expr -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm (Convention(..)) import GHC.Cmm.Ppr () -- For Outputable instances diff --git a/compiler/GHC/Cmm/Graph.hs b/compiler/GHC/Cmm/Graph.hs index 8d19e7fdb9..1d8b44776d 100644 --- a/compiler/GHC/Cmm/Graph.hs +++ b/compiler/GHC/Cmm/Graph.hs @@ -35,7 +35,7 @@ import DynFlags import FastString import ForeignCall import OrdList -import GHC.Runtime.Layout (ByteOff) +import GHC.Runtime.Heap.Layout (ByteOff) import UniqSupply import Util import Panic diff --git a/compiler/GHC/Cmm/Info.hs b/compiler/GHC/Cmm/Info.hs index 9e12fb170d..6948f78969 100644 --- a/compiler/GHC/Cmm/Info.hs +++ b/compiler/GHC/Cmm/Info.hs @@ -38,7 +38,7 @@ import GhcPrelude import GHC.Cmm import GHC.Cmm.Utils import GHC.Cmm.CLabel -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Data.Bitmap import Stream (Stream) import qualified Stream diff --git a/compiler/GHC/Cmm/Info/Build.hs b/compiler/GHC/Cmm/Info/Build.hs index d90c776c88..4b0532eef1 100644 --- a/compiler/GHC/Cmm/Info/Build.hs +++ b/compiler/GHC/Cmm/Info/Build.hs @@ -27,7 +27,7 @@ import GHC.Cmm.Utils import DynFlags import Maybes import Outputable -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import UniqSupply import CostCentre import GHC.StgToCmm.Heap diff --git a/compiler/GHC/Cmm/LayoutStack.hs b/compiler/GHC/Cmm/LayoutStack.hs index f6dda7728c..b34de95982 100644 --- a/compiler/GHC/Cmm/LayoutStack.hs +++ b/compiler/GHC/Cmm/LayoutStack.hs @@ -18,7 +18,7 @@ import GHC.Cmm.Graph import ForeignCall import GHC.Cmm.Liveness import GHC.Cmm.ProcPoint -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow diff --git a/compiler/GHC/Cmm/Node.hs b/compiler/GHC/Cmm/Node.hs index 0764d6d8a3..f7cee80145 100644 --- a/compiler/GHC/Cmm/Node.hs +++ b/compiler/GHC/Cmm/Node.hs @@ -35,7 +35,7 @@ import DynFlags import FastString import ForeignCall import Outputable -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import CoreSyn (Tickish) import qualified Unique as U diff --git a/compiler/GHC/Cmm/Parser.y b/compiler/GHC/Cmm/Parser.y index 886f429611..ed2d95a283 100644 --- a/compiler/GHC/Cmm/Parser.y +++ b/compiler/GHC/Cmm/Parser.y @@ -231,7 +231,7 @@ import GHC.Cmm.BlockId import GHC.Cmm.Lexer import GHC.Cmm.CLabel import GHC.Cmm.Monad -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import Lexer import CostCentre diff --git a/compiler/GHC/Cmm/Utils.hs b/compiler/GHC/Cmm/Utils.hs index eda440040d..c62f7eb3df 100644 --- a/compiler/GHC/Cmm/Utils.hs +++ b/compiler/GHC/Cmm/Utils.hs @@ -75,7 +75,7 @@ import GhcPrelude import TyCon ( PrimRep(..), PrimElemRep(..) ) import GHC.Types.RepType ( UnaryType, SlotTy (..), typePrimRep1 ) -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm import GHC.Cmm.BlockId import GHC.Cmm.CLabel diff --git a/compiler/ghci/ByteCodeGen.hs b/compiler/GHC/CoreToByteCode.hs index 5d5b2990e6..f6ceadf1be 100644 --- a/compiler/ghci/ByteCodeGen.hs +++ b/compiler/GHC/CoreToByteCode.hs @@ -7,18 +7,18 @@ -- (c) The University of Glasgow 2002-2006 -- --- | ByteCodeGen: Generate bytecode from Core -module ByteCodeGen ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where +-- | GHC.CoreToByteCode: Generate bytecode from Core +module GHC.CoreToByteCode ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where #include "HsVersions.h" import GhcPrelude -import ByteCodeInstr -import ByteCodeAsm -import ByteCodeTypes +import GHC.ByteCode.Instr +import GHC.ByteCode.Asm +import GHC.ByteCode.Types -import GHCi +import GHC.Runtime.Interpreter import GHCi.FFI import GHCi.RemoteTypes import BasicTypes @@ -51,7 +51,7 @@ import FastString import Panic import GHC.StgToCmm.Closure ( NonVoid(..), fromNonVoid, nonVoidIds ) import GHC.StgToCmm.Layout -import GHC.Runtime.Layout hiding (WordOff, ByteOff, wordsToBytes) +import GHC.Runtime.Heap.Layout hiding (WordOff, ByteOff, wordsToBytes) import GHC.Data.Bitmap import OrdList import Maybes @@ -88,7 +88,7 @@ byteCodeGen :: HscEnv -> IO CompiledByteCode byteCodeGen hsc_env this_mod binds tycs mb_modBreaks = withTiming dflags - (text "ByteCodeGen"<+>brackets (ppr this_mod)) + (text "GHC.CoreToByteCode"<+>brackets (ppr this_mod)) (const ()) $ do -- Split top-level binds into strings and others. -- See Note [generating code for top-level string literal bindings]. @@ -105,7 +105,7 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks mapM schemeTopBind flatBinds when (notNull ffis) - (panic "ByteCodeGen.byteCodeGen: missing final emitBc?") + (panic "GHC.CoreToByteCode.byteCodeGen: missing final emitBc?") dumpIfSet_dyn dflags Opt_D_dump_BCOs "Proto-BCOs" FormatByteCode @@ -161,7 +161,7 @@ coreExprToBCOs :: HscEnv -> IO UnlinkedBCO coreExprToBCOs hsc_env this_mod expr = withTiming dflags - (text "ByteCodeGen"<+>brackets (ppr this_mod)) + (text "GHC.CoreToByteCode"<+>brackets (ppr this_mod)) (const ()) $ do -- create a totally bogus name for the top-level BCO; this -- should be harmless, since it's never used for anything @@ -175,7 +175,7 @@ coreExprToBCOs hsc_env this_mod expr schemeR [] (invented_name, simpleFreeVars expr) when (notNull mallocd) - (panic "ByteCodeGen.coreExprToBCOs: missing final emitBc?") + (panic "GHC.CoreToByteCode.coreExprToBCOs: missing final emitBc?") dumpIfSet_dyn dflags Opt_D_dump_BCOs "Proto-BCOs" FormatByteCode (ppr proto_bco) @@ -212,7 +212,7 @@ bytesToWords dflags (ByteOff bytes) = let (q, r) = bytes `quotRem` (wORD_SIZE dflags) in if r == 0 then fromIntegral q - else panic $ "ByteCodeGen.bytesToWords: bytes=" ++ show bytes + else panic $ "GHC.CoreToByteCode.bytesToWords: bytes=" ++ show bytes wordSize :: DynFlags -> ByteOff wordSize dflags = ByteOff (wORD_SIZE dflags) @@ -674,7 +674,7 @@ schemeE d s p (AnnCase scrut bndr _ alts) = doCase d s p scrut bndr alts Nothing{-not an unboxed tuple-} schemeE _ _ _ expr - = pprPanic "ByteCodeGen.schemeE: unhandled case" + = pprPanic "GHC.CoreToByteCode.schemeE: unhandled case" (pprCoreExpr (deAnnotate' expr)) -- Is this Id a not-necessarily-lifted join point? @@ -965,7 +965,7 @@ findPushSeq (D: rest) findPushSeq (L: rest) = (PUSH_APPLY_L, 1, rest) findPushSeq _ - = panic "ByteCodeGen.findPushSeq" + = panic "GHC.CoreToByteCode.findPushSeq" -- ----------------------------------------------------------------------------- -- Case expressions @@ -1222,7 +1222,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l !d_after_args = d0 + wordsToBytes dflags a_reps_sizeW a_reps_pushed_RAW | null a_reps_pushed_r_to_l || not (isVoidRep (head a_reps_pushed_r_to_l)) - = panic "ByteCodeGen.generateCCall: missing or invalid World token?" + = panic "GHC.CoreToByteCode.generateCCall: missing or invalid World token?" | otherwise = reverse (tail a_reps_pushed_r_to_l) @@ -1294,7 +1294,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l a_reps -- | trace (showSDoc (ppr a_reps_pushed_RAW)) False = error "???" | is_static = a_reps_pushed_RAW | otherwise = if null a_reps_pushed_RAW - then panic "ByteCodeGen.generateCCall: dyn with no args" + then panic "GHC.CoreToByteCode.generateCCall: dyn with no args" else tail a_reps_pushed_RAW -- push the Addr# @@ -1324,7 +1324,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l conv = case cconv of CCallConv -> FFICCall StdCallConv -> FFIStdCall - _ -> panic "ByteCodeGen: unexpected calling convention" + _ -> panic "GHC.CoreToByteCode: unexpected calling convention" -- the only difference in libffi mode is that we prepare a cif -- describing the call type by calling libffi, and we attach the @@ -1620,7 +1620,7 @@ pushAtom _ _ (AnnLit lit) = do LitNumNatural -> panic "pushAtom: LitNatural" pushAtom _ _ expr - = pprPanic "ByteCodeGen.pushAtom" + = pprPanic "GHC.CoreToByteCode.pushAtom" (pprCoreExpr (deAnnotate' expr)) @@ -2007,7 +2007,7 @@ getLabelsBc n getCCArray :: BcM (Array BreakIndex (RemotePtr CostCentre)) getCCArray = BcM $ \st -> - let breaks = expectJust "ByteCodeGen.getCCArray" $ modBreaks st in + let breaks = expectJust "GHC.CoreToByteCode.getCCArray" $ modBreaks st in return (st, modBreaks_ccs breaks) diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs index 59de501fa8..fdd182b48b 100644 --- a/compiler/GHC/CoreToStg/Prep.hs +++ b/compiler/GHC/CoreToStg/Prep.hs @@ -946,7 +946,7 @@ pragma. It is levity-polymorphic. -> (# State# RealWorld, o #) It needs no special treatment in GHC except this special inlining here -in CorePrep (and in ByteCodeGen). +in CorePrep (and in GHC.CoreToByteCode). -- --------------------------------------------------------------------------- -- CpeArg: produces a result satisfying CpeArg diff --git a/compiler/GHC/Data/Bitmap.hs b/compiler/GHC/Data/Bitmap.hs index a8eba5e2e8..c778a575f8 100644 --- a/compiler/GHC/Data/Bitmap.hs +++ b/compiler/GHC/Data/Bitmap.hs @@ -17,7 +17,7 @@ module GHC.Data.Bitmap ( import GhcPrelude -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import DynFlags import Util diff --git a/compiler/ghci/Debugger.hs b/compiler/GHC/Runtime/Debugger.hs index 7bfc4eff4c..9443ff9421 100644 --- a/compiler/ghci/Debugger.hs +++ b/compiler/GHC/Runtime/Debugger.hs @@ -12,14 +12,14 @@ -- ----------------------------------------------------------------------------- -module Debugger (pprintClosureCommand, showTerm, pprTypeAndContents) where +module GHC.Runtime.Debugger (pprintClosureCommand, showTerm, pprTypeAndContents) where import GhcPrelude -import Linker -import RtClosureInspect +import GHC.Runtime.Linker +import GHC.Runtime.Heap.Inspect -import GHCi +import GHC.Runtime.Interpreter import GHCi.RemoteTypes import GhcMonad import HscTypes diff --git a/compiler/main/InteractiveEval.hs b/compiler/GHC/Runtime/Eval.hs index badb746718..d43c5be7b8 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -11,7 +11,7 @@ -- -- ----------------------------------------------------------------------------- -module InteractiveEval ( +module GHC.Runtime.Eval ( Resume(..), History(..), execStmt, execStmt', ExecOptions(..), execOptions, ExecResult(..), resumeExec, runDecls, runDeclsWithLocation, runParsedDecls, @@ -48,9 +48,9 @@ module InteractiveEval ( import GhcPrelude -import InteractiveEvalTypes +import GHC.Runtime.Eval.Types -import GHCi +import GHC.Runtime.Interpreter as GHCi import GHCi.Message import GHCi.RemoteTypes import GhcMonad @@ -75,8 +75,8 @@ import NameSet import Avail import RdrName import VarEnv -import ByteCodeTypes -import Linker +import GHC.ByteCode.Types +import GHC.Runtime.Linker as Linker import DynFlags import Unique import UniqSupply @@ -88,7 +88,7 @@ import Panic import Maybes import ErrUtils import SrcLoc -import RtClosureInspect +import GHC.Runtime.Heap.Inspect import Outputable import FastString import Bag @@ -661,7 +661,7 @@ pushResume hsc_env resume = hsc_env { hsc_IC = ictxt1 } Note [Syncing breakpoint info] To display the values of the free variables for a single breakpoint, the - function `compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint` pulls + function `GHC.Runtime.Eval.bindLocalsAtBreakpoint` pulls out the information from the fields `modBreaks_breakInfo` and `modBreaks_vars` of the `ModBreaks` data structure. For a specific breakpoint this gives 2 lists of type `Id` (or `Var`) @@ -671,9 +671,9 @@ pushResume hsc_env resume = hsc_env { hsc_IC = ictxt1 } There are 3 situations where items are removed from the Id list (or replaced with `Nothing`): - 1.) If function `compiler/ghci/ByteCodeGen.hs:schemeER_wrk` (which creates + 1.) If function `GHC.CoreToByteCode.schemeER_wrk` (which creates the Id list) doesn't find an Id in the ByteCode environement. - 2.) If function `compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint` + 2.) If function `GHC.Runtime.Eval.bindLocalsAtBreakpoint` filters out unboxed elements from the Id list, because GHCi cannot yet handle them. 3.) If the GHCi interpreter doesn't find the reference to a free variable diff --git a/compiler/main/InteractiveEvalTypes.hs b/compiler/GHC/Runtime/Eval/Types.hs index 3bc043f88b..93072075c0 100644 --- a/compiler/main/InteractiveEvalTypes.hs +++ b/compiler/GHC/Runtime/Eval/Types.hs @@ -6,7 +6,7 @@ -- -- ----------------------------------------------------------------------------- -module InteractiveEvalTypes ( +module GHC.Runtime.Eval.Types ( Resume(..), History(..), ExecResult(..), SingleStep(..), isStep, ExecOptions(..), BreakInfo(..) diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs index 9ed5eaef9f..de6f9a7af3 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/GHC/Runtime/Heap/Inspect.hs @@ -7,7 +7,7 @@ -- Pepe Iborra (supported by Google SoC) 2006 -- ----------------------------------------------------------------------------- -module RtClosureInspect( +module GHC.Runtime.Heap.Inspect( -- * Entry points and types cvObtainTerm, cvReconstructType, @@ -27,7 +27,7 @@ module RtClosureInspect( import GhcPrelude -import GHCi +import GHC.Runtime.Interpreter as GHCi import GHCi.RemoteTypes import HscTypes @@ -58,7 +58,7 @@ import DynFlags import Outputable as Ppr import GHC.Char import GHC.Exts.Heap -import GHC.Runtime.Layout ( roundUpTo ) +import GHC.Runtime.Heap.Layout ( roundUpTo ) import Control.Monad import Data.Maybe diff --git a/compiler/GHC/Runtime/Layout.hs b/compiler/GHC/Runtime/Heap/Layout.hs index 8f245479c1..b7899ecc1b 100644 --- a/compiler/GHC/Runtime/Layout.hs +++ b/compiler/GHC/Runtime/Heap/Layout.hs @@ -5,7 +5,7 @@ {-# LANGUAGE CPP,GeneralizedNewtypeDeriving #-} -module GHC.Runtime.Layout ( +module GHC.Runtime.Heap.Layout ( -- * Words and bytes WordOff, ByteOff, wordsToBytes, bytesToWordsRoundUp, diff --git a/compiler/ghci/GHCi.hs b/compiler/GHC/Runtime/Interpreter.hs index 8795b30973..9eadacca1c 100644 --- a/compiler/ghci/GHCi.hs +++ b/compiler/GHC/Runtime/Interpreter.hs @@ -4,7 +4,7 @@ -- | Interacting with the interpreter, whether it is running on an -- external process or in the current process. -- -module GHCi +module GHC.Runtime.Interpreter ( -- * High-level interface to the interpreter evalStmt, EvalStatus_(..), EvalStatus, EvalResult(..), EvalExpr(..) , resumeStmt @@ -135,7 +135,7 @@ The main pieces are: server. This is a fairly simple wrapper, most of the functionality is provided by modules in libraries/ghci. -- This module (GHCi) which provides the interface to the server used +- This module which provides the interface to the server used by the rest of GHC. GHC works with and without -fexternal-interpreter. With the flag, all diff --git a/compiler/ghci/Linker.hs b/compiler/GHC/Runtime/Linker.hs index 773d396ac9..fb409bd75b 100644 --- a/compiler/ghci/Linker.hs +++ b/compiler/GHC/Runtime/Linker.hs @@ -9,25 +9,34 @@ -- This module deals with the top-level issues of dynamic linking, -- calling the object-code linker and the byte-code linker where -- necessary. -module Linker ( getHValue, showLinkerState, - linkExpr, linkDecls, unload, withExtendedLinkEnv, - extendLinkEnv, deleteFromLinkEnv, - extendLoadedPkgs, - linkPackages, initDynLinker, linkModule, - linkCmdLineLibs, - uninitializedLinker - ) where +module GHC.Runtime.Linker + ( getHValue + , showLinkerState + , linkExpr + , linkDecls + , unload + , withExtendedLinkEnv + , extendLinkEnv + , deleteFromLinkEnv + , extendLoadedPkgs + , linkPackages + , initDynLinker + , linkModule + , linkCmdLineLibs + , uninitializedLinker + ) +where #include "HsVersions.h" import GhcPrelude -import GHCi +import GHC.Runtime.Interpreter import GHCi.RemoteTypes import GHC.Iface.Load -import ByteCodeLink -import ByteCodeAsm -import ByteCodeTypes +import GHC.ByteCode.Linker +import GHC.ByteCode.Asm +import GHC.ByteCode.Types import TcRnMonad import Packages import DriverPhases @@ -37,7 +46,7 @@ import Name import NameEnv import Module import ListSetOps -import LinkerTypes (DynLinker(..), LinkerUnitId, PersistentLinkerState(..)) +import GHC.Runtime.Linker.Types (DynLinker(..), LinkerUnitId, PersistentLinkerState(..)) import DynFlags import BasicTypes import Outputable @@ -175,7 +184,7 @@ getHValue hsc_env name = do m <- lookupClosure hsc_env (unpackFS sym_to_find) case m of Just hvref -> mkFinalizedHValue hsc_env hvref - Nothing -> linkFail "ByteCodeLink.lookupCE" + Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find) linkDependencies :: HscEnv -> PersistentLinkerState diff --git a/compiler/ghci/LinkerTypes.hs b/compiler/GHC/Runtime/Linker/Types.hs index 4cdfc198da..5b2f506c6d 100644 --- a/compiler/ghci/LinkerTypes.hs +++ b/compiler/GHC/Runtime/Linker/Types.hs @@ -6,7 +6,7 @@ -- ----------------------------------------------------------------------------- -module LinkerTypes ( +module GHC.Runtime.Linker.Types ( DynLinker(..), PersistentLinkerState(..), LinkerUnitId, @@ -20,7 +20,7 @@ import Data.Time ( UTCTime ) import Data.Maybe ( Maybe ) import Control.Concurrent.MVar ( MVar ) import Module ( InstalledUnitId, Module ) -import ByteCodeTypes ( ItblEnv, CompiledByteCode ) +import GHC.ByteCode.Types ( ItblEnv, CompiledByteCode ) import Outputable import Var ( Id ) import GHC.Fingerprint.Type ( Fingerprint ) diff --git a/compiler/main/DynamicLoading.hs b/compiler/GHC/Runtime/Loader.hs index a48f0238be..a1c7c2a0fa 100644 --- a/compiler/main/DynamicLoading.hs +++ b/compiler/GHC/Runtime/Loader.hs @@ -1,7 +1,7 @@ {-# LANGUAGE CPP, MagicHash #-} -- | Dynamically lookup up values from modules and loading them. -module DynamicLoading ( +module GHC.Runtime.Loader ( initializePlugins, -- * Loading plugins loadFrontendPlugin, @@ -23,8 +23,8 @@ module DynamicLoading ( import GhcPrelude import DynFlags -import Linker ( linkModule, getHValue ) -import GHCi ( wormhole ) +import GHC.Runtime.Linker ( linkModule, getHValue ) +import GHC.Runtime.Interpreter ( wormhole ) import SrcLoc ( noSrcSpan ) import Finder ( findPluginModule, cannotFindModule ) import TcRnMonad ( initTcInteractive, initIfaceTcRn ) diff --git a/compiler/GHC/Stg/Lift/Analysis.hs b/compiler/GHC/Stg/Lift/Analysis.hs index ccbad37210..881d0340a5 100644 --- a/compiler/GHC/Stg/Lift/Analysis.hs +++ b/compiler/GHC/Stg/Lift/Analysis.hs @@ -26,7 +26,7 @@ import BasicTypes import Demand import DynFlags import Id -import GHC.Runtime.Layout ( WordOff ) +import GHC.Runtime.Heap.Layout ( WordOff ) import GHC.Stg.Syntax import qualified GHC.StgToCmm.ArgRep as StgToCmm.ArgRep import qualified GHC.StgToCmm.Closure as StgToCmm.Closure diff --git a/compiler/GHC/StgToCmm/ArgRep.hs b/compiler/GHC/StgToCmm/ArgRep.hs index 347d908b44..436b37fced 100644 --- a/compiler/GHC/StgToCmm/ArgRep.hs +++ b/compiler/GHC/StgToCmm/ArgRep.hs @@ -19,7 +19,7 @@ import GhcPrelude import GHC.StgToCmm.Closure ( idPrimRep ) -import GHC.Runtime.Layout ( WordOff ) +import GHC.Runtime.Heap.Layout ( WordOff ) import Id ( Id ) import TyCon ( PrimRep(..), primElemRepSizeB ) import BasicTypes ( RepArity ) diff --git a/compiler/GHC/StgToCmm/Bind.hs b/compiler/GHC/StgToCmm/Bind.hs index 977fa4649e..089fec789c 100644 --- a/compiler/GHC/StgToCmm/Bind.hs +++ b/compiler/GHC/StgToCmm/Bind.hs @@ -31,7 +31,7 @@ import GHC.StgToCmm.Foreign (emitPrimCall) import GHC.Cmm.Graph import CoreSyn ( AltCon(..), tickishIsCode ) import GHC.Cmm.BlockId -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm import GHC.Cmm.Info import GHC.Cmm.Utils diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs index 724ca6000a..b171e7a1fb 100644 --- a/compiler/GHC/StgToCmm/Closure.hs +++ b/compiler/GHC/StgToCmm/Closure.hs @@ -67,7 +67,7 @@ module GHC.StgToCmm.Closure ( import GhcPrelude import GHC.Stg.Syntax -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm import GHC.Cmm.Ppr.Expr() -- For Outputable instances diff --git a/compiler/GHC/StgToCmm/DataCon.hs b/compiler/GHC/StgToCmm/DataCon.hs index 7d86620708..eb7f9223d7 100644 --- a/compiler/GHC/StgToCmm/DataCon.hs +++ b/compiler/GHC/StgToCmm/DataCon.hs @@ -33,7 +33,7 @@ import GHC.Cmm.Expr import GHC.Cmm.Utils import GHC.Cmm.CLabel import GHC.Cmm.Graph -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import CostCentre import Module import DataCon diff --git a/compiler/GHC/StgToCmm/Expr.hs b/compiler/GHC/StgToCmm/Expr.hs index 1befdd7d3a..95c8f7defb 100644 --- a/compiler/GHC/StgToCmm/Expr.hs +++ b/compiler/GHC/StgToCmm/Expr.hs @@ -354,7 +354,7 @@ We want to generate an assignment y := x We want to allow this assignment to be generated in the case when the types are compatible, because this allows some slightly-dodgy but -occasionally-useful casts to be used, such as in RtClosureInspect +occasionally-useful casts to be used, such as in GHC.Runtime.Heap.Inspect where we cast an HValue to a MutVar# so we can print out the contents of the MutVar#. If instead we generate code that enters the HValue, then we'll get a runtime panic, because the HValue really is a diff --git a/compiler/GHC/StgToCmm/Foreign.hs b/compiler/GHC/StgToCmm/Foreign.hs index 62a948d13c..b2302a175a 100644 --- a/compiler/GHC/StgToCmm/Foreign.hs +++ b/compiler/GHC/StgToCmm/Foreign.hs @@ -35,7 +35,7 @@ import GHC.Cmm.Graph import Type import GHC.Types.RepType import GHC.Cmm.CLabel -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import ForeignCall import DynFlags import Maybes diff --git a/compiler/GHC/StgToCmm/Heap.hs b/compiler/GHC/StgToCmm/Heap.hs index 085d47219f..0656cb2a08 100644 --- a/compiler/GHC/StgToCmm/Heap.hs +++ b/compiler/GHC/StgToCmm/Heap.hs @@ -37,7 +37,7 @@ import GHC.StgToCmm.Env import GHC.Cmm.Graph import GHC.Cmm.Dataflow.Label -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Utils diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs index e78221de3a..9139c36f0b 100644 --- a/compiler/GHC/StgToCmm/Layout.hs +++ b/compiler/GHC/StgToCmm/Layout.hs @@ -42,7 +42,7 @@ import GHC.StgToCmm.Monad import GHC.StgToCmm.Utils import GHC.Cmm.Graph -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Utils diff --git a/compiler/GHC/StgToCmm/Monad.hs b/compiler/GHC/StgToCmm/Monad.hs index 4f7d2e1220..34709f3d67 100644 --- a/compiler/GHC/StgToCmm/Monad.hs +++ b/compiler/GHC/StgToCmm/Monad.hs @@ -68,7 +68,7 @@ import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Graph as CmmGraph import GHC.Cmm.BlockId import GHC.Cmm.CLabel -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import Module import Id import VarEnv diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs index 6c5a836d7b..63cb5a532f 100644 --- a/compiler/GHC/StgToCmm/Prim.hs +++ b/compiler/GHC/StgToCmm/Prim.hs @@ -48,7 +48,7 @@ import TyCon import GHC.Cmm.CLabel import GHC.Cmm.Utils import PrimOp -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import FastString import Outputable import Util diff --git a/compiler/GHC/StgToCmm/Prof.hs b/compiler/GHC/StgToCmm/Prof.hs index 581e8279dc..068b768073 100644 --- a/compiler/GHC/StgToCmm/Prof.hs +++ b/compiler/GHC/StgToCmm/Prof.hs @@ -28,7 +28,7 @@ import GhcPrelude import GHC.StgToCmm.Closure import GHC.StgToCmm.Utils import GHC.StgToCmm.Monad -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.Cmm.Graph import GHC.Cmm diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs index fbb121dae6..22f91518f3 100644 --- a/compiler/GHC/StgToCmm/Ticky.hs +++ b/compiler/GHC/StgToCmm/Ticky.hs @@ -116,7 +116,7 @@ import GHC.Cmm.Expr import GHC.Cmm.Graph import GHC.Cmm.Utils import GHC.Cmm.CLabel -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import Module import Name diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs index 373beeed07..3611a64f75 100644 --- a/compiler/GHC/StgToCmm/Utils.hs +++ b/compiler/GHC/StgToCmm/Utils.hs @@ -66,7 +66,7 @@ import ForeignCall import IdInfo import Type import TyCon -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import Module import Literal import Digraph diff --git a/compiler/basicTypes/Literal.hs b/compiler/basicTypes/Literal.hs index 526115d5ef..8e4d82a0f3 100644 --- a/compiler/basicTypes/Literal.hs +++ b/compiler/basicTypes/Literal.hs @@ -846,6 +846,6 @@ Here are the moving parts: it in the code generators, but it seems simpler to do it once and for all in CoreToSTG. - In ByteCodeAsm we just lower it as a 0 literal, because + In GHC.ByteCode.Asm we just lower it as a 0 literal, because it's all boxed and lifted to the host GC anyway. -} diff --git a/compiler/ghci/keepCAFsForGHCi.c b/compiler/cbits/keepCAFsForGHCi.c index ba635b0d95..ba635b0d95 100644 --- a/compiler/ghci/keepCAFsForGHCi.c +++ b/compiler/cbits/keepCAFsForGHCi.c diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs index 0092e991ef..3e124b5829 100644 --- a/compiler/deSugar/Coverage.hs +++ b/compiler/deSugar/Coverage.hs @@ -14,10 +14,10 @@ module Coverage (addTicksToBinds, hpcInitCode) where import GhcPrelude as Prelude -import qualified GHCi +import qualified GHC.Runtime.Interpreter as GHCi import GHCi.RemoteTypes import Data.Array -import ByteCodeTypes +import GHC.ByteCode.Types import GHC.Stack.CCS import Type import GHC.Hs diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index c965973403..84a912998f 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -156,7 +156,7 @@ Library c-sources: cbits/cutils.c cbits/genSym.c - ghci/keepCAFsForGHCi.c + cbits/keepCAFsForGHCi.c hs-source-dirs: . @@ -165,7 +165,6 @@ Library cmm coreSyn deSugar - ghci iface llvmGen main @@ -304,7 +303,7 @@ Library GHC.StgToCmm.Ticky GHC.StgToCmm.Utils GHC.StgToCmm.ExtCode - GHC.Runtime.Layout + GHC.Runtime.Heap.Layout CoreArity CoreFVs CoreLint @@ -380,13 +379,13 @@ Library GhcMake GhcPlugins GhcPrelude - DynamicLoading HeaderInfo HscMain HscStats HscTypes - InteractiveEval - InteractiveEvalTypes + GHC.Runtime.Eval + GHC.Runtime.Eval.Types + GHC.Runtime.Loader UnitInfo Packages PlatformConstants @@ -650,14 +649,14 @@ Library Dwarf.Types Dwarf.Constants GHC.ThToHs - ByteCodeTypes - ByteCodeAsm - ByteCodeGen - ByteCodeInstr - ByteCodeItbls - ByteCodeLink - Debugger - LinkerTypes - Linker - RtClosureInspect - GHCi + GHC.ByteCode.Types + GHC.ByteCode.Asm + GHC.ByteCode.Instr + GHC.ByteCode.InfoTable + GHC.ByteCode.Linker + GHC.CoreToByteCode + GHC.Runtime.Debugger + GHC.Runtime.Linker.Types + GHC.Runtime.Linker + GHC.Runtime.Heap.Inspect + GHC.Runtime.Interpreter diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 1ca0f0bb17..2276559cd6 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -1106,7 +1106,7 @@ data DynFlags = DynFlags { -- loaded here is directed by pluginModNames. Arguments are loaded from -- pluginModNameOpts. The purpose of this field is to cache the plugins so -- they don't have to be loaded each time they are needed. See - -- 'DynamicLoading.initializePlugins'. + -- 'GHC.Runtime.Loader.initializePlugins'. staticPlugins :: [StaticPlugin], -- ^ static plugins which do not need dynamic loading. These plugins are -- intended to be added by GHC API users directly to this list. diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 1510947e7b..49017611ce 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -132,7 +132,7 @@ module GHC ( -- ** Compiling expressions HValue, parseExpr, compileParsedExpr, - InteractiveEval.compileExpr, dynCompileExpr, + GHC.Runtime.Eval.compileExpr, dynCompileExpr, ForeignHValue, compileExprRemote, compileParsedExprRemote, @@ -154,8 +154,8 @@ module GHC ( modInfoModBreaks, ModBreaks(..), BreakIndex, BreakInfo(breakInfo_number, breakInfo_module), - InteractiveEval.back, - InteractiveEval.forward, + GHC.Runtime.Eval.back, + GHC.Runtime.Eval.forward, -- * Abstract syntax elements @@ -295,10 +295,10 @@ module GHC ( import GhcPrelude hiding (init) -import ByteCodeTypes -import InteractiveEval -import InteractiveEvalTypes -import GHCi +import GHC.ByteCode.Types +import GHC.Runtime.Eval +import GHC.Runtime.Eval.Types +import GHC.Runtime.Interpreter import GHCi.RemoteTypes import PprTyThing ( pprFamInst ) @@ -1526,15 +1526,15 @@ getGHCiMonad = fmap (ic_monad . hsc_IC) getSession getHistorySpan :: GhcMonad m => History -> m SrcSpan getHistorySpan h = withSession $ \hsc_env -> - return $ InteractiveEval.getHistorySpan hsc_env h + return $ GHC.Runtime.Eval.getHistorySpan hsc_env h obtainTermFromVal :: GhcMonad m => Int -> Bool -> Type -> a -> m Term obtainTermFromVal bound force ty a = withSession $ \hsc_env -> - liftIO $ InteractiveEval.obtainTermFromVal hsc_env bound force ty a + liftIO $ GHC.Runtime.Eval.obtainTermFromVal hsc_env bound force ty a obtainTermFromId :: GhcMonad m => Int -> Bool -> Id -> m Term obtainTermFromId bound force id = withSession $ \hsc_env -> - liftIO $ InteractiveEval.obtainTermFromId hsc_env bound force id + liftIO $ GHC.Runtime.Eval.obtainTermFromId hsc_env bound force id -- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index 0f1e5cdc4b..2a597a205d 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -35,7 +35,7 @@ module GhcMake( import GhcPrelude -import qualified Linker ( unload ) +import qualified GHC.Runtime.Linker as Linker import DriverPhases import DriverPipeline diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 8ce49e4aab..8e7a9db87a 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -89,10 +89,10 @@ import GhcPrelude import Data.Data hiding (Fixity, TyCon) import Data.Maybe ( fromJust ) import Id -import GHCi ( addSptEntry ) +import GHC.Runtime.Interpreter ( addSptEntry ) import GHCi.RemoteTypes ( ForeignHValue ) -import ByteCodeGen ( byteCodeGen, coreExprToBCOs ) -import Linker +import GHC.CoreToByteCode ( byteCodeGen, coreExprToBCOs ) +import GHC.Runtime.Linker import CoreTidy ( tidyExpr ) import Type ( Type ) import {- Kind parts of -} Type ( Kind ) @@ -147,7 +147,7 @@ import Hooks import TcEnv import PrelNames import Plugins -import DynamicLoading ( initializePlugins ) +import GHC.Runtime.Loader ( initializePlugins ) import DynFlags import ErrUtils diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index b43c41db2a..33f827e2c6 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -155,8 +155,8 @@ module HscTypes ( import GhcPrelude -import ByteCodeTypes -import InteractiveEvalTypes ( Resume ) +import GHC.ByteCode.Types +import GHC.Runtime.Eval.Types ( Resume ) import GHCi.Message ( Pipe ) import GHCi.RemoteTypes import GHC.ForeignSrcLang @@ -190,7 +190,7 @@ import TysWiredIn import Packages hiding ( Version(..) ) import CmdLineParser import DynFlags -import LinkerTypes ( DynLinker, Linkable(..), Unlinked(..), SptEntry(..) ) +import GHC.Runtime.Linker.Types ( DynLinker, Linkable(..), Unlinked(..), SptEntry(..) ) import DriverPhases ( Phase, HscSource(..), hscSourceString , isHsBootOrSig, isHsigFile ) import qualified DriverPhases as Phase @@ -1680,7 +1680,7 @@ data InteractiveContext ic_rn_gbl_env :: GlobalRdrEnv, -- ^ The cached 'GlobalRdrEnv', built by - -- 'InteractiveEval.setContext' and updated regularly + -- 'GHC.Runtime.Eval.setContext' and updated regularly -- It contains everything in scope at the command line, -- including everything in ic_tythings diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index b8fb162432..026631df37 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -52,7 +52,7 @@ import SrcLoc import Util import Module import Plugins ( withPlugins, installCoreToDos ) -import DynamicLoading -- ( initializePlugins ) +import GHC.Runtime.Loader -- ( initializePlugins ) import UniqSupply ( UniqSupply, mkSplitUniqSupply, splitUniqSupply ) import UniqFM diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 9557efa40c..3fd70d0a2b 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -2946,7 +2946,7 @@ Note [Runtime skolems] ~~~~~~~~~~~~~~~~~~~~~~ We want to give a reasonably helpful error message for ambiguity arising from *runtime* skolems in the debugger. These -are created by in RtClosureInspect.zonkRTTIType. +are created by in GHC.Runtime.Heap.Inspect.zonkRTTIType. ************************************************************************ * * diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 566db1c1df..485948a5a3 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -57,7 +57,7 @@ import Control.Monad import GHCi.Message import GHCi.RemoteTypes -import GHCi +import GHC.Runtime.Interpreter import HscMain -- These imports are the reason that TcSplice -- is very high up the module hierarchy diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index 4cec96a847..ac3820884e 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -1025,7 +1025,7 @@ isMetaTyVar tv -- isAmbiguousTyVar is used only when reporting type errors -- It picks out variables that are unbound, namely meta -- type variables and the RuntimUnk variables created by --- RtClosureInspect.zonkRTTIType. These are "ambiguous" in +-- GHC.Runtime.Heap.Inspect.zonkRTTIType. These are "ambiguous" in -- the sense that they stand for an as-yet-unknown type isAmbiguousTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index f49c1834d3..6bca4e8dba 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -33,10 +33,10 @@ import qualified GHCi.UI.Monad as GhciMonad ( args, runStmt, runDecls' ) import GHCi.UI.Monad hiding ( args, runStmt ) import GHCi.UI.Tags import GHCi.UI.Info -import Debugger +import GHC.Runtime.Debugger -- The GHC interface -import GHCi +import GHC.Runtime.Interpreter import GHCi.RemoteTypes import GHCi.BreakArray import DynFlags @@ -68,7 +68,7 @@ import qualified Lexer import StringBuffer import Outputable hiding ( printForUser, printForUserPartWay ) -import DynamicLoading ( initializePlugins ) +import GHC.Runtime.Loader ( initializePlugins ) -- Other random utilities import BasicTypes hiding ( isTopLevel ) @@ -76,7 +76,7 @@ import Config import Digraph import Encoding import FastString -import Linker +import GHC.Runtime.Linker import Maybes ( orElse, expectJust ) import NameSet import Panic hiding ( showException ) @@ -3153,7 +3153,7 @@ ticket contains an analysis of the situation and suggests the solution implemented above. The same filter was also implemented to fix #11051 [3]. See the -Note [What to show to users] in compiler/main/InteractiveEval.hs +Note [What to show to users] in GHC.Runtime.Eval [1] https://gitlab.haskell.org/ghc/ghc/issues/12525 [2] https://gitlab.haskell.org/ghc/ghc/issues/12525#note_123489 diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs index 63356d6418..6bd584bbe6 100644 --- a/ghc/GHCi/UI/Monad.hs +++ b/ghc/GHCi/UI/Monad.hs @@ -48,7 +48,7 @@ import SrcLoc import Module import RdrName (mkOrig) import PrelNames (gHC_GHCI_HELPERS) -import GHCi +import GHC.Runtime.Interpreter import GHCi.RemoteTypes import GHC.Hs (ImportDecl, GhcPs, GhciLStmt, LHsDecl) import GHC.Hs.Utils diff --git a/ghc/Main.hs b/ghc/Main.hs index 6514a00345..c30109d5aa 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -33,10 +33,10 @@ import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings ) #endif -- Frontend plugins -import DynamicLoading ( loadFrontendPlugin ) +import GHC.Runtime.Loader ( loadFrontendPlugin ) import Plugins #if defined(HAVE_INTERNAL_INTERPRETER) -import DynamicLoading ( initializePlugins ) +import GHC.Runtime.Loader ( initializePlugins ) #endif import Module ( ModuleName ) diff --git a/includes/rts/Bytecodes.h b/includes/rts/Bytecodes.h index e5d55f694f..f7a0d6f151 100644 --- a/includes/rts/Bytecodes.h +++ b/includes/rts/Bytecodes.h @@ -17,7 +17,7 @@ /* NOTE: - THIS FILE IS INCLUDED IN HASKELL SOURCES (ghc/compiler/ghci/ByteCodeAsm.hs). + THIS FILE IS INCLUDED IN HASKELL SOURCES (ghc/compiler/GHC/ByteCode/Asm.hs). DO NOT PUT C-SPECIFIC STUFF IN HERE! I hope that's clear :-) diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index 0843b95b37..e69e28ecaf 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -72,7 +72,7 @@ RTS_RET(stg_restore_cccs_eval); // RTS_FUN(stg_interp_constr6_entry); // RTS_FUN(stg_interp_constr7_entry); // -// This is referenced using the FFI in the compiler (ByteCodeItbls), +// This is referenced using the FFI in the compiler (GHC.ByteCode.InfoTable), // so we can't give it the correct type here because the prototypes // would clash (FFI references are always declared with type StgWord[] // in the generated C code). diff --git a/libraries/ghc-heap/GHC/Exts/Heap.hs b/libraries/ghc-heap/GHC/Exts/Heap.hs index 4865dd60c9..c1f2376729 100644 --- a/libraries/ghc-heap/GHC/Exts/Heap.hs +++ b/libraries/ghc-heap/GHC/Exts/Heap.hs @@ -122,7 +122,7 @@ getClosureRaw x = do ptrList = amap' Box $ Array 0 (pelems - 1) pelems pointers pure (Ptr iptr, rawWds, ptrList) --- From compiler/ghci/RtClosureInspect.hs +-- From GHC.Runtime.Heap.Inspect amap' :: (t -> b) -> Array Int t -> [b] amap' f (Array i0 i _ arr#) = map g [0 .. i - i0] where g (I# i#) = case indexArray# arr# i# of @@ -145,7 +145,7 @@ getClosure x = do case tipe itbl of t | t >= CONSTR && t <= CONSTR_NOCAF -> do (p, m, n) <- dataConNames iptr - if m == "ByteCodeInstr" && n == "BreakInfo" + if m == "GHC.ByteCode.Instr" && n == "BreakInfo" then pure $ UnsupportedClosure itbl else pure $ ConstrClosure itbl pts npts p m n diff --git a/libraries/ghci/GHCi/BreakArray.hs b/libraries/ghci/GHCi/BreakArray.hs index 8ab813a5a7..a0f9d03bdc 100644 --- a/libraries/ghci/GHCi/BreakArray.hs +++ b/libraries/ghci/GHCi/BreakArray.hs @@ -19,7 +19,7 @@ module GHCi.BreakArray ( BreakArray - (BA) -- constructor is exported only for ByteCodeGen + (BA) -- constructor is exported only for GHC.CoreToByteCode , newBreakArray , getBreak , setBreakOn diff --git a/libraries/integer-gmp/src/GHC/Integer/Type.hs b/libraries/integer-gmp/src/GHC/Integer/Type.hs index 44a2964895..cc94089828 100644 --- a/libraries/integer-gmp/src/GHC/Integer/Type.hs +++ b/libraries/integer-gmp/src/GHC/Integer/Type.hs @@ -159,7 +159,7 @@ data Integer = S# !Int# -- ^ iff value in @]-inf, minBound::'Int'[@ range -- NOTE: the above representation is baked into the GHCi debugger in --- compiler/ghci/RtClosureInspect.hs. If you change it here, fixes +-- GHC.Runtime.Heap.Inspect. If you change it here, fixes -- will be required over there too. Tests for this are in -- testsuite/tests/ghci.debugger. diff --git a/rts/Disassembler.c b/rts/Disassembler.c index 01d6c3b1d9..d5593c8a07 100644 --- a/rts/Disassembler.c +++ b/rts/Disassembler.c @@ -324,7 +324,7 @@ disInstr ( StgBCO *bco, int pc ) /* Something of a kludge .. how do we know where the end of the insn array is, since it isn't recorded anywhere? Answer: the first short is the number of bytecodes which follow it. - See ByteCodeGen.linkBCO.insns_arr for construction ... + See GHC.CoreToByteCode.linkBCO.insns_arr for construction ... */ void disassemble( StgBCO *bco ) { diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 78a958d5ec..e1f6fab93a 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -2109,7 +2109,7 @@ stg_mkApUpd0zh ( P_ bco ) W_ ap; // This function is *only* used to wrap zero-arity BCOs in an - // updatable wrapper (see ByteCodeLink.hs). An AP thunk is always + // updatable wrapper (see GHC.ByteCode.Linker). An AP thunk is always // saturated and always points directly to a FUN or BCO. ASSERT(%INFO_TYPE(%GET_STD_INFO(bco)) == HALF_W_(BCO) && StgBCO_arity(bco) == HALF_W_(0)); diff --git a/testsuite/tests/codeGen/should_run/T13825-unit.hs b/testsuite/tests/codeGen/should_run/T13825-unit.hs index 85777bfe72..1c8d6e2155 100644 --- a/testsuite/tests/codeGen/should_run/T13825-unit.hs +++ b/testsuite/tests/codeGen/should_run/T13825-unit.hs @@ -2,7 +2,7 @@ module Main where import DynFlags import GHC.Types.RepType -import GHC.Runtime.Layout +import GHC.Runtime.Heap.Layout import GHC.StgToCmm.Layout import GHC.StgToCmm.Closure import GHC diff --git a/testsuite/tests/ghc-api/T4891/T4891.hs b/testsuite/tests/ghc-api/T4891/T4891.hs index 62edae0e78..feb792862b 100644 --- a/testsuite/tests/ghc-api/T4891/T4891.hs +++ b/testsuite/tests/ghc-api/T4891/T4891.hs @@ -1,15 +1,15 @@ {-# LANGUAGE BangPatterns #-} module Main where -import ByteCodeLink +import GHC.ByteCode.Linker import CoreMonad import Data.Array import DataCon import GHC import GHC.Exts.Heap import HscTypes -import Linker -import RtClosureInspect +import GHC.Runtime.Linker +import GHC.Runtime.Heap.Inspect import TcEnv import Type import TcRnMonad diff --git a/testsuite/tests/ghci/should_run/ghcirun004.hs b/testsuite/tests/ghci/should_run/ghcirun004.hs index f3e3095275..1a1c474427 100644 --- a/testsuite/tests/ghci/should_run/ghcirun004.hs +++ b/testsuite/tests/ghci/should_run/ghcirun004.hs @@ -1,5 +1,5 @@ -- crashes in 7.2.1 and earlier, due to bogus calculations of label --- offsets in ByteCodeAsm for a BCO with large instructions. +-- offsets in GHC.ByteCode.Asm for a BCO with large instructions. main = print (map foo [1,50..5000] ) diff --git a/testsuite/tests/rts/linker/LinkerUnload.hs b/testsuite/tests/rts/linker/LinkerUnload.hs index 9d6b243256..d26fae57ea 100644 --- a/testsuite/tests/rts/linker/LinkerUnload.hs +++ b/testsuite/tests/rts/linker/LinkerUnload.hs @@ -2,7 +2,7 @@ module LinkerUnload (init) where import GHC import DynFlags -import Linker +import GHC.Runtime.Linker as Linker import System.Environment import MonadUtils ( MonadIO(..) ) diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr index 30d756f058..3ec6cb6ca5 100644 --- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr +++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr @@ -12,7 +12,7 @@ This could be caused by: ghc-stage2: ^^ Could not load 'c', dependency unresolved. See top entry above. -ByteCodeLink: can't find label +GHC.ByteCode.Linker: can't find label During interactive linking, GHCi couldn't find the following symbol: c This may be due to you not asking GHCi to load extra object files, diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32 index 1b32baf67e..5304e84a37 100644 --- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32 +++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32 @@ -12,7 +12,7 @@ This could be caused by: ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above. -ByteCodeLink: can't find label +GHC.ByteCode.Linker: can't find label During interactive linking, GHCi couldn't find the following symbol: c This may be due to you not asking GHCi to load extra object files, diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32 index d38e1c00ec..5396070515 100644 --- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32 +++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32 @@ -12,7 +12,7 @@ This could be caused by: ghc-stage2.exe: ^^ Could not load 'c', dependency unresolved. See top entry above. -ByteCodeLink: can't find label +GHC.ByteCode.Linker: can't find label During interactive linking, GHCi couldn't find the following symbol: c This may be due to you not asking GHCi to load extra object files, diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr index 0f54eab090..b5d1872a8d 100644 --- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr +++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr @@ -12,7 +12,7 @@ This could be caused by: ghc-stage2: ^^ Could not load 'c', dependency unresolved. See top entry above. -ByteCodeLink: can't find label +GHC.ByteCode.Linker: can't find label During interactive linking, GHCi couldn't find the following symbol: c This may be due to you not asking GHCi to load extra object files, diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32 index 6226dda848..fcf9f6cbd9 100644 --- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32 +++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32 @@ -12,7 +12,7 @@ This could be caused by: ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above. -ByteCodeLink: can't find label +GHC.ByteCode.Linker: can't find label During interactive linking, GHCi couldn't find the following symbol: c This may be due to you not asking GHCi to load extra object files, diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32 index 5b9103e606..84742a8271 100644 --- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32 +++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32 @@ -12,7 +12,7 @@ This could be caused by: ghc-stage2.exe: ^^ Could not load 'c', dependency unresolved. See top entry above. -ByteCodeLink: can't find label +GHC.ByteCode.Linker: can't find label During interactive linking, GHCi couldn't find the following symbol: c This may be due to you not asking GHCi to load extra object files, diff --git a/utils/haddock b/utils/haddock -Subproject e7a650a94dbc118c423e684b27203a52baf34ff +Subproject d838d08f0ac0173dc704d51191b1c1976964b6f |