Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
7 7u83 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
 */
31
/*
2 7u83 32
    		 Crown Copyright (c) 1997
7 7u83 33
 
2 7u83 34
    This TenDRA(r) Computer Program is subject to Copyright
35
    owned by the United Kingdom Secretary of State for Defence
36
    acting through the Defence Evaluation and Research Agency
37
    (DERA).  It is made available to Recipients with a
38
    royalty-free licence for its use, reproduction, transfer
39
    to other parties and amendment for any purpose not excluding
40
    product development provided that any such use et cetera
41
    shall be deemed to be acceptance of the following conditions:-
7 7u83 42
 
2 7u83 43
        (1) Its Recipients shall ensure that this Notice is
44
        reproduced upon any copies or amended versions of it;
7 7u83 45
 
2 7u83 46
        (2) Any amended version of it shall be clearly marked to
47
        show both the nature of and the organisation responsible
48
        for the relevant amendment or amendments;
7 7u83 49
 
2 7u83 50
        (3) Its onward transfer from a recipient to another
51
        party shall be deemed to be that party's acceptance of
52
        these conditions;
7 7u83 53
 
2 7u83 54
        (4) DERA gives no warranty or assurance as to its
55
        quality or suitability for any purpose and DERA accepts
56
        no liability whatsoever in relation to any use to which
57
        it may be put.
58
*/
59
 
60
 
61
/**********************************************************************
62
$Author: pwe $
63
$Date: 1998/03/11 11:03:31 $
64
$Revision: 1.2 $
65
$Log: dg_types.h,v $
66
 * Revision 1.2  1998/03/11  11:03:31  pwe
67
 * DWARF optimisation info
68
 *
69
 * Revision 1.1.1.1  1998/01/17  15:55:46  release
70
 * First version to be checked into rolling release.
71
 *
72
 * Revision 1.8  1998/01/11  18:44:58  pwe
73
 * consistent new/old diags
74
 *
75
 * Revision 1.7  1998/01/09  09:29:50  pwe
76
 * prep restructure
77
 *
78
 * Revision 1.6  1997/12/04  19:36:34  pwe
79
 * ANDF-DE V1.9
80
 *
81
 * Revision 1.5  1997/11/06  09:17:46  pwe
82
 * ANDF-DE V1.8
83
 *
84
 * Revision 1.4  1997/10/28  10:12:35  pwe
85
 * local location support
86
 *
87
 * Revision 1.3  1997/10/23  09:21:12  pwe
88
 * ANDF-DE V1.7 and extra diags
89
 *
90
 * Revision 1.2  1997/10/10  18:16:42  pwe
91
 * prep ANDF-DE revision
92
 *
93
 * Revision 1.1  1997/08/23  13:26:56  pwe
94
 * initial ANDF-DE
95
 *
96
***********************************************************************/
97
#ifndef dg_types_key
98
#define dg_types_key 1
99
 
100
#include "dg_first.h"
101
 
102
 
103
 
104
typedef dg_info dg;
7 7u83 105
#define nildiag	(dg_info)0
2 7u83 106
 
7 7u83 107
typedef struct dg_tag_t *dg_tag;
108
typedef struct dg_comp_t *dg_compilation;
2 7u83 109
 
110
typedef dg_name dg_name_list;
111
typedef dg dg_list;
112
 
113
typedef dg_tag dg_tag_option;
114
typedef dg_type dg_type_option;
115
typedef dg_name dg_name_option;
116
typedef dg_filename dg_filename_option;
117
 
7 7u83 118
typedef struct {
119
	dg_name_list	list;
120
	dg_tag		tg;
2 7u83 121
} dg_namelist;
122
 
7 7u83 123
typedef struct {
124
	int		len;
125
	dg_type		*array;
2 7u83 126
} dg_type_list;
127
 
128
typedef dg_type_list dg_type_list_option;
129
 
7 7u83 130
typedef struct {
131
	int		len;
132
	dg_tag		*array;
2 7u83 133
} dg_tag_list;
134
 
