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