From: simonmar Date: Fri, 6 Sep 2002 14:40:28 +0000 (+0000) Subject: [project @ 2002-09-06 14:40:28 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1709 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c92ddc55847b34d45f188f7c62092d69915a7a7d;p=ghc-hetmet.git [project @ 2002-09-06 14:40:28 by simonmar] Disallow ForeignObj as well as ForeignPtr FFI arguments --- diff --git a/ghc/compiler/typecheck/TcType.lhs b/ghc/compiler/typecheck/TcType.lhs index fa4d84f..531709a 100644 --- a/ghc/compiler/typecheck/TcType.lhs +++ b/ghc/compiler/typecheck/TcType.lhs @@ -829,8 +829,7 @@ legalFEArgTyCon :: TyCon -> Bool -- bytearrays from a _ccall_ / foreign declaration -- (or be passed them as arguments in foreign exported functions). legalFEArgTyCon tc - | getUnique tc `elem` [ foreignObjTyConKey, - byteArrayTyConKey, mutableByteArrayTyConKey ] + | getUnique tc `elem` [ byteArrayTyConKey, mutableByteArrayTyConKey ] = False -- It's also illegal to make foreign exports that take unboxed -- arguments. The RTS API currently can't invoke such things. --SDM 7/2000 @@ -840,16 +839,14 @@ legalFEArgTyCon tc legalFIResultTyCon :: DynFlags -> TyCon -> Bool legalFIResultTyCon dflags tc | getUnique tc `elem` - [ foreignObjTyConKey, - byteArrayTyConKey, mutableByteArrayTyConKey ] = False + [ byteArrayTyConKey, mutableByteArrayTyConKey ] = False | tc == unitTyCon = True | otherwise = marshalableTyCon dflags tc legalFEResultTyCon :: TyCon -> Bool legalFEResultTyCon tc | getUnique tc `elem` - [ foreignObjTyConKey, - byteArrayTyConKey, mutableByteArrayTyConKey ] = False + [ byteArrayTyConKey, mutableByteArrayTyConKey ] = False | tc == unitTyCon = True | otherwise = boxedMarshalableTyCon tc @@ -872,7 +869,7 @@ boxedMarshalableTyCon tc , word32TyConKey, word64TyConKey , floatTyConKey, doubleTyConKey , addrTyConKey, ptrTyConKey, funPtrTyConKey - , charTyConKey, foreignObjTyConKey + , charTyConKey , stablePtrTyConKey , byteArrayTyConKey, mutableByteArrayTyConKey , boolTyConKey