135
 
7 7u83 136
typedef struct {
137
	int		len;
138
	char		**array;
2 7u83 139
} string_list;
140
 
141
 
7 7u83 142
struct file_t {
143
	long		file_dat;
144
	char 		*file_host;
145
	char 		*file_path;
146
	char 		*file_name;
147
	struct file_t	*another;
148
	int		index;
2 7u83 149
};
150
 
7 7u83 151
typedef enum {
152
	SP_NULL = 0,
153
	SP_SHORT,
154
	SP_SPAN,
155
	SP_FILE,
156
	SP_GLOB
2 7u83 157
} dg_sourcepos_key;
158
 
7 7u83 159
typedef struct {
160
	dg_sourcepos_key	sp_key;
161
	dg_filename		file;
162
	dg_filename		to_file;
163
	long			from_line;
164
	long			to_line;
165
	short			from_column;
166
	short			to_column;
2 7u83 167
} dg_sourcepos;
168
 
7 7u83 169
typedef struct {
170
	dg_filename	file;
171
	long		line;
172
	short		column;
2 7u83 173
} short_sourcepos;
174
 
175
typedef dg_sourcepos dg_sourcepos_option;
176
 
7 7u83 177
typedef struct dg_dflt {
178
	exp		val;
179
	dg_sourcepos	span;
180
	long		lab;
181
	struct dg_dflt	*next;
2 7u83 182
} dg_default;
183
 
7 7u83 184
typedef dg_default *dg_default_option;
2 7u83 185
 
7 7u83 186
typedef struct dg_con {
187
	dg_tag		refmem;
188
	int		is_val;
189
	union {
190
		dg_type	typ;
191
		exp	val;
192
	} u;
193
	struct dg_con *next;
194
} *dg_constraint;
2 7u83 195
 
196
typedef dg_constraint	dg_constraint_list;
197
typedef dg_constraint	dg_constraint_list_option;
198
 
199
 
7 7u83 200
typedef enum {
201
	DG_ACC_NONE = 0,
202
	DG_ACC_PUB,
203
	DG_ACC_PROT,
204
	DG_ACC_PRIV,
205
	DG_ACC_LOC
2 7u83 206
} dg_accessibility;
207
typedef dg_accessibility dg_accessibility_option;
208
 
7 7u83 209
typedef enum {
210
	DG_VIRT_NONE = 0,
211
	DG_VIRT_VIRT,
212
	DG_VIRT_PURE
2 7u83 213
} dg_virtuality;
214
typedef dg_virtuality dg_virtuality_option;
215
 
216
 
7 7u83 217
typedef enum {
218
	DG_ID_NONE = 0,
219
	DG_ID_SRC,
220
	DG_ID_EXT,
221
	DG_ID_ANON,
222
	DG_ID_ARTFL,
223
	DG_ID_INST
2 7u83 224
} dg_idname_key;
225
 
7 7u83 226
typedef struct {
227
	dg_idname_key	id_key;
228
	union {
229
		char			*nam;
230
		struct dg_inst_t	*instance;
231
	} idd;
2 7u83 232
} dg_idname;
233
typedef dg_idname dg_idname_option;
234
 
7 7u83 235
typedef struct dg_inst_t {
236
	dg_idname	nam;
237
	dg_idname	spec;
238
	short_sourcepos	whence;
239
	dg_name_list	params;
2 7u83 240
} dg_instantn;
241
 
7 7u83 242
typedef union {
243
	dg_tag	tg;
244
	exp	x;
2 7u83 245
} tg_or_exp;
246
 
7 7u83 247
typedef struct {
248
	int		is_ref;
249
	tg_or_exp	u;
250
	shape		sha;
2 7u83 251
} dg_bound;
252
 
7 7u83 253
typedef enum {
254
	DG_DIM_NONE,
255
	DG_DIM_TYPE,
256
	DG_DIM_BOUNDS
2 7u83 257
} dg_dim_key;
258
 
