[project @ 2005-02-25 13:06:31 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / IdInfo.lhs
index be26dfb..54578ae 100644 (file)
@@ -26,12 +26,14 @@ module IdInfo (
        -- New demand and strictness info
        newStrictnessInfo, setNewStrictnessInfo, 
        newDemandInfo, setNewDemandInfo, pprNewStrictness,
+       setAllStrictnessInfo,
 
+#ifdef OLD_STRICTNESS
        -- Strictness; imported from Demand
        StrictnessInfo(..),
        mkStrictnessInfo, noStrictnessInfo,
        ppStrictnessInfo,isBottomingStrictness, 
-       setAllStrictnessInfo,
+#endif
 
         -- Worker
         WorkerInfo(..), workerExists, wrapperArity, workerId,
@@ -75,12 +77,8 @@ module IdInfo (
 
 
 import CoreSyn
-import TyCon           ( TyCon )
 import Class           ( Class )
 import PrimOp          ( PrimOp )
-#ifdef OLD_STRICTNESS
-import Name            ( Name )
-#endif
 import Var              ( Id )
 import BasicTypes      ( OccInfo(..), isFragileOcc, isDeadOcc, seqOccInfo, isLoopBreaker,
                          InsideLam, insideLam, notInsideLam, 
@@ -89,14 +87,16 @@ import BasicTypes   ( OccInfo(..), isFragileOcc, isDeadOcc, seqOccInfo, isLoopBrea
                          Activation(..)
                        )
 import DataCon         ( DataCon )
+import TyCon           ( TyCon, FieldLabel )
 import ForeignCall     ( ForeignCall )
-import FieldLabel      ( FieldLabel )
-import Demand          hiding( Demand, seqDemand )
-import qualified Demand
 import NewDemand
 import Outputable      
 import Maybe           ( isJust )
+
 #ifdef OLD_STRICTNESS
+import Name            ( Name )
+import Demand          hiding( Demand, seqDemand )
+import qualified Demand
 import Util            ( listLengthCmp )
 import List            ( replicate )
 #endif
@@ -230,8 +230,8 @@ an IdInfo.hi-boot, but no Id.hi-boot, and GlobalIdDetails is imported
 data GlobalIdDetails
   = VanillaGlobal              -- Imported from elsewhere, a default method Id.
 
-  | GenericOpId TyCon          -- The to/from operations of a 
-  | RecordSelId FieldLabel     -- The Id for a record selector
+  | RecordSelId TyCon FieldLabel  -- The Id for a record selector
+
   | DataConWorkId DataCon      -- The Id for a data constructor *worker*
   | DataConWrapId DataCon      -- The Id for a data constructor *wrapper*
                                -- [the only reasons we need to know is so that
@@ -251,13 +251,12 @@ notGlobalId = NotGlobalId
 instance Outputable GlobalIdDetails where
     ppr NotGlobalId       = ptext SLIT("[***NotGlobalId***]")
     ppr VanillaGlobal     = ptext SLIT("[GlobalId]")
-    ppr (GenericOpId _)   = ptext SLIT("[GenericOp]")
     ppr (DataConWorkId _) = ptext SLIT("[DataCon]")
     ppr (DataConWrapId _) = ptext SLIT("[DataConWrapper]")
     ppr (ClassOpId _)     = ptext SLIT("[ClassOp]")
     ppr (PrimOpId _)      = ptext SLIT("[PrimOp]")
     ppr (FCallId _)       = ptext SLIT("[ForeignCall]")
-    ppr (RecordSelId _)   = ptext SLIT("[RecSel]")
+    ppr (RecordSelId _ _) = ptext SLIT("[RecSel]")
 \end{code}
 
 
@@ -350,19 +349,6 @@ setUnfoldingInfoLazily info uf     -- Lazy variant to avoid looking at the
     info { unfoldingInfo = uf }        -- (In this case the demand-zapping is redundant.)
 
 setUnfoldingInfo info uf 
-  | isEvaldUnfolding uf
-       -- If the unfolding is a value, the demand info may
-       -- go pear-shaped, so we nuke it.  Example:
-       --      let x = (a,b) in
-       --      case x of (p,q) -> h p q x
-       -- Here x is certainly demanded. But after we've nuked
-       -- the case, we'll get just
-       --      let x = (a,b) in h a b x
-       -- and now x is not demanded (I'm assuming h is lazy)
-       -- This really happens.  The solution here is a bit ad hoc...
-  = info { unfoldingInfo = uf, newDemandInfo = Nothing }
-
-  | otherwise
        -- We do *not* seq on the unfolding info, For some reason, doing so 
        -- actually increases residency significantly. 
   = info { unfoldingInfo = uf }
@@ -488,7 +474,7 @@ this to".
 data WorkerInfo = NoWorker
                | HasWorker Id Arity
        -- The Arity is the arity of the *wrapper* at the moment of the
-       -- w/w split. See comments in MkIface.ifaceId, with the 'Worker' code.
+       -- w/w split.  See notes above.
 
 seqWorker :: WorkerInfo -> ()
 seqWorker (HasWorker id a) = id `seq` a `seq` ()