summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgExpr.lhs
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2009-06-09 15:11:55 +0000
committerDuncan Coutts <duncan@well-typed.com>2009-06-09 15:11:55 +0000
commitcbbee4e8727c583daf32d9bf17f00afaa839ef10 (patch)
treeb86e3e566d90444803eb6fc7592cf2a162d04d94 /compiler/codeGen/CgExpr.lhs
parent5b7e2a875b089f31cd8dedb52d47ef9a93f276be (diff)
downloadhaskell-cbbee4e8727c583daf32d9bf17f00afaa839ef10.tar.gz
Add PrimCall to the STG layer and update Core -> STG translation
It adds a third case to StgOp which already hold StgPrimOp and StgFCallOp. The code generation for the new StgPrimCallOp case is almost exactly the same as for out-of-line primops. They now share the tailCallPrim function. In the Core -> STG translation we map foreign calls using the "prim" calling convention to the StgPrimCallOp case. This is because in Core we represent prim calls using the ForeignCall stuff. At the STG level however the prim calls are really much more like primops than foreign calls.
Diffstat (limited to 'compiler/codeGen/CgExpr.lhs')
-rw-r--r--compiler/codeGen/CgExpr.lhs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/codeGen/CgExpr.lhs b/compiler/codeGen/CgExpr.lhs
index eb1d9f082c..71087ca7c5 100644
--- a/compiler/codeGen/CgExpr.lhs
+++ b/compiler/codeGen/CgExpr.lhs
@@ -179,6 +179,9 @@ cgExpr (StgOpApp (StgPrimOp primop) args res_ty)
performReturn emitReturnInstr
where
result_info = getPrimOpResultInfo primop
+
+cgExpr (StgOpApp (StgPrimCallOp primcall) args _res_ty)
+ = tailCallPrimCall primcall args
\end{code}
%********************************************************