[commit: ghc] wip/nested-cpr: Do not export DmdResult constructors in Demand.lhs (9b41137)
git at git.haskell.org
git at git.haskell.org
Sun Dec 15 16:23:24 UTC 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nested-cpr
Link : http://ghc.haskell.org/trac/ghc/changeset/9b411376f793cdfc207434e0bcdc7462c5597120/ghc
>---------------------------------------------------------------
commit 9b411376f793cdfc207434e0bcdc7462c5597120
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Mon Dec 9 16:56:32 2013 +0000
Do not export DmdResult constructors in Demand.lhs
>---------------------------------------------------------------
9b411376f793cdfc207434e0bcdc7462c5597120
compiler/basicTypes/Demand.lhs | 20 ++++++++++----------
compiler/basicTypes/MkId.lhs | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index 3d393f1..3ca8466 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -25,7 +25,7 @@ module Demand (
DmdEnv, emptyDmdEnv,
peelFV,
- DmdResult(..), CPRResult(..),
+ DmdResult, CPRResult,
isBotRes, isTopRes, resTypeArgDmd,
topRes, botRes, cprProdRes, vanillaCprProdRes, cprSumRes,
appIsBottom, isBottomingSig, pprIfaceStrictSig,
@@ -768,19 +768,19 @@ topRes, botRes :: DmdResult
topRes = Dunno NoCPR
botRes = Diverges
-cprSumRes :: ConTag -> CPRResult
-cprSumRes tag | opt_CprOff = NoCPR
- | otherwise = RetSum tag
+cprSumRes :: ConTag -> DmdResult
+cprSumRes tag | opt_CprOff = topRes
+ | otherwise = Dunno $ RetSum tag
-cprProdRes :: [DmdType] -> CPRResult
+cprProdRes :: [DmdType] -> DmdResult
cprProdRes _arg_tys
- | opt_CprOff = NoCPR
- | otherwise = RetProd
+ | opt_CprOff = topRes
+ | otherwise = Dunno $ RetProd
-vanillaCprProdRes :: Arity -> CPRResult
+vanillaCprProdRes :: Arity -> DmdResult
vanillaCprProdRes _arity
- | opt_CprOff = NoCPR
- | otherwise = RetProd
+ | opt_CprOff = topRes
+ | otherwise = Dunno $ RetProd
isTopRes :: DmdResult -> Bool
isTopRes (Dunno NoCPR) = True
diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs
index 6120b56..604163f 100644
--- a/compiler/basicTypes/MkId.lhs
+++ b/compiler/basicTypes/MkId.lhs
@@ -434,8 +434,8 @@ dataConCPR con
, isVanillaDataCon con -- No existentials
, wkr_arity > 0
, wkr_arity <= mAX_CPR_SIZE
- = if is_prod then Dunno (vanillaCprProdRes (dataConRepArity con))
- else Dunno (cprSumRes (dataConTag con))
+ = if is_prod then vanillaCprProdRes (dataConRepArity con)
+ else cprSumRes (dataConTag con)
| otherwise
= topRes
where
More information about the ghc-commits
mailing list