7 7u83 259
typedef struct {
260
	int		d_key:8;
261
	int		low_ref:1;
262
	int		hi_ref:1;
263
	int		hi_cnt:1;
264
	long		count;
265
	dg_type		d_typ;
266
	shape		sha;
267
	tg_or_exp	lower;
268
	tg_or_exp	upper;
269
	dg_tag		tg;
2 7u83 270
} dg_dim;
271
 
272
typedef dg_dim dg_dim_option;
273
 
7 7u83 274
typedef struct {
275
	int	len;
276
	dg_dim	*array;
2 7u83 277
} dg_dim_list;
278
 
7 7u83 279
typedef struct {
280
	char		*enam;
281
	short_sourcepos	pos;
282
	exp		value;
283
	int		is_chn:1;
284
	int		chn:8;
285
	dg_tag		tg;
2 7u83 286
} dg_enum;
287
 
7 7u83 288
typedef struct {
289
	int	len;
290
	dg_enum	*array;
2 7u83 291
} dg_enum_list;
292
 
7 7u83 293
typedef enum {
294
	DG_CM_FIELD,
295
	DG_CM_FN,
296
	DG_CM_INDIRECT,
297
	DG_CM_STAT
2 7u83 298
} dg_cm_key;
299
 
7 7u83 300
typedef struct {
301
	dg_cm_key	cm_key;
302
	union {
303
		struct {
304
			char		*fnam;
305
			short_sourcepos	f_pos;
306
			dg_type		f_typ;
307
			exp		f_offset;
308
			struct dg_dflt	*dflt;
309
			int		acc:4;
310
			int		discr:1;
311
		} cm_f;
312
		struct {
313
			dg_name		fn;
314
			exp		slot;
315
		} cm_fn;
316
		struct {
317
			char		*nam;
318
			short_sourcepos	pos;
319
			dg_type		typ;
320
			exp		ind_loc;
321
		} cm_ind;
322
		dg_name		cm_stat;
323
	} d;
324
	dg_tag	tg;
2 7u83 325
} dg_classmem;
326
 
7 7u83 327
typedef struct {
328
	int		len;
329
	dg_classmem	*array;
2 7u83 330
} dg_classmem_list;
331
 
7 7u83 332
typedef struct {
333
	exp	lower;
334
	exp	upper;
2 7u83 335
} dg_discrim;
336
 
7 7u83 337
typedef struct {
338
	int		len;
339
	dg_discrim	*array;
2 7u83 340
} dg_discrim_list;
341
 
7 7u83 342
typedef struct {
343
	dg_discrim_list		discr;
344
	dg_classmem_list	fields;
2 7u83 345
} dg_variant;
346
 
7 7u83 347
typedef struct {
348
	int		len;
349
	dg_variant	*array;
2 7u83 350
} dg_variant_list;
351
 
7 7u83 352
typedef enum {
353
	DG_V_D,
354
	DG_V_S,
355
	DG_V_T
2 7u83 356
} dg_v_key;
357
 
7 7u83 358
typedef struct {
359
	dg_v_key		v_key;
360
	union {
361
		dg_classmem	d;
362
		dg_tag		s;
363
		dg_type		t;
364
	} u;
365
	dg_variant_list	vnts;
2 7u83 366
} dg_varpart;
367
 
7 7u83 368
typedef dg_varpart *dg_varpart_option;
2 7u83 369
 
370
 
7 7u83 371
typedef enum {
372
	DG_NO_MODE = 0,
373
	DG_IN_MODE,
374
	DG_OUT_MODE,
375
	DG_INOUT_MODE
2 7u83 376
} dg_param_mode;
377
typedef dg_param_mode dg_param_mode_option;
378
 
7 7u83 379
typedef struct {
380
	char		*pnam;
381
	short_sourcepos	ppos;
382
	dg_param_mode	pmode;
383
	dg_type		p_typ;
384
	dg_default	*p_dflt;
2 7u83 385
} dg_param;
386
 
