diff options
Diffstat (limited to 'compiler/codeGen/StgCmmForeign.hs')
-rw-r--r-- | compiler/codeGen/StgCmmForeign.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs index c8db8644db..eb14e8cce6 100644 --- a/compiler/codeGen/StgCmmForeign.hs +++ b/compiler/codeGen/StgCmmForeign.hs @@ -34,6 +34,7 @@ import Cmm import CmmUtils import MkGraph import Type +import RepType import TysPrim import CLabel import SMRep @@ -110,7 +111,7 @@ cgForeignCall (CCall (CCallSpec target cconv safety)) stg_args res_ty _something_else -> do { _ <- emitForeignCall safety res_regs call_target call_args - ; emitReturn (map (CmmReg . CmmLocal) res_regs) + ; emitReturn (map (CmmExprArg . CmmReg . CmmLocal) res_regs) } } @@ -523,10 +524,12 @@ getFCallArgs args = do { mb_cmms <- mapM get args ; return (catMaybes mb_cmms) } where + get arg@(StgRubbishArg{}) + = pprPanic "getFCallArgs" (text "Rubbish arg in foreign call:" <+> ppr arg) get arg | isVoidRep arg_rep = return Nothing | otherwise - = do { cmm <- getArgAmode (NonVoid arg) + = do { cmm <- getArgAmode_no_rubbish (NonVoid arg) ; dflags <- getDynFlags ; return (Just (add_shim dflags arg_ty cmm, hint)) } where |