[commit: ghc] wip/names3: TysWiredIn: Use dataConWorkerUnique instead of incrUnique (dc40244)
git at git.haskell.org
git at git.haskell.org
Thu Sep 8 18:51:55 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/names3
Link : http://ghc.haskell.org/trac/ghc/changeset/dc402449bd995ae24749385eb0264a489a4a02e1/ghc
>---------------------------------------------------------------
commit dc402449bd995ae24749385eb0264a489a4a02e1
Author: Ben Gamari <ben at smart-cactus.org>
Date: Fri Aug 19 07:31:23 2016 -0400
TysWiredIn: Use dataConWorkerUnique instead of incrUnique
Try to preserve some amount of encapsulation.
>---------------------------------------------------------------
dc402449bd995ae24749385eb0264a489a4a02e1
compiler/basicTypes/Unique.hs | 1 -
compiler/prelude/TysWiredIn.hs | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/compiler/basicTypes/Unique.hs b/compiler/basicTypes/Unique.hs
index 0bbf861..c933d61 100644
--- a/compiler/basicTypes/Unique.hs
+++ b/compiler/basicTypes/Unique.hs
@@ -31,7 +31,6 @@ module Unique (
getKey, -- Used in Var, UniqFM, Name only!
mkUnique, unpkUnique, -- Used in BinIface only
- incrUnique, -- Used for renumbering
deriveUnique, -- Ditto
newTagUnique, -- Used in CgCase
initTyVarUnique,
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs
index 1028478..b334967 100644
--- a/compiler/prelude/TysWiredIn.hs
+++ b/compiler/prelude/TysWiredIn.hs
@@ -489,7 +489,7 @@ pcDataConWithFixity :: Bool -- ^ declared infix?
-> [Type] -- ^ args
-> TyCon
-> DataCon
-pcDataConWithFixity infx n = pcDataConWithFixity' infx n (incrUnique (nameUnique n))
+pcDataConWithFixity infx n = pcDataConWithFixity' infx n (dataConWorkerUnique (nameUnique n))
NoRRI
-- The Name's unique is the first of two free uniques;
-- the first is used for the datacon itself,
@@ -535,7 +535,7 @@ pcDataConWithFixity' declared_infix dc_name wrk_key rri tyvars ex_tyvars arg_tys
-- used for RuntimeRep and friends
pcSpecialDataCon :: Name -> [Type] -> TyCon -> RuntimeRepInfo -> DataCon
pcSpecialDataCon dc_name arg_tys tycon rri
- = pcDataConWithFixity' False dc_name (incrUnique (nameUnique dc_name)) rri
+ = pcDataConWithFixity' False dc_name (dataConWorkerUnique (nameUnique dc_name)) rri
[] [] arg_tys tycon
{-
More information about the ghc-commits
mailing list