[project @ 1997-07-05 03:02:04 by sof]
[ghc-hetmet.git] / ghc / compiler / basicTypes / IdLoop.lhi
index 86680a8..48ea6b1 100644 (file)
@@ -3,30 +3,37 @@ Breaks the IdInfo/<everything> loops.
 \begin{code}
 interface IdLoop where
 
-import PreludePS       ( _PackedString )
+--import PreludePS     ( _PackedString )
+import FastString       ( FastString )
 import PreludeStdIO    ( Maybe )
 
 import BinderInfo      ( BinderInfo )
 import CoreSyn         ( CoreExpr(..), GenCoreExpr, GenCoreArg )
-import CoreUnfold      ( Unfolding(..), UnfoldingGuidance(..), 
+import CoreUnfold      ( Unfolding(..), UnfoldingGuidance(..), mkUnfolding,
                          SimpleUnfolding(..), FormSummary(..), noUnfolding  )
 import CoreUtils       ( unTagBinders )
 import Id              ( externallyVisibleId, isDataCon, isWorkerId, isWrapperId,
-                         unfoldingUnfriendlyId, getIdInfo, nmbrId,
+                         unfoldingUnfriendlyId, getIdInfo, nmbrId, pprId, idName,
                          nullIdEnv, lookupIdEnv, IdEnv(..),
                          Id(..), GenId
                        )
-import CostCentre      ( CostCentre )
-import IdInfo          ( IdInfo )
+import Name            ( Name )
+import CostCentre      ( CostCentre,
+                         noCostCentre, subsumedCosts, cafifyCC,
+                         useCurrentCostCentre, dontCareCostCentre,
+                         overheadCostCentre, preludeCafsCostCentre,
+                         preludeDictsCostCentre, mkAllCafsCC,
+                         mkAllDictsCC, mkUserCC
+                       )
+import IdInfo          ( IdInfo, DemandInfo )
 import SpecEnv         ( SpecEnv, nullSpecEnv, isNullSpecEnv )
 import Literal         ( Literal )
 import MagicUFs                ( mkMagicUnfoldingFun, MagicUnfoldingFun )
 import OccurAnal       ( occurAnalyseGlobalExpr )
-import Outputable      ( Outputable(..) )
-import PprEnv          ( NmbrEnv )
-import PprStyle                ( PprStyle )
+import Outputable      ( Outputable(..), PprStyle )
 import PprType         ( pprParendGenType )
-import Pretty          ( PrettyRep )
+import PragmaInfo      ( PragmaInfo )
+import Pretty          ( Doc )
 import Type            ( GenType )
 import TyVar           ( GenTyVar )
 import UniqFM          ( UniqFM )
@@ -47,15 +54,10 @@ isNullSpecEnv :: SpecEnv -> Bool
 externallyVisibleId    :: Id       -> Bool
 isDataCon              :: GenId ty -> Bool
 isWorkerId             :: GenId ty -> Bool
-isWrapperId            :: Id       -> Bool
-unfoldingUnfriendlyId  :: Id       -> Bool
-getIdInfo              :: Id       -> IdInfo
-nullIdEnv              :: UniqFM a
-lookupIdEnv            :: UniqFM b -> GenId a -> Maybe b
-mAX_WORKER_ARGS                :: Int
-nmbrId                 :: Id -> NmbrEnv -> (NmbrEnv, Id)
-pprParendGenType       :: (Eq a, Outputable a, Eq b, Outputable b) => PprStyle -> GenType a b -> Int -> Bool -> PrettyRep
+pprId                  :: Outputable ty => PprStyle -> GenId ty -> Doc
 mkMagicUnfoldingFun    :: Unique -> MagicUnfoldingFun
+idName                 :: Id -> Name
+
 
 type IdEnv a = UniqFM a
 type CoreExpr = GenCoreExpr (GenId (GenType (GenTyVar (GenUsage Unique)) Unique))
@@ -71,8 +73,8 @@ instance Outputable (GenTyVar a)
 instance (Outputable a) => Outputable (GenId a)
 instance (Eq a, Outputable a, Eq b, Outputable b) => Outputable (GenType a b)
 
+data DemandInfo
 data SpecEnv
-data NmbrEnv
 data MagicUnfoldingFun
 data FormSummary = VarForm | ValueForm | BottomForm | OtherForm
 
@@ -83,6 +85,7 @@ data FormSummary = VarForm | ValueForm | BottomForm | OtherForm
 
 data Unfolding
 noUnfolding :: Unfolding
+mkUnfolding :: PragmaInfo -> CoreExpr -> Unfolding
 
 -- data SimpleUnfolding = SimpleUnfolding FormSummary UnfoldingGuidance (GenCoreExpr (GenId (GenType (GenTyVar (GenUsage Unique)) Unique), BinderInfo) (GenId (GenType (GenTyVar (GenUsage Unique)) Unique)) (GenTyVar (GenUsage Unique)) Unique) 
 
@@ -93,8 +96,16 @@ data UnfoldingGuidance
   | UnfoldIfGoodArgs Int Int [Bool] Int
 
 data CostCentre
-\end{code}
-
-
-
 
+noCostCentre           :: CostCentre
+subsumedCosts          :: CostCentre
+useCurrentCostCentre   :: CostCentre
+dontCareCostCentre     :: CostCentre
+overheadCostCentre     :: CostCentre
+preludeCafsCostCentre  :: CostCentre
+preludeDictsCostCentre :: Bool -> CostCentre
+mkAllCafsCC           :: FastString -> FastString -> CostCentre
+mkAllDictsCC          :: FastString -> FastString -> Bool -> CostCentre
+mkUserCC              :: FastString -> FastString -> FastString -> CostCentre
+cafifyCC              :: CostCentre -> CostCentre
+\end{code}