Subversion Repositories tendra.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/**********************************************************************
32
$Author: release $
33
$Date: 1998/01/17 15:56:05 $
34
$Revision: 1.1.1.1 $
35
$Log: expmacs.h,v $
36
 * Revision 1.1.1.1  1998/01/17  15:56:05  release
37
 * First version to be checked into rolling release.
38
 *
39
 * Revision 1.6  1997/08/06  10:59:10  currie
40
 * const overflow prop
41
 *
42
Revision 1.5  1995/09/22 15:49:14  currie
43
added outpar
44
 
45
 * Revision 1.4  1995/07/05  09:25:49  currie
46
 * continue wrong
47
 *
48
 * Revision 1.3  1995/07/03  15:31:49  currie
49
 * untidy call
50
 *
51
 * Revision 1.1  1995/04/13  09:08:06  currie
52
 * Initial revision
53
 *
54
***********************************************************************/
55
 
56
#ifndef expmacs_key
57
#define expmacs_key 1
58
 
59
#define nilexp (exp)0
60
#define Assert(x) if(!(x)) failer("x")
61
/* main components of exp */
62
 
63
#define son(x) ((x)->sonf.e)
64
#define bro(x) ((x)->brof.e)
65
#define last(x) (x)->lastf
66
#define name(x) (x)->namef
67
#define sh(x) (x)->shf
68
#define pt(x) ((x)->ptf.e)
69
#define props(x) (x)->propsf
70
#define no(x) ((x)->numf.l)
71
#define parked(x) ((x)->park)
72
 
73
/* alternative components of exp */
74
 
75
#define brog(x) ((x)->brof.glob)
76
#define nostr(x) ((x)->numf.str)
77
#define ptno(x) ((x) ->ptf.l)
78
#define sonno(x) ((x) ->sonf.l)
79
#define fno(x) ((x) -> numf.f)
80
#define dno(x) ((x) -> numf.d)
81
#define uno(x) ((x) -> numf.ui)
82
 
83
/* ntests */
84
#define test_number(x) (x)->propsf
85
#define settest_number(x, t) props(x) = (t)
86
 
87
/* rounding */
88
#define round_number(x) ((x)->propsf >> 3)
89
#define setround_number(x,r) (x)->propsf=(((x)->propsf & 0x7) | (r << 3))
90
 
91
/* error handling macros */
92
#define errhandle(x) ((x)->propsf & 0x7)
93
#define optop(x) ((int)errhandle(x) <= 2) 
94
#define seterrhandle(x,e) (x)->propsf= ((x)->propsf & 0xf8) | (e)
95
 
96
/* properties of constructions with EXCEPTIONS */
97
#define setjmp_dest(r,d) {(r)->ptf.e = (d); ++no(son(d));}
98
#define isov(x) (errhandle(x) == 0x4)
99
 
100
/* setting macros for components of exp */
101
 
102
#define setbro(x,b) (x)->brof.e = (b)
103
#define setsh(x,b) (x)->shf = (b)
104
#define setson(x,b) (x)->sonf.e = (b)
105
#define setpt(x,b) (x)->ptf.e = (b)
106
#define setlast(x) (x)->lastf = 1
107
#define clearlast(x) (x)->lastf = 0
108
#define setname(x,n) (x)->namef = (n)
109
#define setfather(f,s) (s)->brof.e = (f); (s)->lastf = 1
110
 
111
/* components of shapes */
112
#define shape_size(x) ((x)->numf.l)
113
#define shape_align(x) ((unsigned long)((x)->brof.ald->al.al_val.al))
114
#define align_of(x) ((x)->brof.ald)
115
#define al1(x) ((unsigned long)((x)->sonf.ald->al.al_val.al))
116
#define al1_of(x) ((x)->sonf.ald)
117
#define al2(x) ((unsigned long)((x)->ptf.ald->al.al_val.al))
118
#define al2_of(x) ((x)->ptf.ald)
119
#define is_signed(x) (x)->lastf
120
 
121
#define frame_al_of_ptr(x) (x)->sonf.ald->al.al_val.al_frame
122
#define frame_al1_of_offset(x) (x)->sonf.ald->al.al_val.al_frame
123
#define includes_vcallees(x) ((x & 16) != 0)
124
#define l_or_cees(x) ((x &25) !=0)
125
 
