%********************************************************
\begin{code}
-#include "HsVersions.h"
-
module CgTailCall (
cgTailCall,
performReturn,
tailCallBusiness
) where
-IMP_Ubiq(){-uitous-}
+#include "HsVersions.h"
import CgMonad
import AbsCSyn
)
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}
\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.
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}
([],
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)