7 7u83 387
typedef struct {
388
	int		len;
389
	dg_param	*array;
2 7u83 390
} dg_param_list;
391
 
7 7u83 392
typedef struct {
393
	dg_tag		base;
394
	short_sourcepos	pos;
395
	exp		location;
396
	int		acc:8;
397
	int		virt:8;
2 7u83 398
} dg_class_base;
399
 
7 7u83 400
typedef struct {
401
	int		len;
402
	dg_class_base	*array;
2 7u83 403
} dg_class_base_list;
404
 
7 7u83 405
typedef struct {
406
	dg_class_base_list	inherits;
407
	dg_classmem_list	members;
408
	dg_tag_list		friends;
409
	dg_tag			vt_s;
410
	dg_tag			vt_d;
411
	dg_tag			rtti_s;
412
	dg_tag			rtti_d;
2 7u83 413
} class_data;
414
 
7 7u83 415
typedef struct {
416
	dg_name_list		entries;
417
	dg_tag			id;
418
	dg_tag			cb;
419
	dg_classmem_list	members;
2 7u83 420
} task_data;			/* task or synchronised type */
421
 
422
 
7 7u83 423
typedef union {
424
	long	l;
425
	char	*s;
2 7u83 426
} lab_union;
427
 
7 7u83 428
typedef enum {
429
	NO_LAB = 0,
430
	LAB_STR,
431
	LAB_CODE,
432
	LAB_D
2 7u83 433
} dg_lab_key;
434
 
7 7u83 435
typedef struct {
436
	lab_union	u;
437
	int		k;
2 7u83 438
} ext_lab;
439
 
7 7u83 440
typedef enum {
441
	NO_WH = 0,
442
	WH_STR,
443
	WH_CODELAB,
444
	WH_REG,
445
	WH_REGOFF
2 7u83 446
} dg_where_key;
447
 
7 7u83 448
typedef struct {
449
	lab_union	u;
450
	long		o;
451
	dg_where_key	k;
2 7u83 452
} dg_where;
453
 
454
 
7 7u83 455
typedef enum {
456
	DGT_TAGGED,
457
	DGT_BASIC,
458
	DGT_QUAL,	/* ptr, ref and qual */
459
	DGT_ARRAY,
460
	DGT_SUBR,
461
	DGT_ENUM,
462
	DGT_STRUCT,	/* includes union */
463
	DGT_CLASS,
464
	DGT_A_TASK,
465
	DGT_A_SYNCH,
466
	DGT_PMEM,
467
	DGT_CONS,	/* set and file */
468
	DGT_PROC,
469
	DGT_BITF,
470
	DGT_FIXED,
471
	DGT_FLDIG,
472
	DGT_MOD,
473
	DGT_STRING,
474
	DGT_UNKNOWN
2 7u83 475
} dg_type_key;
476
 
7 7u83 477
typedef enum {
478
	DG_ADR_T,
479
	DG_BOOL_T,
480
	DG_CHAR_T,
481
	DG_INT_T,
482
	DG_FLOAT_T
2 7u83 483
} dg_basic_type_key;
484
 
7 7u83 485
typedef enum {
486
	DG_PTR_T = 0,
487
	DG_HPPTR_T,
488
	DG_REF_T,
489
	DG_PACK_T,
490
	DG_CONST_T,
491
	DG_VOL_T,
492
	DG_ALIAS_T,
493
	DG_CLWID_T,
494
	DG_LIM_T,
495
	N_DG_QUAL_TYPES
2 7u83 496
} dg_qual_type_key;
497
 
498
typedef dg_qual_type_key dg_qualifier;
499
 
7 7u83 500
typedef enum {
501
	DG_SET_T,
502
	DG_FILE_T
2 7u83 503
} dg_cons_type_key;
504
 
