link.h 3.78 KB
Newer Older
1

2
extern Cell conCons;
3

4
extern Name nameRunIO_toplevel;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

/* The following data constructors are used to box unboxed
 * arguments and are treated differently by the code generator.
 * That is, they have primop `elem` {INT_REP,FLOAT_REP,...}.
 */
#define boxingConRep(con) ((AsmRep)(name(con).primop))
#define isBoxingCon(con) (isName(con) && boxingConRep(con) != 0)

extern Name nameMkC;
extern Name nameMkI;
extern Name nameMkW;
extern Name nameMkA;
extern Name nameMkF;
extern Name nameMkD;
extern Name nameMkStable;    

/* The following data constructors are used to make boxed but 
 * unpointed values pointed and require no special treatment
 * by the code generator.
 */
extern Name nameMkInteger;
extern Name nameMkPrimArray;            
extern Name nameMkPrimByteArray;
extern Name nameMkRef;                  
extern Name nameMkPrimMutableArray;     
extern Name nameMkPrimMutableByteArray; 
31
32
extern Name nameMkThreadId;  
extern Name nameMkPrimMVar;  
33
34
35
36
37
38
#ifdef PROVIDE_FOREIGN
extern Name nameMkForeign;   
#endif
#ifdef PROVIDE_WEAK
extern Name nameMkWeak;
#endif
39

40
41
42
43
44
45
46
47
48
49
50

/* For every primitive type provided by the runtime system,
 * we construct a Haskell type using a declaration of the form:
 *
 *   data Int  -- no constructors given
 */
extern Type typeChar;
extern Type typeInt;
extern Type typeInteger;
extern Type typeWord;
extern Type typeAddr;
51
52
53
54
55
extern Type typePrimArray;            
extern Type typePrimByteArray;
extern Type typeRef;                  
extern Type typePrimMutableArray;     
extern Type typePrimMutableByteArray; 
56
57
58
extern Type typeFloat;
extern Type typeDouble;
extern Type typeStable;
59
60
extern Type typeThreadId;
extern Type typeMVar;
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifdef PROVIDE_WEAK
extern Type typeWeak;
#endif
#ifdef PROVIDE_FOREIGN
extern Type typeForeign;
#endif

/* And a smaller number of types defined in plain Haskell */
extern Type typeList;
extern Type typeUnit;
extern Type typeString;
extern Type typeBool;
extern Type typeST;
extern Type typeIO;
extern Type typeException;

/* used while desugaring */
extern Name nameId;
extern Name nameOtherwise;
extern Name nameUndefined;              /* generic undefined value         */

/* used in pattern match */
#if NPLUSK
extern Name namePmSub; 
#endif
extern Name nameSel;

/* used in translation */
extern Name nameEq;     
extern Name namePMFail;
extern Name nameEqChar;
extern Name nameEqInteger;
extern Name namePmInt;
extern Name namePmInteger;
extern Name namePmDouble;
extern Name namePmLe;
extern Name namePmSubtract;
extern Name namePmFromInteger;
extern Name nameMkIO;
extern Name nameUnpackString;
101
102
103
104
extern Name namePrimSeq;
extern Name nameMap;
extern Name nameMinus;

105

106
107
108
109
110
111
112
extern Type  arrow;                     /* mkOffset(0) -> mkOffset(1)      */
extern Type  listof;                    /* [ mkOffset(0) ]                 */
extern Cell  predNum;                   /* Num (mkOffset(0))               */
extern Cell  predFractional;            /* Fractional (mkOffset(0))        */
extern Cell  predIntegral;              /* Integral (mkOffset(0))          */
extern Cell  predMonad;                 /* Monad (mkOffset(0))             */

113
114
115
116
117
118
119
120
121
122
123

extern Type  arrow;                     /* mkOffset(0) -> mkOffset(1)      */
extern       Type  boundPair;;                 /* (mkOffset(0),mkOffset(0))       */
extern       Type  listof;;                    /* [ mkOffset(0) ]                 */
extern       Type  typeVarToVar;;              /* mkOffset(0) -> mkOffset(0)      */

extern       Cell  predNum;;                   /* Num (mkOffset(0))               */
extern       Cell  predFractional;;            /* Fractional (mkOffset(0))        */
extern       Cell  predIntegral;;              /* Integral (mkOffset(0))          */
extern       Kind  starToStar;;                /* Type -> Type                    */
extern       Cell  predMonad;;                 /* Monad (mkOffset(0))             */
124
125