Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 58... Line 88...
58
 * Initial revision
88
 * Initial revision
59
 *
89
 *
60
***********************************************************************/
90
***********************************************************************/
61
#ifndef installtypes_key
91
#ifndef installtypes_key
62
#define installtypes_key 1
92
#define installtypes_key 1
63
 
-
 
64
 
93
 
65
typedef exp otagexp;
94
typedef exp otagexp;
66
 
95
 
67
typedef struct otagexp_list_t 
96
typedef struct otagexp_list_t {
68
	{ exp start;
97
	exp start;
69
	  exp end;
98
	exp end;
70
	  exp id;
99
	exp id;
71
	  int number;
100
	int number;
72
	} otagexp_list;
101
} otagexp_list;
73
	
102
 
74
typedef int procprops;
103
typedef int procprops;
75
 
104
 
76
typedef int procprops_option;
105
typedef int procprops_option;
77
typedef exp callees;
106
typedef exp callees;
78
typedef int error_code;
107
typedef int error_code;
79
typedef int error_code_list;
108
typedef int error_code_list;
80
 
109
 
81
typedef tdfstring string;
110
typedef tdfstring string;
82
 
111
 
83
union signed_nat_u {int small_s_nat;
112
union signed_nat_u {
-
 
113
	int small_s_nat;
84
                    flpt big_s_nat;};
114
	flpt big_s_nat;
-
 
115
};
85
 
116
 
-
 
117
struct signed_nat_t {
86
struct signed_nat_t {union signed_nat_u signed_nat_val;
118
	union signed_nat_u signed_nat_val;
87
                     char issmall;	/* 1 if small_s_nat 0 big */
119
	char issmall;		/* 1 if small_s_nat 0 big */
88
                     char negative;};	/* 1 for neg, 0 for pos */
120
	char negative;};	/* 1 for neg, 0 for pos */
89
typedef struct signed_nat_t signed_nat;
121
typedef struct signed_nat_t signed_nat;
90
 
122
 
91
typedef struct nat_option_t 
123
typedef struct nat_option_t {
92
   {int present;	/* 1 if val is present, 0 otherwise */
124
	int present;	/* 1 if val is present, 0 otherwise */
-
 
125
	nat val;
93
    nat val;} nat_option;
126
} nat_option;
94
 
127
 
95
typedef struct exp_option_t 
128
typedef struct exp_option_t {
96
   {int present;	/* 1 if val is present, 0 otherwise */
129
	int present;	/* 1 if val is present, 0 otherwise */
-
 
130
	exp val;
97
    exp val;} exp_option;
131
} exp_option;
98
 
132
 
99
 
133
 
100
	/* dummy definitions */
134
/* dummy definitions */
101
typedef int access;
135
typedef int access;
102
typedef int access_option;
136
typedef int access_option;
103
 
137
 
104
typedef int transfer_mode;
138
typedef int transfer_mode;
105
 
139
 
106
 
140
 
107
typedef struct alignment_t {
141
typedef struct alignment_t {
108
  int al_n;	/* code describing the state
142
	int al_n;	/* code describing the state
109
			1 - defined in al_val.al
143
			   1 - defined in al_val.al
110
			2 - the join of al_val.al_join.a and b
144
			   2 - the join of al_val.al_join.a and b
111
			3 - in al_val.al_join.a
145
			   3 - in al_val.al_join.a
112
		*/
146
			 */
113
  int sh_hd;
147
	int sh_hd;
114
  struct alignment_u
148
	struct alignment_u {
115
  {
-
 
116
    int al;
149
		int al;
117
    int al_frame;
150
		int al_frame;
-
 
151
		struct join_t {
118
    struct join_t {struct aldef_t * a; struct aldef_t * b;}
152
			struct aldef_t *a;
-
 
153
			struct aldef_t *b;
119
            al_join;
154
		} al_join;
120
  } al_val;
155
	} al_val;
121
} alignment_cell;
156
} alignment_cell;
122
 
157
 
123
typedef struct aldef_t {
158
typedef struct aldef_t {
124
   struct aldef_t * next_aldef;	/* keeps a list of all aldefs */
159
	struct aldef_t *next_aldef;	/* keeps a list of all aldefs */
125
   alignment_cell al;
160
	alignment_cell al;
126
 } aldef;
161
} aldef;
127
 
162
 
128
typedef aldef * alignment;
163
typedef aldef *alignment;
129
 
164
 
130
 
165
 
-
 
166
struct bfvar_t {
131
struct bfvar_t {int bits;	/* number of bits in bitfield */
167
	int bits;	/* number of bits in bitfield */
132
                int has_sign;	/* 1 if signed */
168
	int has_sign;	/* 1 if signed */
133
		};
169
};
134
typedef struct bfvar_t bitfield_variety;
170
typedef struct bfvar_t bitfield_variety;
135
 