7 7u83 505
struct dg_type_t {
506
	dg_type_key	key;
507
	ext_lab		outref;
508
	union {
509
		dg_tag	t_tag;
510
		struct {
511
			dg_basic_type_key	b_key;
512
			char			*tnam;
513
			shape			b_sh;
514
		} t_bas;
515
		struct {
516
			dg_qual_type_key	q_key;
517
			dg_type			typ;
518
			dg_type			another;
519
			/* list q_keys to avoid repeat */
520
		} t_qual;
521
		struct {
522
			dg_type			elem_type;
523
			exp			stride;
524
			bool			rowm;
525
			dg_dim_list		dims;
526
		} t_arr;
527
		dg_dim	t_subr;
528
		struct {
529
			char			*tnam;
530
			short_sourcepos		tpos;
531
			dg_enum_list		values;
532
			shape			sha;
533
		} t_enum;
534
		struct {
535
			dg_idname		idnam;
536
			short_sourcepos		tpos;
537
			bool			is_union;
538
			shape			sha;
539
			union {
540
				dg_classmem_list	fields;
541
				class_data		*cd;
542
				task_data		*td;
543
			} u;
544
			dg_varpart_option	vpart;
545
		} t_struct;
546
		struct {
547
			dg_tag			pclass;
548
			dg_type			memtyp;
549
			shape			sha;
550
		} t_pmem;
551
		struct {
552
			dg_cons_type_key	c_key;
553
			dg_type			typ;
554
			shape			sha;
555
		} t_cons;
556
		struct {
557
			dg_param_list		params;
558
			dg_type			res_type;
559
			procprops		prps;
560
			unsigned int		lang:16;
561
			unsigned int		ccv:8;
562
			int			knowpro:1;
563
			int			yespro:1;
564
		} t_proc;
565
		struct {
566
			dg_type			expanded;
567
			shape			sha;
568
			bitfield_variety	bv;
569
			dg_type			another;
570
			/* list all bitfields to avoid repeat */
571
		} t_bitf;
572
		struct {
573
			dg_type			rept;
574
			exp			small;
575
			exp			delta;
576
			exp			digits;
577
			/* or size of modular type */
578
		} t_adanum;
579
		struct {
580
			dg_tag			ct;
581
			exp			lb;
582
			exp			length;
583
		} t_string;
584
	} data;
585
	struct dg_more_t	*mor;
586
	dg_type			type_queue;
2 7u83 587
};
588
 
589
 
7 7u83 590
typedef enum {
591
	DGN_OBJECT,
592
	DGN_PROC,
593
	DGN_MODULE,
594
	DGN_NSP,
595
	DGN_SUBUNIT,
596
	DGN_IMPORT,
597
	DGN_TYPE,
598
	DGN_ENTRY
2 7u83 599
} dg_name_key;
600
 
7 7u83 601
struct dg_name_t {
602
	dg_name_key	key;
603
	dg_idname	idnam;
604
	short_sourcepos	whence;
605
	union {
606
		struct {
607
			dg_type		typ;
608
			exp		obtain_val;
609
			dg_param	*p;
610
		} n_obj;
611
		struct {
612
			dg_type		typ;
613
			exp		obtain_val;
614
			dg_info		params;		/* DGA_PARAMS */
615
		} n_proc;
616
		struct {
617
			dg_name_list	members;
618
			exp		init;
619
		} n_mod;
620
		struct {
621
			dg_tag		parent;
622
			dg_name		sub;
623
			int		acc:8;
624
			int		child:1;
625
			int		split:1;
626
		} n_sub;
627
		struct {
628
			dg_tag		import;
629
			int		ik;
630
			dg_type		i_typ;
631
		} n_imp;
632
		struct {
633
			dg_type		raw;
634
			dg_type		named;
635
			dg_constraint	constraints;
636
		} n_typ;
637
	} data;
638
	struct dg_more_t *mor;
639
	dg_name		next;
2 7u83 640
};
641
 
