diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2021-11-10 17:45:41 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-15 10:17:57 -0500 |
commit | 564a19af184dfb56246fff6034acdd7a5e3c8089 (patch) | |
tree | 229d533b735b16d82a503ce3b97ec128369eb4ff | |
parent | aa3729722bc1aa601c89788c590460ce719bfaed (diff) | |
download | haskell-564a19af184dfb56246fff6034acdd7a5e3c8089.tar.gz |
Refactoring: Move DataConEnv to GHC.Core.DataCon
`DataConEnv` will prove to be useful in another place besides
`GHC.Core.Opt.SpecConstr` in a follow-up commit.
-rw-r--r-- | compiler/GHC/Core/DataCon.hs | 5 | ||||
-rw-r--r-- | compiler/GHC/Core/Opt/SpecConstr.hs | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs index 6c256cca10..dc14f2dcc3 100644 --- a/compiler/GHC/Core/DataCon.hs +++ b/compiler/GHC/Core/DataCon.hs @@ -14,6 +14,7 @@ module GHC.Core.DataCon ( HsSrcBang(..), HsImplBang(..), StrictnessMark(..), ConTag, + DataConEnv, -- ** Equality specs EqSpec, mkEqSpec, eqSpecTyVar, eqSpecType, @@ -84,9 +85,11 @@ import GHC.Data.FastString import GHC.Unit.Types import GHC.Unit.Module.Name import GHC.Utils.Binary +import GHC.Types.Unique.FM ( UniqFM ) import GHC.Types.Unique.Set import GHC.Builtin.Uniques( mkAlphaTyVarUnique ) + import GHC.Utils.Outputable import GHC.Utils.Misc import GHC.Utils.Panic @@ -689,6 +692,8 @@ data DataConRep } +type DataConEnv a = UniqFM DataCon a -- Keyed by DataCon + ------------------------- -- | Haskell Source Bang diff --git a/compiler/GHC/Core/Opt/SpecConstr.hs b/compiler/GHC/Core/Opt/SpecConstr.hs index d714cc0764..6f82257148 100644 --- a/compiler/GHC/Core/Opt/SpecConstr.hs +++ b/compiler/GHC/Core/Opt/SpecConstr.hs @@ -1181,8 +1181,6 @@ data ArgOcc = NoOcc -- Doesn't occur at all; or a type argument | ScrutOcc -- See Note [ScrutOcc] (DataConEnv [ArgOcc]) -- How the sub-components are used -type DataConEnv a = UniqFM DataCon a -- Keyed by DataCon - {- Note [ScrutOcc] ~~~~~~~~~~~~~~~~~~~ An occurrence of ScrutOcc indicates that the thing, or a `cast` version of the thing, |