Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/bc152fc8075362078a36a7d25ac147eb2c65c788

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

commit bc152fc8075362078a36a7d25ac147eb2c65c788
Author: Max Bolingbroke <batterseapo...@hotmail.com>
Date:   Wed Jul 4 18:14:26 2012 +0100

    Move the notion of shortability to the IdInfo module for reuse in the 
supercompiler

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

 compiler/basicTypes/IdInfo.lhs   |   10 ++++++++++
 compiler/simplCore/SimplCore.lhs |    7 +------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/compiler/basicTypes/IdInfo.lhs b/compiler/basicTypes/IdInfo.lhs
index f4e49ea..2e3572c 100644
--- a/compiler/basicTypes/IdInfo.lhs
+++ b/compiler/basicTypes/IdInfo.lhs
@@ -23,6 +23,7 @@ module IdInfo (
        IdInfo,         -- Abstract
        vanillaIdInfo, noCafIdInfo,
        seqIdInfo, megaSeqIdInfo,
+        isShortableIdInfo,
 
        -- ** Zapping various forms of Info
        zapLamInfo, zapDemandInfo, zapFragileInfo,
@@ -304,6 +305,15 @@ vanillaIdInfo
 noCafIdInfo :: IdInfo
 noCafIdInfo  = vanillaIdInfo `setCafInfo`    NoCafRefs
        -- Used for built-in type Ids in MkId.
+
+isShortableIdInfo :: IdInfo -> Bool
+-- True if there is no user-attached IdInfo on exported_id,
+-- so we can safely discard it
+-- See Note [Messing up the exported Id's IdInfo]
+isShortableIdInfo info
+  =  isEmptySpecInfo (specInfo info)
+  && isDefaultInlinePragma (inlinePragInfo info)
+  && not (isStableUnfolding (unfoldingInfo info))
 \end{code}
 
 
diff --git a/compiler/simplCore/SimplCore.lhs b/compiler/simplCore/SimplCore.lhs
index 1e4e5b8..b8548ed 100644
--- a/compiler/simplCore/SimplCore.lhs
+++ b/compiler/simplCore/SimplCore.lhs
@@ -889,12 +889,7 @@ hasShortableIdInfo :: Id -> Bool
 -- True if there is no user-attached IdInfo on exported_id,
 -- so we can safely discard it
 -- See Note [Messing up the exported Id's IdInfo]
-hasShortableIdInfo id
-  =  isEmptySpecInfo (specInfo info)
-  && isDefaultInlinePragma (inlinePragInfo info)
-  && not (isStableUnfolding (unfoldingInfo info))
-  where
-     info = idInfo id
+hasShortableIdInfo = isShortableIdInfo . idInfo
 
 -----------------
 transferIdInfo :: Id -> Id -> Id



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to