[project @ 2003-03-03 12:43:31 by simonmar]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Id.lhs
index bd9fffb..42aa3d1 100644 (file)
@@ -29,7 +29,7 @@ module Id (
        isRecordSelector,
        isPrimOpId, isPrimOpId_maybe, 
        isFCallId, isFCallId_maybe,
-       isDataConId, isDataConId_maybe, 
+       isDataConWorkId, isDataConWorkId_maybe, 
        isDataConWrapId, isDataConWrapId_maybe,
        isBottomingId,
        hasNoBinding,
@@ -48,7 +48,7 @@ module Id (
        setIdNewStrictness, zapIdNewStrictness,
        setIdWorkerInfo,
        setIdSpecialisation,
-       setIdCgInfo,
+       setIdCafInfo,
        setIdOccInfo,
 
 #ifdef OLD_STRICTNESS
@@ -66,7 +66,6 @@ module Id (
        idWorkerInfo,
        idUnfolding,
        idSpecialisation, idCoreRules,
-       idCgInfo,
        idCafInfo,
        idLBVarInfo,
        idOccInfo,
@@ -257,13 +256,13 @@ isFCallId_maybe id = case globalIdDetails id of
                            FCallId call -> Just call
                            other        -> Nothing
 
-isDataConId id = case globalIdDetails id of
-                       DataConId _ -> True
-                       other       -> False
+isDataConWorkId id = case globalIdDetails id of
+                       DataConWorkId _ -> True
+                       other           -> False
 
-isDataConId_maybe id = case globalIdDetails id of
-                         DataConId con -> Just con
-                         other         -> Nothing
+isDataConWorkId_maybe id = case globalIdDetails id of
+                         DataConWorkId con -> Just con
+                         other             -> Nothing
 
 isDataConWrapId_maybe id = case globalIdDetails id of
                                  DataConWrapId con -> Just con
@@ -289,15 +288,17 @@ isImplicitId :: Id -> Bool
        -- file, even if it's mentioned in some other interface unfolding.
 isImplicitId id
   = case globalIdDetails id of
-       RecordSelId _   -> True -- Includes dictionary selectors
+       RecordSelId _   -> True
         FCallId _       -> True
         PrimOpId _      -> True
-        DataConId _     -> True
+       ClassOpId _     -> True
+       GenericOpId _   -> True
+        DataConWorkId _ -> True
        DataConWrapId _ -> True
                -- These are are implied by their type or class decl;
                -- remember that all type and class decls appear in the interface file.
-               -- The dfun id must *not* be omitted, because it carries version info for
-               -- the instance decl
+               -- The dfun id is not an implicit Id; it must *not* be omitted, because 
+               -- it carries version info for the instance decl
        other           -> False
 \end{code}
 
@@ -396,20 +397,6 @@ setIdSpecialisation :: Id -> CoreRules -> Id
 setIdSpecialisation id spec_info = modifyIdInfo (`setSpecInfo` spec_info) id
 
        ---------------------------------
-       -- CG INFO
-idCgInfo :: Id -> CgInfo
-#ifdef OLD_STRICTNESS
-idCgInfo id = case cgInfo (idInfo id) of
-                 NoCgInfo -> pprPanic "idCgInfo" (ppr id)
-                 info     -> info
-#else
-idCgInfo id = cgInfo (idInfo id)
-#endif         
-
-setIdCgInfo :: Id -> CgInfo -> Id
-setIdCgInfo id cg_info = modifyIdInfo (`setCgInfo` cg_info) id
-
-       ---------------------------------
        -- CAF INFO
 idCafInfo :: Id -> CafInfo
 #ifdef OLD_STRICTNESS
@@ -417,8 +404,12 @@ idCafInfo id = case cgInfo (idInfo id) of
                  NoCgInfo -> pprPanic "idCafInfo" (ppr id)
                  info     -> cgCafInfo info
 #else
-idCafInfo id = cgCafInfo (idCgInfo id)
+idCafInfo id = cafInfo (idInfo id)
 #endif
+
+setIdCafInfo :: Id -> CafInfo -> Id
+setIdCafInfo id caf_info = modifyIdInfo (`setCafInfo` caf_info) id
+
        ---------------------------------
        -- CPR INFO
 #ifdef OLD_STRICTNESS