summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-06-01 01:46:09 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-06-02 15:42:59 +0000
commitd550d9079d6518938a2e41622b1c3ebf1fb24f59 (patch)
tree6cc6657783d10640c3eb3dd931567afd2b3e2824
parentf065804eb7afa8a7902ccc779cf2c9fae520f956 (diff)
downloadhaskell-d550d9079d6518938a2e41622b1c3ebf1fb24f59.tar.gz
Rename `HsToCore.{Coverage -> Ticks}`
The old name made it confusing why disabling HPC didn't disable the entire pass. The name makes it clear --- there are other reasons to add ticks in addition.
-rw-r--r--compiler/GHC/Core/Subst.hs2
-rw-r--r--compiler/GHC/Driver/Backend.hs2
-rw-r--r--compiler/GHC/Driver/Pipeline/Execute.hs4
-rw-r--r--compiler/GHC/HsToCore.hs10
-rw-r--r--compiler/GHC/HsToCore/Ticks.hs (renamed from compiler/GHC/HsToCore/Coverage.hs)26
-rw-r--r--compiler/GHC/Rename/Expr.hs2
-rw-r--r--compiler/ghc.cabal.in2
-rw-r--r--rts/Hpc.c2
8 files changed, 25 insertions, 25 deletions
diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs
index be658384b0..9f4f20591e 100644
--- a/compiler/GHC/Core/Subst.hs
+++ b/compiler/GHC/Core/Subst.hs
@@ -765,7 +765,7 @@ and abstractions to get back to an Id, with getIdFromTrivialExpr.
Second, we have to ensure that we never try to substitute a literal
for an Id in a breakpoint. We ensure this by never storing an Id with
-an unlifted type in a Breakpoint - see GHC.HsToCore.Coverage.mkTickish.
+an unlifted type in a Breakpoint - see GHC.HsToCore.Ticks.mkTickish.
Breakpoints can't handle free variables with unlifted types anyway.
-}
diff --git a/compiler/GHC/Driver/Backend.hs b/compiler/GHC/Driver/Backend.hs
index a27a2e7b4a..afe8176f78 100644
--- a/compiler/GHC/Driver/Backend.hs
+++ b/compiler/GHC/Driver/Backend.hs
@@ -645,7 +645,7 @@ backendSptIsDynamic (Named ViaC) = False
backendSptIsDynamic (Named Interpreter) = True
backendSptIsDynamic (Named NoBackend) = False
--- | If this flag is set, then "GHC.HsToCore.Coverage"
+-- | If this flag is set, then "GHC.HsToCore.Ticks"
-- inserts `Breakpoint` ticks. Used only for the
-- interpreter.
backendWantsBreakpointTicks :: Backend -> Bool
diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs
index 86ba305461..ff62a9a6db 100644
--- a/compiler/GHC/Driver/Pipeline/Execute.hs
+++ b/compiler/GHC/Driver/Pipeline/Execute.hs
@@ -573,7 +573,7 @@ runUnlitPhase hsc_env input_fn output_fn = do
-- escape the characters \, ", and ', but don't try to escape
-- Unicode or anything else (so we don't use Util.charToC
-- here). If we get this wrong, then in
- -- GHC.HsToCore.Coverage.isGoodTickSrcSpan where we check that the filename in
+ -- GHC.HsToCore.Ticks.isGoodTickSrcSpan where we check that the filename in
-- a SrcLoc is the same as the source filenaame, the two will
-- look bogusly different. See test:
-- libraries/hpc/tests/function/subdir/tough2.hs
@@ -1362,7 +1362,7 @@ Introduction
4) -fhpc
At some point during compilation with -fhpc, in the function
- `GHC.HsToCore.Coverage.isGoodTickSrcSpan`, we compare the filename that a
+ `GHC.HsToCore.Ticks.isGoodTickSrcSpan`, we compare the filename that a
`SrcSpan` refers to with the name of the file we are currently compiling.
For some reason I don't yet understand, they can sometimes legitimally be
different, and then hpc ignores that SrcSpan.
diff --git a/compiler/GHC/HsToCore.hs b/compiler/GHC/HsToCore.hs
index 8e2b9849e3..772c242a12 100644
--- a/compiler/GHC/HsToCore.hs
+++ b/compiler/GHC/HsToCore.hs
@@ -33,7 +33,7 @@ import GHC.HsToCore.Errors.Types
import GHC.HsToCore.Expr
import GHC.HsToCore.Binds
import GHC.HsToCore.Foreign.Decl
-import GHC.HsToCore.Coverage
+import GHC.HsToCore.Ticks
import GHC.HsToCore.Docs
import GHC.Tc.Types
@@ -152,10 +152,10 @@ deSugar hsc_env
; (binds_cvr, ds_hpc_info, modBreaks)
<- if not (isHsBootOrSig hsc_src)
then addTicksToBinds
- (CoverageConfig
- { coverageConfig_logger = hsc_logger hsc_env
- , coverageConfig_dynFlags = hsc_dflags hsc_env
- , coverageConfig_mInterp = hsc_interp hsc_env
+ (TicksConfig
+ { ticksConfig_logger = hsc_logger hsc_env
+ , ticksConfig_dynFlags = hsc_dflags hsc_env
+ , ticksConfig_mInterp = hsc_interp hsc_env
})
mod mod_loc
export_set (typeEnvTyCons type_env) binds
diff --git a/compiler/GHC/HsToCore/Coverage.hs b/compiler/GHC/HsToCore/Ticks.hs
index c4f04d56c8..cedd1d0439 100644
--- a/compiler/GHC/HsToCore/Coverage.hs
+++ b/compiler/GHC/HsToCore/Ticks.hs
@@ -10,8 +10,8 @@
(c) University of Glasgow, 2007
-}
-module GHC.HsToCore.Coverage
- ( CoverageConfig (..)
+module GHC.HsToCore.Ticks
+ ( TicksConfig (..)
, addTicksToBinds
, hpcInitCode
) where
@@ -80,19 +80,19 @@ import qualified Data.Set as Set
************************************************************************
-}
--- | Configuration for compilation pass to support Haskell Program
--- Coverage.
-data CoverageConfig = CoverageConfig
- { coverageConfig_logger :: Logger
+-- | Configuration for compilation pass to add tick for instrumentation
+-- to binding sites.
+data TicksConfig = TicksConfig
+ { ticksConfig_logger :: Logger
-- FIXME: replace this with the specific fields of DynFlags we care about.
- , coverageConfig_dynFlags :: DynFlags
+ , ticksConfig_dynFlags :: DynFlags
- , coverageConfig_mInterp :: Maybe Interp
+ , ticksConfig_mInterp :: Maybe Interp
}
addTicksToBinds
- :: CoverageConfig
+ :: TicksConfig
-> Module
-> ModLocation -- ^ location of the current module
-> NameSet -- ^ Exported Ids. When we call addTicksToBinds,
@@ -102,10 +102,10 @@ addTicksToBinds
-> LHsBinds GhcTc
-> IO (LHsBinds GhcTc, HpcInfo, Maybe ModBreaks)
-addTicksToBinds (CoverageConfig
- { coverageConfig_logger = logger
- , coverageConfig_dynFlags = dflags
- , coverageConfig_mInterp = m_interp
+addTicksToBinds (TicksConfig
+ { ticksConfig_logger = logger
+ , ticksConfig_dynFlags = dflags
+ , ticksConfig_mInterp = m_interp
})
mod mod_loc exports tyCons binds
| let passes = coveragePasses dflags
diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs
index eab8711c8f..70233c0854 100644
--- a/compiler/GHC/Rename/Expr.hs
+++ b/compiler/GHC/Rename/Expr.hs
@@ -122,7 +122,7 @@ but several have a little bit of special treatment:
* HsIf (if-the-else)
if b then e1 else e2 ==> ifThenElse b e1 e2
We do this /only/ if rebindable syntax is on, because the coverage
- checker looks for HsIf (see GHC.HsToCore.Coverage.addTickHsExpr)
+ checker looks for HsIf (see GHC.HsToCore.Ticks.addTickHsExpr)
That means the typechecker and desugarer need to understand HsIf
for the non-rebindable-syntax case.
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index d757925444..afb7618e1e 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -453,7 +453,6 @@ Library
GHC.HsToCore
GHC.HsToCore.Arrows
GHC.HsToCore.Binds
- GHC.HsToCore.Coverage
GHC.HsToCore.Docs
GHC.HsToCore.Errors.Ppr
GHC.HsToCore.Errors.Types
@@ -478,6 +477,7 @@ Library
GHC.HsToCore.Pmc.Types
GHC.HsToCore.Pmc.Utils
GHC.HsToCore.Quote
+ GHC.HsToCore.Ticks
GHC.HsToCore.Types
GHC.HsToCore.Usage
GHC.HsToCore.Utils
diff --git a/rts/Hpc.c b/rts/Hpc.c
index edbad500c0..55e0fa355a 100644
--- a/rts/Hpc.c
+++ b/rts/Hpc.c
@@ -241,7 +241,7 @@ startupHpc(void)
/*
* Called on a per-module basis, by a constructor function compiled
- * with each module (see GHC.HsToCore.Coverage.hpcInitCode), declaring
+ * with each module (see GHC.HsToCore.Ticks.hpcInitCode), declaring
* where the tix boxes are stored in memory. This memory can be uninitized,
* because we will initialize it with either the contents of the tix
* file, or all zeros.