%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CgExpr.lhs,v 1.56 2003/07/02 13:19:28 simonpj Exp $
+% $Id: CgExpr.lhs,v 1.57 2004/03/31 15:23:16 simonmar Exp $
%
%********************************************************
%* *
temp_uniqs = map mkBuiltinUnique [ n_args .. n_args + length ty_args - 1]
temp_amodes = zipWith CTemp temp_uniqs prim_reps
in
- ccallReturnUnboxedTuple temp_amodes
+ ccallReturnUnboxedTuple temp_amodes
(absC (COpStmt temp_amodes op arg_temps []))
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: ClosureInfo.lhs,v 1.61 2003/11/17 14:23:31 simonmar Exp $
+% $Id: ClosureInfo.lhs,v 1.62 2004/03/31 15:23:17 simonmar Exp $
%
\section[ClosureInfo]{Data structures which describe closures}
import SMRep -- all of it
import Type ( isUnLiftedType, Type, repType, splitTyConApp_maybe )
import TcType ( tcSplitSigmaTy )
-import TyCon ( isFunTyCon )
+import TyCon ( isFunTyCon, isAbstractTyCon )
import BasicTypes ( TopLevelFlag(..), isNotTopLevel, isTopLevel, ipNameName )
import Util ( mapAccumL, listLengthCmp, lengthIs )
import FastString
might_be_a_function :: Type -> Bool
might_be_a_function ty
| Just (tc,_) <- splitTyConApp_maybe (repType ty),
- not (isFunTyCon tc) = False
+ not (isFunTyCon tc) && not (isAbstractTyCon tc) = False
+ -- don't forget to check for abstract types, which might
+ -- be functions too.
| otherwise = True
\end{code}
AlgTyConRhs(..), visibleDataCons,
- isFunTyCon, isUnLiftedTyCon, isProductTyCon,
+ isFunTyCon, isUnLiftedTyCon, isProductTyCon, isAbstractTyCon,
isAlgTyCon, isDataTyCon, isSynTyCon, isNewTyCon, isPrimTyCon,
isEnumerationTyCon,
isTupleTyCon, isUnboxedTupleTyCon, isBoxedTupleTyCon, tupleTyConBoxity,
isFunTyCon (FunTyCon {}) = True
isFunTyCon _ = False
+isAbstractTyCon :: TyCon -> Bool
+isAbstractTyCon (AlgTyCon { algTyConRhs = AbstractTyCon }) = True
+isAbstractTyCon _ = False
+
isPrimTyCon :: TyCon -> Bool
isPrimTyCon (PrimTyCon {}) = True
isPrimTyCon _ = False