[project @ 2002-03-14 15:27:15 by simonpj]
[ghc-hetmet.git] / ghc / compiler / absCSyn / CLabel.lhs
index e5e09a2..b56db8d 100644 (file)
@@ -1,7 +1,7 @@
 %
 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
 %
-% $Id: CLabel.lhs,v 1.46 2001/04/20 14:54:37 sewardj Exp $
+% $Id: CLabel.lhs,v 1.51 2002/03/14 15:27:15 simonpj Exp $
 %
 \section[CLabel]{@CLabel@: Information to make C Labels}
 
@@ -44,7 +44,7 @@ module CLabel (
        mkIndInfoLabel,
        mkIndStaticInfoLabel,
        mkRtsGCEntryLabel,
-        mkMainRegTableLabel,
+        mkMainCapabilityLabel,
        mkCharlikeClosureLabel,
        mkIntlikeClosureLabel,
        mkMAP_FROZEN_infoLabel,
@@ -70,9 +70,6 @@ module CLabel (
        CLabelType(..), labelType, labelDynamic,
 
        pprCLabel
-#if ! OMIT_NATIVE_CODEGEN
-       , pprCLabel_asm
-#endif
     ) where
 
 
@@ -87,7 +84,7 @@ import CStrings               ( pp_cSEP )
 import DataCon         ( ConTag )
 import Module          ( moduleName, moduleNameFS, 
                          Module, isHomeModule )
-import Name            ( Name, getName, isDllName, isExternallyVisibleName )
+import Name            ( Name, getName, isDllName, isExternalName )
 import TyCon           ( TyCon )
 import Unique          ( pprUnique, Unique )
 import PrimOp          ( PrimOp )
@@ -181,7 +178,7 @@ data RtsLabelInfo
   | RtsUpdInfo                 -- upd_frame_info
   | RtsSeqInfo                 -- seq_frame_info
   | RtsGCEntryLabel String     -- a heap check fail handler, eg  stg_chk_2
-  | RtsMainRegTable             -- MainRegTable (??? Capabilities wurble ???)
+  | RtsMainCapability           -- MainCapability
   | Rts_Closure String         -- misc rts closures, eg CHARLIKE_closure
   | Rts_Info String            -- misc rts itbls, eg MUT_ARR_PTRS_FROZEN_info
   | Rts_Code String            -- misc rts code
@@ -250,7 +247,7 @@ mkSeqInfoLabel                      = RtsLabel RtsSeqInfo
 mkIndInfoLabel                 = RtsLabel (Rts_Info "stg_IND_info")
 mkIndStaticInfoLabel           = RtsLabel (Rts_Info "stg_IND_STATIC_info")
 mkRtsGCEntryLabel str          = RtsLabel (RtsGCEntryLabel str)
-mkMainRegTableLabel            = RtsLabel RtsMainRegTable
+mkMainCapabilityLabel          = RtsLabel RtsMainCapability
 mkCharlikeClosureLabel         = RtsLabel (Rts_Closure "stg_CHARLIKE_closure")
 mkIntlikeClosureLabel          = RtsLabel (Rts_Closure "stg_INTLIKE_closure")
 mkMAP_FROZEN_infoLabel         = RtsLabel (Rts_Info "stg_MUT_ARR_PTRS_FROZEN_info")
@@ -338,7 +335,7 @@ externallyVisibleCLabel (ModuleInitLabel _)= True
 externallyVisibleCLabel (RtsLabel RtsModuleRegd) = False --hack
 externallyVisibleCLabel (RtsLabel _)      = True
 externallyVisibleCLabel (ForeignLabel _ _) = True
-externallyVisibleCLabel (IdLabel id _)     = isExternallyVisibleName id
+externallyVisibleCLabel (IdLabel id _)     = isExternalName id
 externallyVisibleCLabel (CC_Label _)      = False -- not strictly true
 externallyVisibleCLabel (CCS_Label _)     = False -- not strictly true
 \end{code}
@@ -351,6 +348,7 @@ labelType (RtsLabel (RtsBlackHoleInfoTbl _))  = InfoTblType
 labelType (RtsLabel (RtsSelectorInfoTbl _ _)) = InfoTblType
 labelType (RtsLabel (RtsApInfoTbl _ _))       = InfoTblType
 labelType (RtsLabel RtsUpdInfo)              = InfoTblType
+labelType (RtsLabel (Rts_Info _))             = InfoTblType
 labelType (CaseLabel _ CaseReturnInfo)        = InfoTblType
 labelType (CaseLabel _ CaseReturnPt)         = CodeType
 labelType (CaseLabel _ CaseVecTbl)            = VecTblType
@@ -431,11 +429,6 @@ internal names. <type> is one of the following:
         ccs                    Cost centre stack
 
 \begin{code}
--- specialised for PprAsm: saves lots of arg passing in NCG
-#if ! OMIT_NATIVE_CODEGEN
-pprCLabel_asm = pprCLabel
-#endif
-
 pprCLabel :: CLabel -> SDoc
 
 #if ! OMIT_NATIVE_CODEGEN
@@ -471,7 +464,7 @@ pprCLbl (RtsLabel RtsShouldNeverHappenCode) = ptext SLIT("NULL")
 
 pprCLbl (RtsLabel RtsUpdInfo)            = ptext SLIT("stg_upd_frame_info")
 pprCLbl (RtsLabel RtsSeqInfo)            = ptext SLIT("stg_seq_frame_info")
-pprCLbl (RtsLabel RtsMainRegTable)       = ptext SLIT("MainRegTable")
+pprCLbl (RtsLabel RtsMainCapability)     = ptext SLIT("MainCapability")
 pprCLbl (RtsLabel (RtsGCEntryLabel str)) = text str
 pprCLbl (RtsLabel (Rts_Closure str))     = text str
 pprCLbl (RtsLabel (Rts_Info str))        = text str
@@ -528,7 +521,7 @@ pprCLbl (CC_Label cc)               = ppr cc
 pprCLbl (CCS_Label ccs)        = ppr ccs
 
 pprCLbl (ModuleInitLabel mod)  
-   = ptext SLIT("__init_") <> ptext (moduleNameFS (moduleName mod))
+   = ptext SLIT("__stginit_") <> ptext (moduleNameFS (moduleName mod))
 
 ppIdFlavor :: IdLabelInfo -> SDoc