7 7u83 642
typedef struct dg_more_t {
643
	dg_tag		this_tag;
644
	dg_tag		inline_ref;
645
	dg_tag		refspec;
646
	dg_tag		elabn;
647
	dg_type_list	exptns;		/* proc_name */
648
	short_sourcepos	end_pos;	/* proc_name */
649
	dg_dim		*en_family;	/* proc_name */
650
	exp		vslot;		/* proc_name */
651
	exp		repn;
652
	int		acc:4;
653
	int		virt:4;		/* proc_name */
654
	int		isinline:1;	/* proc_name */
655
	int		prognm:1;	/* proc_name */
656
	int		isconst:1;	/* obj_name */
657
	int		isspec:1;
658
	int		issep:1;
659
	int		isnew:1;	/* types */
660
	int		aderiv:1;	/* types */
661
} *dg_more_name;
2 7u83 662
 
663
 
7 7u83 664
typedef struct ret_t {
665
	long		lab;
666
	long		over;
667
	struct ret_t	*next;
2 7u83 668
} retrec;
669
 
7 7u83 670
typedef struct ob_s {
671
	dg_tag		tg;
672
	int		ass;
673
	struct ob_s	*next;
2 7u83 674
} objset;
675
 
7 7u83 676
/* These are optimisation kinds */
677
typedef enum {
678
	DGD_NONE = 0,
679
	DGD_DEAD,	/* 1 OpK_Unreachable */
680
	DGD_REM,	/* 2 OpK_Copy_Propagation */
681
	DGD_RDND,	/* 3 OpK_Redundant - no side effect */
682
	DGD_CNST,	/* 4 OpK_Const_Eval */
683
	DGD_MOVD,	/* 5 OpK_Structural */
684
	DGD_EXTRACT	/* 6 OpK_Loop_Const */
2 7u83 685
			/* 7 OpK_Loop_Invariant assignments */
686
			/* 8 OpK_Index_Reduction */
687
			/* 9 OpK_Loop_Unroll */
688
} dg_detch_key;
689
 
7 7u83 690
typedef struct dgt_s {
691
	dg_detch_key	why;
692
	dg_info		info;
693
	dg_tag		tg;
694
	struct dgt_s	*next;
695
	struct dgt_s	*sub;
2 7u83 696
} detch_info;
697
 
698
 
7 7u83 699
typedef enum {
700
	DGR_SEL,
701
	DGR_ACC,
702
	DGR_RTS,
703
	DGR_ALT,
704
	DGR_SGD,
705
	DGR_TRIG,
706
	DGR_ABTL,
707
	DGR_REQUE
2 7u83 708
} dg_rvs_key;
709
 
710
 
7 7u83 711
typedef enum {
712
	DGA_NONE = 0,
713
	DGA_PARAMS,	/* params_dg */
714
	DGA_COMP,	/* compilation_dg, source_language_dg */
715
	DGA_SRC,	/* sourcepos_dg, singlestep_dg */
716
	DGA_SCOPE,	/* lexical_block_dg */
717
	DGA_EXTRA,	/* lexical_fragment */
718
	DGA_LAB,	/* label_dg */
719
	DGA_NAME,	/* name_decl_dg */
720
	DGA_WITH,	/* with_dg */
721
	DGA_CALL,	/* call_dg, apply_(gen)_tag */
722
	DGA_INL_CALL,	/* inline_call_dg */
723
	DGA_INL_RES,	/* inline_result_dg */
724
	DGA_X_TRY,	/* exception_scope_dg */
725
	DGA_X_CATCH,	/* exception_handler_dg */
726
	DGA_X_RAISE,	/* raise_dg */
727
	DGA_BRANCH,	/* branch_dg, case_tag */
728
	DGA_TEST,	/* test_dg, test_tag */
729
	DGA_JUMP,	/* jump_dg, goto_tag */
730
	DGA_LJ,		/* long_jump_dg, long_jump_tag, goto_lv_tag,
731
			   return_to_label_tag, tail_call_tag */
732
	DGA_BEG,	/* statement_part_dg */
733
	DGA_DEST,	/* destructor_dg */
734
	DGA_RVS,	/* Ada rendevous (various) */
735
	DGA_BAR,	/* barrier_dg */
736
	DGA_DETCH,	/*   detached_dg ? */
737
	DGA_MOVD,	/*    ditto */
738
	DGA_HOIST,	/*  (as MOVD but no ref to it) */
739
	DGA_OPTIM,	/*   optimisation_dg ? */
2 7u83 740
 
7 7u83 741
	DGA_PRC,	/* used when outputting proc */
742
	DGA_REMVAL	/* removed assign constants */
2 7u83 743
} dg_info_key;
744
 
