[commit: ghc] wip/T16039: minor touchups [ci skip] (23c950f)

git at git.haskell.org git at git.haskell.org
Sun Mar 31 15:07:44 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T16039
Link       : http://ghc.haskell.org/trac/ghc/changeset/23c950f6a113a536d0e2080fa65eb8a0ea8eddbc/ghc

>---------------------------------------------------------------

commit 23c950f6a113a536d0e2080fa65eb8a0ea8eddbc
Author: Gabor Greif <ggreif at gmail.com>
Date:   Sun Jan 6 00:08:40 2019 +0100

    minor touchups [ci skip]


>---------------------------------------------------------------

23c950f6a113a536d0e2080fa65eb8a0ea8eddbc
 compiler/basicTypes/IdInfo.hs  | 3 +--
 compiler/coreSyn/CoreArity.hs  | 2 +-
 compiler/coreSyn/CorePrep.hs   | 4 ++--
 compiler/coreSyn/CoreUnfold.hs | 4 ++--
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs
index 12ea490..cbedfd2 100644
--- a/compiler/basicTypes/IdInfo.hs
+++ b/compiler/basicTypes/IdInfo.hs
@@ -464,8 +464,7 @@ vanillaCafInfo :: CafInfo
 vanillaCafInfo = MayHaveCafRefs
 
 mayHaveCafRefs :: CafInfo -> Bool
-mayHaveCafRefs  MayHaveCafRefs = True
-mayHaveCafRefs _               = False
+mayHaveCafRefs = (==MayHaveCafRefs)
 
 instance Outputable CafInfo where
    ppr = ppCafInfo
diff --git a/compiler/coreSyn/CoreArity.hs b/compiler/coreSyn/CoreArity.hs
index d15da87..354937c 100644
--- a/compiler/coreSyn/CoreArity.hs
+++ b/compiler/coreSyn/CoreArity.hs
@@ -99,7 +99,7 @@ exprArity e = go e
     go (Tick t e) | not (tickishIsCode t) = go e
     go (Cast e co)                 = trim_arity (go e) (pSnd (coercionKind co))
                                         -- Note [exprArity invariant]
-    go (App e (Type _))            = go e
+    go (App e Type {})             = go e
     go (App f a) | exprIsTrivial a = (go f - 1) `max` 0
         -- See Note [exprArity for applications]
         -- NB: coercions count as a value argument
diff --git a/compiler/coreSyn/CorePrep.hs b/compiler/coreSyn/CorePrep.hs
index cf37a8d..ddaf9b2 100644
--- a/compiler/coreSyn/CorePrep.hs
+++ b/compiler/coreSyn/CorePrep.hs
@@ -273,9 +273,9 @@ point all the CafInfo is supposed to be correct, and we must make certain
 that is true of the new top-level bindings.  There are two cases
 to consider
 
-a) The top-level binding is marked asCafRefs.  In that case we are
+a) The top-level binding is marked MayHaveCafRefs.  In that case we are
    basically fine.  The floated bindings had better all be lazy lets,
-   so they can float to top level, but they'll all have HasCafRefs
+   so they can float to top level, but they'll all have MayHaveCafRefs
    (the default) which is safe.
 
 b) The top-level binding is marked NoCafRefs.  This really happens
diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs
index 020aa85..53d1973 100644
--- a/compiler/coreSyn/CoreUnfold.hs
+++ b/compiler/coreSyn/CoreUnfold.hs
@@ -409,10 +409,10 @@ inlineBoringOk e
     go :: Int -> CoreExpr -> Bool
     go credit (Lam x e) | isId x           = go (credit+1) e
                         | otherwise        = go credit e
-    go credit (App f (Type {}))            = go credit f
+    go credit (App f Type {})              = go credit f
     go credit (App f a) | credit > 0
                         , exprIsTrivial a  = go (credit-1) f
-    go credit (Tick _ e)                 = go credit e -- dubious
+    go credit (Tick _ e)                   = go credit e -- dubious
     go credit (Cast e _)                   = go credit e
     go _      (Var {})                     = boringCxtOk
     go _      _                            = boringCxtNotOk



More information about the ghc-commits mailing list