Remove old 'foreign import dotnet' code
[ghc-hetmet.git] / compiler / codeGen / CgForeignCall.hs
index ceff757..957651d 100644 (file)
@@ -34,6 +34,7 @@ import Constants
 import StaticFlags
 import Outputable
 import FastString
+import BasicTypes
 
 import Control.Monad
 
@@ -77,7 +78,7 @@ emitForeignCall results (CCall (CCallSpec target cconv safety)) args live
       (call_args, cmm_target)
        = case target of
           StaticTarget lbl -> (args, CmmLit (CmmLabel 
-                                       (mkForeignLabel lbl call_size False)))
+                                       (mkForeignLabel lbl call_size False IsFunction)))
           DynamicTarget    ->  case args of
                                (CmmHinted fn _):rest -> (rest, fn)
                                [] -> panic "emitForeignCall: DynamicTarget []"
@@ -93,9 +94,6 @@ emitForeignCall results (CCall (CCallSpec target cconv safety)) args live
        -- ToDo: this might not be correct for 64-bit API
       arg_size rep = max (widthInBytes (typeWidth rep)) wORD_SIZE
 
-emitForeignCall _ (DNCall _) _ _
-  = panic "emitForeignCall: DNCall"
-
 
 -- alternative entry point, used by CmmParse
 emitForeignCall'
@@ -211,7 +209,11 @@ emitLoadThreadState = do
                              bWord),
        -- SpLim = tso->stack + RESERVED_STACK_WORDS;
        CmmAssign spLim (cmmOffsetW (cmmOffset (CmmReg (CmmLocal tso)) tso_STACK)
-                                   rESERVED_STACK_WORDS)
+                                   rESERVED_STACK_WORDS),
+        -- HpAlloc = 0;
+        --   HpAlloc is assumed to be set to non-zero only by a failed
+        --   a heap check, see HeapStackCheck.cmm:GC_GENERIC
+        CmmAssign hpAlloc (CmmLit zeroCLit)
     ]
   emitOpenNursery
   -- and load the current cost centre stack from the TSO when profiling:
@@ -266,13 +268,14 @@ stgHp               = CmmReg hp
 stgCurrentTSO    = CmmReg currentTSO
 stgCurrentNursery = CmmReg currentNursery
 
-sp, spLim, hp, hpLim, currentTSO, currentNursery :: CmmReg
+sp, spLim, hp, hpLim, currentTSO, currentNursery, hpAlloc :: CmmReg
 sp               = CmmGlobal Sp
 spLim            = CmmGlobal SpLim
 hp               = CmmGlobal Hp
 hpLim            = CmmGlobal HpLim
 currentTSO       = CmmGlobal CurrentTSO
 currentNursery           = CmmGlobal CurrentNursery
+hpAlloc          = CmmGlobal HpAlloc
 
 -- -----------------------------------------------------------------------------
 -- For certain types passed to foreign calls, we adjust the actual