126
 
127
/* properties of IDENT */
128
 
129
 
130
#define setvar(e) props(e) |= 0x01
131
  /* sets the property of a declaration to isvar (is a variable)*/
132
#define clearvar(e) props(e) &= ~0x01
133
  /* sets the property of a declaration to !isvar */
134
#define setid(e) props(e) &= ~0x01
135
  /* sets the property of a declaration to !isvar */
136
#define isvar(e) (props(e)&0x01)
137
  /* tests the property of a declaration as above */
138
 
139
#define setvis(e) props(e) |= 0x02
140
  /* sets the property of a declaration to in memory */
141
#define isvis(e) (props(e)&0x02)
142
  /* tests if a declaration is to be in memory */
143
 
144
#define setenvoff(e) props(e) |= 0x04
145
  /* sets the property of a declaration to visible */
146
#define isenvoff(e) (props(e)&0x04)
147
  /* tests if a declaration is to be visible */
148
 
149
#define setcaonly(e) props(e) |= 0x08
150
  /* sets the property of a variable declaration to show that it is only
151
     operated on by contents and assign operations */
152
#define iscaonly(e) (props(e)&0x08)
153
  /* tests the above property */
154
#define ClearCaonly(e) props(e) &= ~0x08
155
#define clearcaonly(e) props(e) &= ~0x08
156
 
157
#define setusereg(e) props(e) |= 0x10
158
  /* sets the property of a declaration to recommend the use of
159
     a register */
160
#define isusereg(e) (props(e)&0x10)
161
  /* tests a declaration for a register recommendation */
162
#define clearusereg(e) props(e) &= ~0x10
163
 
164
#define setparam(x) props(x) |= 0x20
165
#define clearparam(x) props(x) &= ~0x20
166
#define isparam(x) (props(x) & 0x20)
167
 
168
#define setglob(e) props(e) |= 0x40
169
  /* sets property of declaration to be global, in this case
170
     bro(e) will be the index of the declaration */
171
#define clearglob(e) props(e) &= ~0x40
172
#define isglob(e) (props(e)&0x40)
173
  /* tests the above property */
174
 
175
#define setcopy(e) props(e) |= 0x80
176
  /* set a flag used during copy */
177
#define clearcopy(e) props(e) &= ~0x80
178
  /* clear a flag used during copy */
179
#define copying(e) (props(e)&0x80)
180
  /* test the flag used during copying */
181
 
182
/* Set in weights and used in coder. At this time no copying */
183
#define set_intnl_call(x) props(x) |= 0x80
184
#define has_intnl_call(x) (props(x) & 0x80)
185
 
186
#define setinlined(x) props(x) = (prop)(props(x) | 0x200)
187
#define isinlined(x) ((props(x) & 0x200)!=0)
188
#define clearinlined(x) props(x) &= ~0x200
189
 
190
#define setoutpar(x) props(x) = (prop)(props(x) | 0x8000)
191
#define isoutpar(x) ((props(x) & 0x8000) != 0)
192
#define clearoutpar(x) props(x) &= ~0x8000
193
 
194
/* properties of MAKE_PROC construction */
195
 
196
#define set_struct_res(x) props(x) |= 0x1
197
#define has_struct_res(x) (props(x) & 0x1)
198
 
199
#define set_loc_address(x) props(x) |= 0x2
200
#define loc_address(x) (props(x) & 0x2)
201
 
202
#define set_proc_has_setjmp(x) props(x) |= 0x4
203
#define proc_has_setjmp(x) (props(x) & 0x4)
204
 
205
#define set_proc_has_alloca(x) props(x) |= 0x8
206
#define proc_has_alloca(x) (props(x) & 0x8)
207
 
208
#define set_proc_has_lv(x) props(x) |= 0x10
209
#define proc_has_lv(x) (props(x) & 0x10)
210
 
211
#define isrecursive(x) (props(x) & 0x20)
212
#define setrecursive(x) props(x) |= 0x20
213
 
214
#define set_proc_uses_crt_env(x) props(x) |= 0x40
215
#define proc_uses_crt_env(x) (props(x) & 0x40)
216
 
