summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmForeign.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/codeGen/StgCmmForeign.hs')
-rw-r--r--compiler/codeGen/StgCmmForeign.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs
index d12eaaf0b8..2e3ed39a37 100644
--- a/compiler/codeGen/StgCmmForeign.hs
+++ b/compiler/codeGen/StgCmmForeign.hs
@@ -525,16 +525,16 @@ getFCallArgs args
= do { mb_cmms <- mapM get args
; return (catMaybes mb_cmms) }
where
- get arg | isVoidRep arg_rep
+ get arg | null arg_reps
= return Nothing
| otherwise
= do { cmm <- getArgAmode (NonVoid arg)
; dflags <- getDynFlags
; return (Just (add_shim dflags arg_ty cmm, hint)) }
where
- arg_ty = stgArgType arg
- arg_rep = typePrimRep arg_ty
- hint = typeForeignHint arg_ty
+ arg_ty = stgArgType arg
+ arg_reps = typePrimRep arg_ty
+ hint = typeForeignHint arg_ty
add_shim :: DynFlags -> Type -> CmmExpr -> CmmExpr
add_shim dflags arg_ty expr
@@ -549,6 +549,5 @@ add_shim dflags arg_ty expr
| otherwise = expr
where
- UnaryRep rep_ty = repType arg_ty
- tycon = tyConAppTyCon rep_ty
+ tycon = tyConAppTyCon (unwrapType arg_ty)
-- should be a tycon app, since this is a foreign call