summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmPrim.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-03-06 12:24:40 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-03-06 13:28:32 +0000
commit93e42a6895d2172f40d37fd13cb7405243dc4d0f (patch)
tree61e620bdba7d5b0e37348d68ba6ab2a60959a21e /compiler/codeGen/StgCmmPrim.hs
parent9a32e71d912985a6fd8e3491518ac357f2e8686b (diff)
downloadhaskell-93e42a6895d2172f40d37fd13cb7405243dc4d0f.tar.gz
Lower safe foreign calls in the new CmmLayoutStack
We also generate much better code for safe foreign calls (and maybe also unsafe foreign calls) than previously. See the two new Notes: Note [lower safe foreign calls] Note [safe foreign call convention]
Diffstat (limited to 'compiler/codeGen/StgCmmPrim.hs')
-rw-r--r--compiler/codeGen/StgCmmPrim.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index c95b1f02ff..9f87271fba 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -68,14 +68,9 @@ cgOpApp :: StgOp -- The op
-- Foreign calls
cgOpApp (StgFCallOp fcall _) stg_args res_ty
- = do { (res_regs, res_hints) <- newUnboxedTupleRegs res_ty
- -- Choose result regs r1, r2
- -- Note [Foreign call results]
- ; cgForeignCall res_regs res_hints fcall stg_args
- -- r1, r2 = foo( x, y )
- ; emitReturn (map (CmmReg . CmmLocal) res_regs) }
- -- return (r1, r2)
-
+ = cgForeignCall fcall stg_args res_ty
+ -- Note [Foreign call results]
+
-- tagToEnum# is special: we need to pull the constructor
-- out of the table, and perform an appropriate return.