171
 
136
typedef char bool;
172
typedef char bool;
137
 
173
 
138
typedef exp shape;
174
typedef exp shape;
139
 
175
 
140
typedef exp * label;
176
typedef exp *label;
141
 
177
 
142
struct caselim_t {label lab;	/* label to jump if control between
178
struct caselim_t {
143
				   low and high */
179
	label lab;	/* label to jump if control between low and high */
144
                  signed_nat low;
180
	signed_nat low;
145
                  signed_nat high;
181
	signed_nat high;
146
		};	/* caselim during reading */
182
};	/* caselim during reading */
147
 
183
 
148
typedef struct caselim_t caselim;
184
typedef struct caselim_t caselim;
149
 
185
 
150
typedef struct error_treatment_t
186
typedef struct error_treatment_t {
151
  {int err_code;	/* code for treatment */
187
	int err_code;	/* code for treatment */
152
   label jmp_dest;
188
	label jmp_dest;
153
  } error_treatment;	/* error treatment during reading */
189
} error_treatment;	/* error treatment during reading */
154
 
190
 
155
 /* structure which describes a declaration */
191
 /* structure which describes a declaration */
156
struct dec_t {
192
struct dec_t {
157
  struct dec_t *def_next;
193
	struct dec_t *def_next;
158
  /* if this is a global declaration this field holds next global
194
	/* if this is a global declaration this field holds next global
159
     declaration which needs processing. If there is none, it is nilexp */
195
	   declaration which needs processing. If there is none, it is nilexp */
160
                union ut {
196
	union ut {
161
    struct dec_v {
197
		struct dec_v {
162
      char *dec_id;
198
			char *dec_id;
163
      /* identifier to be used */
199
			/* identifier to be used */
164
      shape dec_shape;
200
			shape dec_shape;
165
      /* shape of the value */
201
			/* shape of the value */
166
      exp dec_exp;
202
			exp dec_exp;
167
      /* definition or nilexp */
203
			/* definition or nilexp */
168
      int unit_number;
204
			int unit_number;
169
      diag_global * diag_info;
205
			diag_global *diag_info;
170
      access acc;
206
			access acc;
171
      int index;
207
			int index;
172
      /* used in inl_norm to hold procedure index number */
208
			/* used in inl_norm to hold procedure index number */
173
 
209
 
174
#if ismips || issparc || ispower || isAlpha || ishppa
210
#if ismips || issparc || ispower || isAlpha || ishppa
175
      int sym_number;
211
			int sym_number;
176
#endif
212
#endif
177
 
213
 
178
        /* bitfields only after this */
214
			/* bitfields only after this */
179
      unsigned int extnamed :1;
215
			unsigned int extnamed :1;
180
      /* external */
216
			/* external */
181
      unsigned int dec_var :1;
217
			unsigned int dec_var :1;
182
      /* this is a variable */
218
			/* this is a variable */
183
      unsigned int dec_outermost :1;
219
			unsigned int dec_outermost :1;
184
      /* this is global */
220
			/* this is global */
185
      unsigned int have_def :1;
221
			unsigned int have_def :1;
186
      /* we have a definition */
222
			/* we have a definition */
187
      unsigned int processed :1;
223
			unsigned int processed :1;
188
      /* this exp has been output */
224
			/* this exp has been output */
189
      unsigned int isweak :1;
225
			unsigned int isweak :1;
190
      /* definition is weak */
226
			/* definition is weak */
191
      unsigned int is_common :1;
227
			unsigned int is_common :1;
192
      /* declaration is common */
228
			/* declaration is common */
193
      unsigned int has_signature : 1;
229
			unsigned int has_signature : 1;
194
      /* declaration has signature */
230
			/* declaration has signature */
195
    }             dec_val;
231
		} dec_val;
196
  }             dec_u;
232
	} dec_u;
197
};
233
};
198
 
234
 
199
typedef struct dec_t  dec;
235
typedef struct dec_t dec;
200
 
236
 
201
typedef dec * tag;
237
typedef dec *tag;
202
typedef aldef * al_tag;
238
typedef aldef *al_tag;
203
 
239
 
204
typedef int floating_variety;
240
typedef int floating_variety;
205
typedef unsigned char ntest;
241
typedef unsigned char ntest;
206
typedef unsigned char rounding_mode;
242
typedef unsigned char rounding_mode;
207
 
243
 
208
typedef struct shape_list_t
244
typedef struct shape_list_t {
209
  {shape * elems;
245
	shape *elems;
-
 
246
	int number;
210
   int number;} shape_list;	/* number shapes */
247
} shape_list;	/* number shapes */
211
 
248
 
212
typedef shape variety;
249
typedef shape variety;
213
 
-
 
214
 
250
 
