X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FDsForeign.lhs;h=b0c82f85916739785c80eca4d8ee5722f54543a9;hb=620531f5074b189bd04d10c88196493b1e2fa692;hp=9df091179144185f5c4042368a02113e85dc0e77;hpb=0e7150a93803531c5214662f7b26109dcabb30b2;p=ghc-hetmet.git diff --git a/compiler/deSugar/DsForeign.lhs b/compiler/deSugar/DsForeign.lhs index 9df0911..b0c82f8 100644 --- a/compiler/deSugar/DsForeign.lhs +++ b/compiler/deSugar/DsForeign.lhs @@ -145,7 +145,7 @@ dsCImport id (CLabel cid) cconv _ = do (resTy, foRhs) <- resultWrapper ty ASSERT(fromJust resTy `coreEqType` addrPrimTy) -- typechecker ensures this let - rhs = foRhs (mkLit (MachLabel cid stdcall_info)) + rhs = foRhs (Lit (MachLabel cid stdcall_info)) stdcall_info = fun_type_arg_stdcall_info cconv ty in return ([(id, rhs)], empty, empty) @@ -250,7 +250,7 @@ The function that does most of the work for `@foreign export@' declarations. For each `@foreign export foo@' in a module M we generate: \begin{itemize} \item a C function `@foo@', which calls -\item a Haskell stub `@M.$ffoo@', which calls +\item a Haskell stub `@M.\$ffoo@', which calls \end{itemize} the user-written Haskell function `@M.foo@'. @@ -356,8 +356,8 @@ dsFExportDynamic id cconv = do -} adj_args = [ mkIntLitInt (ccallConvToInt cconv) , Var stbl_value - , mkLit (MachLabel fe_nm mb_sz_args) - , mkLit (mkStringLit typestring) + , Lit (MachLabel fe_nm mb_sz_args) + , Lit (mkMachString typestring) ] -- name of external entry point providing these services. -- (probably in the RTS.) @@ -619,7 +619,9 @@ insertRetAddr _ args = args -- need to flush a register argument to the stack (See rts/Adjustor.c for -- details). insertRetAddr CCallConv args = go 0 args - where go 6 args = ret_addr_arg : args + where go :: Int -> [(SDoc, SDoc, Type, MachRep)] + -> [(SDoc, SDoc, Type, MachRep)] + go 6 args = ret_addr_arg : args go n (arg@(_,_,_,rep):args) | I64 <- rep = arg : go (n+1) args | otherwise = arg : go n args