[project @ 2002-04-02 13:21:36 by simonpj]
[ghc-hetmet.git] / ghc / compiler / absCSyn / AbsCSyn.lhs
index a850a9f..36d3db7 100644 (file)
@@ -1,7 +1,7 @@
 %
 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
 %
-% $Id: AbsCSyn.lhs,v 1.41 2001/12/05 17:35:12 sewardj Exp $
+% $Id: AbsCSyn.lhs,v 1.46 2002/03/02 18:02:30 sof Exp $
 %
 \section[AbstractC]{Abstract C: the last stop before machine code}
 
@@ -52,7 +52,6 @@ import Unique           ( Unique )
 import StgSyn          ( StgOp )
 import TyCon           ( TyCon )
 import BitSet                          -- for liveness masks
-import Maybes          ( Maybe012(..) )
 import FastTypes
 
 import Outputable
@@ -116,14 +115,14 @@ stored in a mixed type location.)
   | CInitHdr           -- to initialise the header of a closure (both fixed/var parts)
        ClosureInfo
        CAddrMode       -- address of the info ptr
-       CAddrMode       -- cost centre to place in closure
+       !CAddrMode      -- cost centre to place in closure
                        --   CReg CurCostCentre or CC_HDR(R1.p{-Node-})
        Int             -- size of closure, for profiling
 
   -- NEW CASES FOR EXPANDED PRIMOPS
 
   | CMachOpStmt                        -- Machine-level operation
-       (Maybe012 CAddrMode)    -- 0, 1 or 2 results
+       CAddrMode               -- result
        MachOp
        [CAddrMode]             -- Arguments
         (Maybe [MagicId])      -- list of regs which need to be preserved
@@ -193,8 +192,7 @@ stored in a mixed type location.)
   -- *** the next three [or so...] are DATA (those above are CODE) ***
 
   | CStaticClosure
-       CLabel  -- The (full, not base) label to use for labelling the closure.
-       ClosureInfo
+       ClosureInfo             -- Todo: maybe info_lbl & closure_lbl instead?
        CAddrMode               -- cost centre identifier to place in closure
        [CAddrMode]             -- free vars; ptrs, then non-ptrs.
 
@@ -271,6 +269,9 @@ data CStmtMacro
   | PUSH_SEQ_FRAME                     -- push seq frame
   | UPDATE_SU_FROM_UPD_FRAME           -- pull Su out of the update frame
   | SET_TAG                            -- set TagReg if it exists
+      -- dataToTag# primop -- *only* used in unregisterised builds.
+      -- (see AbsCUtils.dsCOpStmt)
+  | DATA_TO_TAGZH
 
   | REGISTER_FOREIGN_EXPORT            -- register a foreign exported fun
   | REGISTER_IMPORT                    -- register an imported module
@@ -340,6 +341,10 @@ data CAddrMode
                        --      which gives the magic location itself
                        --      (NB: superceded by CReg)
 
+             -- JRS 2002-02-05: CAddr is really scummy and should be fixed.
+             -- The effect is that the semantics of CAddr depend on what the
+             -- contained RegRelative is; it is decidely non-orthogonal.
+
   | CReg MagicId       -- To replace (CAddr MagicId 0)
 
   | CTemp !Unique !PrimRep     -- Temporary locations
@@ -372,8 +377,9 @@ data CAddrMode
        CExprMacro      -- the macro to generate a value
        [CAddrMode]     -- and its arguments
 
-  | CMem   PrimRep     -- A value :: PrimRep, in memory, at the 
-           CAddrMode   -- specified address
+  | CBytesPerWord      -- Word size, in bytes, on this platform
+                       -- required for: half-word loads (used in fishing tags
+                       -- out of info tables), and sizeofByteArray#.
 \end{code}
 
 Various C macros for values which are dependent on the back-end layout.