217
#define set_proc_uses_external(x) props(x) |= 0x80
218
#define proc_uses_external(x) (props(x) & 0x80)
219
 
220
/*set property of SOLVE construction */
221
#define setcrtsolve(x) props(x)=1
222
 
223
/* properties of pt of REP and SOLVE during copy */
224
#define set_copying_solve(x) props(x) |= 1
225
#define clear_copying_solve(x) props(x) &= ~0x01
226
 
227
/* properties of MOVE_SOME construction */
228
#define setnooverlap(x) props(x) |= 0x01
229
#define isnooverlap(x) (props(x) & 0x01)
230
 
231
/* properties of CONT construction */
232
#define set_propagate(x) props(x) |= 0x1
233
#define to_propagate(x) (props(x) & 0x1)
234
#define clear_propagate(x) props(x) &= ~0x01
235
 
236
/* various properties of LABST construction are used in exp.c */
237
#define set_loaded_lv(x) props(x) |= 0x10
238
#define is_loaded_lv(x) (props(x) & 0x10)
239
#define setunroll(x) props(x) = (prop)(props(x) | 0x04)
240
#define clearunroll(x)  props(x) = (prop)(props(x) & ~0x04)
241
#define isunroll(x) (props(x) & 0x04)
242
 
243
/* properties of NAME construction */
244
#define setlastuse(x) props(x) |= 0x01
245
#define islastuse(x) (props(x) & 0x01)
246
 
247
#define setloadparam(x) props(x) |= 0x02
248
#define isloadparam(x) (props(x) & 0x02)
249
 
250
#define setreallyass(x) props(x) |= 0x04
251
#define isreallyass(x) (props(x) & 0x04)
252
 
253
/* properties of STRING construction */
254
#define string_char_size(e) props(e)
255
 
256
/* properties of VAL construction */
257
#define setbigval(x)  props(x) = (prop)(props(x) | 0x01)
258
#define clearbigval(x) props(x) = (prop)(props(x) & ~0x01)
259
#define isbigval(x) (props(x) & 0x01)
260
 
261
#define setconstovf(x)  props(x) = (prop)(props(x) | 0x02)
262
#define constovf(x) (props(x) & 0x02)
263
 
264
/* properties of REP construction */
265
#define setunrolled(x)  props(x) = (prop)(props(x) | 0x01)
266
#define isunrolled(x) (props(x) & 0x01)
267
/* properties of APPLY construction */
268
#define settoinline(x)  props(x) = (prop)(props(x) | 0x01)
269
#define istoinline(x) (props(x) & 0x01)
270
 
271
/* properties of alloca constructions */
272
#define set_checkalloc(x) props(x) |= 1;
273
#define checkalloc(x) (props(x) & 1)
274
 
275
/* properties of jump record */
276
 
277
#define fstack_pos_of(x) (x)->propsf
278
 
279
 
280
/* rounding for alignment */
281
 
282
#define rounder(n,a) (((n)+(a)-1)/(a))*(a)
283
 
284
#define align32 ((unsigned long) 32)
285
#define align16 ((unsigned long) 16)
286
#define align8 ((unsigned long) 8)
287
#define align1 ((unsigned long) 1)
288
 
289
#define size64 ((long) 64)
290
#define size32 ((long) 32)
291
#define size16 ((long) 16)
292
#define size8 ((long) 8)
293
#define Z (long)0
294
 
295
 
296
/* previously in extra_expmacs.h */
297
#define set_callee(id)	setname(son(id), formal_callee_tag)
298
#define set_make_procprops(e, p) props(e) |= ((p)<<8)
299
#define proc_has_vcallees(e) ((props(e) & 0x200)!=0)
300
#define postlude_has_call(e) (props(e) & 1)
301
#define call_has_vcallees(e) ((props(e) & 2) != 0)
302
#define proc_has_checkstack(e) ((props(e) & 0x800)!=0)
303
#define proc_has_vcallers(e) ((props(e) & 0x100) != 0)
304
#define proc_has_nolongj(e) ((props(e) & 0x1000) !=0)
305
#define call_is_untidy(e) ((props(e) & 4) != 0)
306
 
307
 
308
 
309
#endif