[project @ 1998-01-09 12:10:37 by simonm]
[ghc-hetmet.git] / ghc / compiler / codeGen / CgTailCall.lhs
index 702f647..fb09a0e 100644 (file)
@@ -8,8 +8,6 @@
 %********************************************************
 
 \begin{code}
-#include "HsVersions.h"
-
 module CgTailCall (
        cgTailCall,
        performReturn,
@@ -19,7 +17,7 @@ module CgTailCall (
        tailCallBusiness
     ) where
 
-IMP_Ubiq(){-uitous-}
+#include "HsVersions.h"
 
 import CgMonad
 import AbsCSyn
@@ -32,21 +30,22 @@ import CgRetConv    ( dataReturnConvPrim, dataReturnConvAlg,
                        )
 import CgStackery      ( adjustRealSps, mkStkAmodes )
 import CgUsages                ( getSpARelOffset )
-import CLabel          ( mkStdUpdCodePtrVecLabel, mkConUpdCodePtrVecLabel )
+import CLabel          ( mkStdUpdCodePtrVecLabel, mkConUpdCodePtrVecLabel, CLabel )
 import ClosureInfo     ( nodeMustPointToIt,
                          getEntryConvention, EntryConvention(..),
                          LambdaFormInfo
                        )
 import CmdLineOpts     ( opt_DoSemiTagging )
-import HeapOffs                ( zeroOff, SYN_IE(VirtualSpAOffset) )
+import HeapOffs                ( zeroOff, VirtualSpAOffset )
 import Id              ( idType, dataConTyCon, dataConTag,
-                         fIRST_TAG
+                         fIRST_TAG, Id
                        )
 import Literal         ( mkMachInt )
 import Maybes          ( assocMaybe )
 import PrimRep         ( PrimRep(..) )
-import StgSyn          ( SYN_IE(StgArg), GenStgArg(..), SYN_IE(StgLiveVars) )
-import Type            ( isPrimType )
+import StgSyn          ( StgArg, GenStgArg(..), StgLiveVars )
+import Type            ( isUnpointedType )
+import TyCon            ( TyCon )
 import Util            ( zipWithEqual, panic, assertPanic )
 \end{code}
 
@@ -80,6 +79,11 @@ Things to be careful about:
 \item  Adjust the stack high water mark appropriately.
 \end{itemize}
 
+\begin{code}
+cgTailCall (StgConArg con) args live_vars
+  = panic "cgTailCall StgConArg"       -- Only occur in argument positions
+\end{code}
+
 Literals are similar to constructors; they return by putting
 themselves in an appropriate register and returning to the address on
 top of the B stack.
@@ -95,7 +99,7 @@ mode for the local instead of (CLit lit) in the assignment.
 Case for unboxed @Ids@ first:
 \begin{code}
 cgTailCall atom@(StgVarArg fun) [] live_vars
-  | isPrimType (idType fun)
+  | isUnpointedType (idType fun)
   = getCAddrMode fun `thenFC` \ amode ->
     performPrimReturn amode live_vars
 \end{code}
@@ -334,7 +338,7 @@ tailCallBusiness fun fun_amode lf_info arg_amodes live_vars pending_assts
                ([],
                     mkAbstractCs [
                        CCallProfCtrMacro SLIT("ENT_VIA_NODE") [],
-                       CJump (CMacroExpr CodePtrKind ENTRY_CODE [(CMacroExpr DataPtrKind INFO_PTR [CReg node])])
+                       CJump (CMacroExpr CodePtrRep ENTRY_CODE [(CMacroExpr DataPtrRep INFO_PTR [CReg node])])
                     ])
              StdEntry lbl Nothing        -> ([], CJump (CLbl lbl CodePtrRep))
              StdEntry lbl (Just itbl)    -> ([], CAssign (CReg infoptr) (CLbl itbl DataPtrRep)