From 446fbcd76883108e9a1caab3c63b2f4e8a9cdf6d Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 6 Sep 2002 13:52:21 +0000 Subject: [PATCH 1/1] [project @ 2002-09-06 13:52:21 by simonmar] Disallow ForeignPtr as an FFI argument type. --- ghc/compiler/typecheck/TcType.lhs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/typecheck/TcType.lhs b/ghc/compiler/typecheck/TcType.lhs index 8a13a77..fa4d84f 100644 --- a/ghc/compiler/typecheck/TcType.lhs +++ b/ghc/compiler/typecheck/TcType.lhs @@ -44,7 +44,7 @@ module TcType ( tcEqType, tcEqTypes, tcEqPred, tcCmpType, tcCmpTypes, tcCmpPred, isSigmaTy, isOverloadedTy, isDoubleTy, isFloatTy, isIntTy, - isIntegerTy, isAddrTy, isBoolTy, isUnitTy, isForeignPtrTy, + isIntegerTy, isAddrTy, isBoolTy, isUnitTy, isTauTy, tcIsTyVarTy, tcIsForAllTy, allDistinctTyVars, @@ -699,7 +699,6 @@ isOverloadedTy _ = False \begin{code} isFloatTy = is_tc floatTyConKey isDoubleTy = is_tc doubleTyConKey -isForeignPtrTy = is_tc foreignPtrTyConKey isIntegerTy = is_tc integerTyConKey isIntTy = is_tc intTyConKey isAddrTy = is_tc addrTyConKey @@ -830,7 +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, foreignPtrTyConKey, + | getUnique tc `elem` [ foreignObjTyConKey, byteArrayTyConKey, mutableByteArrayTyConKey ] = False -- It's also illegal to make foreign exports that take unboxed @@ -841,7 +840,7 @@ legalFEArgTyCon tc legalFIResultTyCon :: DynFlags -> TyCon -> Bool legalFIResultTyCon dflags tc | getUnique tc `elem` - [ foreignObjTyConKey, foreignPtrTyConKey, + [ foreignObjTyConKey, byteArrayTyConKey, mutableByteArrayTyConKey ] = False | tc == unitTyCon = True | otherwise = marshalableTyCon dflags tc @@ -849,7 +848,7 @@ legalFIResultTyCon dflags tc legalFEResultTyCon :: TyCon -> Bool legalFEResultTyCon tc | getUnique tc `elem` - [ foreignObjTyConKey, foreignPtrTyConKey, + [ foreignObjTyConKey, byteArrayTyConKey, mutableByteArrayTyConKey ] = False | tc == unitTyCon = True | otherwise = boxedMarshalableTyCon tc @@ -874,7 +873,6 @@ boxedMarshalableTyCon tc , floatTyConKey, doubleTyConKey , addrTyConKey, ptrTyConKey, funPtrTyConKey , charTyConKey, foreignObjTyConKey - , foreignPtrTyConKey , stablePtrTyConKey , byteArrayTyConKey, mutableByteArrayTyConKey , boolTyConKey -- 1.7.10.4