Commit 24879129 authored by Takenobu Tani's avatar Takenobu Tani Committed by Marge Bot
Browse files

Clarify leaf module names for new module hierarchy

This updates comments only.

This patch replaces leaf module names according to new module
hierarchy [1][2] as followings:

* Expand leaf names to easily find the module path:
  for instance, `Id.hs` to `GHC.Types.Id`.

* Modify leaf names according to new module hierarchy:
  for instance, `Convert.hs` to `GHC.ThToHs`.

* Fix typo:
  for instance, `GHC.Core.TyCo.Rep.hs` to `GHC.Core.TyCo.Rep`

See also !3375

[1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular
[2]: #13009
parent a47e6442
......@@ -2602,7 +2602,7 @@ primop RaiseOp "raise#" GenPrimOp
-- Hence, it has 'botDiv', not 'exnDiv'.
-- For the same reasons, 'raise#' is marked as "can_fail" (which 'raiseIO#'
-- is not), but not as "has_side_effects" (which 'raiseIO#' is).
-- See Note [PrimOp can_fail and has_side_effects] in PrimOp.hs.
-- See Note [PrimOp can_fail and has_side_effects] in "GHC.Builtin.PrimOps".
strictness = { \ _arity -> mkClosedStrictSig [topDmd] botDiv }
out_of_line = True
can_fail = True
......@@ -2653,7 +2653,7 @@ primop RaiseOverflowOp "raiseOverflow#" GenPrimOp
primop RaiseIOOp "raiseIO#" GenPrimOp
a -> State# RealWorld -> (# State# RealWorld, b #)
with
-- See Note [Precise exceptions and strictness analysis] in Demand.hs
-- See Note [Precise exceptions and strictness analysis] in "GHC.Types.Demand"
-- for why this is the *only* primop that has 'exnDiv'
strictness = { \ _arity -> mkClosedStrictSig [topDmd, topDmd] exnDiv }
out_of_line = True
......
......@@ -395,7 +395,7 @@ The flow of unwinding information through the compiler is a bit convoluted:
(by the Dwarf module) and emitted in the final object.
See also:
Note [Unwinding information in the NCG] in AsmCodeGen,
Note [Unwinding information in the NCG] in "GHC.CmmToAsm",
Note [Unwind pseudo-instruction in Cmm],
Note [Debugging DWARF unwinding info].
......@@ -460,7 +460,7 @@ symbols for gdb if you obtain it through a package manager.
Keep in mind that the current release of GDB has an instruction pointer handling
heuristic that works well for C-like languages, but doesn't always work for
Haskell. See Note [Info Offset] in Dwarf.Types for more details.
Haskell. See Note [Info Offset] in "GHC.CmmToAsm.Dwarf.Types" for more details.
Note [Unwind pseudo-instruction in Cmm]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -70,7 +70,7 @@ data CmmNode e x where
-- up one frame. Having unwind information for @Sp@ will allow the
-- debugger to "walk" the stack.
--
-- See Note [What is this unwinding business?] in Debug
-- See Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock"
CmmUnwind :: [(GlobalReg, Maybe CmmExpr)] -> CmmNode O O
CmmAssign :: !CmmReg -> !CmmExpr -> CmmNode O O
......
......@@ -253,7 +253,7 @@ pprArea :: Area -> SDoc
pprArea Old = text "old"
pprArea (Young id) = hcat [ text "young<", ppr id, text ">" ]
-- needs to be kept in syn with CmmExpr.hs.GlobalReg
-- needs to be kept in syn with 'GHC.Cmm.Expr.GlobalReg'
--
pprGlobalReg :: GlobalReg -> SDoc
pprGlobalReg gr
......
......@@ -289,7 +289,7 @@ data NativeGenAcc statics instr
, ngs_dwarfFiles :: !DwarfFiles
, ngs_unwinds :: !(LabelMap [UnwindPoint])
-- ^ see Note [Unwinding information in the NCG]
-- and Note [What is this unwinding business?] in Debug.
-- and Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock".
}
{-
......@@ -314,7 +314,7 @@ field of NativeGenAcc. This is a label map which contains an entry for each
procedure, containing a list of unwinding points (e.g. a label and an associated
unwinding table).
See also Note [What is this unwinding business?] in Debug.
See also Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock".
-}
nativeCodeGen' :: (Outputable statics, Outputable instr,Outputable jumpDest,
......@@ -432,7 +432,7 @@ cmmNativeGenStream dflags this_mod modLoc ncgImpl h us cmm_stream ngs
dbgMap us cmms ngs 0
-- Link native code information into debug blocks
-- See Note [What is this unwinding business?] in Debug.
-- See Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock".
let !ldbgs = cmmDebugLink (ngs_labels ngs') (ngs_unwinds ngs') ndbgs
unless (null ldbgs) $
dumpIfSet_dyn dflags Opt_D_dump_debug "Debug Infos" FormatText
......
......@@ -251,7 +251,7 @@ filterEdges f cfg =
See Note [What is shortcutting] in the control flow optimization
code (GHC.Cmm.ContFlowOpt) for a slightly more in depth explanation on shortcutting.
In the native backend we shortcut jumps at the assembly level. (AsmCodeGen.hs)
In the native backend we shortcut jumps at the assembly level. ("GHC.CmmToAsm")
This means we remove blocks containing only one jump from the code
and instead redirecting all jumps targeting this block to the deleted
blocks jump target.
......
......@@ -246,7 +246,7 @@ procToFrame initUws blk
-- | If the current procedure has an info table, then we also say that
-- its first block has one to ensure that it gets the necessary -1
-- offset applied to its start address.
-- See Note [Info Offset] in Dwarf.Types.
-- See Note [Info Offset] in "GHC.CmmToAsm.Dwarf.Types".
setHasInfo :: [(DebugBlock, [UnwindPoint])]
-> [(DebugBlock, [UnwindPoint])]
setHasInfo [] = []
......
......@@ -93,7 +93,7 @@ data NcgImpl statics instr jumpDest = NcgImpl {
extractUnwindPoints :: [instr] -> [UnwindPoint],
-- ^ given the instruction sequence of a block, produce a list of
-- the block's 'UnwindPoint's
-- See Note [What is this unwinding business?] in Debug
-- See Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock"
-- and Note [Unwinding information in the NCG] in this module.
invertCondBranches :: Maybe CFG -> LabelMap RawCmmStatics -> [NatBasicBlock instr]
-> [NatBasicBlock instr]
......
......@@ -144,7 +144,7 @@ pprBasicBlock config info_env (BasicBlock blockid instrs)
pprDatas :: Platform -> RawCmmStatics -> SDoc
-- See note [emit-time elimination of static indirections] in CLabel.
-- See note [emit-time elimination of static indirections] in "GHC.Cmm.CLabel".
pprDatas _platform (CmmStaticsRaw alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
......
......@@ -103,7 +103,7 @@ pprBasicBlock platform info_env (BasicBlock blockid instrs)
pprDatas :: Platform -> RawCmmStatics -> SDoc
-- See note [emit-time elimination of static indirections] in CLabel.
-- See note [emit-time elimination of static indirections] in "GHC.Cmm.CLabel".
pprDatas _platform (CmmStaticsRaw alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
......
......@@ -222,7 +222,7 @@ basicBlockCodeGen block = do
return (BasicBlock id top : other_blocks, statics)
-- | Convert 'DELTA' instructions into 'UNWIND' instructions to capture changes
-- in the @sp@ register. See Note [What is this unwinding business?] in Debug
-- in the @sp@ register. See Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock"
-- for details.
addSpUnwindings :: Instr -> NatM (OrdList Instr)
addSpUnwindings instr@(DELTA d) = do
......
......@@ -150,7 +150,7 @@ pprBasicBlock config info_env (BasicBlock blockid instrs)
pprDatas :: NCGConfig -> (Alignment, RawCmmStatics) -> SDoc
-- See note [emit-time elimination of static indirections] in CLabel.
-- See note [emit-time elimination of static indirections] in "GHC.Cmm.CLabel".
pprDatas _config (_, CmmStaticsRaw alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
......
......@@ -568,7 +568,7 @@ generateExternDecls = do
-- | Here we take a global variable definition, rename it with a
-- @$def@ suffix, and generate the appropriate alias.
aliasify :: LMGlobal -> LlvmM [LMGlobal]
-- See note [emit-time elimination of static indirections] in CLabel.
-- See note [emit-time elimination of static indirections] in "GHC.Cmm.CLabel".
-- Here we obtain the indirectee's precise type and introduce
-- fresh aliases to both the precise typed label (lbl$def) and the i8*
-- typed (regular) label of it with the matching new names.
......
......@@ -43,7 +43,7 @@ linkage lbl = if externallyVisibleCLabel lbl
-- | Pass a CmmStatic section to an equivalent Llvm code.
genLlvmData :: (Section, RawCmmStatics) -> LlvmM LlvmData
-- See note [emit-time elimination of static indirections] in CLabel.
-- See note [emit-time elimination of static indirections] in "GHC.Cmm.CLabel".
genLlvmData (_, CmmStaticsRaw alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
......
......@@ -1538,7 +1538,7 @@ data UnfoldingSource
| InlineCompulsory -- Something that *has* no binding, so you *must* inline it
-- Only a few primop-like things have this property
-- (see MkId.hs, calls to mkCompulsoryUnfolding).
-- (see "GHC.Types.Id.Make", calls to mkCompulsoryUnfolding).
-- Inline absolutely always, however boring the context.
......
......@@ -448,7 +448,7 @@ See also:
* Note [Newtype eta] in GHC.Core.TyCon. This is notionally separate
and deals with the axiom connecting a newtype with its representation
type; but it too is eta-reduced.
* Note [Implementing eta reduction for data families] in TcInstDcls. This
* Note [Implementing eta reduction for data families] in "GHC.Tc.TyCl.Instance". This
describes the implementation details of this eta reduction happen.
-}
......
......@@ -482,7 +482,7 @@ idRuleRhsVars is_active id
get_fvs (Rule { ru_fn = fn, ru_bndrs = bndrs
, ru_rhs = rhs, ru_act = act })
| is_active act
-- See Note [Finding rule RHS free vars] in OccAnal.hs
-- See Note [Finding rule RHS free vars] in "GHC.Core.Opt.OccurAnal"
= delOneFromUniqSet_Directly fvs (getUnique fn)
-- Note [Rule free var hack]
where
......
......@@ -647,7 +647,7 @@ mkCoAxBranch :: [TyVar] -- original, possibly stale, tyvars
-> SrcSpan
-> CoAxBranch
mkCoAxBranch tvs eta_tvs cvs ax_tc lhs rhs roles loc
= -- See Note [CoAxioms are homogeneous] in Core.Coercion.Axiom
= -- See Note [CoAxioms are homogeneous] in "GHC.Core.Coercion.Axiom"
ASSERT( typeKind (mkTyConApp ax_tc lhs) `eqType` typeKind rhs )
CoAxBranch { cab_tvs = tvs'
, cab_eta_tvs = eta_tvs'
......
......@@ -163,7 +163,7 @@ Note [Linting type lets]
In the desugarer, it's very very convenient to be able to say (in effect)
let a = Type Bool in
let x::a = True in <body>
That is, use a type let. See Note [Type let] in CoreSyn.
That is, use a type let. See Note [Type let] in "GHC.Core".
One place it is used is in mkWwArgs; see Note [Join points and beta-redexes]
in GHC.Core.Opt.WorkWrap.Utils. (Maybe there are other "clients" of this feature; I'm not sure).
......@@ -468,7 +468,7 @@ lintCoreBindings dflags pass local_in_scope binds
all_pairs = flattenBinds binds
-- Put all the top-level binders in scope at the start
-- This is because rewrite rules can bring something
-- into use 'unexpectedly'; see Note [Glomming] in OccurAnal
-- into use 'unexpectedly'; see Note [Glomming] in "GHC.Core.Opt.OccurAnal"
binders = map fst all_pairs
flags = defaultLintFlags
......@@ -1834,7 +1834,7 @@ conceivably we could allow it. But we can always eta-expand such an
"undersaturated" rule (see 'GHC.Core.Opt.Arity.etaExpandToJoinPointRule'), and in fact
the simplifier would have to in order to deal with the RHS. So we take a
conservative view and don't allow undersaturated rules for join points. See
Note [Rules and join points] in OccurAnal for further discussion.
Note [Rules and join points] in "GHC.Core.Opt.OccurAnal" for further discussion.
-}
{-
......
......@@ -373,7 +373,7 @@ data AnalEnv
-- ^ Current approximation of signatures for local ids
, ae_virgin :: Bool
-- ^ True only on every first iteration in a fixed-point
-- iteration. See Note [Initialising strictness] in "DmdAnal"
-- iteration. See Note [Initialising strictness] in "GHC.Core.Opt.DmdAnal"
, ae_fam_envs :: FamInstEnvs
-- ^ Needed when expanding type families and synonyms of product types.
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment