* included in the distribution.
*
* $RCSfile: storage.h,v $
- * $Revision: 1.23 $
- * $Date: 1999/12/20 16:55:28 $
+ * $Revision: 1.32 $
+ * $Date: 2000/03/10 14:53:00 $
* ------------------------------------------------------------------------*/
/* --------------------------------------------------------------------------
* and string text etc.
* ------------------------------------------------------------------------*/
+#if !defined(SIZEOF_VOID_P) || !defined(SIZEOF_INT)
+#error SIZEOF_VOID_P or SIZEOF_INT is not defined
+#endif
+
#define TAGMIN 1 /* Box and constructor cell tag values */
#define BCSTAG 30 /* Box=TAGMIN..BCSTAG-1 */
#define isTag(c) (TAGMIN<=(c) && (c)<SPECMIN) /* Tag cell values */
#define ADDPAT 11 /* (_+k) pattern discr: snd :: Int */
#define FLOATCELL 15 /* Floating Pt literal: snd :: Text */
#define BIGCELL 16 /* Integer literal: snd :: Text */
-#if PTR_ON_HEAP
#define PTRCELL 17 /* C Heap Pointer snd :: Ptr */
+#define CPTRCELL 21 /* Native code pointer snd :: Ptr */
+
#if IPARAM
#define IPCELL 19 /* Imp Param Cell: snd :: Text */
#define IPVAR 20 /* ?x: snd :: Text */
#endif
-#define CPTRCELL 21 /* Native code pointer snd :: Ptr */
-#endif
+
#if TREX
#define EXTCOPY 22 /* Copy of an Ext: snd :: Text */
#endif
#define stringToBignum(s) pair(BIGCELL,findText(s))
#define bignumToString(b) textToStr(snd(b))
-#if PTR_ON_HEAP
#define isPtr(c) (isPair(c) && fst(c)==PTRCELL)
extern Cell mkPtr Args((Ptr));
extern Ptr ptrOf Args((Cell));
#define isCPtr(c) (isPair(c) && fst(c)==CPTRCELL)
extern Cell mkCPtr Args((Ptr));
extern Ptr cptrOf Args((Cell));
-#endif
/* --------------------------------------------------------------------------
* Constructor cell tags are used as the fst element of a pair to indicate
#define FATBAR 42 /* FATBAR snd :: (Exp,Exp) */
#define LAZYPAT 43 /* LAZYPAT snd :: Exp */
#define DERIVE 45 /* DERIVE snd :: Cell */
-#if BREAK_FLOATS
-#define FLOATCELL 46 /* FLOATCELL snd :: (Int,Int) */
-#endif
-
#define BOOLQUAL 49 /* BOOLQUAL snd :: Exp */
#define QWHERE 50 /* QWHERE snd :: [Decl] */
#define FROMQUAL 51 /* FROMQUAL snd :: (Exp,Exp) */
#define DOQUAL 52 /* DOQUAL snd :: Exp */
#define MONADCOMP 53 /* MONADCOMP snd :: ((m,m0),(Exp,[Qual])*/
-
#define GUARDED 54 /* GUARDED snd :: [guarded exprs] */
-
#define ARRAY 55 /* Array snd :: (Bounds,[Values]) */
#define MUTVAR 56 /* Mutvar snd :: Cell */
-#if INTERNAL_PRIMS
#define HUGSOBJECT 57 /* HUGSOBJECT snd :: Cell */
-#endif
#if IPARAM
#define WITHEXP 58 /* WITHEXP snd :: [(Var,Exp)] */
#endif
-
#define POLYTYPE 60 /* POLYTYPE snd :: (Kind,Type) */
#define QUAL 61 /* QUAL snd :: ([Classes],Type) */
#define RANK2 62 /* RANK2 snd :: (Int,Type) */
#define DICTAP 80 /* DICTAP snd :: (QClassId,[Type]) */
#define UNBOXEDTUP 81 /* UNBOXEDTUP snd :: [Type] */
-#if SIZEOF_INTP != SIZEOF_INT
+#if SIZEOF_VOID_P != SIZEOF_INT
#define PTRCELL 82 /* C Heap Pointer snd :: (Int,Int) */
#endif
#define I_FIXDECL 113 /* snd :: ((NIL|Int, Associativity, ConVarId))
fixity, associativity, name */
-#define I_INSTANCE 114 /* snd :: ((Line, [((QConId,VarId))],
- Type, VarId, Inst))
+#define I_INSTANCE 114 /* snd :: ((Line,
+ [((VarId,Kind))],
+ Type, VarId, Inst))
lineno,
- forall-y bit (eg __forall [a b] {M.C1 a, M.C2 b} =>),
+ forall-y bit (eg __forall [a b] =>),
other bit, eg { C a1 } -> { C2 a2 } -> ... -> { Cn an },
name of dictionary builder,
(after startGHCInstance) the instance table location */
extern Tycon addTupleTycon ( Int n );
extern Name addWiredInBoxingTycon
( String modNm, String typeNm, String constrNm,
- Int arity, Int no, Int rep );
+ Int rep, Kind kind );
Tycon addWiredInEnumTycon ( String modNm, String typeNm,
List /*of Text*/ constrs );
#define isPrelude(m) (m==modulePrelude)
+#define N_PRELUDE_SCRIPTS (combined ? 32 : 1)
+
/* --------------------------------------------------------------------------
* Type constructor names:
* ------------------------------------------------------------------------*/
extern List addTyconsMatching Args((String,List));
extern List addNamesMatching Args((String,List));
+extern Tycon findTyconInAnyModule ( Text t );
+extern Class findClassInAnyModule ( Text t );
+extern Name findNameInAnyModule ( Text t );
+extern Void print Args((Cell, Int));
+extern void dumpTycon ( Int t );
+extern void dumpName ( Int n );
+extern void dumpClass ( Int c );
+extern void dumpInst ( Int i );
+extern void locateSymbolByName ( Text t );
+
+#if LEADING_UNDERSCORE
+#define MAYBE_LEADING_UNDERSCORE(sss) _##sss
+#define MAYBE_LEADING_UNDERSCORE_STR(sss) "_" sss
+#else
+#define MAYBE_LEADING_UNDERSCORE(sss) sss
+#define MAYBE_LEADING_UNDERSCORE_STR(sss) sss
+#endif
+
/*-------------------------------------------------------------------------*/