[project @ 2003-07-28 16:05:30 by simonmar]
[ghc-hetmet.git] / ghc / compiler / nativeGen / StixPrim.lhs
index b151494..1e9f029 100644 (file)
@@ -19,8 +19,7 @@ import Literal                ( Literal(..), word2IntLit )
 import MachOp          ( MachOp(..) )
 import PrimRep         ( PrimRep(..), getPrimRepSizeInBytes )
 import UniqSupply      ( returnUs, thenUs, getUniqueUs, UniqSM )
-import Constants       ( wORD_SIZE,
-                         mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE,
+import Constants       ( mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE,
                          rESERVED_STACK_WORDS )
 import CLabel          ( mkIntlikeClosureLabel, mkCharlikeClosureLabel,
                          mkMAP_FROZEN_infoLabel, 
@@ -114,6 +113,10 @@ foreignCallCode lhs call@(CCall (CCallSpec ctarget cconv safety)) rhs
                         Int64Rep  -> Int64Rep
                         Word64Rep -> Word64Rep
                         other     -> IntRep
+
+-- a bit late to catch this here..
+foreignCallCode _ DNCall{} _
+ = panic "foreignCallCode: .NET interop not supported via NCG; compile with -fvia-C"
 \end{code}
 
 %************************************************************************
@@ -142,9 +145,6 @@ amodeToStix am@(CVal rr CharRep)
 
 amodeToStix (CVal rr pk) = StInd pk (amodeToStix (CAddr rr))
 
-amodeToStix CBytesPerWord
-  = StInt (toInteger wORD_SIZE)
-
 amodeToStix (CAddr (SpRel off))
   = StIndex PtrRep (StReg stgSp) (StInt (toInteger (iBox off)))
 
@@ -184,7 +184,7 @@ amodeToStix (CLit core)
   = case core of
       MachChar c     -> StInt (toInteger c)
       MachStr s             -> StString s
-      MachAddr a     -> StInt a
+      MachNullAddr   -> StInt 0
       MachInt i      -> StInt i
       MachWord w     -> case word2IntLit core of MachInt iw -> StInt iw
       MachLitLit s _ -> litLitErr
@@ -214,10 +214,6 @@ amodeToStix (CMacroExpr _ macro [arg])
                                                 (StInt (toInteger (-1)))),
                         StInt 16]
 #endif
-      UPD_FRAME_UPDATEE
-         -> StInd PtrRep (StIndex PtrRep arg_amode 
-                                         (StInt (toInteger uF_UPDATEE)))
-
       BYTE_ARR_CTS -> StIndex IntRep arg_amode arrWordsHS
       PTRS_ARR_CTS -> StIndex PtrRep arg_amode arrPtrsHS
       ForeignObj_CLOSURE_DATA -> StInd PtrRep (StIndex PtrRep arg_amode fixedHS)