7 7u83 745
struct dg_info_t {
746
	dg_info_key	key;
747
	union {
748
		struct {
749
			dg_name_list	args;
750
			exp		o_env;
751
			long		b_start;
752
		} i_param;
753
		struct {
754
			bool		is_tag;
755
			union {
756
				dg_tag	comp_tag;
757
				long	comp_lang;
758
			} corl;
759
			long		lo_pc;
760
			long		hi_pc;
761
		} i_comp;
762
		struct {
763
			bool		is_stmt;
764
			short_sourcepos	startpos;
765
			short_sourcepos	endpos;
766
			long		start;
767
			long		end;
768
		} i_src;
769
		struct {
770
			char		*lexname;
771
			short_sourcepos	lexpos;
772
			short_sourcepos	endpos;
773
			long		start;
774
			long		begin_st;
775
			long		end;
776
		} i_scope;
777
		struct {
778
			dg_name		dnam;
779
			long		scope_start;
780
		} i_nam;
781
		struct {
782
			dg_type		w_typ;
783
			exp		w_exp;
784
			long		lo_pc;
785
			long		hi_pc;
786
		} i_with;
787
		struct {
788
			char		*clnam;
789
			short_sourcepos	pos;
790
			int		ck;
791
			long		brk;
792
			dg_where	p;
793
		} i_call;
794
		struct {
795
			dg_tag		proc;
796
			dg_name_list	args;
797
			int		ck;
798
			long		lo_pc;
799
			long		hi_pc;
800
			dg_info		resref;
801
		} i_inl;
802
		struct {
803
			dg_tag		call;
804
			long		brk;
805
			dg_where	res;
806
			dg_info		next;
807
		} i_res;
808
		struct {
809
			dg_tag_list	hl;
810
			long		lo_pc;
811
			long		hi_pc;
812
		} i_try;
813
		struct {
814
			dg_name		ex;
815
			long		lo_pc;
816
			long		hi_pc;
817
		} i_catch;
818
		struct {
819
			short_sourcepos	pos;
820
			dg_type		x_typ;
821
			exp		x_val;
822
		} i_raise;
823
		struct {
824
			short_sourcepos	pos;
825
			long		brk;
826
			exp		val;
827
		} i_dest;
828
		struct {
829
			short_sourcepos	pos;
830
			long		brk;
831
			long		cont;
832
		} i_brn;
833
		struct {
834
			short_sourcepos	pos;
835
			long		brk;
836
			ext_lab		jlab;
837
			long		cont;
838
			int		inv;
839
		} i_tst;
840
		struct {
841
			short_sourcepos	pos;
842
			long		brk;
843
			dg_where	j;
844
		} i_lj;
845
		struct {
846
			short_sourcepos	pos;
847
			dg_tag		entry;
848
			long		lo_pc;
849
			long		hi_pc;
850
		} i_bar;
851
		struct {
852
			long		prc_start;
853
			long		prc_end;
854
			retrec		*returns;
855
			dg_info		p;	/* DGA_PARAMS */
856
			dg_info		barrier;
857
		} i_prc;
858
		struct {
859
			int		rvs_key:8;
860
			int		n_code:2;
861
			int		has_iv:2;
862
			int		holder:1;
863
			int		alt:1;
864
			int		w_abort:1;
865
			int		async:1;
866
			int		kind:16;
867
			short_sourcepos	pos;
868
			long		lo_pc;
869
			long		hi_pc;
870
			union {
871
				dg_tag	tg;
872
				dg_info	iv;
873
			} u;
874
			exp		info_e;
875
			dg_tag		en;
876
			union {
877
				dg_name_list	p;
878
				exp		e;
879
			} u2;
880
		} i_rvs;
881
		dg_tag	i_tg;
882
		struct {
883
			int		posn;	/* pre <0, post >0 */
884
			detch_info	*dl;
885
		} i_detch;
886
		struct {
887
			int		reason;
888
			int		lost;
889
			dg_tag		tg;
890
			long		lo_pc;
891
			long		hi_pc;
892
		} i_movd;
893
		struct {
894
			int		reason;
895
			objset		*objs;
896
			long		lo_pc;
897
			long		hi_pc;
898
		} i_optim;
899
		struct {
900
			exp		var;	/* detached */
901
			exp		val;
902
			long		lo_pc;
903
		} i_remval;
904
	} data;
905
	dg_tag				this_tag;
906
	dg_info				more;
2 7u83 907
};
908
 