215
typedef struct tag_option_t {bool present;
251
typedef struct tag_option_t {
-
 
252
	bool present;
216
	/* 1 if val is present, 0 otherwise */
253
	/* 1 if val is present, 0 otherwise */
217
                                  tag val;
254
	tag val;
218
                                 } tag_option;
255
} tag_option;
219
 
256
 
220
typedef struct string_option_t {
257
typedef struct string_option_t {
221
	bool present;
258
	bool present;
222
	string val;
259
	string val;
223
} string_option;
260
} string_option;
224
 
261
 
225
typedef struct tagsh_t {shape sha;
262
typedef struct tagsh_t {
-
 
263
	shape sha;
226
                        access visible;
264
	access visible;
227
                        tag tg;
265
	tag tg;
228
                       } tagshacc;
266
} tagshacc;
229
 
267
 
230
typedef struct tagsh_list_t
268
typedef struct tagsh_list_t {
231
  {exp id;
269
	exp id;
232
   exp last_def;
270
	exp last_def;
233
   exp last_id;
271
	exp last_id;
234
   exp proc_def;
272
	exp proc_def;
235
   int size;
273
	int size;
-
 
274
	int number;
236
   int number;} tagshacc_list;
275
} tagshacc_list;
237
 
276
 
238
typedef struct tagacc_t {
277
typedef struct tagacc_t {
239
   tag tg;
278
	tag tg;
240
   access visible;
279
	access visible;
241
  } tagacc;
280
} tagacc;
242
 
281
 
243
typedef struct tagacc_option_t {
282
typedef struct tagacc_option_t {
244
	bool present;	/* 1 if val is present, 0 otherwise */
283
	bool present;	/* 1 if val is present, 0 otherwise */
245
	tagacc val;
284
	tagacc val;
246
} tagacc_option;
285
} tagacc_option;
247
 
286
 
248
typedef  struct labtag_t {label place_label;
287
typedef  struct labtag_t {
249
                          } labtag;
288
	label place_label;
-
 
289
} labtag;
250
 
290
 
251
 
291
 
252
typedef struct exp_list_t
292
typedef struct exp_list_t {
253
  {exp start;	/* the first element of a list chained through bro */
293
	exp start;	/* the first element of a list chained through bro */
254
   exp end;	/* the last element of a list chained through bro */
294
	exp end;	/* the last element of a list chained through bro */
255
   int number;	/* the number of elements in the list */
295
	int number;	/* the number of elements in the list */
256
  } exp_list;
296
} exp_list;
257
 
297
 
258
typedef exp caselim_list;
298
typedef exp caselim_list;
259
 
299
 
260
 
300
 
261
struct labtag_list_t
301
struct labtag_list_t {
262
  {label * elems;
302
	label *elems;
263
   int number;	/* number labels */
303
	int number;	/* number labels */
264
  };
304
};
265
typedef struct labtag_list_t label_list;
305
typedef struct labtag_list_t label_list;
266
 
306
 
267
typedef struct tagshacc_option_t 
307
typedef struct tagshacc_option_t {
268
   {int present;	/* 1 if val is present, 0 otherwise */
308
	int present;	/* 1 if val is present, 0 otherwise */
-
 
309
	tagshacc val;
269
    tagshacc val;} tagshacc_option;
310
} tagshacc_option;
270
 
311
 
271
typedef struct proc_props_t {
312
typedef struct proc_props_t {
272
	struct proc_props_t * pushed;
313
	struct proc_props_t *pushed;
273
	exp proc_struct_result;
314
	exp proc_struct_result;
274
	int proc_label_count;
315
	int proc_label_count;
275
	float default_freq;
316
	float default_freq;
276
	alignment frame_alignment;
317
	alignment frame_alignment;
277
	int has_alloca;
318
	int has_alloca;
Line 280... Line 321...
280
	int has_setjmp;
321
	int has_setjmp;
281
	int uses_loc_address;
322
	int uses_loc_address;
282
	int proc_struct_res;
323
	int proc_struct_res;
283
	int proc_externs;
324
	int proc_externs;
284
	int in_proc_def;
325
	int in_proc_def;
285
        int rep_make_proc;
326
	int rep_make_proc;
286
	int in_initial_value;
327
	int in_initial_value;
287
	} proc_props;
328
} proc_props;
288
	/* holds properties of a procedure while an internally defined
329
/* holds properties of a procedure while an internally defined procedure is
289
	   procedure is being read */
330
 * being read */
290
 
331
 
291
typedef struct version_t {
332
typedef struct version_t {
292
	int major_version;
333
	int major_version;
293
	int minor_version;
334
	int minor_version;
294
} version;
335
} version;
295
 
336
 
296
typedef int version_props;
337
typedef int version_props;
297
typedef int version_list;
338
typedef int version_list;
298
 
339
 
299
 
-
 
300
 
-
 
301
 
-
 
302
#endif
340
#endif /* installtypes_key */