From ae08a1e6d7b2ed19d312f035fa69c4297dd1756a Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 18 Apr 2006 14:36:41 +0000 Subject: [PATCH] remove vestiges of ByteArray and MutableByteArray, which are no more --- compiler/prelude/PrelNames.lhs | 11 ----------- compiler/typecheck/TcType.lhs | 21 ++------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/compiler/prelude/PrelNames.lhs b/compiler/prelude/PrelNames.lhs index d656fbf..ca63e96 100644 --- a/compiler/prelude/PrelNames.lhs +++ b/compiler/prelude/PrelNames.lhs @@ -110,8 +110,6 @@ basicKnownKeyNames rationalTyConName, ratioDataConName, ratioTyConName, - byteArrayTyConName, - mutableByteArrayTyConName, integerTyConName, smallIntegerDataConName, largeIntegerDataConName, -- Classes. *Must* include: @@ -240,7 +238,6 @@ pREL_CONC = mkModule "GHC.Conc" pREL_IO_BASE = mkModule "GHC.IOBase" pREL_ST = mkModule "GHC.ST" pREL_ARR = mkModule "GHC.Arr" -pREL_BYTEARR = mkModule "PrelByteArr" pREL_STABLE = mkModule "GHC.Stable" pREL_ADDR = mkModule "GHC.Addr" pREL_PTR = mkModule "GHC.Ptr" @@ -605,10 +602,6 @@ addrTyConName = tcQual aDDR FSLIT("Addr") addrTyConKey ptrTyConName = tcQual pREL_PTR FSLIT("Ptr") ptrTyConKey funPtrTyConName = tcQual pREL_PTR FSLIT("FunPtr") funPtrTyConKey --- Byte array types -byteArrayTyConName = tcQual pREL_BYTEARR FSLIT("ByteArray") byteArrayTyConKey -mutableByteArrayTyConName = tcQual pREL_BYTEARR FSLIT("MutableByteArray") mutableByteArrayTyConKey - -- Foreign objects and weak pointers stablePtrTyConName = tcQual pREL_STABLE FSLIT("StablePtr") stablePtrTyConKey newStablePtrName = varQual pREL_STABLE FSLIT("newStablePtr") newStablePtrIdKey @@ -762,10 +755,8 @@ stablePtrTyConKey = mkPreludeTyConUnique 36 statePrimTyConKey = mkPreludeTyConUnique 50 stableNamePrimTyConKey = mkPreludeTyConUnique 51 stableNameTyConKey = mkPreludeTyConUnique 52 -mutableByteArrayTyConKey = mkPreludeTyConUnique 53 mutVarPrimTyConKey = mkPreludeTyConUnique 55 ioTyConKey = mkPreludeTyConUnique 56 -byteArrayTyConKey = mkPreludeTyConUnique 57 wordPrimTyConKey = mkPreludeTyConUnique 58 wordTyConKey = mkPreludeTyConUnique 59 word8TyConKey = mkPreludeTyConUnique 60 @@ -998,8 +989,6 @@ numericTyKeys = cCallishTyKeys = [ addrTyConKey , wordTyConKey - , byteArrayTyConKey - , mutableByteArrayTyConKey , stablePtrTyConKey , int8TyConKey , int16TyConKey diff --git a/compiler/typecheck/TcType.lhs b/compiler/typecheck/TcType.lhs index 0818437..4ebeeb7 100644 --- a/compiler/typecheck/TcType.lhs +++ b/compiler/typecheck/TcType.lhs @@ -1083,8 +1083,7 @@ isFFILabelTy = checkRepTyConKey [ptrTyConKey, funPtrTyConKey, addrTyConKey] isFFIDotnetTy :: DynFlags -> Type -> Bool isFFIDotnetTy dflags ty - = checkRepTyCon (\ tc -> not (isByteArrayLikeTyCon tc) && - (legalFIResultTyCon dflags tc || + = checkRepTyCon (\ tc -> (legalFIResultTyCon dflags tc || isFFIDotnetObjTy ty || isStringTy ty)) ty -- Support String as an argument or result from a .NET FFI call. @@ -1160,35 +1159,24 @@ These chaps do the work; they are not exported \begin{code} legalFEArgTyCon :: TyCon -> Bool --- It's illegal to return foreign objects and (mutable) --- bytearrays from a _ccall_ / foreign declaration --- (or be passed them as arguments in foreign exported functions). legalFEArgTyCon tc - | isByteArrayLikeTyCon tc - = False - -- It's also illegal to make foreign exports that take unboxed + -- It's illegal to make foreign exports that take unboxed -- arguments. The RTS API currently can't invoke such things. --SDM 7/2000 - | otherwise = boxedMarshalableTyCon tc legalFIResultTyCon :: DynFlags -> TyCon -> Bool legalFIResultTyCon dflags tc - | isByteArrayLikeTyCon tc = False | tc == unitTyCon = True | otherwise = marshalableTyCon dflags tc legalFEResultTyCon :: TyCon -> Bool legalFEResultTyCon tc - | isByteArrayLikeTyCon tc = False | tc == unitTyCon = True | otherwise = boxedMarshalableTyCon tc legalOutgoingTyCon :: DynFlags -> Safety -> TyCon -> Bool -- Checks validity of types going from Haskell -> external world legalOutgoingTyCon dflags safety tc - | playSafe safety && isByteArrayLikeTyCon tc - = False - | otherwise = marshalableTyCon dflags tc legalFFITyCon :: TyCon -> Bool @@ -1209,11 +1197,6 @@ boxedMarshalableTyCon tc , addrTyConKey, ptrTyConKey, funPtrTyConKey , charTyConKey , stablePtrTyConKey - , byteArrayTyConKey, mutableByteArrayTyConKey , boolTyConKey ] - -isByteArrayLikeTyCon :: TyCon -> Bool -isByteArrayLikeTyCon tc = - getUnique tc `elem` [byteArrayTyConKey, mutableByteArrayTyConKey] \end{code} -- 1.7.10.4