909
 
7 7u83 910
typedef enum {
911
	DGK_NONE = 0,
912
	DGK_TYPE,
913
	DGK_NAME,
914
	DGK_INFO,
915
	DGK_COMP,
916
	DGK_CLASSMEM,
917
	DGK_DIM,
918
	DGK_ENUM,
919
	DGK_NAMELIST
2 7u83 920
} dg_tag_key;
921
 
7 7u83 922
typedef struct dg_tag_t {
923
	union
924
	{
925
		dg_type		typ;
926
		dg_name		nam;
927
		dg_info		info;
928
		dg_compilation	comp;
929
		dg_name_list	*nl;
930
	} p;
931
	ext_lab			outref;
932
	long			abstract_lab;
933
	int			key:8;
934
	int			done:1;
935
	int			needed:1;
936
	int			any_inl:1;
937
	dg_tag			copy;
2 7u83 938
#if 0
7 7u83 939
	exp			e;
2 7u83 940
#endif
941
} dgtag_struct;
942
 
943
 
944
typedef string_list dg_idname_list;
945
 
7 7u83 946
typedef enum {
947
	DGM_FN,
948
	DGM_OBJ,
949
	DGM_UNDEF,
950
	DGM_INC
2 7u83 951
} dg_mac_key;
952
 
7 7u83 953
typedef struct {
954
	int		len;
955
	struct dg_mac_t *array;
2 7u83 956
} dg_macro_list;
957
 
7 7u83 958
typedef struct dg_mac_t {
959
	dg_mac_key			key;
960
	short_sourcepos			pos;
961
	union {
962
		struct {
963
			char		*nam;
964
			char		*defn;
965
			string_list	pms;
966
		} d;
967
		struct {
968
			dg_filename	file;
969
			dg_macro_list	macs;
970
		} i;
971
	} u;
2 7u83 972
} dg_macro;
973
 
974
 
7 7u83 975
struct dg_comp_t {
2 7u83 976
  dg_filename		prim_file;
977
  string_list		comp_deps;
978
  long			date;
979
  short			language;
980
  short			id_case;
7 7u83 981
  char			*producer;
2 7u83 982
  dg_filename		comp_dir;
983
  string_list		options;
984
  dg_name_list		dn_list;
985
  dg_macro_list		macros;
986
  dg_compilation	another;
987
};
988
 
989
 
7 7u83 990
typedef struct {
991
	int	present;
992
	bool	val;
2 7u83 993
} bool_option;
994
 
7 7u83 995
typedef struct {
996
	int	present;
997
	shape	val;
2 7u83 998
} shape_option;
999
 
7 7u83 1000
typedef struct {
1001
  int			present;
1002
  struct tok_define_t	*val;
2 7u83 1003
} token_option;
1004
 
1005
 
1006
typedef int dg_comp_props;
1007
typedef int dg_append;
1008
typedef dg_append dg_append_list;
1009
 
1010
 
1011
#endif