00001 #ifndef stab_INCLUDED
00002 #define stab_INCLUDED
00003
00004 #ifdef _NEW_SYMTAB
00005 #ifdef __cplusplus
00006 #include "symtab.h"
00007 #endif
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #define Enter_ST(s)
00047 #define ST_can_use_reg_align(s) FALSE
00048 #define Enter_TY(s)
00049
00050 #else
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 struct wn;
00097 struct tcon;
00098 struct einfo;
00099 struct symexpr;
00100 struct inito;
00101
00102 #include "mtypes.h"
00103
00104
00105 typedef struct st ST;
00106 typedef ST* ST_IDX;
00107 typedef UINT32 LABEL_IDX;
00108 typedef struct stch STCH;
00109 typedef struct sblk SBLK;
00110 typedef struct ty TY;
00111 typedef TY * TY_IDX;
00112 typedef struct tylist TYLIST;
00113 typedef TYLIST* TYLIST_IDX;
00114 typedef struct fld FLD;
00115 typedef struct fld * FLD_IDX;
00116 typedef struct ari ARI;
00117 typedef struct arb ARB;
00118 typedef struct arb * ARB_IDX;
00119 typedef struct symtab SYMTAB;
00120 typedef SYMTAB* SYMTAB_IDX;
00121 typedef struct enum_const ENUM_CONST;
00122 typedef struct fti FTI;
00123 typedef struct tcon *TCON_IDX;
00124
00125
00126
00127 inline TY_IDX
00128 Get_TY (TY_IDX x) { return x; }
00129 #define Get_ST(x) (x)
00130 #define ST_st_idx(x) (x)
00131 #define Get_ARB(x) (x)
00132 #define Get_FLD(x) (x)
00133
00134 #include "aux_stab.h"
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 #ifndef CAN_USE_ARB
00165 #define CAN_USE_ARB(a) (a)
00166 #endif
00167
00168 #ifndef CAN_USE_STCH
00169 #define CAN_USE_STCH(a) (a)
00170 #endif
00171
00172 #ifndef CAN_USE_TY
00173 #define CAN_USE_TY(a) (a)
00174 #endif
00175
00176 #ifndef CAN_USE_TYLIST
00177 #define CAN_USE_TYLIST(a) (a)
00178 #endif
00179
00180 #ifndef CAN_USE_FLD
00181 #define CAN_USE_FLD(a) (a)
00182 #endif
00183
00184 #ifndef CAN_USE_MBR
00185 #define CAN_USE_MBR(a) (a)
00186 #endif
00187
00188 #ifndef CAN_USE_ENUM_CONST
00189 #define CAN_USE_ENUM_CONST(a) (a)
00190 #endif
00191
00192 #ifndef CAN_USE_ST
00193 #define CAN_USE_ST(a) (a)
00194 #endif
00195
00196
00197
00198
00199
00200
00201
00202 #if defined(Is_True_On) && !(defined(FRONT_END_C) || defined(FRONT_END_CPLUSPLUS))
00203 extern INT16 Is_Valid_Dim ( const TY *ty, INT16 i);
00204 #define IS_VALID_DIM(ty, i) Is_Valid_Dim(ty,i)
00205 #else
00206 #define IS_VALID_DIM(ty, i) (i)
00207 #endif
00208
00209
00210 #ifdef Is_True_On
00211 extern void CHECK_KIND_func(const TY *,UINT16);
00212 extern void CHECK_KIND2_func(const TY *,UINT16,UINT16);
00213 # define CHECK_KIND(s,k) (CHECK_KIND_func(s,k),s)
00214 # define CHECK_KIND2(s,k,kk) (CHECK_KIND2_func(s,k,kk),s)
00215 #else
00216 # define CHECK_KIND(s,k) (s)
00217 # define CHECK_KIND2(s,k,kk) (s)
00218 #endif
00219
00220 #define KIND_IS_SCALAR(s) CHECK_KIND(s,KIND_SCALAR)
00221 #define KIND_IS_ARRAY(s) CHECK_KIND(s,KIND_ARRAY)
00222 #define KIND_IS_STRUCT(s) CHECK_KIND(s,KIND_STRUCT)
00223 #define KIND_IS_ENUM(s) CHECK_KIND(s,KIND_ENUM)
00224 #define KIND_IS_POINTER(s) CHECK_KIND(s,KIND_POINTER)
00225 #define KIND_IS_FUNCTION(s) CHECK_KIND(s,KIND_FUNCTION)
00226 #define KIND_IS_CLASS(s) CHECK_KIND(s,KIND_CLASS)
00227 #define KIND_IS_STRUCT_CLASS(s) CHECK_KIND2(s,KIND_STRUCT,KIND_CLASS)
00228 #define KIND_IS_SCALAR_OR_POINTER(s) CHECK_KIND2(s,KIND_SCALAR,KIND_POINTER)
00229
00230
00231
00232
00233
00234
00235 #ifdef Is_True_On
00236
00237 extern ST *CHECK_SCLASS_func (ST *, INT16 );
00238 extern ST *CHECK_CLASS2_func (ST *, INT16, INT16 );
00239 extern ST *CHECK_CLASS3_func (ST *, INT16, INT16, INT16 );
00240 extern ST *CHECK_CLASS_func ( const ST *, INT16 );
00241
00242 # define CHECK_SCLASS(s,c) CHECK_SCLASS_func(s,c)
00243 # define CHECK_CLASS2(s,c1,c2) CHECK_CLASS2_func(s,c1,c2)
00244 # define CHECK_CLASS3(s,c1,c2,c3) CHECK_CLASS3_func(s,c1,c2,c3)
00245 # define CHECK_CLASS(s,c) CHECK_CLASS_func(s,c)
00246
00247 #else
00248
00249 # define CHECK_SCLASS(s,c) (s)
00250 # define CHECK_CLASS2(s,c1,c2) (s)
00251 # define CHECK_CLASS3(s,c1,c2,c3) (s)
00252 # define CHECK_CLASS(s,c) (s)
00253
00254 #endif
00255
00256 #define SCLASS_IS_LOCAL(s) CHECK_SCLASS(s,SCLASS_LOCAL)
00257 #define SCLASS_IS_SAVED(s) CHECK_SCLASS(s,SCLASS_SAVED)
00258 #define SCLASS_IS_COMMON(s) CHECK_SCLASS(s,SCLASS_COMMON)
00259 #define SCLASS_IS_EXTERN(s) CHECK_SCLASS(s,SCLASS_EXTERN)
00260 #define SCLASS_IS_STATIC (s) CHECK_SCLASS(s,SCLASS_STATIC)
00261 #define SCLASS_IS_DEFINED(s) CHECK_SCLASS(s,SCLASS_DEFINED)
00262
00263 #define CLASS_IS_VAR(s) CHECK_CLASS(s,CLASS_VAR)
00264 #define CLASS_IS_FUNC(s) CHECK_CLASS(s,CLASS_FUNC)
00265 #define CLASS_IS_CONST(s) CHECK_CLASS(s,CLASS_CONST)
00266 #define CLASS_IS_LABEL(s) CHECK_CLASS(s,CLASS_LABEL)
00267 #define CLASS_IS_SYM_CONST(s) CHECK_CLASS(s,CLASS_SYM_CONST)
00268 #define CLASS_IS_INTR(s) CHECK_CLASS(s,CLASS_INTR)
00269 #define CLASS_IS_PREG(s) CHECK_CLASS(s,CLASS_PREG)
00270 #define CLASS_IS_BLOCK(s) CHECK_CLASS(s,CLASS_BLOCK)
00271 #define CLASS_IS_VAR_UNK(s) CHECK_CLASS2(s,CLASS_VAR,CLASS_UNK)
00272 #define CLASS_IS_FUNC_UNK(s) CHECK_CLASS2(s,CLASS_FUNC,CLASS_UNK)
00273 #define CLASS_IS_VAR_FUNC(s) CHECK_CLASS2(s,CLASS_VAR,CLASS_FUNC)
00274 #define CLASS_IS_VAR_CONST(s) \
00275 CHECK_CLASS3(s,CLASS_VAR,CLASS_CONST,CLASS_SYM_CONST)
00276 #define CLASS_IS_VAR_BLOCK(s) CHECK_CLASS2(s,CLASS_VAR,CLASS_BLOCK)
00277 #define CLASS_IS_CONST_SYM(s) CHECK_CLASS2(s,CLASS_CONST,CLASS_SYM_CONST)
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297 struct fld {
00298 char *name;
00299 struct ty *type;
00300 mINT64 ofst;
00301 mUINT8 bsize;
00302 mUINT8 bofst;
00303 mUINT16 flags;
00304 FLD *next;
00305 };
00306
00307 #define FLD_name(fld) ((CAN_USE_FLD(fld))->name)
00308 #define FLD_type(fld) ((CAN_USE_FLD(fld))->type)
00309 #define FLD_ofst(fld) ((CAN_USE_FLD(fld))->ofst)
00310 #define FLD_bsize(fld) ((CAN_USE_FLD(fld))->bsize)
00311 #define FLD_bofst(fld) ((CAN_USE_FLD(fld))->bofst)
00312 #define FLD_flags(fld) ((CAN_USE_FLD(fld))->flags)
00313 #define FLD_next(fld) ((CAN_USE_FLD(fld))->next)
00314
00315 #define FLD_SET_ONCE 0x0010
00316 #define FLD_EQUIVALENCE 0x0020
00317
00318
00319
00320 #define FLD_BEGIN_UNION 0x0040
00321 #define FLD_END_UNION 0x0080
00322 #define FLD_BEGIN_MAP 0x0100
00323 #define FLD_END_MAP 0x0200
00324 #define FLD_BIT_FIELD 0x0400
00325
00326 #define FLD_is_set_once(m) ((FLD_flags(m)) & FLD_SET_ONCE)
00327 #define Set_FLD_is_set_once(m) ((FLD_flags(m)) |= FLD_SET_ONCE)
00328 #define Reset_FLD_is_set_once(m) ((FLD_flags(m)) &= ~FLD_SET_ONCE)
00329 #define FLD_is_equivalence(m) ((FLD_flags(m)) & FLD_EQUIVALENCE)
00330 #define Set_FLD_is_equivalence(m) ((FLD_flags(m)) |= FLD_EQUIVALENCE)
00331 #define Reset_FLD_is_equivalence(m) ((FLD_flags(m)) &= ~FLD_EQUIVALENCE)
00332 #define FLD_is_begin_union(m) ((FLD_flags(m)) & FLD_BEGIN_UNION)
00333 #define Set_FLD_is_begin_union(m) ((FLD_flags(m)) |= FLD_BEGIN_UNION)
00334 #define Reset_FLD_is_begin_union(m) ((FLD_flags(m)) &= ~FLD_BEGIN_UNION)
00335 #define FLD_is_end_union(m) ((FLD_flags(m)) & FLD_END_UNION)
00336 #define Set_FLD_is_end_union(m) ((FLD_flags(m)) |= FLD_END_UNION)
00337 #define Reset_FLD_is_end_union(m) ((FLD_flags(m)) &= ~FLD_END_UNION)
00338 #define FLD_is_begin_map(m) ((FLD_flags(m)) & FLD_BEGIN_MAP)
00339 #define Set_FLD_is_begin_map(m) ((FLD_flags(m)) |= FLD_BEGIN_MAP)
00340 #define Reset_FLD_is_begin_map(m) ((FLD_flags(m)) &= ~FLD_BEGIN_MAP)
00341 #define FLD_is_end_map(m) ((FLD_flags(m)) & FLD_END_MAP)
00342 #define Set_FLD_is_end_map(m) ((FLD_flags(m)) |= FLD_END_MAP)
00343 #define Reset_FLD_is_end_map(m) ((FLD_flags(m)) &= ~FLD_END_MAP)
00344 #define FLD_is_bit_field(m) ((FLD_flags(m)) & FLD_BIT_FIELD)
00345 #define Set_FLD_is_bit_field(m) ((FLD_flags(m)) |= FLD_BIT_FIELD)
00346 #define Reset_FLD_is_bit_field(m) ((FLD_flags(m)) &= ~FLD_BIT_FIELD)
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368 typedef FLD MBR;
00369
00370
00371 #define MBR_name(mbr) FLD_name(mbr)
00372 #define MBR_ofst(mbr) FLD_ofst(mbr)
00373 #define MBR_type(mbr) FLD_type(mbr)
00374 #define MBR_next(mbr) FLD_next(mbr)
00375 #define MBR_flags(mbr) FLD_flags(mbr)
00376
00377
00378 #define MBR_STATIC 0x0001
00379 #define MBR_VIRTUAL 0x0002
00380 #define MBR_FUNCTION 0x0004
00381 #define MBR_BASE 0x0008
00382
00383 #define MBR_BIT_FIELD 0x0400
00384
00385
00386 #define MBR_static(m) ((MBR_flags(m)) & MBR_STATIC)
00387 #define Set_MBR_static(m) ((MBR_flags(m)) |= MBR_STATIC)
00388 #define Reset_MBR_static(m) ((MBR_flags(m)) &= ~MBR_STATIC)
00389 #define MBR_virtual(m) ((MBR_flags(m)) & MBR_VIRTUAL)
00390 #define Set_MBR_virtual(m) ((MBR_flags(m)) |= MBR_VIRTUAL)
00391 #define Reset_MBR_virtual(m) ((MBR_flags(m)) &= ~MBR_VIRTUAL)
00392 #define MBR_function(m) ((MBR_flags(m)) & MBR_FUNCTION)
00393 #define Set_MBR_function(m) ((MBR_flags(m)) |= MBR_FUNCTION)
00394 #define Reset_MBR_function(m) ((MBR_flags(m)) &= ~MBR_FUNCTION)
00395 #define MBR_base(m) ((MBR_flags(m)) & MBR_BASE)
00396 #define Set_MBR_base(m) ((MBR_flags(m)) |= MBR_BASE)
00397 #define Reset_MBR_base(m) ((MBR_flags(m)) &= ~MBR_BASE)
00398 #define MBR_is_bit_field(m) ((MBR_flags(m)) & MBR_BIT_FIELD)
00399 #define Set_MBR_is_bit_field(m) ((MBR_flags(m)) |= MBR_BIT_FIELD)
00400 #define Reset_MBR_is_bit_field(m) ((MBR_flags(m)) &= ~MBR_BIT_FIELD)
00401
00402
00403
00404
00405
00406
00407
00408
00409 #define MBR_DYNAMIC_OFST INT32_MIN
00410 #define MBR_NO_OFST INT32_MIN+1
00411 #define MBR_VALID_OFST INT32_MIN+2
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425 typedef FLD COMP;
00426
00427 #define COMP_fld(c) ((FLD) c)
00428 #define COMP_mbr(c) ((MBR) c)
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447 struct enum_const {
00448 char *name;
00449 mINT64 val;
00450 struct enum_const *next;
00451 };
00452
00453 #define ENUM_CONST_name(f) ((CAN_USE_ENUM_CONST(f))->name)
00454 #define ENUM_CONST_val(f) ((CAN_USE_ENUM_CONST(f))->val)
00455 #define ENUM_CONST_next(f) ((CAN_USE_ENUM_CONST(f))->next)
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478 struct arb {
00479 mBOOL const_lbnd;
00480 mBOOL const_ubnd;
00481 mBOOL const_stride;
00482 union {
00483 mINT64 lbnd_val;
00484 struct wn *lbnd_tree;
00485 } lbnd;
00486 union {
00487 mINT64 ubnd_val;
00488 struct wn *ubnd_tree;
00489 } ubnd;
00490 union {
00491 mINT64 stride_val;
00492 struct wn *stride_tree;
00493 } stride;
00494 };
00495
00496 #define ARB_const_lbnd(a) ((CAN_USE_ARB(a)).const_lbnd)
00497 #define ARB_lbnd_val(a) ((CAN_USE_ARB(a)).lbnd.lbnd_val)
00498 #define ARB_lbnd_tree(a) ((CAN_USE_ARB(a)).lbnd.lbnd_tree)
00499 #define ARB_const_ubnd(a) ((CAN_USE_ARB(a)).const_ubnd)
00500 #define ARB_ubnd_val(a) ((CAN_USE_ARB(a)).ubnd.ubnd_val)
00501 #define ARB_ubnd_tree(a) ((CAN_USE_ARB(a)).ubnd.ubnd_tree)
00502 #define ARB_const_stride(a) ((CAN_USE_ARB(a)).const_stride)
00503 #define ARB_stride_val(a) ((CAN_USE_ARB(a)).stride.stride_val)
00504 #define ARB_stride_tree(a) ((CAN_USE_ARB(a)).stride.stride_tree)
00505
00506 struct ari {
00507 struct ty *etype;
00508 mINT16 ndims;
00509 mBOOL const_zofst;
00510 union {
00511 mINT64 zofst_val;
00512 struct wn *zofst_tree;
00513 } zofst;
00514 ARB bnds[1];
00515 };
00516
00517 #define ARI_etype(a) ((a)->etype)
00518 #define ARI_ndims(a) ((a)->ndims)
00519 #define ARI_const_zofst(a) ((a)->const_zofst)
00520 #define ARI_zofst_val(a) ((a)->zofst.zofst_val)
00521 #define ARI_zofst_tree(a) ((a)->zofst.zofst_tree)
00522 #define ARI_bnds(a) ((a)->bnds)
00523 #define ARI_bnd(a,i) ((a)->bnds[i])
00524
00525 struct tylist {
00526 TY *item;
00527 struct tylist *next;
00528 };
00529
00530 #define TYLIST_item(s) ((CAN_USE_TYLIST(s))->item)
00531 #define TYLIST_next(s) ((CAN_USE_TYLIST(s))->next)
00532
00533
00534
00535
00536
00537
00538 struct fti {
00539 struct tylist *parms;
00540 struct ty *ret_type;
00541 mINT32 arg_area_size;
00542
00543
00544 };
00545 #define FTI_parms(s) ((s)->parms)
00546 #define FTI_ret_type(s) ((s)->ret_type)
00547 #define FTI_arg_area_size(s) ((s)->arg_area_size)
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594 typedef enum {
00595 KIND_INVALID,
00596 KIND_SCALAR,
00597 KIND_ARRAY,
00598 KIND_STRUCT,
00599 KIND_ENUM,
00600 KIND_POINTER,
00601 KIND_FUNCTION,
00602 KIND_VOID,
00603 KIND_CLASS,
00604 KIND_LAST
00605 } TY_KIND;
00606
00607
00608 extern BOOL Is_Simple_Type ( TY_IDX );
00609 extern BOOL Is_Structure_Type ( TY_IDX );
00610 extern BOOL Is_Composite_Type ( TY_IDX );
00611
00612
00613 #define KIND_QUALIFIED 0x0080
00614
00615
00616
00617
00618 struct ty {
00619 mINT64 size;
00620
00621
00622
00623 mUINT32 flags;
00624 mUINT32 id;
00625 mUINT8 kind;
00626 mUINT8 btype;
00627 mUINT16 align;
00628 char *name;
00629 union {
00630 ENUM_CONST *ec_list;
00631 FLD *flist;
00632 MBR *mlist;
00633 COMP *clist;
00634 ARI *arinfo;
00635 struct ty *pointed;
00636 struct fti *ftinfo;
00637 } spec_type_info;
00638
00639
00640 struct ty *pointer;
00641 struct ty *next;
00642 };
00643
00644 #define TY_GLOBAL 0x0001
00645 #define TY_CHARACTER 0x0002
00646 #define TY_DYNAMIC 0x0004
00647 #define TY_RETURN_TO_PARAM 0x0008
00648 #define TY_VARARGS 0x0010
00649 #define TY_PROTOTYPED 0x0020
00650 #define TY_REFERENCED 0x0040
00651 #define TY_THUNK 0x0080
00652 #define TY_VOLATILE 0x0100
00653 #define TY_CONST 0x0200
00654
00655 #define TY_RESTRICT 0x1000
00656 #define TY_QUALIFIED 0x1300
00657 #define TY_LOGICAL 0x0400
00658 #define TY_UNION 0x0800
00659 #define TY_LONG 0x1000
00660 #define TY_TRANSLATED_TO_C 0x2000
00661 #define TY_PACKED 0x4000
00662 #define TY_PTR_AS_ARRAY 0x8000
00663 #define TY_ANONYMOUS 0x10000
00664 #define TY_SPLIT 0x20000
00665
00666 #define TY_LAST_IN_SPLIT 0x40000
00667
00668 #define TY_ENTERED 0x80000
00669 #define TY_F90_POINTER 0x100000
00670 #define TY_F90_TARGET 0x200000
00671 #define TY_NOT_IN_UNION 0x40000
00672
00673 #define TY_NO_ANSI_ALIAS TY_VARARGS
00674
00675 #define TY_kind(s) (CAN_USE_TY(s)->kind)
00676 #define TY_size(s) (CAN_USE_TY(s)->size)
00677 #define TY_align(s) (CAN_USE_TY(s)->align)
00678 #define TY_flags(s) (CAN_USE_TY(s)->flags)
00679 #define TY_id(s) (CAN_USE_TY(s)->id)
00680 #define TY_next(s) (CAN_USE_TY(s)->next)
00681 #define TY_name(s) (CAN_USE_TY(s)->name)
00682 #define TY_btype(s) (CAN_USE_TY(s)->btype)
00683 #define TY_mtype(s) TY_btype(s)
00684
00685 #define Set_TY_kind(t,v) (TY_kind(t) = v)
00686 #define Set_TY_size(t,v) (TY_size(t) = v)
00687 #define Set_TY_align(t,v) (TY_align(t) = v)
00688 #define Set_TY_name(t,v) (TY_name(t) = v)
00689
00690 #define TY_is_global(s) (TY_flags(s) & TY_GLOBAL)
00691 #define Set_TY_is_global(s) (TY_flags(s) |= TY_GLOBAL)
00692 #define Reset_TY_is_global(s) (TY_flags(s) &= ~TY_GLOBAL)
00693 #define TY_is_character(s) (TY_flags(s) & TY_CHARACTER)
00694 #define Set_TY_is_character(s) (TY_flags(s) |= TY_CHARACTER)
00695 #define Reset_TY_is_character(s) (TY_flags(s) &= ~TY_CHARACTER)
00696 #define TY_is_dynamic(s) (TY_flags(s) & TY_DYNAMIC)
00697 #define Set_TY_is_dynamic(s) (TY_flags(s) |= TY_DYNAMIC)
00698 #define Reset_TY_is_dynamic(s) (TY_flags(s) &= ~TY_DYNAMIC)
00699 #define TY_return_to_param(s) (TY_flags(s) & TY_RETURN_TO_PARAM)
00700 #define Set_TY_return_to_param(s) (TY_flags(s) |= TY_RETURN_TO_PARAM)
00701 #define Reset_TY_return_to_param(s) (TY_flags(s) &= ~TY_RETURN_TO_PARAM)
00702 #define TY_is_varargs(s) (TY_flags(s) & TY_VARARGS)
00703 #define Set_TY_is_varargs(s) (TY_flags(s) |= TY_VARARGS)
00704 #define Reset_TY_is_varargs(s) (TY_flags(s) &= ~TY_VARARGS)
00705 #define TY_has_prototype(s) (TY_flags(s) & TY_PROTOTYPED)
00706 #define Set_TY_has_prototype(s) (TY_flags(s) |= TY_PROTOTYPED)
00707 #define Reset_TY_has_prototype(s) (TY_flags(s) &= ~TY_PROTOTYPED)
00708 #define TY_is_thunk(s) (TY_flags(s) & TY_THUNK)
00709 #define Set_TY_is_thunk(s) (TY_flags(s) |= TY_THUNK)
00710 #define Reset_TY_is_thunk(s) (TY_flags(s) &= ~TY_THUNK)
00711 #define TY_is_referenced(s) (TY_flags(s) & TY_REFERENCED)
00712 #define Set_TY_is_referenced(s) (TY_flags(s) |= TY_REFERENCED)
00713 #define Reset_TY_is_referenced(s) (TY_flags(s) &= ~TY_REFERENCED)
00714 #define TY_is_volatile(s) (TY_flags(s) & TY_VOLATILE)
00715 #define Set_TY_is_volatile(s) (TY_flags(s) |= TY_VOLATILE)
00716 #define Reset_TY_is_volatile(s) (TY_flags(s) &= ~TY_VOLATILE)
00717 #define TY_is_const(s) (TY_flags(s) & TY_CONST)
00718 #define Set_TY_is_const(s) (TY_flags(s) |= TY_CONST)
00719 #define Reset_TY_is_const(s) (TY_flags(s) &= ~TY_CONST)
00720 #define TY_is_restrict(s) (TY_flags(s) & TY_RESTRICT)
00721 #define Set_TY_is_restrict(s) (TY_flags(s) |= TY_RESTRICT)
00722 #define Reset_TY_is_restrict(s) (TY_flags(s) &= ~TY_RESTRICT)
00723 #define TY_is_qualified(s) (TY_flags(s) & TY_QUALIFIED)
00724 #define TY_is_logical(s) (TY_flags(s) & TY_LOGICAL)
00725 #define Set_TY_is_logical(s) (TY_flags(s) |= TY_LOGICAL)
00726 #define Reset_TY_is_logical(s) (TY_flags(s) &= ~TY_LOGICAL)
00727 #define TY_is_union(s) (TY_flags(s) & TY_UNION)
00728 #define Set_TY_is_union(s) (TY_flags(s) |= TY_UNION)
00729 #define Reset_TY_is_union(s) (TY_flags(s) &= ~TY_UNION)
00730 #define TY_is_long(s) (TY_flags(s) & TY_LONG)
00731 #define Set_TY_is_long(s) (TY_flags(s) |= TY_LONG)
00732 #define Reset_TY_is_long(s) (TY_flags(s) &= ~TY_LONG)
00733 #define TY_is_translated_to_c(s) (TY_flags(s) & TY_TRANSLATED_TO_C)
00734 #define Set_TY_is_translated_to_c(s) (TY_flags(s) |= TY_TRANSLATED_TO_C)
00735 #define Reset_TY_is_translated_to_c(s) (TY_flags(s) &= ~TY_TRANSLATED_TO_C)
00736 #define TY_is_packed(s) (TY_flags(s) & TY_PACKED)
00737 #define Set_TY_is_packed(s) (TY_flags(s) |= TY_PACKED)
00738 #define Reset_TY_is_packed(s) (TY_flags(s) &= ~TY_PACKED)
00739 #define TY_ptr_as_array(s) (TY_flags(s) & TY_PTR_AS_ARRAY)
00740 #define Set_TY_ptr_as_array(s) (TY_flags(s) |= TY_PTR_AS_ARRAY)
00741 #define Reset_TY_ptr_as_array(s) (TY_flags(s) &= ~TY_PTR_AS_ARRAY)
00742 #define TY_anonymous(s) (TY_flags(s) & TY_ANONYMOUS)
00743 #define Set_TY_anonymous(s) (TY_flags(s) |= TY_ANONYMOUS)
00744 #define Reset_TY_anonymous(s) (TY_flags(s) &= ~TY_ANONYMOUS)
00745 #define TY_split(s) (TY_flags(s) & TY_SPLIT)
00746 #define Set_TY_split(s) (TY_flags(s) |= TY_SPLIT)
00747 #define Reset_TY_split(s) (TY_flags(s) &= ~TY_SPLIT)
00748 #define TY_last_in_split(s) (TY_flags(s) & TY_LAST_IN_SPLIT)
00749 #define Set_TY_last_in_split(s) (TY_flags(s) |= TY_LAST_IN_SPLIT)
00750 #define Reset_TY_last_in_split(s) (TY_flags(s) &= ~TY_LAST_IN_SPLIT)
00751 #define TY_entered(s) (TY_flags(s) & TY_ENTERED)
00752 #define Set_TY_entered(s) (TY_flags(s) |= TY_ENTERED)
00753 #define Reset_TY_entered(s) (TY_flags(s) &= ~TY_ENTERED)
00754 #define TY_no_ansi_alias(s) (TY_flags(s) & TY_NO_ANSI_ALIAS)
00755 #define Set_TY_no_ansi_alias(s) (TY_flags(s) |= TY_NO_ANSI_ALIAS)
00756 #define Reset_TY_no_ansi_alias(s) (TY_flags(s) &= ~TY_NO_ANSI_ALIAS)
00757 #define TY_is_f90_pointer(s) (TY_flags(s) & TY_F90_POINTER)
00758 #define Set_TY_is_f90_pointer(s) (TY_flags(s) |= TY_F90_POINTER)
00759 #define Reset_TY_is_f90_pointer(s) (TY_flags(s) &= ~TY_F90_POINTER)
00760 #define TY_is_f90_target(s) (TY_flags(s) & TY_F90_TARGET)
00761 #define Set_TY_is_f90_target(s) (TY_flags(s) |= TY_F90_TARGET)
00762 #define Reset_TY_is_f90_target(s) (TY_flags(s) &= ~TY_F90_TARGET)
00763 #define TY_not_in_union(s) (TY_flags(s) & TY_NOT_IN_UNION)
00764 #define Set_TY_not_in_union(s) (TY_flags(s) |= TY_NOT_IN_UNION)
00765 #define Reset_TY_not_in_union(s) (TY_flags(s) &= ~TY_NOT_IN_UNION)
00766
00767 #define TY_enum_const_list(s) (KIND_IS_SCALAR(s)->spec_type_info.ec_list)
00768 #define TY_flist(s) (KIND_IS_STRUCT(s)->spec_type_info.flist)
00769 #define TY_fld(s) (KIND_IS_STRUCT(s)->spec_type_info.flist)
00770 #define TY_mlist(s) (KIND_IS_CLASS(s)->spec_type_info.mlist)
00771 #define TY_clist(s) (KIND_IS_STRUCT_CLASS(s)->spec_type_info.clist)
00772 #define TY_arinfo(s) (KIND_IS_ARRAY(s)->spec_type_info.arinfo)
00773 #define TY_pointed(s) (KIND_IS_POINTER(s)->spec_type_info.pointed)
00774 #define TY_ftinfo(s) (KIND_IS_FUNCTION(s)->spec_type_info.ftinfo)
00775 #define TY_parms(s) (FTI_parms(TY_ftinfo(s)))
00776 #define TY_ret_type(s) (FTI_ret_type(TY_ftinfo(s)))
00777 #define TY_arg_area_size(s) (FTI_arg_area_size(TY_ftinfo(s)))
00778
00779 #define TY_AR_etype(s) (ARI_etype(TY_arinfo(s)))
00780 #define TY_etype(t) TY_AR_etype(t)
00781 #define TY_AR_ndims(s) (ARI_ndims(TY_arinfo(s)))
00782 #define TY_AR_const_zofst(s) (ARI_const_zofst(TY_arinfo(s)))
00783 #define TY_AR_zofst_val(s) (ARI_zofst_val(TY_arinfo(s)))
00784 #define TY_AR_zofst_tree(s) (ARI_zofst_tree(TY_arinfo(s)))
00785 #define TY_AR_bnds(s,i) (ARI_bnd(TY_arinfo(s),IS_VALID_DIM((s),(i))))
00786 #define TY_AR_const_stride(s,i) (ARB_const_stride(TY_AR_bnds(s,i)))
00787 #define TY_AR_stride_val(s,i) (ARB_stride_val(TY_AR_bnds(s,i)))
00788 #define TY_AR_stride_tree(s,i) (ARB_stride_tree(TY_AR_bnds(s,i)))
00789 #define TY_AR_const_lbnd(s,i) (ARB_const_lbnd(TY_AR_bnds(s,i)))
00790 #define TY_AR_lbnd_val(s,i) (ARB_lbnd_val(TY_AR_bnds(s,i)))
00791 #define TY_AR_lbnd_tree(s,i) (ARB_lbnd_tree(TY_AR_bnds(s,i)))
00792 #define TY_AR_const_ubnd(s,i) (ARB_const_ubnd(TY_AR_bnds(s,i)))
00793 #define TY_AR_ubnd_val(s,i) (ARB_ubnd_val(TY_AR_bnds(s,i)))
00794 #define TY_AR_ubnd_tree(s,i) (ARB_ubnd_tree(TY_AR_bnds(s,i)))
00795
00796 #define TY_AR_const_fbnd(s,i) TY_AR_const_lbnd(s,i)
00797 #define TY_AR_fbnd_val(s,i) TY_AR_lbnd_val(s,i)
00798 #define TY_AR_fbnd_tree(s,i) TY_AR_lbnd_tree(s,i)
00799 #define TY_AR_const_tbnd(s,i) TY_AR_const_ubnd(s,i)
00800 #define TY_AR_tbnd_val(s,i) TY_AR_ubnd_val(s,i)
00801 #define TY_AR_tbnd_tree(s,i) TY_AR_ubnd_tree(s,i)
00802
00803 #define TY_pointer(s) (CAN_USE_TY(s)->pointer)
00804
00805
00806
00807
00808 #define TY_DYNAMIC_SIZE -1
00809 #define TY_DYNAMIC_ALIGN 0
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836 typedef enum {
00837 CLASS_BAD,
00838 CLASS_NEW,
00839 CLASS_UNK,
00840
00841
00842 CLASS_VAR,
00843 CLASS_FUNC,
00844 CLASS_CONST,
00845 CLASS_LABEL,
00846 CLASS_SYM_CONST,
00847 CLASS_PREG,
00848 CLASS_BLOCK,
00849 CLASS_COUNT
00850 } ST_CLASS;
00851
00852
00853 #define CLASS_MASK 0x0f
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864 typedef enum {
00865 EXPORT_LOCAL,
00866 EXPORT_INTERNAL,
00867
00868
00869 EXPORT_HIDDEN,
00870
00871
00872
00873 EXPORT_PROTECTED,
00874 EXPORT_PREEMPTIBLE,
00875 EXPORT_OPTIONAL,
00876 EXPORT_COUNT
00877 } ST_EXPORT;
00878
00879
00880
00881
00882
00883
00884
00885 #define EXPORT_MASK 0x07
00886
00887
00888 #define ST_is_preemptible(s) \
00889 (ST_export(s) == EXPORT_PREEMPTIBLE || ST_export(s) == EXPORT_OPTIONAL)
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961 typedef enum {
00962 SCLASS_UNKNOWN,
00963 SCLASS_AUTO,
00964 SCLASS_TEMP_OBSOLETE,
00965 SCLASS_ACTUAL,
00966 SCLASS_FORMAL,
00967 SCLASS_PSTATIC,
00968 SCLASS_FSTATIC,
00969
00970 SCLASS_THREAD,
00971 SCLASS_COMMON,
00972 SCLASS_EXTERN,
00973 SCLASS_UGLOBAL,
00974
00975
00976
00977 SCLASS_DGLOBAL,
00978
00979 SCLASS_TEXT,
00980 SCLASS_BASED,
00981 SCLASS_REG,
00982 SCLASS_FORMAL_REF,
00983 SCLASS_LAST
00984 } ST_SCLASS;
00985
00986 #define SCLASS_MASK 0x0f
00987 #define SCLASS_LOCAL SCLASS_AUTO
00988 #define SCLASS_SAVED SCLASS_FSTATIC
00989 #define SCLASS_STATIC SCLASS_UGLOBAL
00990 #define SCLASS_DEFINED SCLASS_DGLOBAL
00991 #define SCLASS_TEMP SCLASS_AUTO
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025 typedef enum {
01026 AFORM_MEM = 0x00,
01027 AFORM_UNUSED = 0x02,
01028 AFORM_REG = 0x04,
01029 AFORM_RADICAL = 0x06,
01030 AFORM_MASK = 0x06
01031 } ST_AFORM;
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045 #define STFL_CFORM 0x10
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055 struct sblk {
01056 mINT64 size;
01057 mUINT16 align;
01058 mINT16 temp;
01059 mUINT8 gp_group;
01060 mUINT64 section_idx;
01061 };
01062 struct stch {
01063 ST *item;
01064 struct stch *next;
01065 };
01066 #define STCH_item(s) ((CAN_USE_STCH(s))->item)
01067 #define STCH_next(s) ((CAN_USE_STCH(s))->next)
01068
01069
01070
01071
01072
01073
01074
01075 struct st {
01076 mINT64 ofst;
01077 union {
01078 struct tcon *tcon;
01079 char *name;
01080 } id;
01081 ST_CLASS symclass :8;
01082 ST_SCLASS sclass :8;
01083 mUINT8 level;
01084 mUINT8 scope_id;
01085 union {
01086 mINT32 hashval;
01087 mUINT32 index;
01088 } uindex;
01089 mUINT32 symtab_id;
01090 mUINT32 flags;
01091 TY *type;
01092 ST *base;
01093 void* temp;
01094 union {
01095 ST *common;
01096 ST *strong;
01097 ST *formalBase;
01098 mPREG_NUM preg;
01099 } full;
01100 union {
01101 struct {
01102 mUINT32 flags2;
01103 void *address_taken_field_bv;
01104
01105
01106 } vs;
01107 struct {
01108 mUINT32 flags2;
01109 mUINT16 int_reg_used;
01110 mUINT16 float_reg_used;
01111 } fs;
01112 struct {
01113 mUINT32 label_number;
01114 void* ltemp;
01115 } ls;
01116 mINT32 ct_idx;
01117 struct {
01118 INTSC disp;
01119 union {
01120 ST* refsym;
01121 struct symexpr *expr;
01122 } scu;
01123 } scs;
01124 SBLK *block_info;
01125 } uc;
01126 ST *next;
01127 };
01128
01129
01130
01131
01132
01133
01134
01135 #define ST_name(s) (CAN_USE_ST(s)->id.name)
01136 #define Set_ST_name(s,n) (ST_name(s) = n)
01137 #define STC_tcon(s) (CAN_USE_ST(s)->id.tcon)
01138 #define ST_tcon(s) (STC_tcon(s))
01139 #define STC_val(s) (*STC_tcon(s))
01140
01141 #define ST_class(s) (CAN_USE_ST(s)->symclass)
01142 #define ST_symclass(s) (CAN_USE_ST(s)->symclass)
01143 #define ST_sclass(s) (CAN_USE_ST(s)->sclass)
01144 #define Set_ST_sclass(s,c) (ST_sclass(s) = c)
01145 #define Set_ST_classes(s,c,sc) (ST_class(s) = c, ST_sclass(s) = sc)
01146 #define ST_flags(s) (CAN_USE_ST(s)->flags)
01147 #define ST_scope_id(s) (CAN_USE_ST(s)->scope_id)
01148 #define ST_level(s) (CAN_USE_ST(s)->level)
01149 #define ST_index(s) (CAN_USE_ST(s)->uindex.index)
01150 #define ST_hashval(s) (CLASS_IS_CONST_SYM(s)->uindex.hashval)
01151 #define ST_symtab_id(s) (CAN_USE_ST(s)->symtab_id)
01152 #define ST_type(s) (CAN_USE_ST(s)->type)
01153 #define Set_ST_type(s,t) (ST_type(s) = t)
01154 #define ST_btype(s) (TY_btype(ST_type(s)))
01155 #define ST_base(s) (CAN_USE_ST(s)->base)
01156
01157 #define Has_Base_Block(st) (ST_base(st) != st)
01158 #define Set_ST_base(s,b) (ST_base(s) = b)
01159 #define ST_ofst(s) (CAN_USE_ST(s)->ofst)
01160 #define Set_ST_ofst(s,o) (ST_ofst(s) = o)
01161 #define ST_size(s) (TY_size(ST_type(s)))
01162 #define ST_full(s) (CAN_USE_ST(s)->full.common)
01163 #define ST_strong(s) (CAN_USE_ST(s)->full.strong)
01164 #define ST_formal_ref_base(s) (CAN_USE_ST(s)->full.formalBase)
01165 #define ST_formal_preg_no(s) ((s)->full.preg)
01166 #define ST_temp(s) (CAN_USE_ST(s)->temp)
01167 #define Set_ST_temp(s,v) (ST_temp(s) = (void*)v)
01168
01169 #define ST_flags2(s) (CLASS_IS_VAR_FUNC(s)->uc.vs.flags2)
01170 #define STV_flags2(s) (CLASS_IS_VAR(s)->uc.vs.flags2)
01171 #define STV_address_taken_field_bv(s) (CLASS_IS_VAR(s)->uc.vs.address_taken_field_bv)
01172 #define STF_flags2(s) (CLASS_IS_FUNC(s)->uc.fs.flags2)
01173 #define STF_int_reg_used(s) (CLASS_IS_FUNC(s)->uc.fs.int_reg_used)
01174 #define STF_float_reg_used(s) (CLASS_IS_FUNC(s)->uc.fs.float_reg_used)
01175 #define STL_label_number(s) (CLASS_IS_LABEL(s)->uc.ls.label_number)
01176 #define STL_ltemp(s) (CLASS_IS_LABEL(s)->uc.ls.ltemp)
01177 #define Set_STL_ltemp(s,v) (STL_ltemp(s) = (void*)v)
01178 #define STC_ct_idx(s) (CLASS_IS_CONST(s)->uc.ct_idx)
01179 #define STSC_refsym(s) (CLASS_IS_SYM_CONST(s)->uc.scs.scu.refsym)
01180 #define STSC_expr(s) (CLASS_IS_SYM_CONST(s)->uc.scs.scu.expr)
01181 #define STSC_disp(s) (CLASS_IS_SYM_CONST(s)->uc.scs.disp)
01182 #define STB_block_info(s) (CLASS_IS_BLOCK(s)->uc.block_info)
01183 #define STB_size(s) (STB_block_info(s)->size)
01184 #define Set_STB_size(s,v) (STB_block_info(s)->size = v)
01185 #define STB_align(s) (STB_block_info(s)->align)
01186 #define Set_STB_align(s,v) (STB_block_info(s)->align = v)
01187 #define STB_temp(s) (STB_block_info(s)->temp)
01188 #define STB_gp_group(s) (STB_block_info(s)->gp_group)
01189 #define STB_section_idx(s) (STB_block_info(s)->section_idx)
01190 #define Set_STB_section_idx(s,v) (STB_block_info(s)->section_idx = v)
01191 #define ST_next(s) (CAN_USE_ST(s)->next)
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201 #define ST_id(s) \
01202 ((ST_index(s) & 0xffffff) | ((ST_level(s) & 0x7f) << 24))
01203
01204
01205 #define Is_Full_Split_Common(st) \
01206 (ST_sclass(st) == SCLASS_COMMON && ST_full(st) != NULL)
01207 #define ST_is_split_common(st) Is_Full_Split_Common(st)
01208
01209 #define Is_Formal_Preg(st) \
01210 (ST_sclass(st) == SCLASS_FORMAL && ST_formal_preg_no(st) != 0)
01211
01212
01213
01214
01215
01216
01217
01218 #define STFL_WEAK_SYMBOL 0x00000008
01219 #define STFL_WEAK_ALIAS 0x00000010
01220
01221 #define STFL_REFERENCED 0x00000020
01222
01223
01224
01225
01226 #define STFL_NOT_USED 0x00000040
01227
01228
01229 #define STFL_GLOBAL 0x00000080
01230 #define STFL_INITIALIZED 0x00000100
01231
01232 #define STFL_ADDR_TAKEN_SAVED 0x00000200
01233 #define STFL_ADDR_USED_LOCALLY 0x00000400
01234
01235 #define STFL_STATIC_MBR 0x00000800
01236
01237
01238 #define STFL_IS_CONST_VAR 0x00001000
01239 #define STFL_USE_REG_ALIGN 0x00002000
01240
01241 #define STFL_IS_PADDED 0x00004000
01242
01243 #define STFL_IS_RETURN_VAR 0x00008000
01244 #define STFL_IS_VALUE_PARM 0x00010000
01245 #define STFL_PROMOTE_PARM 0x00020000
01246 #define STFL_IS_NOT_ALIASED 0x00040000
01247
01248
01249
01250
01251
01252 #define STFL_GPREL 0x00080000
01253 #define STFL_FORMAL_REF 0x00100000
01254 #define STFL_TEMP_VAR 0x00200000
01255
01256 #define STFL_USE_CPLINIT 0x00400000
01257 #define STFL_IS_RESTRICT 0x00800000
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267 #define STFL_PT_TO_UNIQUE_MEM 0x01000000
01268
01269
01270
01271
01272
01273 #define STFL_ADDR_TAKEN_PASSED 0x02000000
01274 #define STFL_KEEP_NAME_W2F 0x04000000
01275 #define STFL_IS_DATAPOOL 0x08000000
01276 #define STFL_USE_EH_REGION 0x10000000
01277 #define STFL_USE_EH_REGION_SUPP 0x20000000
01278 #define STFL_USE_DISTR_ARRAY 0x40000000
01279 #define STFL_MAY_NOT_BE_ADDR_TAKEN 0x80000000
01280
01281
01282
01283
01284 #define STFL_ADD_NULL 0x00008000
01285
01286
01287 #define STFL_SYM_SIMPLE 0x00008000
01288 #define STFL_SYM_UNIQUE 0x00010000
01289
01290
01291 #define STFL_DECREMENT 0x00000200
01292 #define STFL_WRITE 0x00000400
01293 #define STFL_EXEC 0x00000800
01294 #define STFL_NOBITS 0x00001000
01295 #define STFL_MERGE 0x00002000
01296 #define STFL_ADDR 0x00004000
01297 #define STFL_NAMES 0x00008000
01298
01299 #define STFL_STATIC 0x00010000
01300
01301 #define STFL_SECTION 0x00020000
01302 #define STFL_ROOT_BASE 0x00040000
01303
01304 #define STFL_IS_BASEREG 0x00100000
01305 #define STFL_NOSTRIP 0x00200000
01306
01307
01308 #define STFL_LABEL_ASSIGNED 0x00000200
01309 #define STFL_IN_COMPGOTO_LST 0x00000400
01310 #define STFL_LKIND 0x00003000
01311 #define LKIND_UNK 0x00000000
01312 #define LKIND_FMT 0x00001000
01313 #define LKIND_EXEC 0x00002000
01314 #define LKIND_SPEC 0x00003000
01315 #define LKIND_SHIFT 12
01316 #define STFL_BEGIN_EH_RANGE 0x00010000
01317 #define STFL_END_EH_RANGE 0x00020000
01318 #define STFL_BEGIN_HANDLER 0x00040000
01319 #define STFL_END_HANDLER 0x00080000
01320
01321
01322
01323
01324
01325 #define STFL_PU_IS_LEAF 0x00001000
01326
01327 #define STFL_PU_IS_MAINPU 0x00002000
01328 #define STFL_PU_NO_SIDE_EFFECTS 0x00004000
01329
01330 #define STFL_PU_IS_PURE 0x00008000
01331 #define STFL_PU_RECURSIVE 0x00010000
01332 #define STFL_PU_IS_INLINE_FUNCTION 0x00020000
01333 #define STFL_PU_NEEDS_T9 0x00040000
01334 #define STFL_PU_IS_BLOCKDATA 0x00080000
01335 #define STFL_PU_NO_INLINE 0x00100000
01336 #define STFL_PU_NO_DELETE 0x00200000
01337 #define STFL_PU_HAS_EXC_SCOPES 0x00400000
01338
01339 #define STFL_PU_NO_THROWS 0x00800000
01340
01341
01342
01343
01344
01345 #define STFL_PU_THROWS 0x01000000
01346
01347
01348
01349
01350 #define STFL_PU_IS_NESTED_FUNC 0x04000000
01351 #define STFL_PU_HAS_NON_MANGLED_CALL 0x08000000
01352
01353
01354 #define STFL_PU_IS_CONSTRUCTOR 0x10000000
01355 #define STFL_PU_IS_DESTRUCTOR 0x20000000
01356 #define STFL_PU_ARGS_ALIASED 0x40000000
01357 #define STFL_PU_IN_ELF_SECTION 0x80000000
01358
01359
01360
01361
01362
01363 #define STFL_IS_RESHAPED 0x00000001
01364 #define STFL_EMIT_SYMBOL 0x00000002
01365 #define STFL_HAS_NESTED_REF 0x00000004
01366 #define STFL_INIT_VALUE_ZERO 0x00000008
01367 #define STFL_FORCE_GPREL 0x00000010
01368 #define STFL_FORCE_NOT_GPREL 0x00000020
01369 #define STFL_IS_NAMELIST 0x00000040
01370 #define STFL_IS_F90_POINTER 0x00000080
01371 #define STFL_IS_F90_TARGET 0x00000100
01372 #define STFL_DECLARED_STATIC 0x00000200
01373 #define STFL_IS_EQUIVALENCED 0x00000400
01374 #define STFL_IS_THIS_POINTER 0x00000800
01375 #define STFL_IS_AUTO_OR_CPOINTER 0x00001000
01376 #define STFL_IS_NON_CONTIGUOUS 0x00002000
01377 #define STFL_IS_FILL_ALIGN 0x00004000
01378
01379
01380 #define STFL_IS_OPTIONAL_ARGUMENT 0x00008000
01381 #define STFL_IS_THREAD_PRIVATE 0x00010000
01382
01383
01384
01385
01386
01387
01388
01389
01390 #define STFL_PU_NEEDS_F90_LOWERING 0x00000001
01391 #define STFL_PU_HAS_SINGLE_RETURN 0x00000002
01392 #define STFL_PU_NO_GP_PROLOG 0x00000004
01393 #define STFL_PU_MUST_INLINE 0x00000008
01394 #define STFL_PU_CALLS_SETJMP 0x00000010
01395 #define STFL_PU_CALLS_LONGJMP 0x00000020
01396 #define STFL_PU_NEEDS_FILL_ALIGN_LOWERING 0x00004000
01397
01398
01399
01400
01401
01402
01403
01404
01405 #define DEFAULT_GP_GROUP 0
01406 #define MAX_GP_GROUP 0xff
01407 #define GPGROUP_MASK 0xff000000
01408 #define GPGROUP_SHIFT 24
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433 #define ST_export(s) (ST_flags(s) & EXPORT_MASK)
01434 #define Set_ST_export(s,c) (ST_flags(s)=(ST_flags(s)&(~EXPORT_MASK))|(c))
01435
01436
01437 #define ST_CVF_flags(s) ST_flags(CLASS_IS_VAR_FUNC(s))
01438 #define ST_CVC_flags(s) ST_flags(CLASS_IS_VAR_CONST(s))
01439 #define ST_CVB_flags(s) ST_flags(CLASS_IS_VAR_BLOCK(s))
01440 #define ST_CV_flags(s) ST_flags(CLASS_IS_VAR(s))
01441 #define ST_CV_flags2(s) STV_flags2(CLASS_IS_VAR(s))
01442 #define ST_CVF_flags2(s) ST_flags2(CLASS_IS_VAR_FUNC(s))
01443 #define ST_SC_flags(s) ST_flags(CLASS_IS_SYM_CONST(s))
01444
01445
01446 #define ST_is_weak_symbol(s) (ST_flags(s) & STFL_WEAK_SYMBOL)
01447 #define Set_ST_is_weak_symbol(s) (ST_flags(s) |= STFL_WEAK_SYMBOL)
01448 #define ST_is_weak_alias(s) (ST_flags(s) & STFL_WEAK_ALIAS)
01449 #define Set_ST_is_weak_alias(s) (ST_flags(s) |= STFL_WEAK_ALIAS)
01450 #define ST_is_referenced(s) (ST_flags(s) & STFL_REFERENCED)
01451 #define Set_ST_is_referenced(s) (ST_flags(s) |= STFL_REFERENCED)
01452 #define Reset_ST_is_referenced(s) (ST_flags(s) &= ~STFL_REFERENCED)
01453 #define ST_is_not_used(s) (ST_flags(s) & STFL_NOT_USED)
01454 #define Set_ST_is_not_used(s) (ST_flags(s) |= STFL_NOT_USED)
01455 #define Reset_ST_is_not_used(s) (ST_flags(s) &= ~STFL_NOT_USED)
01456 #define ST_is_global(s) (ST_flags(s) & STFL_GLOBAL)
01457 #define Set_ST_is_global(s) (ST_flags(s) |= STFL_GLOBAL)
01458 #define Reset_ST_is_global(s) (ST_flags(s) &= ~STFL_GLOBAL)
01459
01460 #define ST_is_initialized(s) (ST_flags(s) & STFL_INITIALIZED)
01461 #define Set_ST_is_initialized(s) (ST_flags(s) |= STFL_INITIALIZED)
01462 #define Reset_ST_is_initialized(s) (ST_flags(s) &= ~STFL_INITIALIZED)
01463
01464
01465 #define ST_is_formal_ref(s) (ST_flags(s) & STFL_FORMAL_REF)
01466 #define Set_ST_is_formal_ref(s) (ST_flags(s) |= STFL_FORMAL_REF)
01467 #define Reset_ST_is_formal_ref(s) (ST_flags(s) &= ~STFL_FORMAL_REF)
01468
01469
01470 #define ST_is_temp_var(s) (ST_flags(s) & STFL_TEMP_VAR)
01471 #define Set_ST_is_temp_var(s) (ST_flags(s) |= STFL_TEMP_VAR)
01472 #define Reset_ST_is_temp_var(s) (ST_flags(s) &= ~STFL_TEMP_VAR)
01473
01474 #define ST_addr_taken_saved(s) (ST_CVF_flags(s) & STFL_ADDR_TAKEN_SAVED)
01475 #define Set_ST_addr_taken_saved(s) (ST_CVF_flags(s) |= STFL_ADDR_TAKEN_SAVED)
01476 #define Reset_ST_addr_taken_saved(s) (ST_CVF_flags(s) &= ~STFL_ADDR_TAKEN_SAVED)
01477 #define ST_addr_used_locally(s) (ST_CVF_flags(s) & STFL_ADDR_USED_LOCALLY)
01478 #define Set_ST_addr_used_locally(s) (ST_CVF_flags(s) |= STFL_ADDR_USED_LOCALLY)
01479 #define Reset_ST_addr_used_locally(s) (ST_CVF_flags(s) &= ~STFL_ADDR_USED_LOCALLY)
01480 #define ST_addr_taken_passed(s) \
01481 (ST_CVF_flags(s) & STFL_ADDR_TAKEN_PASSED)
01482 #define Set_ST_addr_taken_passed(s) \
01483 (ST_CVF_flags(s) |= STFL_ADDR_TAKEN_PASSED)
01484 #define Reset_ST_addr_taken_passed(s) \
01485 (ST_CVF_flags(s) &= (~STFL_ADDR_TAKEN_PASSED))
01486 #define ST_addr_taken(s) \
01487 (ST_addr_taken_saved(s) || ST_addr_taken_passed(s) || ST_addr_used_locally(s))
01488
01489
01490
01491
01492
01493
01494
01495
01496
01497
01498
01499
01500
01501
01502 #define ST_visible_outside_dso(s) \
01503 ((ST_export(s) > EXPORT_INTERNAL) || \
01504 ((ST_export(s) == EXPORT_LOCAL) && \
01505 (ST_addr_taken_saved(s) || ST_addr_taken_passed(s)) && \
01506 (!ST_pu_no_gp_prolog(s))))
01507 #define bogus_ST_visible_outside_dso(s) ST_visible_outside_dso(s)
01508
01509 #define ST_may_not_be_addr_taken(s) \
01510 (ST_CVF_flags(s) & STFL_MAY_NOT_BE_ADDR_TAKEN)
01511 #define Set_ST_may_not_be_addr_taken(s) \
01512 (ST_CVF_flags(s) |= STFL_MAY_NOT_BE_ADDR_TAKEN)
01513 #define Reset_ST_may_not_be_addr_taken(s) \
01514 (ST_CVF_flags(s) &= (~STFL_MAY_NOT_BE_ADDR_TAKEN))
01515 #define ST_static_mbr(s) (ST_CVF_flags(s) & STFL_STATIC_MBR)
01516 #define Set_ST_static_mbr(s) (ST_CVF_flags(s) |= STFL_STATIC_MBR)
01517 #define Reset_ST_static_mbr(s) (ST_CVF_flags(s) &= ~STFL_STATIC_MBR)
01518
01519 #define ST_is_const_var(s) (ST_CV_flags(s) & STFL_IS_CONST_VAR)
01520 #define Set_ST_is_const_var(s) (ST_CV_flags(s) |= STFL_IS_CONST_VAR)
01521 #define ST_use_reg_align(s) (ST_CV_flags(s) & STFL_USE_REG_ALIGN)
01522 #define Set_ST_use_reg_align(s) (ST_CV_flags(s) |= STFL_USE_REG_ALIGN)
01523 #define ST_is_restrict(s) (ST_CV_flags(s) & STFL_IS_RESTRICT)
01524 #define Set_ST_is_restrict(s) (ST_CV_flags(s) |= STFL_IS_RESTRICT)
01525 #define ST_is_padded(s) (ST_CVC_flags(s) & STFL_IS_PADDED)
01526 #define Set_ST_is_padded(s) (ST_CVC_flags(s) |= STFL_IS_PADDED)
01527 #define ST_is_return_var(s) (ST_CV_flags(s) & STFL_IS_RETURN_VAR)
01528 #define Set_ST_is_return_var(s) (ST_CV_flags(s) |= STFL_IS_RETURN_VAR)
01529 #define Reset_ST_is_return_var(s) (ST_CV_flags(s) &= (~STFL_IS_RETURN_VAR))
01530 #define ST_is_value_parm(s) (ST_CV_flags(s) & STFL_IS_VALUE_PARM)
01531 #define Set_ST_is_value_parm(s) (ST_CV_flags(s) |= STFL_IS_VALUE_PARM)
01532 #define Reset_ST_is_value_parm(s) (ST_CV_flags(s) &= (~STFL_IS_VALUE_PARM))
01533
01534 #define ST_promote_parm(s) (ST_CV_flags(s) & STFL_PROMOTE_PARM)
01535 #define Set_ST_promote_parm(s) (ST_CV_flags(s) |= STFL_PROMOTE_PARM)
01536 #define Clear_ST_promote_parm(s) (ST_CV_flags(s) &= (~STFL_PROMOTE_PARM))
01537
01538 #define ST_pt_to_unique_mem(s) (ST_CV_flags(s) & STFL_PT_TO_UNIQUE_MEM)
01539 #define Set_ST_pt_to_unique_mem(s) (ST_CV_flags(s) |= STFL_PT_TO_UNIQUE_MEM)
01540 #define ST_use_cplinit(s) (ST_CV_flags(s) & STFL_USE_CPLINIT)
01541 #define Set_ST_use_cplinit(s) (ST_CV_flags(s) |= STFL_USE_CPLINIT)
01542 #define ST_use_eh_region(s) (ST_CV_flags(s) & STFL_USE_EH_REGION)
01543 #define Set_ST_use_eh_region(s) (ST_CV_flags(s) |= STFL_USE_EH_REGION)
01544 #define ST_use_eh_region_supp(s) (ST_CV_flags(s) & STFL_USE_EH_REGION_SUPP)
01545 #define Set_ST_use_eh_region_supp(s) (ST_CV_flags(s) |= STFL_USE_EH_REGION_SUPP)
01546 #define ST_use_distr_array(s) (ST_CV_flags(s) & STFL_USE_DISTR_ARRAY)
01547 #define Set_ST_use_distr_array(s) (ST_CV_flags(s) |= STFL_USE_DISTR_ARRAY)
01548 #define ST_is_not_aliased(s) (ST_CV_flags(s) & STFL_IS_NOT_ALIASED)
01549 #define Set_ST_is_not_aliased(s) (ST_CV_flags(s) |= STFL_IS_NOT_ALIASED)
01550 #define ST_gprel(s) (ST_CVB_flags(s) & STFL_GPREL)
01551 #define Set_ST_gprel(s) (ST_CVB_flags(s) |= STFL_GPREL)
01552 #define Reset_ST_gprel(s) (ST_CVB_flags(s) &= (~STFL_GPREL))
01553 #define ST_keep_name_w2f(s) (ST_CV_flags(s) & STFL_KEEP_NAME_W2F)
01554 #define Set_ST_keep_name_w2f(s) (ST_CV_flags(s) |= STFL_KEEP_NAME_W2F)
01555 #define Reset_ST_keep_name_w2f(s) (ST_CV_flags(s) &= (~STFL_KEEP_NAME_W2F))
01556 #define ST_is_datapool(s) (ST_CV_flags(s) & STFL_IS_DATAPOOL)
01557 #define Set_ST_is_datapool(s) (ST_CV_flags(s) |= STFL_IS_DATAPOOL)
01558
01559
01560 #define STB_gprel(s) ST_gprel(s)
01561 #define Set_STB_gprel(s) Set_ST_gprel(s)
01562
01563
01564 #define ST_CC_flags(s) ST_flags(CLASS_IS_CONST(s))
01565 #define STC_add_null(s) (ST_CC_flags(s) & STFL_ADD_NULL)
01566 #define Set_STC_add_null(s) (ST_CC_flags(s) |= STFL_ADD_NULL)
01567
01568
01569 #define STSC_sym_simple(s) (ST_SC_flags(s) & STFL_SYM_SIMPLE)
01570 #define Set_STSC_sym_simple(s) (ST_SC_flags(s) |= STFL_SYM_SIMPLE)
01571 #define Reset_STSC_sym_simple(s) (ST_SC_flags(s) &= (~STFL_SYM_SIMPLE))
01572 #define STSC_sym_unique(s) (ST_SC_flags(s) & STFL_SYM_UNIQUE)
01573 #define Set_STSC_sym_unique(s) (ST_SC_flags(s) |= STFL_SYM_UNIQUE)
01574 #define Reset_STSC_sym_unique(s) (ST_SC_flags(s) &= (~STFL_SYM_UNIQUE))
01575
01576
01577 #define ST_BL_flags(s) ST_flags(CLASS_IS_BLOCK(s))
01578 #define STB_decrement(s) (ST_BL_flags(s) & STFL_DECREMENT)
01579 #define Set_STB_decrement(s) (ST_BL_flags(s) |= STFL_DECREMENT)
01580 #define Reset_STB_decrement(s) (ST_BL_flags(s) &= (~STFL_DECREMENT))
01581 #define STB_exec(s) (ST_BL_flags(s) & STFL_EXEC)
01582 #define Set_STB_exec(s) (ST_BL_flags(s) |= STFL_EXEC)
01583 #define Reset_STB_exec(s) (ST_BL_flags(s) &= (~STFL_EXEC))
01584 #define STB_nobits(s) (ST_BL_flags(s) & STFL_NOBITS)
01585 #define Set_STB_nobits(s) (ST_BL_flags(s) |= STFL_NOBITS)
01586 #define Reset_STB_nobits(s) (ST_BL_flags(s) &= (~STFL_NOBITS))
01587 #define STB_merge(s) (ST_BL_flags(s) & STFL_MERGE)
01588 #define Set_STB_merge(s) (ST_BL_flags(s) |= STFL_MERGE)
01589 #define Reset_STB_merge(s) (ST_BL_flags(s) &= (~STFL_MERGE))
01590 #define STB_section(s) (ST_BL_flags(s) & STFL_SECTION)
01591 #define Set_STB_section(s) (ST_BL_flags(s) |= STFL_SECTION)
01592 #define Reset_STB_section(s) (ST_BL_flags(s) &= (~STFL_SECTION))
01593 #define STB_root_base(s) (ST_BL_flags(s) & STFL_ROOT_BASE)
01594 #define Set_STB_root_base(s) (ST_BL_flags(s) |= STFL_ROOT_BASE)
01595 #define Reset_STB_root_base(s) (ST_BL_flags(s) &= (~STFL_ROOT_BASE))
01596 #define STB_is_basereg(s) (ST_BL_flags(s) & STFL_IS_BASEREG)
01597 #define Set_STB_is_basereg(s) (ST_BL_flags(s) |= STFL_IS_BASEREG)
01598 #define Reset_STB_is_basereg(s) (ST_BL_flags(s) &= (~STFL_IS_BASEREG))
01599
01600
01601 #define ST_CL_flags(s) ST_flags(CLASS_IS_LABEL(s))
01602 #define STL_is_assigned(s) (ST_CL_flags(s) & STFL_LABEL_ASSIGNED)
01603 #define Set_STL_is_assigned(s) (ST_CL_flags(s) |= STFL_LABEL_ASSIGNED)
01604 #define STL_in_compgoto_lst(s) (ST_CL_flags(s) & STFL_IN_COMPGOTO_LST)
01605 #define Set_STL_in_compgoto_lst(s) (ST_CL_flags(s) |= STFL_IN_COMPGOTO_LST)
01606 #define STL_lkind(s) (ST_CL_flags(s) & STFL_LKIND)
01607 #define Set_STL_lkind(s,k) (ST_flags(s)=(ST_CL_flags(s)&(~STFL_LKIND))|(k))
01608 #define STL_begin_eh_range(s) (ST_CL_flags(s) & STFL_BEGIN_EH_RANGE)
01609 #define Set_STL_begin_eh_range(s) (ST_CL_flags(s) |= STFL_BEGIN_EH_RANGE)
01610 #define Reset_STL_begin_eh_range(s) (ST_CL_flags(s) &= ~STFL_BEGIN_EH_RANGE)
01611 #define STL_end_eh_range(s) (ST_CL_flags(s) & STFL_END_EH_RANGE)
01612 #define Set_STL_end_eh_range(s) (ST_CL_flags(s) |= STFL_END_EH_RANGE)
01613 #define Reset_STL_end_eh_range(s) (ST_CL_flags(s) &= ~STFL_END_EH_RANGE)
01614 #define STL_begin_handler(s) (ST_CL_flags(s) & STFL_BEGIN_HANDLER)
01615 #define Set_STL_begin_handler(s) (ST_CL_flags(s) |= STFL_BEGIN_HANDLER)
01616 #define STL_end_handler(s) (ST_CL_flags(s) & STFL_END_HANDLER)
01617 #define Set_STL_end_handler(s) (ST_CL_flags(s) |= STFL_END_HANDLER)
01618 #define STL_switch_fallthru(s) (ST_CL_flags(s) & STFL_SWITCH_FALLTHRU)
01619 #define Set_STL_switch_fallthru(s) (ST_CL_flags(s) |= STFL_SWITCH_FALLTHRU)
01620
01621
01622 #define ST_CF_flags(s) ST_flags(CLASS_IS_FUNC(s))
01623 #define ST_pu_is_leaf(s) (ST_CF_flags(s) & STFL_PU_IS_LEAF)
01624 #define Set_ST_pu_is_leaf(s) (ST_CF_flags(s) |= STFL_PU_IS_LEAF)
01625 #define Reset_ST_pu_is_leaf(s) (ST_CF_flags(s) &= (~STFL_PU_IS_LEAF))
01626 #define ST_is_mainPU(s) (ST_CF_flags(s) & STFL_PU_IS_MAINPU)
01627 #define Set_ST_is_mainPU(s) (ST_CF_flags(s) |= STFL_PU_IS_MAINPU)
01628 #define ST_pu_no_se(s) (ST_CF_flags(s) & STFL_PU_NO_SIDE_EFFECTS)
01629 #define Set_ST_pu_no_se(s) (ST_CF_flags(s) |= STFL_PU_NO_SIDE_EFFECTS)
01630 #define ST_pu_is_pure(s) (ST_CF_flags(s) & STFL_PU_IS_PURE)
01631 #define Set_ST_pu_is_pure(s) (ST_CF_flags(s) |= STFL_PU_IS_PURE)
01632 #define ST_pu_is_inline_function(s) (ST_CF_flags(s) & STFL_PU_IS_INLINE_FUNCTION)
01633 #define Set_ST_pu_is_inline_function(s) (ST_CF_flags(s) |= STFL_PU_IS_INLINE_FUNCTION)
01634 #define ST_pu_needs_t9(s) (ST_CF_flags(s) & STFL_PU_NEEDS_T9)
01635 #define Set_ST_pu_needs_t9(s) (ST_CF_flags(s) |= STFL_PU_NEEDS_T9)
01636 #define ST_pu_is_blockdata(s) (ST_CF_flags(s) & STFL_PU_IS_BLOCKDATA)
01637 #define Set_ST_pu_is_blockdata(s) (ST_CF_flags(s) |= STFL_PU_IS_BLOCKDATA)
01638 #define ST_pu_no_inline(s) (ST_CF_flags(s) & STFL_PU_NO_INLINE)
01639 #define Set_ST_pu_no_inline(s) (ST_CF_flags(s) |= STFL_PU_NO_INLINE)
01640 #define ST_pu_no_delete(s) (ST_CF_flags(s) & STFL_PU_NO_DELETE)
01641 #define Set_ST_pu_no_delete(s) (ST_CF_flags(s) |= STFL_PU_NO_DELETE)
01642 #define ST_pu_has_exc_scopes(s) (ST_CF_flags(s) & STFL_PU_HAS_EXC_SCOPES)
01643 #define Set_ST_pu_has_exc_scopes(s) (ST_CF_flags(s) |= STFL_PU_HAS_EXC_SCOPES)
01644 #define ST_pu_no_throws(s) (ST_CF_flags(s) & STFL_PU_NO_THROWS)
01645 #define Set_ST_pu_no_throws(s) (ST_CF_flags(s) |= STFL_PU_NO_THROWS)
01646 #define ST_pu_throws(s) (ST_CF_flags(s) & STFL_PU_THROWS)
01647 #define Set_ST_pu_throws(s) (ST_CF_flags(s) |= STFL_PU_THROWS)
01648 #define ST_pu_is_nested_func(s) (ST_CF_flags(s) & STFL_PU_IS_NESTED_FUNC)
01649 #define Set_ST_pu_is_nested_func(s) (ST_CF_flags(s) |= STFL_PU_IS_NESTED_FUNC)
01650 #define ST_pu_has_non_mangled_call(s) (ST_CF_flags(s) & STFL_PU_HAS_NON_MANGLED_CALL)
01651 #define Set_ST_pu_has_non_mangled_call(s) (ST_CF_flags(s) |= STFL_PU_HAS_NON_MANGLED_CALL)
01652 #define ST_pu_is_constructor(s) (ST_CF_flags(s) & STFL_PU_IS_CONSTRUCTOR)
01653 #define Set_ST_pu_is_constructor(s) (ST_CF_flags(s) |= STFL_PU_IS_CONSTRUCTOR)
01654 #define ST_pu_is_destructor(s) (ST_CF_flags(s) & STFL_PU_IS_DESTRUCTOR)
01655 #define Set_ST_pu_is_destructor(s) (ST_CF_flags(s) |= STFL_PU_IS_DESTRUCTOR)
01656 #define ST_pu_args_aliased(s) (ST_CF_flags(s) & STFL_PU_ARGS_ALIASED)
01657 #define Set_ST_pu_args_aliased(s) (ST_CF_flags(s) |= STFL_PU_ARGS_ALIASED)
01658 #define Reset_ST_pu_args_aliased(s) (ST_CF_flags(s) &= (~STFL_PU_ARGS_ALIASED))
01659 #define ST_pu_is_recursive(s) (ST_CF_flags(s) & STFL_PU_RECURSIVE)
01660 #define Set_ST_pu_is_recursive(s) (ST_CF_flags(s) |= STFL_PU_RECURSIVE)
01661
01662 #define ST_pu_in_elf_section(s) (ST_CF_flags(s) & STFL_PU_IN_ELF_SECTION)
01663 #define Set_ST_pu_in_elf_section(s) (ST_CF_flags(s) |= STFL_PU_IN_ELF_SECTION)
01664 #define Reset_ST_pu_in_elf_section(s) (ST_CF_flags(s) &= (~STFL_PU_IN_ELF_SECTION))
01665
01666
01667 #define ST_is_reshaped(s) (ST_CV_flags2(s) & STFL_IS_RESHAPED)
01668 #define Set_ST_is_reshaped(s) (ST_CV_flags2(s) |= STFL_IS_RESHAPED)
01669 #define ST_emit_symbol(s) (ST_CV_flags2(s) & STFL_EMIT_SYMBOL)
01670 #define Set_ST_emit_symbol(s) (ST_CV_flags2(s) |= STFL_EMIT_SYMBOL)
01671 #define ST_has_nested_ref(s) (ST_CV_flags2(s) & STFL_HAS_NESTED_REF)
01672 #define Set_ST_has_nested_ref(s) (ST_CV_flags2(s) |= STFL_HAS_NESTED_REF)
01673 #define ST_init_value_zero(s) (ST_CV_flags2(s) & STFL_INIT_VALUE_ZERO)
01674 #define Set_ST_init_value_zero(s) (ST_CV_flags2(s) |= STFL_INIT_VALUE_ZERO)
01675 #define ST_force_gprel(s) (ST_CV_flags2(s) & STFL_FORCE_GPREL)
01676 #define Set_ST_force_gprel(s) (ST_CV_flags2(s) |= STFL_FORCE_GPREL)
01677 #define ST_force_not_gprel(s) (ST_CV_flags2(s) & STFL_FORCE_NOT_GPREL)
01678 #define Set_ST_force_not_gprel(s) (ST_CV_flags2(s) |= STFL_FORCE_NOT_GPREL)
01679 #define ST_is_namelist(s) (ST_CV_flags2(s) & STFL_IS_NAMELIST)
01680 #define Set_ST_is_namelist(s) (ST_CV_flags2(s) |= STFL_IS_NAMELIST)
01681 #define ST_is_f90_pointer(s) (ST_CV_flags2(s) & STFL_IS_F90_POINTER)
01682 #define Set_ST_is_f90_pointer(s) (ST_CV_flags2(s) |= STFL_IS_F90_POINTER)
01683 #define ST_is_f90_target(s) (ST_CV_flags2(s) & STFL_IS_F90_TARGET)
01684 #define Set_ST_is_f90_target(s) (ST_CV_flags2(s) |= STFL_IS_F90_TARGET)
01685 #define ST_declared_static(s) (ST_CV_flags2(s) & STFL_DECLARED_STATIC)
01686 #define Set_ST_declared_static(s) (ST_CV_flags2(s) |= STFL_DECLARED_STATIC)
01687 #define ST_is_equivalenced(s) (ST_CV_flags2(s) & STFL_IS_EQUIVALENCED)
01688 #define Set_ST_is_equivalenced(s) (ST_CV_flags2(s) |= STFL_IS_EQUIVALENCED)
01689 #define ST_is_this_pointer(s) (ST_CV_flags2(s) & STFL_IS_THIS_POINTER)
01690 #define Set_ST_is_this_pointer(s) (ST_CV_flags2(s) |= STFL_IS_THIS_POINTER)
01691 #define ST_is_auto_or_cpointer(s) (ST_CV_flags2(s) & STFL_IS_AUTO_OR_CPOINTER)
01692 #define Set_ST_is_auto_or_cpointer(s) (ST_CV_flags2(s) |= STFL_IS_AUTO_OR_CPOINTER)
01693 #define Reset_ST_is_auto_or_cpointer(s) (ST_CV_flags2(s) &= (~STFL_IS_AUTO_OR_CPOINTER))
01694 #define ST_is_non_contiguous(s) (ST_CV_flags2(s) & STFL_IS_NON_CONTIGUOUS)
01695 #define Set_ST_is_non_contiguous(s) (ST_CV_flags2(s) |= STFL_IS_NON_CONTIGUOUS)
01696 #define Reset_ST_is_non_contiguous(s) (ST_CV_flags2(s) &= (~STFL_IS_NON_CONTIGUOUS))
01697 #define ST_is_optional_argument(s) (ST_CV_flags2(s) & STFL_IS_OPTIONAL_ARGUMENT)
01698 #define Set_ST_is_optional_argument(s) (ST_CV_flags2(s) |= STFL_IS_OPTIONAL_ARGUMENT)
01699 #define Reset_ST_is_optional_argument(s) (ST_CV_flags2(s) &= (~STFL_IS_OPTIONAL_ARGUMENT))
01700 #define ST_is_thread_private(s) (ST_CV_flags2(s) & STFL_IS_THREAD_PRIVATE)
01701 #define Set_ST_is_thread_private(s) (ST_CV_flags2(s) |= STFL_IS_THREAD_PRIVATE)
01702 #define Reset_ST_is_thread_private(s) (ST_CV_flags2(s) &= (~STFL_IS_THREAD_PRIVATE))
01703 #define ST_is_fill_align(s) (ST_CV_flags2(s) & STFL_IS_FILL_ALIGN)
01704 #define Set_ST_is_fill_align(s) (ST_CV_flags2(s) |= STFL_IS_FILL_ALIGN)
01705
01706
01707 #define ST_pu_needs_f90_lowering(s) (ST_CVF_flags2(s) & STFL_PU_NEEDS_F90_LOWERING)
01708 #define Set_ST_pu_needs_f90_lowering(s) (ST_CVF_flags2(s) |= STFL_PU_NEEDS_F90_LOWERING)
01709 #define ST_pu_has_single_return(s) (ST_CVF_flags2(s) & STFL_PU_HAS_SINGLE_RETURN)
01710 #define Set_ST_pu_has_single_return(s) (ST_CVF_flags2(s) |= STFL_PU_HAS_SINGLE_RETURN)
01711 #define Reset_ST_pu_has_single_return(s) (ST_CVF_flags2(s) &= (~STFL_PU_HAS_SINGLE_RETURN))
01712 #define ST_pu_no_gp_prolog(s) (ST_CVF_flags2(s) & STFL_PU_NO_GP_PROLOG)
01713 #define Set_ST_pu_no_gp_prolog(s) (ST_CVF_flags2(s) |= STFL_PU_NO_GP_PROLOG)
01714 #define Reset_ST_pu_no_gp_prolog(s) (ST_CVF_flags2(s) &= (~STFL_PU_NO_GP_PROLOG))
01715 #define ST_pu_must_inline(s) (ST_CVF_flags2(s) & STFL_PU_MUST_INLINE)
01716 #define Set_ST_pu_must_inline(s) (ST_CVF_flags2(s) |= STFL_PU_MUST_INLINE)
01717 #define Reset_ST_pu_must_inline(s) (ST_CVF_flags2(s) &= (~STFL_PU_MUST_INLINE))
01718 #define ST_pu_calls_setjmp(s) (ST_CVF_flags2(s) & STFL_PU_CALLS_SETJMP)
01719 #define Set_ST_pu_calls_setjmp(s) (ST_CVF_flags2(s) |= STFL_PU_CALLS_SETJMP)
01720 #define Reset_ST_pu_calls_setjmp(s) (ST_CVF_flags2(s) &= (~STFL_PU_CALLS_SETJMP))
01721 #define ST_pu_calls_longjmp(s) (ST_CVF_flags2(s) & STFL_PU_CALLS_LONGJMP)
01722 #define Set_ST_pu_calls_longjmp(s) (ST_CVF_flags2(s) |= STFL_PU_CALLS_LONGJMP)
01723 #define Reset_ST_pu_calls_longjmp(s) (ST_CVF_flags2(s) &= (~STFL_PU_CALLS_LONGJMP))
01724 #define ST_pu_needs_fill_align_lowering(s) (ST_CVF_flags2(s) & STFL_PU_NEEDS_FILL_ALIGN_LOWERING)
01725 #define Set_ST_pu_needs_fill_align_lowering(s) (ST_CVF_flags2(s) |= STFL_PU_NEEDS_FILL_ALIGN_LOWERING)
01726
01727 #define ST_gp_group(s) ((ST_CVF_flags2(s) & GPGROUP_MASK)>>GPGROUP_SHIFT)
01728 #define Set_ST_gp_group(s,v) (ST_CVF_flags2(s)=((ST_CVF_flags2(s)&(~GPGROUP_MASK))|(v<<GPGROUP_SHIFT)))
01729
01730
01731
01732
01733
01734
01735
01736 typedef struct {
01737 INT32 name_index;
01738 struct wn *home;
01739 } PREG_DEBUG_INFO;
01740
01741
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766 struct symtab {
01767 struct symtab *parent;
01768 mUINT32 id;
01769 mUINT8 level;
01770 mUINT8 stack_model;
01771 mUINT16 flags;
01772 ST *symbols;
01773 ST *last_symbol;
01774 ST *labels;
01775 TY *types;
01776 TY *last_type;
01777 ST *slink_sym;
01778 ST *gp_sym;
01779 ST *ra_sym;
01780 mINT64 actual_size;
01781 PREG_DEBUG_INFO *preg_dinfo;
01782 mUINT32 last_st_id;
01783 mUINT32 last_symtab_id;
01784 mUINT8 last_scope_id;
01785 mUINT8 gp_group;
01786 mUINT16 last_preg;
01787 union {
01788
01789 mUINT16 last_label;
01790 mUINT16 last_type_id;
01791 } ulast;
01792 ST **st_map;
01793 SYMTAB **symtab_map;
01794 TY **ty_map;
01795 struct inito *initdata;
01796 };
01797
01798
01799 #define SYMTAB_parent(s) ((s)->parent)
01800 #define SYMTAB_id(s) ((s)->id)
01801 #define SYMTAB_flags(s) ((s)->flags)
01802 #define SYMTAB_level(s) ((s)->level)
01803 #define SYMTAB_stack_model(s) ((s)->stack_model)
01804 #define SYMTAB_last_scope_id(s) ((s)->last_scope_id)
01805 #define SYMTAB_gp_group(s) ((s)->gp_group)
01806 #define SYMTAB_symbols(s) ((s)->symbols)
01807 #define SYMTAB_last_symbol(s) ((s)->last_symbol)
01808 #define SYMTAB_labels(s) ((s)->labels)
01809 #define SYMTAB_types(s) ((s)->types)
01810 #define SYMTAB_last_type(s) ((s)->last_type)
01811 #define SYMTAB_slink_sym(s) ((s)->slink_sym)
01812 #define SYMTAB_gp_sym(s) ((s)->gp_sym)
01813 #define SYMTAB_ra_sym(s) ((s)->ra_sym)
01814 #define SYMTAB_actual_size(s) ((s)->actual_size)
01815 #define SYMTAB_preg_dinfo(s) ((s)->preg_dinfo)
01816
01817 #define SYMTAB_preg_dinfo_size(s) SYMTAB_preg_dinfo(s)[0].name_index
01818 #define SYMTAB_last_preg(s) ((s)->last_preg)
01819 #define SYMTAB_last_st_id(s) ((s)->last_st_id)
01820 #define SYMTAB_last_symtab_id(s) ((s)->last_symtab_id)
01821 #define SYMTAB_last_label(s) ((s)->ulast.last_label)
01822 #define SYMTAB_last_type_id(s) ((s)->ulast.last_type_id)
01823 #define SYMTAB_st_map(s) ((s)->st_map)
01824 #define SYMTAB_symtab_map(s) ((s)->symtab_map)
01825 #define SYMTAB_level_map(s) ((s)->symtab_map)
01826 #define SYMTAB_ty_map(s) ((s)->ty_map)
01827 #define SYMTAB_initdata(s) ((s)->initdata)
01828
01829
01830 #define SYMTAB_UPLEVEL 0x0001
01831 #define SYMTAB_MP_NEEDS_LNO 0x0002
01832 #define SYMTAB_ALLOCA 0x0004
01833 #define SYMTAB_IPA 0x0008
01834 #define SYMTAB_HASMP 0x0010
01835 #define SYMTAB_MP 0x0020
01836 #define SYMTAB_HAS_NAMELIST 0x0040
01837 #define SYMTAB_ADDR_TAKEN 0x0080
01838
01839 #define SYMTAB_HAS_RGN 0x0100
01840 #define SYMTAB_HAS_INL 0x0200
01841 #define SYMTAB_HAS_VERY_HIGH_WHIRL 0x0400
01842 #define SYMTAB_HAS_ALTENTRY 0x0800
01843
01844
01845 #define SYMTAB_SRC_LANG 0xF000
01846 #define SYMTAB_C_LANG 0x1000
01847 #define SYMTAB_CXX_LANG 0x2000
01848 #define SYMTAB_F77_LANG 0x4000
01849 #define SYMTAB_F90_LANG 0x8000
01850
01851 #define SYMTAB_uplevel(s) (SYMTAB_flags(s) & SYMTAB_UPLEVEL)
01852 #define Set_SYMTAB_uplevel(s) (SYMTAB_flags(s) |= SYMTAB_UPLEVEL)
01853 #define Reset_SYMTAB_uplevel(s) (SYMTAB_flags(s) &= ~SYMTAB_UPLEVEL)
01854 #define SYMTAB_has_alloca(s) (SYMTAB_flags(s) & SYMTAB_ALLOCA)
01855 #define Set_SYMTAB_has_alloca(s) (SYMTAB_flags(s) |= SYMTAB_ALLOCA)
01856 #define Reset_SYMTAB_has_alloca(s) (SYMTAB_flags(s) &= ~SYMTAB_ALLOCA)
01857 #define SYMTAB_IPA_on(s) (SYMTAB_flags(s) & SYMTAB_IPA)
01858 #define Set_SYMTAB_IPA_on(s) (SYMTAB_flags(s) |= SYMTAB_IPA)
01859 #define Reset_SYMTAB_IPA_on(s) (SYMTAB_flags(s) &= ~SYMTAB_IPA)
01860 #define SYMTAB_has_mp(s) (SYMTAB_flags(s) & SYMTAB_HASMP)
01861 #define Set_SYMTAB_has_mp(s) (SYMTAB_flags(s) |= SYMTAB_HASMP)
01862 #define Reset_SYMTAB_has_mp(s) (SYMTAB_flags(s) &= ~SYMTAB_HASMP)
01863 #define SYMTAB_mp(s) (SYMTAB_flags(s) & SYMTAB_MP)
01864 #define Set_SYMTAB_mp(s) (SYMTAB_flags(s) |= SYMTAB_MP)
01865 #define Reset_SYMTAB_mp(s) (SYMTAB_flags(s) &= ~SYMTAB_MP)
01866 #define SYMTAB_has_nested(s) (SYMTAB_uplevel(s) || SYMTAB_has_mp(s))
01867 #define SYMTAB_has_namelist(s) (SYMTAB_flags(s) & SYMTAB_HAS_NAMELIST)
01868 #define Set_SYMTAB_has_namelist(s) (SYMTAB_flags(s) |= SYMTAB_HAS_NAMELIST)
01869 #define Reset_SYMTAB_has_namelist(s) (SYMTAB_flags(s) &= ~SYMTAB_HAS_NAMELIST
01870 #define SYMTAB_addr_taken(s) (SYMTAB_flags(s) & SYMTAB_ADDR_TAKEN)
01871 #define Set_SYMTAB_addr_taken(s) (SYMTAB_flags(s) |= SYMTAB_ADDR_TAKEN)
01872 #define Reset_SYMTAB_addr_taken(s) (SYMTAB_flags(s) &= ~SYMTAB_ADDR_TAKEN)
01873 #define SYMTAB_has_rgn(s) (SYMTAB_flags(s) & SYMTAB_HAS_RGN)
01874 #define Set_SYMTAB_has_rgn(s) (SYMTAB_flags(s) |= SYMTAB_HAS_RGN)
01875 #define Reset_SYMTAB_has_rgn(s) (SYMTAB_flags(s) &= ~SYMTAB_HAS_RGN)
01876 #define SYMTAB_has_inlines(s) (SYMTAB_flags(s) & SYMTAB_HAS_INL)
01877 #define Set_SYMTAB_has_inlines(s) (SYMTAB_flags(s) |= SYMTAB_HAS_INL)
01878 #define Reset_SYMTAB_has_inlines(s) (SYMTAB_flags(s) &= ~SYMTAB_HAS_INL)
01879 #define SYMTAB_has_very_high_whirl(s) \
01880 (SYMTAB_flags(s) & SYMTAB_HAS_VERY_HIGH_WHIRL)
01881 #define Set_SYMTAB_has_very_high_whirl(s) \
01882 (SYMTAB_flags(s) |= SYMTAB_HAS_VERY_HIGH_WHIRL)
01883 #define Reset_SYMTAB_has_very_high_whirl(s) \
01884 (SYMTAB_flags(s) &= ~SYMTAB_HAS_VERY_HIGH_WHIRL)
01885 #define SYMTAB_has_altentry(s) (SYMTAB_flags(s) & SYMTAB_HAS_ALTENTRY)
01886 #define Set_SYMTAB_has_altentry(s) (SYMTAB_flags(s) |= SYMTAB_HAS_ALTENTRY)
01887 #define Reset_SYMTAB_has_altentry(s) (SYMTAB_flags(s) &= ~SYMTAB_HAS_ALTENTRY)
01888 #define SYMTAB_mp_needs_lno(s) (SYMTAB_flags(s)&SYMTAB_MP_NEEDS_LNO)
01889 #define Set_SYMTAB_mp_needs_lno(s) (SYMTAB_flags(s)|=SYMTAB_MP_NEEDS_LNO)
01890 #define Reset_SYMTAB_mp_needs_lno(s) (SYMTAB_flags(s)&=~SYMTAB_MP_NEEDS_LNO)
01891
01892 #define SYMTAB_src_lang(s) (SYMTAB_flags(s) & SYMTAB_SRC_LANG)
01893 #define Set_SYMTAB_src_lang(s,v) (SYMTAB_flags(s) |= v)
01894
01895
01896 extern SYMTAB_IDX Global_Symtab;
01897 extern SYMTAB_IDX Current_Symtab;
01898 extern SYMTAB_IDX *Display_Symtab;
01899 #define Display(n) Display_Symtab[n]
01900
01901
01902
01903
01904
01905
01906
01907 #define Convert_Symtab_Id(id) \
01908 SYMTAB_symtab_map(Global_Symtab)[(id)]
01909 #define Convert_Symtab_Level(id, current) \
01910 SYMTAB_level_map(current)[(id)]
01911 #define Convert_TY_Id(id) \
01912 SYMTAB_ty_map(Global_Symtab)[(id)]
01913 #define Convert_ST_Id(id) \
01914 SYMTAB_st_map(Convert_Symtab_Level((id) >> 24, Current_Symtab)) \
01915 [(id) & 0xffffff]
01916
01917
01918 #define Is_Global_Symbol(s) (ST_symtab_id(s) == SYMTAB_id(Global_Symtab))
01919
01920 #define Is_Local_Symbol(s) (ST_symtab_id(s) == SYMTAB_id(Current_Symtab))
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933 extern TY_IDX *MTYPE_To_TY_array;
01934
01935 #ifdef STAB_DOT_C
01936 char *BTT_Message = "Bad MTYPE index %1d to TY array";
01937 #endif
01938
01939 #ifdef Is_True_On
01940 extern char *BTT_Message;
01941 # define MTYPE_To_TY(k) (MTYPE_To_TY_array[Is_True((k)<=MTYPE_LAST, \
01942 (BTT_Message,(k))),(k)])
01943 #else
01944
01945 # define MTYPE_To_TY(k) (MTYPE_To_TY_array[k])
01946
01947 #endif
01948 #define Be_Type_Tbl(k) MTYPE_To_TY(k)
01949
01950
01951 extern TY_IDX Quad_Type;
01952 extern TY *Complex_Type, *Double_Complex_Type, *Quad_Complex_Type;
01953 extern TY *Complex_Type_Split, *Complex_Type_Inverted;
01954
01955
01956 extern ST_IDX Current_PU;
01957
01958 #define GLOBAL_SCOPE_ID 0
01959
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969 #ifndef FOR_ALL_TYPES
01970
01971 #define FOR_ALL_TYPES(stab,t) \
01972 for ( t = SYMTAB_types(stab); t != NULL; t = TY_next(t) )
01973 #define FOR_ALL_GLOBAL_TYPES(t) FOR_ALL_TYPES(Global_Symtab,t)
01974 #define FOR_ALL_LOCAL_TYPES(t) FOR_ALL_TYPES(Current_Symtab,t)
01975
01976 #define FOR_ALL_VISIBLE_TYPES(t) \
01977 for ( t = Get_Next_Type(NULL); t != NULL; t = Get_Next_Type(t) )
01978 extern TY_IDX Get_Next_Type ( TY_IDX ty );
01979 #endif
01980
01981 #ifndef FOR_ALL_SYMBOLS
01982
01983 #define FOR_ALL_SYMBOLS(stab,s) \
01984 for (s = SYMTAB_symbols(stab); s != NULL; s = ST_next(s))
01985 #define FOR_ALL_GLOBAL_SYMBOLS(s) FOR_ALL_SYMBOLS(Global_Symtab,s)
01986 #define FOR_ALL_LOCAL_SYMBOLS(s) FOR_ALL_SYMBOLS(Current_Symtab,s)
01987
01988 #define FOR_ALL_VISIBLE_SYMBOLS(s) \
01989 for ( s = Get_Next_Symbol(NULL); s != NULL; s = Get_Next_Symbol(s) )
01990 extern ST_IDX Get_Next_Symbol ( ST_IDX st );
01991 #endif
01992
01993 #ifndef FOR_ALL_LABELS
01994
01995 #define FOR_ALL_LABELS(stab,l) \
01996 for (l = SYMTAB_labels(stab); l != NULL; l = ST_next(l))
01997 #define FOR_ALL_LOCAL_LABELS(l) FOR_ALL_LABELS(Current_Symtab,l)
01998 #endif
01999
02000 #define FOR_ALL_SYMTABS_IN_LIST(init,stab) \
02001 for (stab = init; stab != NULL; stab = SYMTAB_next(stab))
02002 #define FOR_ALL_SYMTABS(stab) \
02003 for (stab = Global_Symtab; stab != NULL; stab = ((stab == Global_Symtab) ? SYMTAB_child(stab) : SYMTAB_next(stab)) )
02004
02005
02006
02007
02008 extern TY_IDX Comparison_Result_Type;
02009
02010 extern TY *Void_Type;
02011 extern TY *FE_int_Type;
02012 extern TY *FE_double_Type;
02013 extern TY *Spill_Int_Type, *Spill_Float_Type;
02014 extern TY *LL_Struct_Type,
02015 *LLV_Struct_Type,
02016 *ULL_Struct_Type,
02017 *ULLV_Struct_Type,
02018 *LD_Struct_Type,
02019 *LDV_Struct_Type;
02020 extern INT64 Actual_Arg_Size, Formal_Size,
02021 Stack_Size, Frame_Len;
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034
02035
02036 extern ST** MTYPE_To_PREG_array;
02037 #define MTYPE_To_PREG(t) MTYPE_To_PREG_array[t]
02038 #define Int32_Preg MTYPE_To_PREG (MTYPE_I4)
02039 #define Int64_Preg MTYPE_To_PREG (MTYPE_I8)
02040 #define Float32_Preg MTYPE_To_PREG (MTYPE_F4)
02041 #define Float64_Preg MTYPE_To_PREG (MTYPE_F8)
02042
02043
02044 extern ST *Int_Preg, *Float_Preg;
02045
02046
02047 #define Int_Preg_Min_Offset 1
02048 #define Int_Preg_Max_Offset 31
02049 #define Float_Preg_Min_Offset 32
02050 #define Float_Preg_Max_Offset 63
02051 #define Fcc_Preg_Min_Offset 64
02052 #define Fcc_Preg_Max_Offset 71
02053 #define Last_Dedicated_Preg_Offset Fcc_Preg_Max_Offset
02054 #define Preg_Offset_Is_Int(n) \
02055 ((n) >= Int_Preg_Min_Offset && (n) <= Int_Preg_Max_Offset)
02056 #define Preg_Offset_Is_Float(n) \
02057 ((n) >= Float_Preg_Min_Offset && (n) <= Float_Preg_Max_Offset)
02058 #define Preg_Offset_Is_Fcc(n) \
02059 ((n) >= Fcc_Preg_Min_Offset && (n) <= Fcc_Preg_Max_Offset)
02060 #define Preg_Is_Dedicated(n) (n <= Last_Dedicated_Preg_Offset)
02061
02062
02063
02064
02065
02066
02067
02068
02069
02070 extern INT32 Preg_Increment(TYPE_ID mtype);
02071 extern PREG_NUM Create_Preg (TYPE_ID mtype, char *name, struct wn *home);
02072 extern void Reset_Last_Preg (PREG_NUM i);
02073 extern char* Preg_Name (PREG_NUM i);
02074 extern void Set_Preg_Name (PREG_NUM i, char *name);
02075 extern struct wn* Preg_Home (PREG_NUM i);
02076
02077
02078
02079
02080
02081
02082
02083
02084
02085
02086
02087
02088
02089
02090
02091
02092
02093 extern void Stab_Initialize ( SYMTAB *global);
02094
02095
02096 extern void Stab_Begin_PU ( SYMTAB *parent );
02097
02098 extern void Stab_Set_Current_PU (SYMTAB *current);
02099
02100 extern void Stab_Begin_File(void);
02101
02102
02103 extern void New_Scope ( BOOL new_pu );
02104
02105
02106 extern char *Aux_Class_Name ( INT16 );
02107 extern char *Class_Name ( INT16 );
02108 extern char *Sclass_Name ( INT32 );
02109 extern char *Kind_Name ( INT16 );
02110
02111
02112
02113
02114
02115 extern TY_IDX Promoted_Parm_Type ( ST_IDX formal_parm );
02116
02117
02118 extern BOOL ST_is_constant (ST_IDX st);
02119
02120
02121 extern BOOL ST_is_const_initialized( const ST *st );
02122
02123
02124
02125
02126 extern BOOL ST_is_const_initialized_scalar( const ST *st, struct tcon *tc );
02127
02128
02129
02130
02131 extern struct initv *ST_is_const_and_has_initv( const ST *st );
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141 extern void *Symtab_Alloc ( size_t bytes, BOOL is_global );
02142
02143 extern ST_IDX New_ST ( BOOL is_global );
02144 extern SBLK *New_SBLK (BOOL is_global);
02145
02146
02147 extern TY_IDX New_TY ( BOOL is_global );
02148
02149
02150
02151 extern FLD *New_FLD (INT nfields, BOOL is_global );
02152 extern MBR *New_MBR (INT nfields, BOOL is_global );
02153 extern ARI *New_ARI (INT ndims, BOOL is_global);
02154 extern FTI *New_FTI (INT nparms, BOOL is_global);
02155 extern ENUM_CONST *New_ENUM_CONST (INT num, BOOL is_global);
02156 extern TYLIST *New_TYLIST (INT num, BOOL is_global);
02157
02158
02159
02160
02161
02162
02163
02164 extern ST_IDX Copy_ST (ST_IDX, BOOL same_file);
02165 extern TY_IDX Copy_TY (TY_IDX, BOOL always_copy);
02166
02167
02168 extern STCH *Append_To_STCH ( STCH *stch, ST *st, BOOL is_global );
02169
02170 extern TY_IDX Make_Pointer_Type ( TY_IDX pointee, BOOL is_global );
02171 extern TY_IDX Make_Global_Pointer_As_Array_Type ( TY_IDX ty);
02172
02173 extern TY_IDX Make_Function_Type ( TY_IDX rtype, BOOL is_global );
02174 extern TY_IDX Make_Array_Type (TYPE_ID element, INT32 ndim, INT64 len, BOOL is_global);
02175
02176
02177
02178
02179
02180
02181
02182
02183 extern TY *Make_Volatile_Type ( TY *base_type, BOOL is_global );
02184 extern TY *Make_Align_Type ( TY *rtype, INT32 align, BOOL is_global );
02185
02186
02187 extern struct st *Gen_Read_Only_Symbol ( TY * ty, char *rootname );
02188 extern struct st *Gen_Temp_Symbol ( TY *ty, char *rootname );
02189 extern struct st *Gen_Intrinsic_Function( TY *, char *);
02190
02191
02192 extern ST *Gen_Label ( char *name );
02193
02194 extern ST *Gen_Number_Label ( INT32 num );
02195 extern ST *Gen_Local_Number_Label ( INT32 num );
02196
02197 extern ST *Gen_GP_Sym (void);
02198
02199
02200 extern void Base_Symbol_And_Offset (
02201 ST *st,
02202 ST **base_symbol,
02203 INT64 *offset_from_base
02204 );
02205
02206
02207 extern void Fill_Symtab(SYMTAB *stab, INT16 level);
02208
02209
02210
02211
02212
02213
02214 extern void Enter_Label_In_Symtab ( ST *, SYMTAB *, INT32 );
02215 extern void Enter_ST ( ST_IDX);
02216 extern void Enter_ST_In_Symtab ( ST_IDX, SYMTAB *);
02217 extern void Enter_TY ( TY_IDX);
02218 extern void Enter_TY_In_Symtab ( TY_IDX, SYMTAB *);
02219 extern void Print_ST ( FILE *f, ST_IDX st, BOOL verbose );
02220 #pragma mips_frequency_hint NEVER Print_ST
02221 extern void Print_TY ( FILE *f, const TY *ty, BOOL verbose );
02222 #pragma mips_frequency_hint NEVER Print_TY
02223 extern void Print_Symbol_Table ( FILE *f, SYMTAB *stab, BOOL verbose );
02224 #pragma mips_frequency_hint NEVER Print_Symbol_Table
02225 extern void Trace_SYMTAB ( FILE *f, SYMTAB *stab, BOOL verbose );
02226 #pragma mips_frequency_hint NEVER Trace_SYMTAB
02227 extern void Print_Symtab_Stats ( FILE *f);
02228 #pragma mips_frequency_hint NEVER Print_Symtab_Stats
02229
02230
02231 extern void dump_st (ST_IDX);
02232 extern void dump_ty (TY_IDX);
02233 extern void dump_symtab (SYMTAB *);
02234 extern void dump_constants (void);
02235
02236 extern SYMTAB * Get_Symtab_At_Id (INT32 id);
02237
02238
02239 extern char Get_ST_Id (ST_IDX st, INT *level, INT *index);
02240
02241 extern ST_IDX Get_ST_At_Id (INT32 level, INT32 index, char kind);
02242 extern ST_IDX Get_Symbol_At_Id (INT32 level, INT32 index);
02243 extern ST * Get_Label_At_Id (INT32 level, INT32 index);
02244 extern TY_IDX Get_TY_At_Id (INT32 id);
02245
02246 extern BOOL ST_is_private_local(const ST *st);
02247
02248 #ifdef __cplusplus
02249 }
02250
02251 class SYMBOL_TABLE {
02252 public:
02253 ST &operator[](ST *idx) {
02254 return *idx;
02255 }
02256 };
02257
02258 class TYPE_TABLE {
02259 public:
02260 TY *operator[](TY *idx) {
02261 return idx;
02262 }
02263 };
02264
02265 class FIELD_TABLE {
02266 public:
02267 FLD *operator[](FLD *idx) {
02268 return idx;
02269 }
02270 };
02271
02272 class ARB_TABLE {
02273 public:
02274 ARB *operator[](ARB *idx) {
02275 return idx;
02276 }
02277 };
02278
02279 extern "C" SYMBOL_TABLE St_Table;
02280 extern "C" TYPE_TABLE Ty_Table;
02281 extern "C" FIELD_TABLE Fld_Table;
02282 extern "C" ARB_TABLE Arb_Table;
02283 #endif
02284
02285
02286
02287
02288 #define PU_has_mp(p) SYMTAB_has_mp(p)
02289 #define PU_has_altentry(p) SYMTAB_has_altentry(p)
02290 #define PU_has_nested(p) SYMTAB_has_nested(p)
02291 #define PU_has_alloca(p) SYMTAB_has_alloca(p)
02292 #define PU_uplevel(p) SYMTAB_uplevel(p)
02293 #define PU_has_region(p) SYMTAB_has_rgn(p)
02294 #define Set_PU_has_region(p) Set_SYMTAB_has_rgn(p)
02295 #define PU_has_namelist(p) SYMTAB_has_namelist(p)
02296 #define PU_IPA_on(p) SYMTAB_IPA_on(p)
02297 #define PU_has_return_address(p) SYMTAB_ra_sym(p)
02298 #define Get_Current_PU() Current_Symtab
02299 #define Get_Current_PU_ST() Current_PU
02300 #define PU_lexical_level(p) ST_scope_id(p)
02301 #define Clear_ST_is_not_used(s) Reset_ST_is_not_used(s)
02302 #define LABEL_name(s) ST_name(s)
02303 #define FILE_INFO_has_inlines(s) SYMTAB_has_inlines(s)
02304 #define PU_has_inlines(s) SYMTAB_has_inlines(s)
02305 #define LABEL_begin_eh_range(s) STL_begin_eh_range(s)
02306 #define Set_LABEL_begin_eh_range(s) Set_STL_begin_eh_range(s)
02307 #define LABEL_end_eh_range(s) STL_end_eh_range(s)
02308 #define Set_LABEL_end_eh_range(s) Set_STL_end_eh_range(s)
02309 #define ST_pu_type(s) ST_type(s)
02310
02311 #define PU_C_LANG SYMTAB_C_LANG
02312 #define PU_CXX_LANG SYMTAB_CXX_LANG
02313 #define PU_F77_LANG SYMTAB_F77_LANG
02314 #define PU_F90_LANG SYMTAB_F90_LANG
02315 #define PU_src_lang(p) SYMTAB_src_lang(p)
02316 #define FOREACH_SYMBOL(t,s,i) FOR_ALL_SYMBOLS(t,s)
02317 #define FOREACH_LABEL(t,s,i) FOR_ALL_LABELS(t,s)
02318 #define FOREACH_TYPE(t,s,i) FOR_ALL_TYPES(t,s)
02319 #define CURRENT_SYMTAB Current_Symtab
02320 #define GLOBAL_SYMTAB Global_Symtab
02321 #define File_info Global_Symtab
02322
02323 #endif
02324
02325 #endif