[project @ 2006-01-06 16:30:17 by simonmar]
[ghc-hetmet.git] / ghc / compiler / cmm / Cmm.hs
index 9fcc96e..13961c1 100644 (file)
@@ -30,6 +30,7 @@ import CLabel         ( CLabel )
 import ForeignCall     ( CCallConv )
 import Unique          ( Unique, Uniquable(..) )
 import FastString      ( FastString )
+import DATA_WORD       ( Word8 )
 
 -----------------------------------------------------------------------------
 --             Cmm, CmmTop, CmmBasicBlock
@@ -162,7 +163,6 @@ data CmmExpr
        --        ** is shorthand only, meaning **
        -- CmmMachOp (MO_S_Add rep (CmmReg reg) (CmmLit (CmmInt i rep)))
        --      where rep = cmmRegRep reg
-  | CmmPicBaseReg               -- Base Register for PIC calculations
 
 cmmExprRep :: CmmExpr -> MachRep
 cmmExprRep (CmmLit lit)      = cmmLitRep lit
@@ -170,7 +170,6 @@ cmmExprRep (CmmLoad _ rep)   = rep
 cmmExprRep (CmmReg reg)      = cmmRegRep reg
 cmmExprRep (CmmMachOp op _)  = resultRepOfMachOp op
 cmmExprRep (CmmRegOff reg _) = cmmRegRep reg
-cmmExprRep CmmPicBaseReg     = wordRep
 
 data CmmReg 
   = CmmLocal  LocalReg
@@ -239,7 +238,9 @@ data Section
   = Text
   | Data
   | ReadOnlyData
+  | RelocatableReadOnlyData
   | UninitialisedData
+  | ReadOnlyData16     -- .rodata.cst16 on x86_64, 16-byte aligned
   | OtherSection String
 
 data CmmStatic
@@ -251,9 +252,8 @@ data CmmStatic
        -- align to next N-byte boundary (N must be a power of 2).
   | CmmDataLabel CLabel
        -- label the current position in this section.
-  | CmmString String
+  | CmmString [Word8]
        -- string of 8-bit values only, not zero terminated.
-       -- ToDo: might be more honest to use [Word8] here?
 
 -----------------------------------------------------------------------------
 --             Global STG registers
@@ -294,6 +294,11 @@ data GlobalReg
   -- (where necessary) in the native code generator.
   | BaseReg
 
+  -- Base Register for PIC (position-independent code) calculations
+  -- Only used inside the native code generator. It's exact meaning differs
+  -- from platform to platform (see module PositionIndependentCode).
+  | PicBaseReg
+
   deriving( Eq
 #ifdef DEBUG
        , Show