00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCC_TREE_H
00026 #define GCC_TREE_H
00027
00028 #include "hashtab.h"
00029 #include "machmode.h"
00030 #include "input.h"
00031 #include "statistics.h"
00032 #include "vec.h"
00033
00034
00035
00036 #define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM,
00037
00038 enum tree_code {
00039 #include "tree.def"
00040
00041 LAST_AND_UNUSED_TREE_CODE
00042
00043 };
00044
00045 #undef DEFTREECODE
00046
00047 extern unsigned char tree_contains_struct[256][64];
00048 #define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
00049
00050
00051 #define NUM_TREE_CODES ((int) LAST_AND_UNUSED_TREE_CODE)
00052
00053
00054
00055
00056
00057
00058 enum tree_code_class {
00059 tcc_exceptional,
00060 tcc_constant,
00061
00062 tcc_type,
00063 tcc_declaration,
00064 tcc_reference,
00065 tcc_comparison,
00066 tcc_unary,
00067 tcc_binary,
00068 tcc_statement,
00069
00070 tcc_expression
00071 };
00072
00073
00074
00075
00076 extern const char *const tree_code_class_strings[];
00077
00078
00079
00080 #define TREE_CODE_CLASS_STRING(CLASS)\
00081 tree_code_class_strings[(int) (CLASS)]
00082
00083 #define MAX_TREE_CODES 256
00084 extern const enum tree_code_class tree_code_type[];
00085 #define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)]
00086
00087
00088
00089 #define EXCEPTIONAL_CLASS_P(CODE)\
00090 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_exceptional)
00091
00092
00093
00094 #define CONSTANT_CLASS_P(CODE)\
00095 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_constant)
00096
00097
00098
00099 #define TYPE_P(CODE)\
00100 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_type)
00101
00102
00103
00104 #define DECL_P(CODE)\
00105 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration)
00106
00107
00108
00109 #define MTAG_P(CODE) \
00110 (TREE_CODE (CODE) == STRUCT_FIELD_TAG \
00111 || TREE_CODE (CODE) == NAME_MEMORY_TAG \
00112 || TREE_CODE (CODE) == SYMBOL_MEMORY_TAG)
00113
00114
00115
00116
00117 #define VAR_OR_FUNCTION_DECL_P(DECL)\
00118 (TREE_CODE (DECL) == VAR_DECL || TREE_CODE (DECL) == FUNCTION_DECL)
00119
00120
00121
00122
00123 #define INDIRECT_REF_P(CODE)\
00124 (TREE_CODE (CODE) == INDIRECT_REF \
00125 || TREE_CODE (CODE) == ALIGN_INDIRECT_REF \
00126 || TREE_CODE (CODE) == MISALIGNED_INDIRECT_REF)
00127
00128
00129
00130 #define REFERENCE_CLASS_P(CODE)\
00131 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_reference)
00132
00133
00134
00135 #define COMPARISON_CLASS_P(CODE)\
00136 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_comparison)
00137
00138
00139
00140 #define UNARY_CLASS_P(CODE)\
00141 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_unary)
00142
00143
00144
00145 #define BINARY_CLASS_P(CODE)\
00146 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_binary)
00147
00148
00149
00150 #define STATEMENT_CLASS_P(CODE)\
00151 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_statement)
00152
00153
00154
00155 #define EXPRESSION_CLASS_P(CODE)\
00156 (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_expression)
00157
00158
00159
00160 #define IS_TYPE_OR_DECL_P(CODE)\
00161 (TYPE_P (CODE) || DECL_P (CODE))
00162
00163
00164
00165
00166 #define IS_EXPR_CODE_CLASS(CLASS)\
00167 ((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
00168
00169
00170
00171 #define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
00172
00173
00174
00175 #define OMP_DIRECTIVE_P(NODE) \
00176 (TREE_CODE (NODE) == OMP_PARALLEL \
00177 || TREE_CODE (NODE) == OMP_FOR \
00178 || TREE_CODE (NODE) == OMP_SECTIONS \
00179 || TREE_CODE (NODE) == OMP_SINGLE \
00180 || TREE_CODE (NODE) == OMP_SECTION \
00181 || TREE_CODE (NODE) == OMP_MASTER \
00182 || TREE_CODE (NODE) == OMP_ORDERED \
00183 || TREE_CODE (NODE) == OMP_CRITICAL \
00184 || TREE_CODE (NODE) == OMP_RETURN \
00185 || TREE_CODE (NODE) == OMP_CONTINUE)
00186
00187
00188
00189 extern const unsigned char tree_code_length[];
00190 #define TREE_CODE_LENGTH(CODE) tree_code_length[(int) (CODE)]
00191
00192
00193
00194 extern const char *const tree_code_name[];
00195
00196
00197 DEF_VEC_P(tree);
00198 DEF_VEC_ALLOC_P(tree,gc);
00199 DEF_VEC_ALLOC_P(tree,heap);
00200
00201
00202
00203
00204 enum built_in_class
00205 {
00206 NOT_BUILT_IN = 0,
00207 BUILT_IN_FRONTEND,
00208 BUILT_IN_MD,
00209 BUILT_IN_NORMAL
00210 };
00211
00212
00213 extern const char *const built_in_class_names[4];
00214
00215
00216
00217
00218 #define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) ENUM,
00219 enum built_in_function
00220 {
00221 #include "builtins.def"
00222
00223
00224
00225 BUILT_IN_COMPLEX_MUL_MIN,
00226 BUILT_IN_COMPLEX_MUL_MAX
00227 = BUILT_IN_COMPLEX_MUL_MIN
00228 + MAX_MODE_COMPLEX_FLOAT
00229 - MIN_MODE_COMPLEX_FLOAT,
00230
00231 BUILT_IN_COMPLEX_DIV_MIN,
00232 BUILT_IN_COMPLEX_DIV_MAX
00233 = BUILT_IN_COMPLEX_DIV_MIN
00234 + MAX_MODE_COMPLEX_FLOAT
00235 - MIN_MODE_COMPLEX_FLOAT,
00236
00237
00238 END_BUILTINS
00239 };
00240 #undef DEF_BUILTIN
00241
00242
00243 extern const char * built_in_names[(int) END_BUILTINS];
00244
00245
00246
00247 #define BUILTIN_EXP10_P(FN) \
00248 ((FN) == BUILT_IN_EXP10 || (FN) == BUILT_IN_EXP10F || (FN) == BUILT_IN_EXP10L \
00249 || (FN) == BUILT_IN_POW10 || (FN) == BUILT_IN_POW10F || (FN) == BUILT_IN_POW10L)
00250
00251 #define BUILTIN_EXPONENT_P(FN) (BUILTIN_EXP10_P (FN) \
00252 || (FN) == BUILT_IN_EXP || (FN) == BUILT_IN_EXPF || (FN) == BUILT_IN_EXPL \
00253 || (FN) == BUILT_IN_EXP2 || (FN) == BUILT_IN_EXP2F || (FN) == BUILT_IN_EXP2L)
00254
00255 #define BUILTIN_SQRT_P(FN) \
00256 ((FN) == BUILT_IN_SQRT || (FN) == BUILT_IN_SQRTF || (FN) == BUILT_IN_SQRTL)
00257
00258 #define BUILTIN_CBRT_P(FN) \
00259 ((FN) == BUILT_IN_CBRT || (FN) == BUILT_IN_CBRTF || (FN) == BUILT_IN_CBRTL)
00260
00261 #define BUILTIN_ROOT_P(FN) (BUILTIN_SQRT_P (FN) || BUILTIN_CBRT_P (FN))
00262
00263 #define CASE_FLT_FN(FN) case FN: case FN##F: case FN##L
00264 #define CASE_INT_FN(FN) case FN: case FN##L: case FN##LL
00265
00266
00267 extern GTY(()) tree built_in_decls[(int) END_BUILTINS];
00268 extern GTY(()) tree implicit_built_in_decls[(int) END_BUILTINS];
00269
00270
00271
00272
00273 extern unsigned const char omp_clause_num_ops[];
00274 extern const char * const omp_clause_code_name[];
00275
00276
00277
00278 enum omp_clause_code
00279 {
00280
00281
00282 OMP_CLAUSE_ERROR = 0,
00283
00284
00285 OMP_CLAUSE_PRIVATE,
00286
00287
00288 OMP_CLAUSE_SHARED,
00289
00290
00291 OMP_CLAUSE_FIRSTPRIVATE,
00292
00293
00294 OMP_CLAUSE_LASTPRIVATE,
00295
00296
00297
00298
00299
00300
00301
00302
00303 OMP_CLAUSE_REDUCTION,
00304
00305
00306 OMP_CLAUSE_COPYIN,
00307
00308
00309 OMP_CLAUSE_COPYPRIVATE,
00310
00311
00312 OMP_CLAUSE_IF,
00313
00314
00315 OMP_CLAUSE_NUM_THREADS,
00316
00317
00318 OMP_CLAUSE_SCHEDULE,
00319
00320
00321 OMP_CLAUSE_NOWAIT,
00322
00323
00324 OMP_CLAUSE_ORDERED,
00325
00326
00327 OMP_CLAUSE_DEFAULT
00328 };
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351 union tree_ann_d;
00352
00353 struct tree_common GTY(())
00354 {
00355 tree chain;
00356 tree type;
00357 union tree_ann_d *ann;
00358
00359 ENUM_BITFIELD(tree_code) code : 8;
00360
00361 unsigned side_effects_flag : 1;
00362 unsigned constant_flag : 1;
00363 unsigned addressable_flag : 1;
00364 unsigned volatile_flag : 1;
00365 unsigned readonly_flag : 1;
00366 unsigned unsigned_flag : 1;
00367 unsigned asm_written_flag: 1;
00368 unsigned nowarning_flag : 1;
00369
00370 unsigned used_flag : 1;
00371 unsigned nothrow_flag : 1;
00372 unsigned static_flag : 1;
00373 unsigned public_flag : 1;
00374 unsigned private_flag : 1;
00375 unsigned protected_flag : 1;
00376 unsigned deprecated_flag : 1;
00377 unsigned invariant_flag : 1;
00378
00379 unsigned lang_flag_0 : 1;
00380 unsigned lang_flag_1 : 1;
00381 unsigned lang_flag_2 : 1;
00382 unsigned lang_flag_3 : 1;
00383 unsigned lang_flag_4 : 1;
00384 unsigned lang_flag_5 : 1;
00385 unsigned lang_flag_6 : 1;
00386 unsigned visited : 1;
00387
00388 unsigned int emitted : 1;
00389 unsigned int not_emitted_by_gxx : 1;
00390
00391
00392
00393 unsigned int emit_target_expr_cleanup : 1;
00394
00395 unsigned int dwarf_access : 2;
00396
00397 unsigned int fully_translated_to_gs : 1;
00398
00399 unsigned long translated_gs_node;
00400 HOST_WIDE_INT gs_sequence_num;
00401 };
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562 #undef DEFTREESTRUCT
00563 #define DEFTREESTRUCT(ENUM, NAME) ENUM,
00564 enum tree_node_structure_enum {
00565 #include "treestruct.def"
00566 LAST_TS_ENUM
00567 };
00568 #undef DEFTREESTRUCT
00569
00570
00571
00572
00573
00574
00575 #define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
00576 #define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (VALUE))
00577
00578
00579
00580 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
00581
00582 #define TREE_CHECK(T, CODE) __extension__ \
00583 ({ const tree __t = (T); \
00584 if (TREE_CODE (__t) != (CODE)) \
00585 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00586 (CODE), 0); \
00587 __t; })
00588
00589 #define TREE_NOT_CHECK(T, CODE) __extension__ \
00590 ({ const tree __t = (T); \
00591 if (TREE_CODE (__t) == (CODE)) \
00592 tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00593 (CODE), 0); \
00594 __t; })
00595
00596 #define TREE_CHECK2(T, CODE1, CODE2) __extension__ \
00597 ({ const tree __t = (T); \
00598 if (TREE_CODE (__t) != (CODE1) \
00599 && TREE_CODE (__t) != (CODE2)) \
00600 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00601 (CODE1), (CODE2), 0); \
00602 __t; })
00603
00604 #define TREE_NOT_CHECK2(T, CODE1, CODE2) __extension__ \
00605 ({ const tree __t = (T); \
00606 if (TREE_CODE (__t) == (CODE1) \
00607 || TREE_CODE (__t) == (CODE2)) \
00608 tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00609 (CODE1), (CODE2), 0); \
00610 __t; })
00611
00612 #define TREE_CHECK3(T, CODE1, CODE2, CODE3) __extension__ \
00613 ({ const tree __t = (T); \
00614 if (TREE_CODE (__t) != (CODE1) \
00615 && TREE_CODE (__t) != (CODE2) \
00616 && TREE_CODE (__t) != (CODE3)) \
00617 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00618 (CODE1), (CODE2), (CODE3), 0); \
00619 __t; })
00620
00621 #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) __extension__ \
00622 ({ const tree __t = (T); \
00623 if (TREE_CODE (__t) == (CODE1) \
00624 || TREE_CODE (__t) == (CODE2) \
00625 || TREE_CODE (__t) == (CODE3)) \
00626 tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00627 (CODE1), (CODE2), (CODE3), 0); \
00628 __t; })
00629
00630 #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) __extension__ \
00631 ({ const tree __t = (T); \
00632 if (TREE_CODE (__t) != (CODE1) \
00633 && TREE_CODE (__t) != (CODE2) \
00634 && TREE_CODE (__t) != (CODE3) \
00635 && TREE_CODE (__t) != (CODE4)) \
00636 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00637 (CODE1), (CODE2), (CODE3), (CODE4), 0); \
00638 __t; })
00639
00640 #define NON_TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) __extension__ \
00641 ({ const tree __t = (T); \
00642 if (TREE_CODE (__t) == (CODE1) \
00643 || TREE_CODE (__t) == (CODE2) \
00644 || TREE_CODE (__t) == (CODE3) \
00645 || TREE_CODE (__t) == (CODE4)) \
00646 tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00647 (CODE1), (CODE2), (CODE3), (CODE4), 0); \
00648 __t; })
00649
00650 #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__ \
00651 ({ const tree __t = (T); \
00652 if (TREE_CODE (__t) != (CODE1) \
00653 && TREE_CODE (__t) != (CODE2) \
00654 && TREE_CODE (__t) != (CODE3) \
00655 && TREE_CODE (__t) != (CODE4) \
00656 && TREE_CODE (__t) != (CODE5)) \
00657 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00658 (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), 0);\
00659 __t; })
00660
00661 #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__ \
00662 ({ const tree __t = (T); \
00663 if (TREE_CODE (__t) == (CODE1) \
00664 || TREE_CODE (__t) == (CODE2) \
00665 || TREE_CODE (__t) == (CODE3) \
00666 || TREE_CODE (__t) == (CODE4) \
00667 || TREE_CODE (__t) == (CODE5)) \
00668 tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00669 (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), 0);\
00670 __t; })
00671
00672 #define CONTAINS_STRUCT_CHECK(T, STRUCT) __extension__ \
00673 ({ const tree __t = (T); \
00674 if (tree_contains_struct[TREE_CODE(__t)][(STRUCT)] != 1) \
00675 tree_contains_struct_check_failed (__t, (STRUCT), __FILE__, __LINE__, \
00676 __FUNCTION__); \
00677 __t; })
00678
00679 #define TREE_CLASS_CHECK(T, CLASS) __extension__ \
00680 ({ const tree __t = (T); \
00681 if (TREE_CODE_CLASS (TREE_CODE(__t)) != (CLASS)) \
00682 tree_class_check_failed (__t, (CLASS), __FILE__, __LINE__, \
00683 __FUNCTION__); \
00684 __t; })
00685
00686 #define TREE_RANGE_CHECK(T, CODE1, CODE2) __extension__ \
00687 ({ const tree __t = (T); \
00688 if (TREE_CODE (__t) < (CODE1) || TREE_CODE (__t) > (CODE2)) \
00689 tree_range_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00690 (CODE1), (CODE2)); \
00691 __t; })
00692
00693 #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) __extension__ \
00694 ({ const tree __t = (T); \
00695 if (TREE_CODE (__t) != OMP_CLAUSE) \
00696 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00697 OMP_CLAUSE, 0); \
00698 if (__t->omp_clause.code != (CODE)) \
00699 omp_clause_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00700 (CODE)); \
00701 __t; })
00702
00703 #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) __extension__ \
00704 ({ const tree __t = (T); \
00705 if (TREE_CODE (__t) != OMP_CLAUSE) \
00706 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00707 OMP_CLAUSE, 0); \
00708 if ((int) __t->omp_clause.code < (int) (CODE1) \
00709 || (int) __t->omp_clause.code > (int) (CODE2)) \
00710 omp_clause_range_check_failed (__t, __FILE__, __LINE__, \
00711 __FUNCTION__, (CODE1), (CODE2)); \
00712 __t; })
00713
00714
00715 #define EXPR_CHECK(T) __extension__ \
00716 ({ const tree __t = (T); \
00717 char const __c = TREE_CODE_CLASS (TREE_CODE (__t)); \
00718 if (!IS_EXPR_CODE_CLASS (__c)) \
00719 tree_class_check_failed (__t, tcc_expression, __FILE__, __LINE__, \
00720 __FUNCTION__); \
00721 __t; })
00722
00723
00724 #define NON_TYPE_CHECK(T) __extension__ \
00725 ({ const tree __t = (T); \
00726 if (TYPE_P (__t)) \
00727 tree_not_class_check_failed (__t, tcc_type, __FILE__, __LINE__, \
00728 __FUNCTION__); \
00729 __t; })
00730
00731 #define TREE_VEC_ELT_CHECK(T, I) __extension__ \
00732 (*({const tree __t = (T); \
00733 const int __i = (I); \
00734 if (TREE_CODE (__t) != TREE_VEC) \
00735 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00736 TREE_VEC, 0); \
00737 if (__i < 0 || __i >= __t->vec.length) \
00738 tree_vec_elt_check_failed (__i, __t->vec.length, \
00739 __FILE__, __LINE__, __FUNCTION__); \
00740 &__t->vec.a[__i]; }))
00741
00742 #define PHI_NODE_ELT_CHECK(t, i) __extension__ \
00743 (*({const tree __t = t; \
00744 const int __i = (i); \
00745 if (TREE_CODE (__t) != PHI_NODE) \
00746 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00747 PHI_NODE, 0); \
00748 if (__i < 0 || __i >= __t->phi.capacity) \
00749 phi_node_elt_check_failed (__i, __t->phi.num_args, \
00750 __FILE__, __LINE__, __FUNCTION__); \
00751 &__t->phi.a[__i]; }))
00752
00753 #define OMP_CLAUSE_ELT_CHECK(t, i) __extension__ \
00754 (*({const tree __t = t; \
00755 const int __i = (i); \
00756 if (TREE_CODE (__t) != OMP_CLAUSE) \
00757 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
00758 OMP_CLAUSE, 0); \
00759 if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code]) \
00760 omp_clause_operand_check_failed (__i, __t, __FILE__, __LINE__, \
00761 __FUNCTION__); \
00762 &__t->omp_clause.ops[__i]; }))
00763
00764
00765 #define TREE_OPERAND_CHECK(T, I) __extension__ \
00766 (*({const tree __t = EXPR_CHECK (T); \
00767 const int __i = (I); \
00768 if (__i < 0 || __i >= TREE_CODE_LENGTH (TREE_CODE (__t))) \
00769 tree_operand_check_failed (__i, TREE_CODE (__t), \
00770 __FILE__, __LINE__, __FUNCTION__); \
00771 &__t->exp.operands[__i]; }))
00772
00773 #define TREE_OPERAND_CHECK_CODE(T, CODE, I) __extension__ \
00774 (*({const tree __t = (T); \
00775 const int __i = (I); \
00776 if (TREE_CODE (__t) != CODE) \
00777 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, (CODE), 0);\
00778 if (__i < 0 || __i >= TREE_CODE_LENGTH (CODE)) \
00779 tree_operand_check_failed (__i, (CODE), \
00780 __FILE__, __LINE__, __FUNCTION__); \
00781 &__t->exp.operands[__i]; }))
00782
00783 #define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__ \
00784 (*(rtx *) \
00785 ({const tree __t = (T); \
00786 const int __i = (I); \
00787 if (TREE_CODE (__t) != (CODE)) \
00788 tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, (CODE), 0); \
00789 if (__i < 0 || __i >= TREE_CODE_LENGTH ((CODE))) \
00790 tree_operand_check_failed (__i, (CODE), \
00791 __FILE__, __LINE__, __FUNCTION__); \
00792 &__t->exp.operands[__i]; }))
00793
00794 extern void tree_contains_struct_check_failed (const tree,
00795 const enum tree_node_structure_enum,
00796 const char *, int, const char *)
00797 ATTRIBUTE_NORETURN;
00798
00799 extern void tree_check_failed (const tree, const char *, int, const char *,
00800 ...) ATTRIBUTE_NORETURN;
00801 extern void tree_not_check_failed (const tree, const char *, int, const char *,
00802 ...) ATTRIBUTE_NORETURN;
00803 extern void tree_class_check_failed (const tree, const enum tree_code_class,
00804 const char *, int, const char *)
00805 ATTRIBUTE_NORETURN;
00806 extern void tree_range_check_failed (const tree, const char *, int,
00807 const char *, enum tree_code,
00808 enum tree_code);
00809 extern void tree_not_class_check_failed (const tree,
00810 const enum tree_code_class,
00811 const char *, int, const char *)
00812 ATTRIBUTE_NORETURN;
00813 extern void tree_vec_elt_check_failed (int, int, const char *,
00814 int, const char *)
00815 ATTRIBUTE_NORETURN;
00816 extern void phi_node_elt_check_failed (int, int, const char *,
00817 int, const char *)
00818 ATTRIBUTE_NORETURN;
00819 extern void tree_operand_check_failed (int, enum tree_code,
00820 const char *, int, const char *)
00821 ATTRIBUTE_NORETURN;
00822 extern void omp_clause_check_failed (const tree, const char *, int,
00823 const char *, enum omp_clause_code)
00824 ATTRIBUTE_NORETURN;
00825 extern void omp_clause_operand_check_failed (int, tree, const char *,
00826 int, const char *)
00827 ATTRIBUTE_NORETURN;
00828 extern void omp_clause_range_check_failed (const tree, const char *, int,
00829 const char *, enum omp_clause_code,
00830 enum omp_clause_code)
00831 ATTRIBUTE_NORETURN;
00832
00833 #else
00834
00835 #define CONTAINS_STRUCT_CHECK(T, ENUM) (T)
00836 #define TREE_CHECK(T, CODE) (T)
00837 #define TREE_NOT_CHECK(T, CODE) (T)
00838 #define TREE_CHECK2(T, CODE1, CODE2) (T)
00839 #define TREE_NOT_CHECK2(T, CODE1, CODE2) (T)
00840 #define TREE_CHECK3(T, CODE1, CODE2, CODE3) (T)
00841 #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) (T)
00842 #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
00843 #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
00844 #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
00845 #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
00846 #define TREE_CLASS_CHECK(T, CODE) (T)
00847 #define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
00848 #define EXPR_CHECK(T) (T)
00849 #define NON_TYPE_CHECK(T) (T)
00850 #define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
00851 #define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
00852 #define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
00853 #define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
00854 #define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
00855 #define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
00856 #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
00857 #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
00858
00859 #endif
00860
00861 #define TREE_BLOCK(NODE) (EXPR_CHECK (NODE)->exp.block)
00862
00863 #include "tree-check.h"
00864
00865 #define TYPE_CHECK(T) TREE_CLASS_CHECK (T, tcc_type)
00866 #define DECL_MINIMAL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_MINIMAL)
00867 #define TREE_MEMORY_TAG_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_MEMORY_TAG)
00868 #define DECL_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_COMMON)
00869 #define DECL_WRTL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WRTL)
00870 #define DECL_WITH_VIS_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WITH_VIS)
00871 #define DECL_NON_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_NON_COMMON)
00872 #define CST_CHECK(T) TREE_CLASS_CHECK (T, tcc_constant)
00873 #define STMT_CHECK(T) TREE_CLASS_CHECK (T, tcc_statement)
00874 #define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
00875 #define PTR_OR_REF_CHECK(T) TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
00876
00877 #define RECORD_OR_UNION_CHECK(T) \
00878 TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
00879 #define NOT_RECORD_OR_UNION_CHECK(T) \
00880 TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
00881
00882 #define NUMERICAL_TYPE_CHECK(T) \
00883 TREE_CHECK4 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE)
00884
00885
00886
00887
00888
00889 #define TREE_TYPE(NODE) ((NODE)->common.type)
00890
00891
00892
00893 #define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
00894
00895
00896
00897 #define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908 #define TREE_CHAIN(NODE) ((NODE)->common.chain)
00909
00910
00911
00912
00913 #define STRIP_NOPS(EXP) \
00914 while ((TREE_CODE (EXP) == NOP_EXPR \
00915 || TREE_CODE (EXP) == CONVERT_EXPR \
00916 || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
00917 && TREE_OPERAND (EXP, 0) != error_mark_node \
00918 && (TYPE_MODE (TREE_TYPE (EXP)) \
00919 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
00920 (EXP) = TREE_OPERAND (EXP, 0)
00921
00922
00923
00924 #define STRIP_SIGN_NOPS(EXP) \
00925 while ((TREE_CODE (EXP) == NOP_EXPR \
00926 || TREE_CODE (EXP) == CONVERT_EXPR \
00927 || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
00928 && TREE_OPERAND (EXP, 0) != error_mark_node \
00929 && (TYPE_MODE (TREE_TYPE (EXP)) \
00930 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
00931 && (TYPE_UNSIGNED (TREE_TYPE (EXP)) \
00932 == TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
00933 (EXP) = TREE_OPERAND (EXP, 0)
00934
00935
00936
00937 #define STRIP_TYPE_NOPS(EXP) \
00938 while ((TREE_CODE (EXP) == NOP_EXPR \
00939 || TREE_CODE (EXP) == CONVERT_EXPR \
00940 || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
00941 && TREE_OPERAND (EXP, 0) != error_mark_node \
00942 && (TREE_TYPE (EXP) \
00943 == TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
00944 (EXP) = TREE_OPERAND (EXP, 0)
00945
00946
00947
00948
00949 #define STRIP_USELESS_TYPE_CONVERSION(EXP) \
00950 while (tree_ssa_useless_type_conversion (EXP)) \
00951 EXP = TREE_OPERAND (EXP, 0)
00952
00953
00954
00955
00956
00957 #define INTEGRAL_TYPE_P(TYPE) \
00958 (TREE_CODE (TYPE) == ENUMERAL_TYPE \
00959 || TREE_CODE (TYPE) == BOOLEAN_TYPE \
00960 || TREE_CODE (TYPE) == INTEGER_TYPE)
00961
00962
00963
00964 #define SCALAR_FLOAT_TYPE_P(TYPE) (TREE_CODE (TYPE) == REAL_TYPE)
00965
00966
00967
00968 #define COMPLEX_FLOAT_TYPE_P(TYPE) \
00969 (TREE_CODE (TYPE) == COMPLEX_TYPE \
00970 && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
00971
00972
00973
00974 #define VECTOR_FLOAT_TYPE_P(TYPE) \
00975 (TREE_CODE (TYPE) == VECTOR_TYPE \
00976 && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
00977
00978
00979
00980
00981
00982 #define FLOAT_TYPE_P(TYPE) \
00983 (SCALAR_FLOAT_TYPE_P (TYPE) \
00984 || ((TREE_CODE (TYPE) == COMPLEX_TYPE \
00985 || TREE_CODE (TYPE) == VECTOR_TYPE) \
00986 && SCALAR_FLOAT_TYPE_P (TREE_TYPE (TYPE))))
00987
00988
00989 #define DECIMAL_FLOAT_TYPE_P(TYPE) \
00990 (SCALAR_FLOAT_TYPE_P (TYPE) \
00991 && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TYPE)))
00992
00993
00994
00995
00996 #define AGGREGATE_TYPE_P(TYPE) \
00997 (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \
00998 || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
00999
01000
01001
01002
01003
01004 #define POINTER_TYPE_P(TYPE) \
01005 (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
01006
01007
01008 #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
01009
01010
01011 #define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
01012
01013
01014 #define COMPLETE_OR_VOID_TYPE_P(NODE) \
01015 (COMPLETE_TYPE_P (NODE) || VOID_TYPE_P (NODE))
01016
01017
01018 #define COMPLETE_OR_UNBOUND_ARRAY_TYPE_P(NODE) \
01019 (COMPLETE_TYPE_P (TREE_CODE (NODE) == ARRAY_TYPE ? TREE_TYPE (NODE) : (NODE)))
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039 #define TREE_ADDRESSABLE(NODE) ((NODE)->common.addressable_flag)
01040
01041
01042
01043
01044 #define CALL_EXPR_TAILCALL(NODE) (CALL_EXPR_CHECK(NODE)->common.addressable_flag)
01045
01046
01047
01048 #define CASE_LOW_SEEN(NODE) \
01049 (CASE_LABEL_EXPR_CHECK (NODE)->common.addressable_flag)
01050
01051
01052
01053
01054
01055
01056
01057 #define TREE_STATIC(NODE) ((NODE)->common.static_flag)
01058
01059
01060
01061
01062 #define CLEANUP_EH_ONLY(NODE) ((NODE)->common.static_flag)
01063
01064
01065
01066 #define CASE_HIGH_SEEN(NODE) \
01067 (CASE_LABEL_EXPR_CHECK (NODE)->common.static_flag)
01068
01069
01070
01071
01072
01073
01074 #define TREE_NO_WARNING(NODE) ((NODE)->common.nowarning_flag)
01075
01076
01077
01078
01079
01080 #define TREE_CONSTANT_OVERFLOW(NODE) (CST_CHECK (NODE)->common.static_flag)
01081
01082
01083
01084 #define TREE_SYMBOL_REFERENCED(NODE) \
01085 (IDENTIFIER_NODE_CHECK (NODE)->common.static_flag)
01086
01087
01088
01089 #define TYPE_REF_CAN_ALIAS_ALL(NODE) \
01090 (PTR_OR_REF_CHECK (NODE)->common.static_flag)
01091
01092
01093
01094
01095
01096
01097 #define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->common.public_flag)
01098
01099
01100
01101
01102
01103
01104 #define TREE_PUBLIC(NODE) ((NODE)->common.public_flag)
01105
01106
01107
01108 #define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK(NODE)->common.public_flag)
01109
01110
01111
01112 #define SAVE_EXPR_RESOLVED_P(NODE) \
01113 (TREE_CHECK (NODE, SAVE_EXPR)->common.public_flag)
01114
01115
01116
01117
01118
01119
01120 #define TREE_SIDE_EFFECTS(NODE) \
01121 (NON_TYPE_CHECK (NODE)->common.side_effects_flag)
01122
01123
01124
01125
01126 #define FORCED_LABEL(NODE) ((NODE)->common.side_effects_flag)
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141 #define TREE_THIS_VOLATILE(NODE) ((NODE)->common.volatile_flag)
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153 #define TREE_THIS_NOTRAP(NODE) ((NODE)->common.nothrow_flag)
01154
01155
01156
01157 #define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->common.readonly_flag)
01158
01159
01160 #define TREE_READONLY_DECL_P(NODE)\
01161 (DECL_P (NODE) && TREE_READONLY (NODE))
01162
01163
01164
01165 #define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->common.constant_flag)
01166
01167
01168 #define TYPE_SIZES_GIMPLIFIED(NODE) (TYPE_CHECK (NODE)->common.constant_flag)
01169
01170
01171 #define DECL_UNSIGNED(NODE) (DECL_COMMON_CHECK (NODE)->common.unsigned_flag)
01172
01173
01174 #define BIT_FIELD_REF_UNSIGNED(NODE) \
01175 (BIT_FIELD_REF_CHECK (NODE)->common.unsigned_flag)
01176
01177
01178 #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.unsigned_flag)
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189 #define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_flag)
01190
01191
01192
01193
01194
01195
01196 #define TREE_USED(NODE) ((NODE)->common.used_flag)
01197
01198
01199
01200 #define TREE_NOTHROW(NODE) ((NODE)->common.nothrow_flag)
01201
01202
01203
01204 #define CALL_EXPR_RETURN_SLOT_OPT(NODE) ((NODE)->common.private_flag)
01205
01206
01207
01208 #define DECL_BY_REFERENCE(NODE) (DECL_COMMON_CHECK (NODE)->common.private_flag)
01209
01210
01211
01212 #define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->common.protected_flag)
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223 #define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->common.nothrow_flag)
01224
01225
01226 #define TREE_PRIVATE(NODE) ((NODE)->common.private_flag)
01227
01228
01229 #define TREE_PROTECTED(NODE) ((NODE)->common.protected_flag)
01230
01231
01232
01233 #define TREE_DEPRECATED(NODE) \
01234 ((NODE)->common.deprecated_flag)
01235
01236
01237
01238 #define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
01239 (IDENTIFIER_NODE_CHECK (NODE)->common.deprecated_flag)
01240
01241
01242
01243
01244
01245 #define TREE_INVARIANT(NODE) ((NODE)->common.invariant_flag)
01246
01247
01248 #define TREE_LANG_FLAG_0(NODE) ((NODE)->common.lang_flag_0)
01249 #define TREE_LANG_FLAG_1(NODE) ((NODE)->common.lang_flag_1)
01250 #define TREE_LANG_FLAG_2(NODE) ((NODE)->common.lang_flag_2)
01251 #define TREE_LANG_FLAG_3(NODE) ((NODE)->common.lang_flag_3)
01252 #define TREE_LANG_FLAG_4(NODE) ((NODE)->common.lang_flag_4)
01253 #define TREE_LANG_FLAG_5(NODE) ((NODE)->common.lang_flag_5)
01254 #define TREE_LANG_FLAG_6(NODE) ((NODE)->common.lang_flag_6)
01255
01256
01257
01258
01259
01260
01261
01262 #define TREE_INT_CST(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst)
01263 #define TREE_INT_CST_LOW(NODE) (TREE_INT_CST (NODE).low)
01264 #define TREE_INT_CST_HIGH(NODE) (TREE_INT_CST (NODE).high)
01265
01266 #define INT_CST_LT(A, B) \
01267 (TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B) \
01268 || (TREE_INT_CST_HIGH (A) == TREE_INT_CST_HIGH (B) \
01269 && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
01270
01271 #define INT_CST_LT_UNSIGNED(A, B) \
01272 (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A) \
01273 < (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B)) \
01274 || (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A) \
01275 == (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B)) \
01276 && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
01277
01278 struct tree_int_cst GTY(())
01279 {
01280 struct tree_common common;
01281 double_int int_cst;
01282 };
01283
01284
01285
01286
01287 struct real_value;
01288
01289 #define TREE_REAL_CST_PTR(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst_ptr)
01290 #define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
01291
01292 struct tree_real_cst GTY(())
01293 {
01294 struct tree_common common;
01295 struct real_value * real_cst_ptr;
01296 };
01297
01298
01299 #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
01300 #define TREE_STRING_POINTER(NODE) \
01301 ((const char *)(STRING_CST_CHECK (NODE)->string.str))
01302
01303 struct tree_string GTY(())
01304 {
01305 struct tree_common common;
01306 int length;
01307 char str[1];
01308 };
01309
01310
01311 #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
01312 #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
01313
01314 struct tree_complex GTY(())
01315 {
01316 struct tree_common common;
01317 tree real;
01318 tree imag;
01319 };
01320
01321
01322 #define TREE_VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.elements)
01323
01324 struct tree_vector GTY(())
01325 {
01326 struct tree_common common;
01327 tree elements;
01328 };
01329
01330 #include "symtab.h"
01331
01332
01333
01334 #define IDENTIFIER_LENGTH(NODE) \
01335 (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.len)
01336 #define IDENTIFIER_POINTER(NODE) \
01337 ((const char *) IDENTIFIER_NODE_CHECK (NODE)->identifier.id.str)
01338 #define IDENTIFIER_HASH_VALUE(NODE) \
01339 (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.hash_value)
01340
01341
01342
01343
01344 #define HT_IDENT_TO_GCC_IDENT(NODE) \
01345 ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
01346 #define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
01347
01348 struct tree_identifier GTY(())
01349 {
01350 struct tree_common common;
01351 struct ht_identifier id;
01352 };
01353
01354
01355 #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
01356 #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
01357
01358 struct tree_list GTY(())
01359 {
01360 struct tree_common common;
01361 tree purpose;
01362 tree value;
01363 };
01364
01365
01366 #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length)
01367 #define TREE_VEC_END(NODE) \
01368 ((void) TREE_VEC_CHECK (NODE), &((NODE)->vec.a[(NODE)->vec.length]))
01369
01370 #define TREE_VEC_ELT(NODE,I) TREE_VEC_ELT_CHECK (NODE, I)
01371
01372 struct tree_vec GTY(())
01373 {
01374 struct tree_common common;
01375 int length;
01376 tree GTY ((length ("TREE_VEC_LENGTH ((tree)&%h)"))) a[1];
01377 };
01378
01379
01380 #define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
01381
01382
01383
01384
01385 #define FOR_EACH_CONSTRUCTOR_VALUE(V, IX, VAL) \
01386 for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
01387 ? false \
01388 : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
01389 true); \
01390 (IX)++)
01391
01392
01393
01394
01395 #define FOR_EACH_CONSTRUCTOR_ELT(V, IX, INDEX, VAL) \
01396 for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
01397 ? false \
01398 : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
01399 (INDEX = VEC_index (constructor_elt, V, IX)->index), \
01400 true); \
01401 (IX)++)
01402
01403 #ifdef KEY
01404
01405
01406
01407 #define FOR_EACH_CONSTRUCTOR_ELT_R(V, IX, INDEX, VAL) \
01408 if (!VEC_empty (constructor_elt, V)) \
01409 for (IX = VEC_length (constructor_elt, V) - 1; (IX < 0) \
01410 ? false \
01411 : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
01412 (INDEX = VEC_index (constructor_elt, V, IX)->index), \
01413 true); \
01414 (IX)--)
01415 #endif
01416
01417
01418 #define CONSTRUCTOR_APPEND_ELT(V, INDEX, VALUE) \
01419 do { \
01420 constructor_elt *_ce___ = VEC_safe_push (constructor_elt, gc, V, NULL); \
01421 _ce___->index = INDEX; \
01422 _ce___->value = VALUE; \
01423 } while (0)
01424
01425
01426
01427
01428
01429 typedef struct constructor_elt_d GTY(())
01430 {
01431 tree index;
01432 tree value;
01433 } constructor_elt;
01434
01435 DEF_VEC_O(constructor_elt);
01436 DEF_VEC_ALLOC_O(constructor_elt,gc);
01437
01438 struct tree_constructor GTY(())
01439 {
01440 struct tree_common common;
01441 VEC(constructor_elt,gc) *elts;
01442 };
01443
01444
01445
01446
01447 #define IS_EMPTY_STMT(NODE) (TREE_CODE (NODE) == NOP_EXPR \
01448 && VOID_TYPE_P (TREE_TYPE (NODE)) \
01449 && integer_zerop (TREE_OPERAND (NODE, 0)))
01450
01451
01452 #define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
01453 #define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
01454
01455
01456 #define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
01457
01458 #ifdef USE_MAPPED_LOCATION
01459
01460
01461
01462 #define EXPR_LOCATION(NODE) \
01463 (EXPR_P (NODE) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
01464 #define SET_EXPR_LOCATION(NODE, FROM) \
01465 (EXPR_CHECK (NODE)->exp.locus = (FROM))
01466 #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
01467
01468 #define EXPR_LOCUS(NODE) \
01469 (EXPR_P (NODE) ? &(NODE)->exp.locus : (location_t *)NULL)
01470 #define SET_EXPR_LOCUS(NODE, FROM) \
01471 do { source_location *loc_tmp = FROM; \
01472 EXPR_CHECK (NODE)->exp.locus \
01473 = loc_tmp == NULL ? UNKNOWN_LOCATION : *loc_tmp; } while (0)
01474 #define EXPR_FILENAME(NODE) \
01475 LOCATION_FILE (EXPR_CHECK (NODE)->exp.locus)
01476 #define EXPR_LINENO(NODE) \
01477 LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
01478 #else
01479
01480
01481
01482 #define EXPR_LOCUS(NODE) \
01483 (EXPR_P (NODE) ? (NODE)->exp.locus : (location_t *)NULL)
01484 #define SET_EXPR_LOCUS(NODE, FROM) \
01485 (EXPR_CHECK (NODE)->exp.locus = (FROM))
01486 #define SET_EXPR_LOCATION(NODE, FROM) annotate_with_locus (NODE, FROM)
01487 #define EXPR_FILENAME(NODE) \
01488 (EXPR_CHECK (NODE)->exp.locus->file)
01489 #define EXPR_LINENO(NODE) \
01490 (EXPR_CHECK (NODE)->exp.locus->line)
01491 #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCUS (NODE) != NULL)
01492 #define EXPR_LOCATION(NODE) \
01493 (EXPR_HAS_LOCATION(NODE) ? *(NODE)->exp.locus : UNKNOWN_LOCATION)
01494 #endif
01495
01496
01497 #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
01498 #define TARGET_EXPR_INITIAL(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 1)
01499 #define TARGET_EXPR_CLEANUP(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 2)
01500
01501
01502
01503 #define DECL_EXPR_DECL(NODE) TREE_OPERAND (DECL_EXPR_CHECK (NODE), 0)
01504
01505 #define EXIT_EXPR_COND(NODE) TREE_OPERAND (EXIT_EXPR_CHECK (NODE), 0)
01506
01507
01508
01509
01510 #define SWITCH_COND(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 0)
01511 #define SWITCH_BODY(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 1)
01512 #define SWITCH_LABELS(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 2)
01513
01514
01515
01516 #define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 0)
01517 #define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1)
01518 #define CASE_LABEL(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2)
01519
01520
01521 #define TMR_SYMBOL(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 0))
01522 #define TMR_BASE(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 1))
01523 #define TMR_INDEX(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 2))
01524 #define TMR_STEP(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 3))
01525 #define TMR_OFFSET(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 4))
01526 #define TMR_ORIGINAL(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 5))
01527 #define TMR_TAG(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 6))
01528
01529
01530 #define BIND_EXPR_VARS(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 0))
01531 #define BIND_EXPR_BODY(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 1))
01532 #define BIND_EXPR_BLOCK(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 2))
01533
01534
01535
01536 #define GOTO_DESTINATION(NODE) TREE_OPERAND ((NODE), 0)
01537
01538
01539
01540
01541
01542 #define ASM_STRING(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 0)
01543 #define ASM_OUTPUTS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 1)
01544 #define ASM_INPUTS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
01545 #define ASM_CLOBBERS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
01546
01547
01548 #define ASM_INPUT_P(NODE) (TREE_STATIC (NODE))
01549 #define ASM_VOLATILE_P(NODE) (TREE_PUBLIC (NODE))
01550
01551
01552 #define COND_EXPR_COND(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 0))
01553 #define COND_EXPR_THEN(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 1))
01554 #define COND_EXPR_ELSE(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 2))
01555
01556
01557
01558 #define LABEL_EXPR_LABEL(NODE) TREE_OPERAND (LABEL_EXPR_CHECK (NODE), 0)
01559
01560
01561
01562
01563
01564 #define CATCH_TYPES(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 0)
01565 #define CATCH_BODY(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 1)
01566
01567
01568 #define EH_FILTER_TYPES(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 0)
01569 #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1)
01570 #define EH_FILTER_MUST_NOT_THROW(NODE) TREE_STATIC (EH_FILTER_EXPR_CHECK (NODE))
01571
01572
01573 #define OBJ_TYPE_REF_EXPR(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0)
01574 #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1)
01575 #define OBJ_TYPE_REF_TOKEN(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 2)
01576
01577
01578 #define ASSERT_EXPR_VAR(NODE) TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 0)
01579 #define ASSERT_EXPR_COND(NODE) TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 1)
01580
01581
01582
01583 #define OMP_BODY(NODE) \
01584 TREE_OPERAND (TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_CRITICAL), 0)
01585 #define OMP_CLAUSES(NODE) \
01586 TREE_OPERAND (TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_SINGLE), 1)
01587
01588 #define OMP_PARALLEL_BODY(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
01589 #define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
01590 #define OMP_PARALLEL_FN(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 2)
01591 #define OMP_PARALLEL_DATA_ARG(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 3)
01592
01593 #define OMP_FOR_BODY(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 0)
01594 #define OMP_FOR_CLAUSES(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 1)
01595 #define OMP_FOR_INIT(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 2)
01596 #define OMP_FOR_COND(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 3)
01597 #define OMP_FOR_INCR(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 4)
01598 #define OMP_FOR_PRE_BODY(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 5)
01599
01600 #define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
01601 #define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
01602
01603 #define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
01604
01605 #define OMP_SINGLE_BODY(NODE) TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 0)
01606 #define OMP_SINGLE_CLAUSES(NODE) TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 1)
01607
01608 #define OMP_MASTER_BODY(NODE) TREE_OPERAND (OMP_MASTER_CHECK (NODE), 0)
01609
01610 #define OMP_ORDERED_BODY(NODE) TREE_OPERAND (OMP_ORDERED_CHECK (NODE), 0)
01611
01612 #define OMP_CRITICAL_BODY(NODE) TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 0)
01613 #define OMP_CRITICAL_NAME(NODE) TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 1)
01614
01615 #define OMP_CLAUSE_CHAIN(NODE) TREE_CHAIN (OMP_CLAUSE_CHECK (NODE))
01616 #define OMP_CLAUSE_DECL(NODE) \
01617 OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \
01618 OMP_CLAUSE_PRIVATE, \
01619 OMP_CLAUSE_COPYPRIVATE), 0)
01620
01621
01622
01623 #define OMP_SECTION_LAST(NODE) \
01624 TREE_PRIVATE (OMP_SECTION_CHECK (NODE))
01625
01626
01627
01628
01629
01630 #define OMP_RETURN_NOWAIT(NODE) \
01631 TREE_PRIVATE (OMP_RETURN_CHECK (NODE))
01632
01633
01634
01635 #define OMP_PARALLEL_COMBINED(NODE) \
01636 TREE_PRIVATE (OMP_PARALLEL_CHECK (NODE))
01637
01638
01639
01640
01641 #define OMP_CLAUSE_PRIVATE_DEBUG(NODE) \
01642 TREE_PUBLIC (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE))
01643
01644
01645
01646 #define OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE(NODE) \
01647 TREE_PUBLIC (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LASTPRIVATE))
01648
01649 #define OMP_CLAUSE_IF_EXPR(NODE) \
01650 OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0)
01651 #define OMP_CLAUSE_NUM_THREADS_EXPR(NODE) \
01652 OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS),0)
01653 #define OMP_CLAUSE_SCHEDULE_CHUNK_EXPR(NODE) \
01654 OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE), 0)
01655
01656 #define OMP_CLAUSE_REDUCTION_CODE(NODE) \
01657 (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION)->omp_clause.subcode.reduction_code)
01658 #define OMP_CLAUSE_REDUCTION_INIT(NODE) \
01659 OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 1)
01660 #define OMP_CLAUSE_REDUCTION_MERGE(NODE) \
01661 OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 2)
01662 #define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \
01663 OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 3)
01664
01665 enum omp_clause_schedule_kind
01666 {
01667 OMP_CLAUSE_SCHEDULE_STATIC,
01668 OMP_CLAUSE_SCHEDULE_DYNAMIC,
01669 OMP_CLAUSE_SCHEDULE_GUIDED,
01670 OMP_CLAUSE_SCHEDULE_RUNTIME
01671 };
01672
01673 #define OMP_CLAUSE_SCHEDULE_KIND(NODE) \
01674 (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE)->omp_clause.subcode.schedule_kind)
01675
01676 enum omp_clause_default_kind
01677 {
01678 OMP_CLAUSE_DEFAULT_UNSPECIFIED,
01679 OMP_CLAUSE_DEFAULT_SHARED,
01680 OMP_CLAUSE_DEFAULT_NONE,
01681 OMP_CLAUSE_DEFAULT_PRIVATE
01682 };
01683
01684 #define OMP_CLAUSE_DEFAULT_KIND(NODE) \
01685 (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind)
01686
01687 struct tree_exp GTY(())
01688 {
01689 struct tree_common common;
01690 source_locus locus;
01691 int complexity;
01692 tree block;
01693 tree GTY ((special ("tree_exp"),
01694 desc ("TREE_CODE ((tree) &%0)")))
01695 operands[1];
01696 };
01697
01698
01699
01700
01701
01702 #define SSA_NAME_VAR(NODE) SSA_NAME_CHECK (NODE)->ssa_name.var
01703
01704
01705
01706
01707 #define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->common.chain
01708
01709
01710
01711 #define SSA_NAME_VERSION(NODE) SSA_NAME_CHECK (NODE)->ssa_name.version
01712
01713
01714
01715
01716 #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
01717 SSA_NAME_CHECK (NODE)->common.asm_written_flag
01718
01719
01720
01721
01722 #define SSA_NAME_IN_FREE_LIST(NODE) \
01723 SSA_NAME_CHECK (NODE)->common.nothrow_flag
01724
01725
01726 #define SSA_NAME_PTR_INFO(N) \
01727 SSA_NAME_CHECK (N)->ssa_name.ptr_info
01728
01729
01730 #define SSA_NAME_VALUE(N) \
01731 SSA_NAME_CHECK (N)->ssa_name.value_handle
01732
01733 #ifndef _TREE_FLOW_H
01734 struct ptr_info_def;
01735 #endif
01736
01737
01738
01739
01740
01741 typedef struct ssa_use_operand_d GTY(())
01742 {
01743 struct ssa_use_operand_d* GTY((skip(""))) prev;
01744 struct ssa_use_operand_d* GTY((skip(""))) next;
01745 tree GTY((skip(""))) stmt;
01746 tree *GTY((skip(""))) use;
01747 } ssa_use_operand_t;
01748
01749
01750 #define SSA_NAME_IMM_USE_NODE(NODE) SSA_NAME_CHECK (NODE)->ssa_name.imm_uses
01751
01752 struct tree_ssa_name GTY(())
01753 {
01754 struct tree_common common;
01755
01756
01757 tree var;
01758
01759
01760 unsigned int version;
01761
01762
01763 struct ptr_info_def *ptr_info;
01764
01765
01766
01767
01768
01769
01770 tree value_handle;
01771
01772
01773 struct ssa_use_operand_d imm_uses;
01774 };
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784 #define PHI_RESULT_TREE(NODE) PHI_NODE_CHECK (NODE)->phi.result
01785 #define PHI_ARG_DEF_TREE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).def
01786
01787
01788
01789
01790 #define PHI_CHAIN(NODE) TREE_CHAIN (PHI_NODE_CHECK (NODE))
01791
01792 #define PHI_NUM_ARGS(NODE) PHI_NODE_CHECK (NODE)->phi.num_args
01793 #define PHI_ARG_CAPACITY(NODE) PHI_NODE_CHECK (NODE)->phi.capacity
01794 #define PHI_ARG_ELT(NODE, I) PHI_NODE_ELT_CHECK (NODE, I)
01795 #define PHI_ARG_EDGE(NODE, I) (EDGE_PRED (PHI_BB ((NODE)), (I)))
01796 #define PHI_BB(NODE) PHI_NODE_CHECK (NODE)->phi.bb
01797 #define PHI_ARG_IMM_USE_NODE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).imm_use
01798
01799 struct phi_arg_d GTY(())
01800 {
01801
01802
01803 struct ssa_use_operand_d imm_use;
01804 tree def;
01805 };
01806
01807 struct tree_phi_node GTY(())
01808 {
01809 struct tree_common common;
01810 tree result;
01811 int num_args;
01812 int capacity;
01813
01814
01815 struct basic_block_def *bb;
01816
01817
01818
01819 struct phi_arg_d GTY ((length ("((tree)&%h)->phi.num_args"))) a[1];
01820 };
01821
01822 #define OMP_CLAUSE_CODE(NODE) \
01823 (OMP_CLAUSE_CHECK (NODE))->omp_clause.code
01824
01825 #define OMP_CLAUSE_SET_CODE(NODE, CODE) \
01826 ((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE))
01827
01828 #define OMP_CLAUSE_CODE(NODE) \
01829 (OMP_CLAUSE_CHECK (NODE))->omp_clause.code
01830
01831 #define OMP_CLAUSE_OPERAND(NODE, I) \
01832 OMP_CLAUSE_ELT_CHECK (NODE, I)
01833
01834 struct tree_omp_clause GTY(())
01835 {
01836 struct tree_common common;
01837 enum omp_clause_code code;
01838 union omp_clause_subcode {
01839 enum omp_clause_default_kind default_kind;
01840 enum omp_clause_schedule_kind schedule_kind;
01841 enum tree_code reduction_code;
01842 } GTY ((skip)) subcode;
01843 tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]"))) ops[1];
01844 };
01845
01846
01847 struct varray_head_tag;
01848
01849 /* In a BLOCK node. */
01850 #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
01851 #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
01852 #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
01853 /* Note: when changing this, make sure to find the places
01854 that use chainon or nreverse. */
01855 #define BLOCK_CHAIN(NODE) TREE_CHAIN (BLOCK_CHECK (NODE))
01856 #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
01857 #define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
01858
01859 /* Nonzero means that this block is prepared to handle exceptions
01860 listed in the BLOCK_VARS slot. */
01861 #define BLOCK_HANDLER_BLOCK(NODE) \
01862 (BLOCK_CHECK (NODE)->block.handler_block_flag)
01863
01864 /* An index number for this block. These values are not guaranteed to
01865 be unique across functions -- whether or not they are depends on
01866 the debugging output format in use. */
01867 #define BLOCK_NUMBER(NODE) (BLOCK_CHECK (NODE)->block.block_num)
01868
01869 /* If block reordering splits a lexical block into discontiguous
01870 address ranges, we'll make a copy of the original block.
01871
01872 Note that this is logically distinct from BLOCK_ABSTRACT_ORIGIN.
01873 In that case, we have one source block that has been replicated
01874 (through inlining or unrolling) into many logical blocks, and that
01875 these logical blocks have different physical variables in them.
01876
01877 In this case, we have one logical block split into several
01878 non-contiguous address ranges. Most debug formats can't actually
01879 represent this idea directly, so we fake it by creating multiple
01880 logical blocks with the same variables in them. However, for those
01881 that do support non-contiguous regions, these allow the original
01882 logical block to be reconstructed, along with the set of address
01883 ranges.
01884
01885 One of the logical block fragments is arbitrarily chosen to be
01886 the ORIGIN. The other fragments will point to the origin via
01887 BLOCK_FRAGMENT_ORIGIN; the origin itself will have this pointer
01888 be null. The list of fragments will be chained through
01889 BLOCK_FRAGMENT_CHAIN from the origin. */
01890
01891 #define BLOCK_FRAGMENT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_origin)
01892 #define BLOCK_FRAGMENT_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_chain)
01893
01894 /* For an inlined function, this gives the location where it was called
01895 from. This is only set in the top level block, which corresponds to the
01896 inlined function scope. This is used in the debug output routines. */
01897
01898 #define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
01899
01900 struct tree_block GTY(())
01901 {
01902 struct tree_common common;
01903
01904 unsigned handler_block_flag : 1;
01905 unsigned abstract_flag : 1;
01906 unsigned block_num : 30;
01907
01908 tree vars;
01909 tree subblocks;
01910 tree supercontext;
01911 tree abstract_origin;
01912 tree fragment_origin;
01913 tree fragment_chain;
01914 location_t locus;
01915 };
01916
01917 /* Define fields and accessors for nodes representing data types. */
01918
01919 /* See tree.def for documentation of the use of these fields.
01920 Look at the documentation of the various ..._TYPE tree codes.
01921
01922 Note that the type.values, type.minval, and type.maxval fields are
01923 overloaded and used for different macros in different kinds of types.
01924 Each macro must check to ensure the tree node is of the proper kind of
01925 type. Note also that some of the front-ends also overload these fields,
01926 so they must be checked as well. */
01927
01928 #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
01929 #define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type.size)
01930 #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
01931 #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
01932 #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
01933 #define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type.values)
01934 #define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
01935 #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type.values)
01936 #define TYPE_ORIG_SIZE_TYPE(NODE) \
01937 (INTEGER_TYPE_CHECK (NODE)->type.values \
01938 ? TREE_TYPE ((NODE)->type.values) : NULL_TREE)
01939 #define TYPE_METHODS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.maxval)
01940 #define TYPE_VFIELD(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.minval)
01941 #define TYPE_ARG_TYPES(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.values)
01942 #define TYPE_METHOD_BASETYPE(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.maxval)
01943 #define TYPE_OFFSET_BASETYPE(NODE) (OFFSET_TYPE_CHECK (NODE)->type.maxval)
01944 #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
01945 #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
01946 #define TYPE_NEXT_PTR_TO(NODE) (POINTER_TYPE_CHECK (NODE)->type.minval)
01947 #define TYPE_NEXT_REF_TO(NODE) (REFERENCE_TYPE_CHECK (NODE)->type.minval)
01948 #define TYPE_MIN_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.minval)
01949 #define TYPE_MAX_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.maxval)
01950 #define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision)
01951 #define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address)
01952 #define TYPE_SYMTAB_POINTER(NODE) (TYPE_CHECK (NODE)->type.symtab.pointer)
01953 #define TYPE_SYMTAB_DIE(NODE) (TYPE_CHECK (NODE)->type.symtab.die)
01954 #define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type.name)
01955 #define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type.next_variant)
01956 #define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant)
01957 #define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context)
01958 #define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
01959
01960 /* For a VECTOR_TYPE node, this describes a different type which is emitted
01961 in the debugging output. We use this to describe a vector as a
01962 structure containing an array. */
01963 #define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) (VECTOR_TYPE_CHECK (NODE)->type.values)
01964
01965 /* For record and union types, information about this type, as a base type
01966 for itself. */
01967 #define TYPE_BINFO(NODE) (RECORD_OR_UNION_CHECK(NODE)->type.binfo)
01968
01969 /* For non record and union types, used in a language-dependent way. */
01970 #define TYPE_LANG_SLOT_1(NODE) (NOT_RECORD_OR_UNION_CHECK(NODE)->type.binfo)
01971
01972 /* The (language-specific) typed-based alias set for this type.
01973 Objects whose TYPE_ALIAS_SETs are different cannot alias each
01974 other. If the TYPE_ALIAS_SET is -1, no alias set has yet been
01975 assigned to this type. If the TYPE_ALIAS_SET is 0, objects of this
01976 type can alias objects of any type. */
01977 #define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type.alias_set)
01978
01979 /* Nonzero iff the typed-based alias set for this type has been
01980 calculated. */
01981 #define TYPE_ALIAS_SET_KNOWN_P(NODE) (TYPE_CHECK (NODE)->type.alias_set != -1)
01982
01983 /* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
01984 to this type. */
01985 #define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type.attributes)
01986
01987 /* The alignment necessary for objects of this type.
01988 The value is an int, measured in bits. */
01989 #define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type.align)
01990
01991 /* 1 if the alignment for this type was requested by "aligned" attribute,
01992 0 if it is the default for this type. */
01993 #define TYPE_USER_ALIGN(NODE) (TYPE_CHECK (NODE)->type.user_align)
01994
01995 /* The alignment for NODE, in bytes. */
01996 #define TYPE_ALIGN_UNIT(NODE) (TYPE_ALIGN (NODE) / BITS_PER_UNIT)
01997
01998 /* If your language allows you to declare types, and you want debug info
01999 for them, then you need to generate corresponding TYPE_DECL nodes.
02000 These "stub" TYPE_DECL nodes have no name, and simply point at the
02001 type node. You then set the TYPE_STUB_DECL field of the type node
02002 to point back at the TYPE_DECL node. This allows the debug routines
02003 to know that the two nodes represent the same type, so that we only
02004 get one debug info record for them. */
02005 #define TYPE_STUB_DECL(NODE) TREE_CHAIN (NODE)
02006
02007 /* In a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE, it means the type
02008 has BLKmode only because it lacks the alignment requirement for
02009 its size. */
02010 #define TYPE_NO_FORCE_BLK(NODE) (TYPE_CHECK (NODE)->type.no_force_blk_flag)
02011
02012 /* In an INTEGER_TYPE, it means the type represents a size. We use
02013 this both for validity checking and to permit optimizations that
02014 are unsafe for other types. Note that the C `size_t' type should
02015 *not* have this flag set. The `size_t' type is simply a typedef
02016 for an ordinary integer type that happens to be the type of an
02017 expression returned by `sizeof'; `size_t' has no special
02018 properties. Expressions whose type have TYPE_IS_SIZETYPE set are
02019 always actual sizes. */
02020 #define TYPE_IS_SIZETYPE(NODE) \
02021 (INTEGER_TYPE_CHECK (NODE)->type.no_force_blk_flag)
02022
02023 /* In a FUNCTION_TYPE, indicates that the function returns with the stack
02024 pointer depressed. */
02025 #define TYPE_RETURNS_STACK_DEPRESSED(NODE) \
02026 (FUNCTION_TYPE_CHECK (NODE)->type.no_force_blk_flag)
02027
02028 /* Nonzero in a type considered volatile as a whole. */
02029 #define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->common.volatile_flag)
02030
02031 /* Means this type is const-qualified. */
02032 #define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->common.readonly_flag)
02033
02034 /* If nonzero, this type is `restrict'-qualified, in the C sense of
02035 the term. */
02036 #define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag)
02037
02038 /* There is a TYPE_QUAL value for each type qualifier. They can be
02039 combined by bitwise-or to form the complete set of qualifiers for a
02040 type. */
02041
02042 #define TYPE_UNQUALIFIED 0x0
02043 #define TYPE_QUAL_CONST 0x1
02044 #define TYPE_QUAL_VOLATILE 0x2
02045 #define TYPE_QUAL_RESTRICT 0x4
02046
02047 /* The set of type qualifiers for this type. */
02048 #define TYPE_QUALS(NODE) \
02049 ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
02050 | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
02051 | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT))
02052
02053 /* These flags are available for each language front end to use internally. */
02054 #define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type.lang_flag_0)
02055 #define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type.lang_flag_1)
02056 #define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type.lang_flag_2)
02057 #define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type.lang_flag_3)
02058 #define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type.lang_flag_4)
02059 #define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type.lang_flag_5)
02060 #define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type.lang_flag_6)
02061
02062 /* Used to keep track of visited nodes in tree traversals. This is set to
02063 0 by copy_node and make_node. */
02064 #define TREE_VISITED(NODE) ((NODE)->common.visited)
02065
02066 #ifdef KEY
02067 #define TREE_EMITTED(NODE) ((NODE)->common.emitted)
02068 #define TREE_NOT_EMITTED_BY_GXX(NODE) ((NODE)->common.not_emitted_by_gxx)
02069 #define GS_NODE(NODE) ((gs_void_t *)TREE_TO_TRANSLATED_GS(NODE))
02070 #define TREE_TO_TRANSLATED_GS(NODE) ((NODE)->common.translated_gs_node)
02071 #define DWARF_ACCESS(NODE) ((NODE)->common.dwarf_access)
02072
02073 /* Inside a TARGET_EXPR, keep track if GNU is emitting the cleanup */
02074 #define EMIT_TARGET_EXPR_CLEANUP(NODE) ((NODE)->common.emit_target_expr_cleanup)
02075 #define FULLY_TRANSLATED_TO_GS(NODE) ((NODE)->common.fully_translated_to_gs)
02076 #define GS_SEQUENCE_NUM(NODE) ((NODE)->common.gs_sequence_num)
02077 #endif
02078
02079 /* If set in an ARRAY_TYPE, indicates a string type (for languages
02080 that distinguish string from array of char).
02081 If set in a INTEGER_TYPE, indicates a character type. */
02082 #define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type.string_flag)
02083
02084 /* If non-NULL, this is an upper bound of the size (in bytes) of an
02085 object of the given ARRAY_TYPE. This allows temporaries to be
02086 allocated. */
02087 #define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) \
02088 (ARRAY_TYPE_CHECK (ARRAY_TYPE)->type.maxval)
02089
02090 /* For a VECTOR_TYPE, this is the number of sub-parts of the vector. */
02091 #define TYPE_VECTOR_SUBPARTS(VECTOR_TYPE) \
02092 (((unsigned HOST_WIDE_INT) 1) \
02093 << VECTOR_TYPE_CHECK (VECTOR_TYPE)->type.precision)
02094
02095 /* Set precision to n when we have 2^n sub-parts of the vector. */
02096 #define SET_TYPE_VECTOR_SUBPARTS(VECTOR_TYPE, X) \
02097 (VECTOR_TYPE_CHECK (VECTOR_TYPE)->type.precision = exact_log2 (X))
02098
02099 /* Indicates that objects of this type must be initialized by calling a
02100 function when they are created. */
02101 #define TYPE_NEEDS_CONSTRUCTING(NODE) \
02102 (TYPE_CHECK (NODE)->type.needs_constructing_flag)
02103
02104 /* Indicates that objects of this type (a UNION_TYPE), should be passed
02105 the same way that the first union alternative would be passed. */
02106 #define TYPE_TRANSPARENT_UNION(NODE) \
02107 (UNION_TYPE_CHECK (NODE)->type.transparent_union_flag)
02108
02109 /* For an ARRAY_TYPE, indicates that it is not permitted to
02110 take the address of a component of the type. */
02111 #define TYPE_NONALIASED_COMPONENT(NODE) \
02112 (ARRAY_TYPE_CHECK (NODE)->type.transparent_union_flag)
02113
02114 /* Indicated that objects of this type should be laid out in as
02115 compact a way as possible. */
02116 #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->type.packed_flag)
02117
02118 /* Used by type_contains_placeholder_p to avoid recomputation.
02119 Values are: 0 (unknown), 1 (false), 2 (true). Never access
02120 this field directly. */
02121 #define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \
02122 (TYPE_CHECK (NODE)->type.contains_placeholder_bits)
02123
02124 struct die_struct;
02125
02126 struct tree_type GTY(())
02127 {
02128 struct tree_common common;
02129 tree values;
02130 tree size;
02131 tree size_unit;
02132 tree attributes;
02133 unsigned int uid;
02134
02135 unsigned int precision : 9;
02136 ENUM_BITFIELD(machine_mode) mode : 7;
02137
02138 unsigned string_flag : 1;
02139 unsigned no_force_blk_flag : 1;
02140 unsigned needs_constructing_flag : 1;
02141 unsigned transparent_union_flag : 1;
02142 unsigned packed_flag : 1;
02143 unsigned restrict_flag : 1;
02144 unsigned contains_placeholder_bits : 2;
02145
02146 unsigned lang_flag_0 : 1;
02147 unsigned lang_flag_1 : 1;
02148 unsigned lang_flag_2 : 1;
02149 unsigned lang_flag_3 : 1;
02150 unsigned lang_flag_4 : 1;
02151 unsigned lang_flag_5 : 1;
02152 unsigned lang_flag_6 : 1;
02153 unsigned user_align : 1;
02154
02155 unsigned int align;
02156 tree pointer_to;
02157 tree reference_to;
02158 union tree_type_symtab {
02159 int GTY ((tag ("0"))) address;
02160 char * GTY ((tag ("1"))) pointer;
02161 struct die_struct * GTY ((tag ("2"))) die;
02162 } GTY ((desc ("debug_hooks == &sdb_debug_hooks ? 1 : debug_hooks == &dwarf2_debug_hooks ? 2 : 0"),
02163 descbits ("2"))) symtab;
02164 tree name;
02165 tree minval;
02166 tree maxval;
02167 tree next_variant;
02168 tree main_variant;
02169 tree binfo;
02170 tree context;
02171 HOST_WIDE_INT alias_set;
02172 /* Points to a structure whose details depend on the language in use. */
02173 struct lang_type *lang_specific;
02174 };
02175
02176 /* Define accessor macros for information about type inheritance
02177 and basetypes.
02178
02179 A "basetype" means a particular usage of a data type for inheritance
02180 in another type. Each such basetype usage has its own "binfo"
02181 object to describe it. The binfo object is a TREE_VEC node.
02182
02183 Inheritance is represented by the binfo nodes allocated for a
02184 given type. For example, given types C and D, such that D is
02185 inherited by C, 3 binfo nodes will be allocated: one for describing
02186 the binfo properties of C, similarly one for D, and one for
02187 describing the binfo properties of D as a base type for C.
02188 Thus, given a pointer to class C, one can get a pointer to the binfo
02189 of D acting as a basetype for C by looking at C's binfo's basetypes. */
02190
02191 /* BINFO specific flags. */
02192
02193 /* Nonzero means that the derivation chain is via a `virtual' declaration. */
02194 #define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->common.static_flag)
02195
02196 /* Flags for language dependent use. */
02197 #define BINFO_MARKED(NODE) TREE_LANG_FLAG_0(TREE_BINFO_CHECK(NODE))
02198 #define BINFO_FLAG_1(NODE) TREE_LANG_FLAG_1(TREE_BINFO_CHECK(NODE))
02199 #define BINFO_FLAG_2(NODE) TREE_LANG_FLAG_2(TREE_BINFO_CHECK(NODE))
02200 #define BINFO_FLAG_3(NODE) TREE_LANG_FLAG_3(TREE_BINFO_CHECK(NODE))
02201 #define BINFO_FLAG_4(NODE) TREE_LANG_FLAG_4(TREE_BINFO_CHECK(NODE))
02202 #define BINFO_FLAG_5(NODE) TREE_LANG_FLAG_5(TREE_BINFO_CHECK(NODE))
02203 #define BINFO_FLAG_6(NODE) TREE_LANG_FLAG_6(TREE_BINFO_CHECK(NODE))
02204
02205 /* The actual data type node being inherited in this basetype. */
02206 #define BINFO_TYPE(NODE) TREE_TYPE (TREE_BINFO_CHECK(NODE))
02207
02208 /* The offset where this basetype appears in its containing type.
02209 BINFO_OFFSET slot holds the offset (in bytes)
02210 from the base of the complete object to the base of the part of the
02211 object that is allocated on behalf of this `type'.
02212 This is always 0 except when there is multiple inheritance. */
02213
02214 #define BINFO_OFFSET(NODE) (TREE_BINFO_CHECK(NODE)->binfo.offset)
02215 #define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE)))
02216
02217 /* The virtual function table belonging to this basetype. Virtual
02218 function tables provide a mechanism for run-time method dispatching.
02219 The entries of a virtual function table are language-dependent. */
02220
02221 #define BINFO_VTABLE(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtable)
02222
02223 /* The virtual functions in the virtual function table. This is
02224 a TREE_LIST that is used as an initial approximation for building
02225 a virtual function table for this basetype. */
02226 #define BINFO_VIRTUALS(NODE) (TREE_BINFO_CHECK(NODE)->binfo.virtuals)
02227
02228 /* A vector of binfos for the direct basetypes inherited by this
02229 basetype.
02230
02231 If this basetype describes type D as inherited in C, and if the
02232 basetypes of D are E and F, then this vector contains binfos for
02233 inheritance of E and F by C. */
02234 #define BINFO_BASE_BINFOS(NODE) (&TREE_BINFO_CHECK(NODE)->binfo.base_binfos)
02235
02236 /* The number of basetypes for NODE. */
02237 #define BINFO_N_BASE_BINFOS(NODE) (VEC_length (tree, BINFO_BASE_BINFOS (NODE)))
02238
02239 /* Accessor macro to get to the Nth base binfo of this binfo. */
02240 #define BINFO_BASE_BINFO(NODE,N) \
02241 (VEC_index (tree, BINFO_BASE_BINFOS (NODE), (N)))
02242 #define BINFO_BASE_ITERATE(NODE,N,B) \
02243 (VEC_iterate (tree, BINFO_BASE_BINFOS (NODE), (N), (B)))
02244 #define BINFO_BASE_APPEND(NODE,T) \
02245 (VEC_quick_push (tree, BINFO_BASE_BINFOS (NODE), (T)))
02246
02247 /* For a BINFO record describing a virtual base class, i.e., one where
02248 TREE_VIA_VIRTUAL is set, this field assists in locating the virtual
02249 base. The actual contents are language-dependent. In the C++
02250 front-end this field is an INTEGER_CST giving an offset into the
02251 vtable where the offset to the virtual base can be found. */
02252 #define BINFO_VPTR_FIELD(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vptr_field)
02253
02254 /* Indicates the accesses this binfo has to its bases. The values are
02255 access_public_node, access_protected_node or access_private_node.
02256 If this array is not present, public access is implied. */
02257 #define BINFO_BASE_ACCESSES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_accesses)
02258
02259 #define BINFO_BASE_ACCESS(NODE,N) \
02260 VEC_index (tree, BINFO_BASE_ACCESSES (NODE), (N))
02261 #define BINFO_BASE_ACCESS_APPEND(NODE,T) \
02262 VEC_quick_push (tree, BINFO_BASE_ACCESSES (NODE), (T))
02263
02264 /* The index in the VTT where this subobject's sub-VTT can be found.
02265 NULL_TREE if there is no sub-VTT. */
02266 #define BINFO_SUBVTT_INDEX(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtt_subvtt)
02267
02268 /* The index in the VTT where the vptr for this subobject can be
02269 found. NULL_TREE if there is no secondary vptr in the VTT. */
02270 #define BINFO_VPTR_INDEX(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtt_vptr)
02271
02272 /* The BINFO_INHERITANCE_CHAIN points at the binfo for the base
02273 inheriting this base for non-virtual bases. For virtual bases it
02274 points either to the binfo for which this is a primary binfo, or to
02275 the binfo of the most derived type. */
02276 #define BINFO_INHERITANCE_CHAIN(NODE) \
02277 (TREE_BINFO_CHECK(NODE)->binfo.inheritance)
02278
02279 struct tree_binfo GTY (())
02280 {
02281 struct tree_common common;
02282
02283 tree offset;
02284 tree vtable;
02285 tree virtuals;
02286 tree vptr_field;
02287 VEC(tree,gc) *base_accesses;
02288 tree inheritance;
02289
02290 tree vtt_subvtt;
02291 tree vtt_vptr;
02292
02293 VEC(tree,none) base_binfos;
02294 };
02295
02296
02297 /* Define fields and accessors for nodes representing declared names. */
02298
02299 /* Nonzero if DECL represents a variable for the SSA passes. */
02300 #define SSA_VAR_P(DECL) \
02301 (TREE_CODE (DECL) == VAR_DECL \
02302 || TREE_CODE (DECL) == PARM_DECL \
02303 || TREE_CODE (DECL) == RESULT_DECL \
02304 || MTAG_P (DECL) \
02305 || (TREE_CODE (DECL) == SSA_NAME \
02306 && (TREE_CODE (SSA_NAME_VAR (DECL)) == VAR_DECL \
02307 || TREE_CODE (SSA_NAME_VAR (DECL)) == PARM_DECL \
02308 || TREE_CODE (SSA_NAME_VAR (DECL)) == RESULT_DECL \
02309 || MTAG_P (SSA_NAME_VAR (DECL)))))
02310
02311
02312
02313
02314 /* Enumerate visibility settings. */
02315 #ifndef SYMBOL_VISIBILITY_DEFINED
02316 #define SYMBOL_VISIBILITY_DEFINED
02317 enum symbol_visibility
02318 {
02319 VISIBILITY_DEFAULT,
02320 VISIBILITY_PROTECTED,
02321 VISIBILITY_HIDDEN,
02322 VISIBILITY_INTERNAL
02323 };
02324 #endif
02325
02326 struct function;
02327
02328
02329 /* This is the name of the object as written by the user.
02330 It is an IDENTIFIER_NODE. */
02331 #define DECL_NAME(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.name)
02332
02333 /* Every ..._DECL node gets a unique number. */
02334 #define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid)
02335
02336 /* These two fields describe where in the source code the declaration
02337 was. If the declaration appears in several places (as for a C
02338 function that is declared first and then defined later), this
02339 information should refer to the definition. */
02340 #define DECL_SOURCE_LOCATION(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
02341 #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
02342 #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
02343 #ifdef USE_MAPPED_LOCATION
02344 #define DECL_IS_BUILTIN(DECL) \
02345 (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
02346 #else
02347 #define DECL_IS_BUILTIN(DECL) (DECL_SOURCE_LINE(DECL) == 0)
02348 #endif
02349
02350 /* For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
02351 QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL,
02352 PARM_DECL, FUNCTION_DECL, LABEL_DECL, and CONST_DECL nodes, this
02353 points to either the FUNCTION_DECL for the containing function,
02354 the RECORD_TYPE or UNION_TYPE for the containing type, or
02355 NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
02356 scope". */
02357 #define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
02358 #define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
02359 struct tree_decl_minimal GTY(())
02360 {
02361 struct tree_common common;
02362 location_t locus;
02363 unsigned int uid;
02364 tree name;
02365 tree context;
02366 };
02367
02368 /* When computing aliasing information, we represent the memory pointed-to
02369 by pointers with artificial variables called "memory tags" (MT). There
02370 are two kinds of tags, namely symbol and name:
02371
02372 Symbol tags (SMT) are used in flow-insensitive alias analysis, they
02373 represent all the pointed-to locations and variables pointed-to by
02374 the same pointer symbol. Usually, this set is computed using
02375 type-based analysis (i.e., alias set classes), but this may not
02376 always be the case.
02377
02378 Name tags (NMT) are used in flow-sensitive points-to alias
02379 analysis, they represent the variables and memory locations
02380 pointed-to by a specific SSA_NAME pointer.
02381
02382 In general, given a pointer P with a symbol tag SMT, the alias set
02383 of SMT should be the union of all the alias sets of the NMTs of
02384 every SSA_NAME for P. */
02385 struct tree_memory_tag GTY(())
02386 {
02387 struct tree_decl_minimal common;
02388 unsigned int is_global:1;
02389 unsigned int is_used_alone:1;
02390 unsigned int old_used_alone:1;
02391 };
02392
02393 #define MTAG_GLOBAL(NODE) (TREE_MEMORY_TAG_CHECK (NODE)->mtag.is_global)
02394
02395 /* This flag is true if a SMT is used as the V_MAY_DEF or VUSE operand
02396 directly, because the access had all of the SMT's aliases pruned
02397 from it. */
02398 #define SMT_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.is_used_alone)
02399
02400 /* This flag is used to temporarily store the old value of the used alone
02401 flag when updating so we know whether to mark the symbol for
02402 renaming. */
02403 #define SMT_OLD_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.old_used_alone)
02404
02405 struct tree_struct_field_tag GTY(())
02406 {
02407 struct tree_memory_tag common;
02408
02409 /* Parent variable. */
02410 tree parent_var;
02411
02412 /* Offset inside structure. */
02413 unsigned HOST_WIDE_INT offset;
02414
02415 /* Size of the field. */
02416 unsigned HOST_WIDE_INT size;
02417
02418 };
02419 #define SFT_PARENT_VAR(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.parent_var)
02420 #define SFT_OFFSET(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.offset)
02421 #define SFT_SIZE(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.size)
02422
02423 /* For any sort of a ..._DECL node, this points to the original (abstract)
02424 decl node which this decl is an instance of, or else it is NULL indicating
02425 that this decl is not an instance of some other decl. For example,
02426 in a nested declaration of an inline function, this points back to the
02427 definition. */
02428 #define DECL_ABSTRACT_ORIGIN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin)
02429
02430 /* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
02431 origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */
02432 #define DECL_ORIGIN(NODE) \
02433 (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : (NODE))
02434
02435 /* Nonzero for any sort of ..._DECL node means this decl node represents an
02436 inline instance of some original (abstract) decl from an inline function;
02437 suppress any warnings about shadowing some other variable. FUNCTION_DECL
02438 nodes can also have their abstract origin set to themselves. */
02439 #define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \
02440 && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
02441
02442 /* In a DECL this is the field where attributes are stored. */
02443 #define DECL_ATTRIBUTES(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.attributes)
02444
02445 /* For a FUNCTION_DECL, holds the tree of BINDINGs.
02446 For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
02447 For a VAR_DECL, holds the initial value.
02448 For a PARM_DECL, not used--default
02449 values for parameters are encoded in the type of the function,
02450 not in the PARM_DECL slot.
02451 For a FIELD_DECL, this is used for enumeration values and the C
02452 frontend uses it for temporarily storing bitwidth of bitfields.
02453
02454 ??? Need to figure out some way to check this isn't a PARM_DECL. */
02455 #define DECL_INITIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.initial)
02456
02457 /* Holds the size of the datum, in bits, as a tree expression.
02458 Need not be constant. */
02459 #define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
02460 /* Likewise for the size in bytes. */
02461 #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
02462 /* Holds the alignment required for the datum, in bits. */
02463 #define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.u1.a.align)
02464 /* The alignment of NODE, in bytes. */
02465 #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
02466 /* For FIELD_DECLs, off_align holds the number of low-order bits of
02467 DECL_FIELD_OFFSET which are known to be always zero.
02468 DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
02469 has. */
02470 #define DECL_USER_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.user_align)
02471 /* Holds the machine mode corresponding to the declaration of a variable or
02472 field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
02473 FIELD_DECL. */
02474 #define DECL_MODE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.mode)
02475
02476 /* For FUNCTION_DECL, if it is built-in, this identifies which built-in
02477 operation it is. Note, however, that this field is overloaded, with
02478 DECL_BUILT_IN_CLASS as the discriminant, so the latter must always be
02479 checked before any access to the former. */
02480 #define DECL_FUNCTION_CODE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_common.u1.f)
02481 #define DECL_DEBUG_EXPR_IS_FROM(NODE) \
02482 (DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from)
02483
02484 /* Nonzero for a given ..._DECL node means that the name of this node should
02485 be ignored for symbolic debug purposes. */
02486 #define DECL_IGNORED_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
02487
02488 /* Nonzero for a given ..._DECL node means that this node represents an
02489 "abstract instance" of the given declaration (e.g. in the original
02490 declaration of an inline function). When generating symbolic debugging
02491 information, we mustn't try to generate any address information for nodes
02492 marked as "abstract instances" because we don't actually generate
02493 any code or allocate any data space for such instances. */
02494 #define DECL_ABSTRACT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag)
02495
02496 /* Language-specific decl information. */
02497 #define DECL_LANG_SPECIFIC(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific)
02498
02499 /* In a VAR_DECL or FUNCTION_DECL, nonzero means external reference:
02500 do not allocate storage, and refer to a definition elsewhere. Note that
02501 this does not necessarily imply the entity represented by NODE
02502 has no program source-level definition in this translation unit. For
02503 example, for a FUNCTION_DECL, DECL_SAVED_TREE may be non-NULL and
02504 DECL_EXTERNAL may be true simultaneously; that can be the case for
02505 a C99 "extern inline" function. */
02506 #define DECL_EXTERNAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.decl_flag_2)
02507
02508 /* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority
02509 initializations. */
02510 #define DEFAULT_INIT_PRIORITY 65535
02511 #define MAX_INIT_PRIORITY 65535
02512 #define MAX_RESERVED_INIT_PRIORITY 100
02513
02514
02515 /* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
02516 For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
02517
02518 For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted.
02519
02520 Also set in some languages for variables, etc., outside the normal
02521 lexical scope, such as class instance variables. */
02522 #define DECL_NONLOCAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag)
02523
02524 /* Used in VAR_DECLs to indicate that the variable is a vtable.
02525 Used in FIELD_DECLs for vtable pointers.
02526 Used in FUNCTION_DECLs to indicate that the function is virtual. */
02527 #define DECL_VIRTUAL_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag)
02528
02529 /* Used to indicate that this DECL represents a compiler-generated entity. */
02530 #define DECL_ARTIFICIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
02531
02532 /* Additional flags for language-specific uses. */
02533 #define DECL_LANG_FLAG_0(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0)
02534 #define DECL_LANG_FLAG_1(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1)
02535 #define DECL_LANG_FLAG_2(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2)
02536 #define DECL_LANG_FLAG_3(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3)
02537 #define DECL_LANG_FLAG_4(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4)
02538 #define DECL_LANG_FLAG_5(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5)
02539 #define DECL_LANG_FLAG_6(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
02540 #define DECL_LANG_FLAG_7(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
02541
02542 /* Used to indicate an alias set for the memory pointed to by this
02543 particular FIELD_DECL, PARM_DECL, or VAR_DECL, which must have
02544 pointer (or reference) type. */
02545 #define DECL_POINTER_ALIAS_SET(NODE) \
02546 (DECL_COMMON_CHECK (NODE)->decl_common.pointer_alias_set)
02547
02548 /* Nonzero if an alias set has been assigned to this declaration. */
02549 #define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \
02550 (DECL_POINTER_ALIAS_SET (NODE) != - 1)
02551
02552 /* Nonzero for a decl which is at file scope. */
02553 #define DECL_FILE_SCOPE_P(EXP) \
02554 (! DECL_CONTEXT (EXP) \
02555 || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)
02556
02557 /* Nonzero for a decl that is decorated using attribute used.
02558 This indicates compiler tools that this decl needs to be preserved. */
02559 #define DECL_PRESERVE_P(DECL) \
02560 DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag
02561
02562 /* For function local variables of COMPLEX type, indicates that the
02563 variable is not aliased, and that all modifications to the variable
02564 have been adjusted so that they are killing assignments. Thus the
02565 variable may now be treated as a GIMPLE register, and use real
02566 instead of virtual ops in SSA form. */
02567 #define DECL_COMPLEX_GIMPLE_REG_P(DECL) \
02568 DECL_COMMON_CHECK (DECL)->decl_common.gimple_reg_flag
02569
02570 /* This is true if DECL is call clobbered in the current function.
02571 The result of this flag should always be the same as
02572 bitmap_bit_p (call_clobbered_vars, DECL_UID (decl)). */
02573 #define DECL_CALL_CLOBBERED(DECL) \
02574 DECL_COMMON_CHECK (DECL)->decl_common.call_clobbered_flag
02575
02576 #ifdef KEY
02577 #define DECL_EMITTED_BY_GXX(DECL) \
02578 DECL_COMMON_CHECK (DECL)->decl_common.decl_emitted_by_gxx
02579 #define DECL_ADDED_TO_WEAK_DECLS(DECL) \
02580 DECL_COMMON_CHECK (DECL)->decl_common.added_to_weak_decls
02581
02582 #define DECL_ASMREG(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.asmreg)
02583 #endif
02584
02585
02586 struct tree_decl_common GTY(())
02587 {
02588 struct tree_decl_minimal common;
02589 tree size;
02590
02591 ENUM_BITFIELD(machine_mode) mode : 8;
02592
02593 unsigned nonlocal_flag : 1;
02594 unsigned virtual_flag : 1;
02595 unsigned ignored_flag : 1;
02596 unsigned abstract_flag : 1;
02597 unsigned artificial_flag : 1;
02598 unsigned user_align : 1;
02599 unsigned preserve_flag: 1;
02600 unsigned debug_expr_is_from : 1;
02601
02602 unsigned lang_flag_0 : 1;
02603 unsigned lang_flag_1 : 1;
02604 unsigned lang_flag_2 : 1;
02605 unsigned lang_flag_3 : 1;
02606 unsigned lang_flag_4 : 1;
02607 unsigned lang_flag_5 : 1;
02608 unsigned lang_flag_6 : 1;
02609 unsigned lang_flag_7 : 1;
02610
02611 /* In LABEL_DECL, this is DECL_ERROR_ISSUED.
02612 In VAR_DECL and PARM_DECL, this is DECL_REGISTER. */
02613 unsigned decl_flag_0 : 1;
02614 /* In FIELD_DECL, this is DECL_PACKED. */
02615 unsigned decl_flag_1 : 1;
02616 /* In FIELD_DECL, this is DECL_BIT_FIELD
02617 In VAR_DECL and FUNCTION_DECL, this is DECL_EXTERNAL.
02618 In TYPE_DECL, this is TYPE_DECL_SUPRESS_DEBUG. */
02619 unsigned decl_flag_2 : 1;
02620 /* In FIELD_DECL, this is DECL_NONADDRESSABLE_P
02621 In VAR_DECL and PARM_DECL, this is DECL_HAS_VALUE_EXPR. */
02622 unsigned decl_flag_3 : 1;
02623 /* Logically, these two would go in a theoretical base shared by var and
02624 parm decl. */
02625 unsigned gimple_reg_flag : 1;
02626 unsigned call_clobbered_flag : 1;
02627 unsigned decl_emitted_by_gxx : 1; /* KEY */
02628 unsigned added_to_weak_decls : 1; /* KEY */
02629
02630 union tree_decl_u1 {
02631 /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
02632 DECL_FUNCTION_CODE. */
02633 enum built_in_function f;
02634 /* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this
02635 is used by language-dependent code. */
02636 HOST_WIDE_INT i;
02637 /* DECL_ALIGN and DECL_OFFSET_ALIGN. (These are not used for
02638 FUNCTION_DECLs). */
02639 struct tree_decl_u1_a {
02640 unsigned int align : 24;
02641 unsigned int off_align : 8;
02642 } a;
02643 } GTY ((skip)) u1;
02644
02645 tree size_unit;
02646 tree initial;
02647 tree attributes;
02648 tree abstract_origin;
02649
02650 HOST_WIDE_INT pointer_alias_set;
02651 /* Points to a structure whose details depend on the language in use. */
02652 struct lang_decl *lang_specific;
02653
02654 int asmreg; /* KEY: asm register number */
02655 };
02656
02657 extern tree decl_value_expr_lookup (tree);
02658 extern void decl_value_expr_insert (tree, tree);
02659
02660 /* In a VAR_DECL or PARM_DECL, the location at which the value may be found,
02661 if transformations have made this more complicated than evaluating the
02662 decl itself. This should only be used for debugging; once this field has
02663 been set, the decl itself may not legitimately appear in the function. */
02664 #define DECL_HAS_VALUE_EXPR_P(NODE) \
02665 (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_flag_3)
02666 #define DECL_VALUE_EXPR(NODE) \
02667 (decl_value_expr_lookup (DECL_WRTL_CHECK (NODE)))
02668 #define SET_DECL_VALUE_EXPR(NODE, VAL) \
02669 (decl_value_expr_insert (DECL_WRTL_CHECK (NODE), VAL))
02670
02671 /* Holds the RTL expression for the value of a variable or function.
02672 This value can be evaluated lazily for functions, variables with
02673 static storage duration, and labels. */
02674 #define DECL_RTL(NODE) \
02675 (DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl \
02676 ? (NODE)->decl_with_rtl.rtl \
02677 : (make_decl_rtl (NODE), (NODE)->decl_with_rtl.rtl))
02678
02679 /* Set the DECL_RTL for NODE to RTL. */
02680 #define SET_DECL_RTL(NODE, RTL) set_decl_rtl (NODE, RTL)
02681
02682 /* Returns nonzero if NODE is a tree node that can contain RTL. */
02683 #define HAS_RTL_P(NODE) (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WRTL))
02684
02685 /* Returns nonzero if the DECL_RTL for NODE has already been set. */
02686 #define DECL_RTL_SET_P(NODE) (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL)
02687
02688 /* Copy the RTL from NODE1 to NODE2. If the RTL was not set for
02689 NODE1, it will not be set for NODE2; this is a lazy copy. */
02690 #define COPY_DECL_RTL(NODE1, NODE2) \
02691 (DECL_WRTL_CHECK (NODE2)->decl_with_rtl.rtl = DECL_WRTL_CHECK (NODE1)->decl_with_rtl.rtl)
02692
02693 /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set. */
02694 #define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
02695
02696 /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
02697 #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
02698
02699 struct tree_decl_with_rtl GTY(())
02700 {
02701 struct tree_decl_common common;
02702 rtx rtl;
02703 };
02704
02705 /* In a FIELD_DECL, this is the field position, counting in bytes, of the
02706 DECL_OFFSET_ALIGN-bit-sized word containing the bit closest to the beginning
02707 of the structure. */
02708 #define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.offset)
02709
02710 /* In a FIELD_DECL, this is the offset, in bits, of the first bit of the
02711 field from DECL_FIELD_OFFSET. This field may be nonzero even for fields
02712 that are not bit fields (since DECL_OFFSET_ALIGN may be larger than the
02713 natural alignment of the field's type). */
02714 #define DECL_FIELD_BIT_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset)
02715
02716 /* In a FIELD_DECL, this indicates whether the field was a bit-field and
02717 if so, the type that was originally specified for it.
02718 TREE_TYPE may have been modified (in finish_struct). */
02719 #define DECL_BIT_FIELD_TYPE(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
02720
02721 /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
02722 if nonzero, indicates that the field occupies the type. */
02723 #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
02724
02725 /* For FIELD_DECLs, off_align holds the number of low-order bits of
02726 DECL_FIELD_OFFSET which are known to be always zero.
02727 DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
02728 has. */
02729 #define DECL_OFFSET_ALIGN(NODE) \
02730 (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align)
02731
02732 /* Specify that DECL_ALIGN(NODE) is a multiple of X. */
02733 #define SET_DECL_OFFSET_ALIGN(NODE, X) \
02734 (FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align = exact_log2 ((X) & -(X)))
02735 /* 1 if the alignment for this type was requested by "aligned" attribute,
02736 0 if it is the default for this type. */
02737
02738 /* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in
02739 which this FIELD_DECL is defined. This information is needed when
02740 writing debugging information about vfield and vbase decls for C++. */
02741 #define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.fcontext)
02742
02743 /* In a FIELD_DECL, indicates this field should be bit-packed. */
02744 #define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_1)
02745
02746 /* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
02747 specially. */
02748 #define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
02749
02750 /* Used in a FIELD_DECL to indicate that we cannot form the address of
02751 this component. */
02752 #define DECL_NONADDRESSABLE_P(NODE) \
02753 (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_3)
02754
02755 struct tree_field_decl GTY(())
02756 {
02757 struct tree_decl_common common;
02758
02759 tree offset;
02760 tree bit_field_type;
02761 tree qualifier;
02762 tree bit_offset;
02763 tree fcontext;
02764
02765 };
02766
02767 /* A numeric unique identifier for a LABEL_DECL. The UID allocation is
02768 dense, unique within any one function, and may be used to index arrays.
02769 If the value is -1, then no UID has been assigned. */
02770 #define LABEL_DECL_UID(NODE) \
02771 (LABEL_DECL_CHECK (NODE)->decl_common.pointer_alias_set)
02772
02773 /* In LABEL_DECL nodes, nonzero means that an error message about
02774 jumping into such a binding contour has been printed for this label. */
02775 #define DECL_ERROR_ISSUED(NODE) (LABEL_DECL_CHECK (NODE)->decl_common.decl_flag_0)
02776
02777 struct tree_label_decl GTY(())
02778 {
02779 struct tree_decl_with_rtl common;
02780 /* Java's verifier has some need to store information about labels,
02781 and was using fields that no longer exist on labels.
02782 Once the verifier doesn't need these anymore, they should be removed. */
02783 tree java_field_1;
02784 tree java_field_2;
02785 tree java_field_3;
02786 unsigned int java_field_4;
02787
02788 };
02789
02790 struct tree_result_decl GTY(())
02791 {
02792 struct tree_decl_with_rtl common;
02793 };
02794
02795 struct tree_const_decl GTY(())
02796 {
02797 struct tree_decl_with_rtl common;
02798 };
02799
02800 /* For a PARM_DECL, records the data type used to pass the argument,
02801 which may be different from the type seen in the program. */
02802 #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial)
02803
02804 /* For PARM_DECL, holds an RTL for the stack slot or register
02805 where the data was actually passed. */
02806 #define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
02807
02808 struct tree_parm_decl GTY(())
02809 {
02810 struct tree_decl_with_rtl common;
02811 rtx incoming_rtl;
02812 };
02813
02814
02815 /* Nonzero in a decl means that the gimplifier has seen (or placed)
02816 this variable in a BIND_EXPR. */
02817 #define DECL_SEEN_IN_BIND_EXPR_P(NODE) \
02818 (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr)
02819
02820 /* Used to indicate that the linkage status of this DECL is not yet known,
02821 so it should not be output now. */
02822 #define DECL_DEFER_OUTPUT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output)
02823
02824 /* Nonzero for a given ..._DECL node means that no warnings should be
02825 generated just because this node is unused. */
02826 #define DECL_IN_SYSTEM_HEADER(NODE) \
02827 (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.in_system_header_flag)
02828
02829 /* Used to indicate that this DECL has weak linkage. */
02830 #define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
02831
02832 /* Internal to the gimplifier. Indicates that the value is a formal
02833 temporary controlled by the gimplifier. */
02834 #define DECL_GIMPLE_FORMAL_TEMP_P(DECL) \
02835 DECL_WITH_VIS_CHECK (DECL)->decl_with_vis.gimple_formal_temp
02836
02837 /* Used to indicate that the DECL is a dllimport. */
02838 #define DECL_DLLIMPORT_P(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
02839
02840 /* DECL_BASED_ON_RESTRICT_P records whether a VAR_DECL is a temporary
02841 based on a variable with a restrict qualified type. If it is,
02842 DECL_RESTRICT_BASE returns the restrict qualified variable on which
02843 it is based. */
02844
02845 #define DECL_BASED_ON_RESTRICT_P(NODE) \
02846 (VAR_DECL_CHECK (NODE)->decl_with_vis.based_on_restrict_p)
02847 #define DECL_GET_RESTRICT_BASE(NODE) \
02848 (decl_restrict_base_lookup (VAR_DECL_CHECK (NODE)))
02849 #define SET_DECL_RESTRICT_BASE(NODE, VAL) \
02850 (decl_restrict_base_insert (VAR_DECL_CHECK (NODE), (VAL)))
02851
02852 extern tree decl_restrict_base_lookup (tree);
02853 extern void decl_restrict_base_insert (tree, tree);
02854
02855 /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
02856 not be put out unless it is needed in this translation unit.
02857 Entities like this are shared across translation units (like weak
02858 entities), but are guaranteed to be generated by any translation
02859 unit that needs them, and therefore need not be put out anywhere
02860 where they are not needed. DECL_COMDAT is just a hint to the
02861 back-end; it is up to front-ends which set this flag to ensure
02862 that there will never be any harm, other than bloat, in putting out
02863 something which is DECL_COMDAT. */
02864 #define DECL_COMDAT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag)
02865
02866 /* A replaceable function is one which may be replaced at link-time
02867 with an entirely different definition, provided that the
02868 replacement has the same type. For example, functions declared
02869 with __attribute__((weak)) on most systems are replaceable.
02870
02871 COMDAT functions are not replaceable, since all definitions of the
02872 function must be equivalent. It is important that COMDAT functions
02873 not be treated as replaceable so that use of C++ template
02874 instantiations is not penalized.
02875
02876 For example, DECL_REPLACEABLE is used to determine whether or not a
02877 function (including a template instantiation) which is not
02878 explicitly declared "inline" can be inlined. If the function is
02879 DECL_REPLACEABLE then it is not safe to do the inlining, since the
02880 implementation chosen at link-time may be different. However, a
02881 function that is not DECL_REPLACEABLE can be inlined, since all
02882 versions of the function will be functionally identical. */
02883 #define DECL_REPLACEABLE_P(NODE) \
02884 (!DECL_COMDAT (NODE) && !targetm.binds_local_p (NODE))
02885
02886 /* The name of the object as the assembler will see it (but before any
02887 translations made by ASM_OUTPUT_LABELREF). Often this is the same
02888 as DECL_NAME. It is an IDENTIFIER_NODE. */
02889 #define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE)
02890
02891 /* Return true if NODE is a NODE that can contain a DECL_ASSEMBLER_NAME.
02892 This is true of all DECL nodes except FIELD_DECL. */
02893 #define HAS_DECL_ASSEMBLER_NAME_P(NODE) \
02894 (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WITH_VIS))
02895
02896 /* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set. If zero,
02897 the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set
02898 yet. */
02899 #define DECL_ASSEMBLER_NAME_SET_P(NODE) \
02900 (HAS_DECL_ASSEMBLER_NAME_P (NODE) && DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE)
02901
02902 /* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */
02903 #define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
02904 (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name = (NAME))
02905
02906 /* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2. Note that if DECL1's
02907 DECL_ASSEMBLER_NAME has not yet been set, using this macro will not cause
02908 the DECL_ASSEMBLER_NAME of either DECL to be set. In other words, the
02909 semantics of using this macro, are different than saying:
02910
02911 SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1))
02912
02913 which will try to set the DECL_ASSEMBLER_NAME for DECL1. */
02914
02915 #define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2) \
02916 (DECL_ASSEMBLER_NAME_SET_P (DECL1) \
02917 ? (void) SET_DECL_ASSEMBLER_NAME (DECL2, \
02918 DECL_ASSEMBLER_NAME (DECL1)) \
02919 : (void) 0)
02920
02921 /* Records the section name in a section attribute. Used to pass
02922 the name from decl_attributes to make_function_rtl and make_decl_rtl. */
02923 #define DECL_SECTION_NAME(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.section_name)
02924
02925 /* Value of the decls's visibility attribute */
02926 #define DECL_VISIBILITY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility)
02927
02928 /* Nonzero means that the decl had its visibility specified rather than
02929 being inferred. */
02930 #define DECL_VISIBILITY_SPECIFIED(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified)
02931
02932 /* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
02933 multiple translation units should be merged. */
02934 #define DECL_ONE_ONLY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.one_only)
02935
02936 struct tree_decl_with_vis GTY(())
02937 {
02938 struct tree_decl_with_rtl common;
02939 tree assembler_name;
02940 tree section_name;
02941
02942 /* Belong to VAR_DECL exclusively. */
02943 unsigned defer_output:1;
02944 unsigned hard_register:1;
02945 unsigned thread_local:1;
02946 unsigned common_flag:1;
02947 unsigned in_text_section : 1;
02948 unsigned gimple_formal_temp : 1;
02949 unsigned dllimport_flag : 1;
02950 unsigned based_on_restrict_p : 1;
02951 /* Used by C++. Might become a generic decl flag. */
02952 unsigned shadowed_for_var_p : 1;
02953
02954 /* Don't belong to VAR_DECL exclusively. */
02955 unsigned in_system_header_flag : 1;
02956 unsigned weak_flag:1;
02957 unsigned seen_in_bind_expr : 1;
02958 unsigned comdat_flag : 1;
02959 ENUM_BITFIELD(symbol_visibility) visibility : 2;
02960 unsigned visibility_specified : 1;
02961 /* Belong to FUNCTION_DECL exclusively. */
02962 unsigned one_only : 1;
02963 unsigned init_priority_p:1;
02964
02965 /* Belongs to VAR_DECL exclusively. */
02966 ENUM_BITFIELD(tls_model) tls_model : 3;
02967 /* 11 unused bits. */
02968 };
02969
02970 /* In a VAR_DECL that's static,
02971 nonzero if the space is in the text section. */
02972 #define DECL_IN_TEXT_SECTION(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section)
02973
02974 /* Nonzero for a given ..._DECL node means that this node should be
02975 put in .common, if possible. If a DECL_INITIAL is given, and it
02976 is not error_mark_node, then the decl cannot be put in .common. */
02977 #define DECL_COMMON(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag)
02978
02979 /* In a VAR_DECL, nonzero if the decl is a register variable with
02980 an explicit asm specification. */
02981 #define DECL_HARD_REGISTER(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register)
02982
02983 extern tree decl_debug_expr_lookup (tree);
02984 extern void decl_debug_expr_insert (tree, tree);
02985 /* For VAR_DECL, this is set to either an expression that it was split
02986 from (if DECL_DEBUG_EXPR_IS_FROM is true), otherwise a tree_list of
02987 subexpressions that it was split into. */
02988 #define DECL_DEBUG_EXPR(NODE) \
02989 (decl_debug_expr_lookup (VAR_DECL_CHECK (NODE)))
02990
02991 #define SET_DECL_DEBUG_EXPR(NODE, VAL) \
02992 (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL))
02993
02994
02995 extern unsigned short decl_init_priority_lookup (tree);
02996 extern void decl_init_priority_insert (tree, unsigned short);
02997
02998 /* In a non-local VAR_DECL with static storage duration, this is the
02999 initialization priority. If this value is zero, the NODE will be
03000 initialized at the DEFAULT_INIT_PRIORITY. Only used by C++ FE*/
03001
03002 #define DECL_HAS_INIT_PRIORITY_P(NODE) \
03003 (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
03004 #define DECL_INIT_PRIORITY(NODE) \
03005 (decl_init_priority_lookup (VAR_DECL_CHECK (NODE)))
03006 #define SET_DECL_INIT_PRIORITY(NODE, VAL) \
03007 (decl_init_priority_insert (VAR_DECL_CHECK (NODE), VAL))
03008
03009 /* In a VAR_DECL, the model to use if the data should be allocated from
03010 thread-local storage. */
03011 #define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model)
03012
03013 /* In a VAR_DECL, nonzero if the data should be allocated from
03014 thread-local storage. */
03015 #define DECL_THREAD_LOCAL_P(NODE) \
03016 (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model != TLS_MODEL_NONE)
03017
03018 struct tree_var_decl GTY(())
03019 {
03020 struct tree_decl_with_vis common;
03021 };
03022
03023
03024 /* This field is used to reference anything in decl.result and is meant only
03025 for use by the garbage collector. */
03026 #define DECL_RESULT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result)
03027
03028 /* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
03029 Before the struct containing the FUNCTION_DECL is laid out,
03030 DECL_VINDEX may point to a FUNCTION_DECL in a base class which
03031 is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual
03032 function. When the class is laid out, this pointer is changed
03033 to an INTEGER_CST node which is suitable for use as an index
03034 into the virtual function table.
03035 C++ also uses this field in namespaces, hence the DECL_NON_COMMON_CHECK. */
03036 #define DECL_VINDEX(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex)
03037
03038 struct tree_decl_non_common GTY(())
03039
03040 {
03041 struct tree_decl_with_vis common;
03042 /* C++ uses this in namespaces. */
03043 tree saved_tree;
03044 /* C++ uses this in templates. */
03045 tree arguments;
03046 /* Almost all FE's use this. */
03047 tree result;
03048 /* C++ uses this in namespaces. */
03049 tree vindex;
03050 };
03051
03052 /* In FUNCTION_DECL, holds the decl for the return value. */
03053 #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result)
03054
03055 /* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
03056 #define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable)
03057
03058 /* In a FUNCTION_DECL, the saved representation of the body of the
03059 entire function. */
03060 #define DECL_SAVED_TREE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.saved_tree)
03061
03062 /* Nonzero in a FUNCTION_DECL means this function should be treated
03063 as if it were a malloc, meaning it returns a pointer that is
03064 not an alias. */
03065 #define DECL_IS_MALLOC(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag)
03066
03067 /* Nonzero in a FUNCTION_DECL means this function may return more
03068 than once. */
03069 #define DECL_IS_RETURNS_TWICE(NODE) \
03070 (FUNCTION_DECL_CHECK (NODE)->function_decl.returns_twice_flag)
03071
03072 /* Nonzero in a FUNCTION_DECL means this function should be treated
03073 as "pure" function (like const function, but may read global memory). */
03074 #define DECL_IS_PURE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.pure_flag)
03075
03076 /* Nonzero in a FUNCTION_DECL means this function should be treated
03077 as "novops" function (function that does not read global memory,
03078 but may have arbitrary side effects). */
03079 #define DECL_IS_NOVOPS(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag)
03080
03081 /* Used in FUNCTION_DECLs to indicate that they should be run automatically
03082 at the beginning or end of execution. */
03083 #define DECL_STATIC_CONSTRUCTOR(NODE) \
03084 (FUNCTION_DECL_CHECK (NODE)->function_decl.static_ctor_flag)
03085
03086 #define DECL_STATIC_DESTRUCTOR(NODE) \
03087 (FUNCTION_DECL_CHECK (NODE)->function_decl.static_dtor_flag)
03088
03089 /* Used in FUNCTION_DECLs to indicate that function entry and exit should
03090 be instrumented with calls to support routines. */
03091 #define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \
03092 (FUNCTION_DECL_CHECK (NODE)->function_decl.no_instrument_function_entry_exit)
03093
03094 /* Used in FUNCTION_DECLs to indicate that limit-stack-* should be
03095 disabled in this function. */
03096 #define DECL_NO_LIMIT_STACK(NODE) \
03097 (FUNCTION_DECL_CHECK (NODE)->function_decl.no_limit_stack)
03098
03099 /* In a FUNCTION_DECL with a nonzero DECL_CONTEXT, indicates that a
03100 static chain is not needed. */
03101 #define DECL_NO_STATIC_CHAIN(NODE) \
03102 (FUNCTION_DECL_CHECK (NODE)->function_decl.regdecl_flag)
03103
03104 /* Nonzero for a decl that cgraph has decided should be inlined into
03105 at least one call site. It is not meaningful to look at this
03106 directly; always use cgraph_function_possibly_inlined_p. */
03107 #define DECL_POSSIBLY_INLINED(DECL) \
03108 FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined
03109
03110 /* Nonzero in a FUNCTION_DECL means this function can be substituted
03111 where it is called. */
03112 #define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.inline_flag)
03113
03114 /* Nonzero in a FUNCTION_DECL means that this function was declared inline,
03115 such as via the `inline' keyword in C/C++. This flag controls the linkage
03116 semantics of 'inline'; whether or not the function is inlined is
03117 controlled by DECL_INLINE. */
03118 #define DECL_DECLARED_INLINE_P(NODE) \
03119 (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
03120
03121 /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
03122 that describes the status of this function. */
03123 #define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
03124
03125 /* In a FUNCTION_DECL, nonzero means a built in function. */
03126 #define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN)
03127
03128 /* For a builtin function, identify which part of the compiler defined it. */
03129 #define DECL_BUILT_IN_CLASS(NODE) \
03130 (FUNCTION_DECL_CHECK (NODE)->function_decl.built_in_class)
03131
03132 /* In FUNCTION_DECL, a chain of ..._DECL nodes.
03133 VAR_DECL and PARM_DECL reserve the arguments slot for language-specific
03134 uses. */
03135 #define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
03136 #define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
03137
03138 /* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
03139 arguments/result/saved_tree fields by front ends. It was either inherit
03140 FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
03141 which seemed a bit strange. */
03142
03143 struct tree_function_decl GTY(())
03144 {
03145 struct tree_decl_non_common common;
03146
03147 unsigned static_ctor_flag : 1;
03148 unsigned static_dtor_flag : 1;
03149 unsigned uninlinable : 1;
03150 unsigned possibly_inlined : 1;
03151 unsigned novops_flag : 1;
03152 unsigned returns_twice_flag : 1;
03153 unsigned malloc_flag : 1;
03154 unsigned pure_flag : 1;
03155
03156 unsigned declared_inline_flag : 1;
03157 unsigned regdecl_flag : 1;
03158 unsigned inline_flag : 1;
03159 unsigned no_instrument_function_entry_exit : 1;
03160 unsigned no_limit_stack : 1;
03161 ENUM_BITFIELD(built_in_class) built_in_class : 2;
03162
03163 struct function *f;
03164 };
03165
03166 /* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */
03167 #define DECL_ORIGINAL_TYPE(NODE) (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
03168
03169 /* In a TYPE_DECL nonzero means the detail info about this type is not dumped
03170 into stabs. Instead it will generate cross reference ('x') of names.
03171 This uses the same flag as DECL_EXTERNAL. */
03172 #define TYPE_DECL_SUPPRESS_DEBUG(NODE) \
03173 (TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_2)
03174
03175 struct tree_type_decl GTY(())
03176 {
03177 struct tree_decl_non_common common;
03178
03179 };
03180
03181 /* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
03182 To reduce overhead, the nodes containing the statements are not trees.
03183 This avoids the overhead of tree_common on all linked list elements.
03184
03185 Use the interface in tree-iterator.h to access this node. */
03186
03187 #define STATEMENT_LIST_HEAD(NODE) \
03188 (STATEMENT_LIST_CHECK (NODE)->stmt_list.head)
03189 #define STATEMENT_LIST_TAIL(NODE) \
03190 (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
03191
03192 struct tree_statement_list_node
03193 GTY ((chain_next ("%h.next"), chain_prev ("%h.prev")))
03194 {
03195 struct tree_statement_list_node *prev;
03196 struct tree_statement_list_node *next;
03197 tree stmt;
03198 };
03199
03200 struct tree_statement_list
03201 GTY(())
03202 {
03203 struct tree_common common;
03204 struct tree_statement_list_node *head;
03205 struct tree_statement_list_node *tail;
03206 };
03207
03208 #define VALUE_HANDLE_ID(NODE) \
03209 (VALUE_HANDLE_CHECK (NODE)->value_handle.id)
03210
03211 #define VALUE_HANDLE_EXPR_SET(NODE) \
03212 (VALUE_HANDLE_CHECK (NODE)->value_handle.expr_set)
03213
03214 #define VALUE_HANDLE_VUSES(NODE) \
03215 (VALUE_HANDLE_CHECK (NODE)->value_handle.vuses)
03216
03217 /* Defined and used in tree-ssa-pre.c. */
03218 struct value_set;
03219
03220 struct tree_value_handle GTY(())
03221 {
03222 struct tree_common common;
03223
03224 /* The set of expressions represented by this handle. */
03225 struct value_set * GTY ((skip)) expr_set;
03226
03227 /* Unique ID for this value handle. IDs are handed out in a
03228 conveniently dense form starting at 0, so that we can make
03229 bitmaps of value handles. */
03230 unsigned int id;
03231
03232 /* Set of virtual uses represented by this handle. */
03233 VEC (tree, gc) *vuses;
03234 };
03235
03236 /* Define the overall contents of a tree node.
03237 It may be any of the structures declared above
03238 for various types of node. */
03239
03240 union tree_node GTY ((ptr_alias (union lang_tree_node),
03241 desc ("tree_node_structure (&%h)")))
03242 {
03243 struct tree_common GTY ((tag ("TS_COMMON"))) common;
03244 struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
03245 struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
03246 struct tree_vector GTY ((tag ("TS_VECTOR"))) vector;
03247 struct tree_string GTY ((tag ("TS_STRING"))) string;
03248 struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex;
03249 struct tree_identifier GTY ((tag ("TS_IDENTIFIER"))) identifier;
03250 struct tree_decl_minimal GTY((tag ("TS_DECL_MINIMAL"))) decl_minimal;
03251 struct tree_decl_common GTY ((tag ("TS_DECL_COMMON"))) decl_common;
03252 struct tree_decl_with_rtl GTY ((tag ("TS_DECL_WRTL"))) decl_with_rtl;
03253 struct tree_decl_non_common GTY ((tag ("TS_DECL_NON_COMMON"))) decl_non_common;
03254 struct tree_parm_decl GTY ((tag ("TS_PARM_DECL"))) parm_decl;
03255 struct tree_decl_with_vis GTY ((tag ("TS_DECL_WITH_VIS"))) decl_with_vis;
03256 struct tree_var_decl GTY ((tag ("TS_VAR_DECL"))) var_decl;
03257 struct tree_field_decl GTY ((tag ("TS_FIELD_DECL"))) field_decl;
03258 struct tree_label_decl GTY ((tag ("TS_LABEL_DECL"))) label_decl;
03259 struct tree_result_decl GTY ((tag ("TS_RESULT_DECL"))) result_decl;
03260 struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl;
03261 struct tree_type_decl GTY ((tag ("TS_TYPE_DECL"))) type_decl;
03262 struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl;
03263 struct tree_type GTY ((tag ("TS_TYPE"))) type;
03264 struct tree_list GTY ((tag ("TS_LIST"))) list;
03265 struct tree_vec GTY ((tag ("TS_VEC"))) vec;
03266 struct tree_exp GTY ((tag ("TS_EXP"))) exp;
03267 struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name;
03268 struct tree_phi_node GTY ((tag ("TS_PHI_NODE"))) phi;
03269 struct tree_block GTY ((tag ("TS_BLOCK"))) block;
03270 struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
03271 struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
03272 struct tree_value_handle GTY ((tag ("TS_VALUE_HANDLE"))) value_handle;
03273 struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
03274 struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
03275 struct tree_struct_field_tag GTY ((tag ("TS_STRUCT_FIELD_TAG"))) sft;
03276 struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
03277 };
03278
03279 /* Standard named or nameless data types of the C compiler. */
03280
03281 enum tree_index
03282 {
03283 TI_ERROR_MARK,
03284 TI_INTQI_TYPE,
03285 TI_INTHI_TYPE,
03286 TI_INTSI_TYPE,
03287 TI_INTDI_TYPE,
03288 TI_INTTI_TYPE,
03289
03290 TI_UINTQI_TYPE,
03291 TI_UINTHI_TYPE,
03292 TI_UINTSI_TYPE,
03293 TI_UINTDI_TYPE,
03294 TI_UINTTI_TYPE,
03295
03296 TI_INTEGER_ZERO,
03297 TI_INTEGER_ONE,
03298 TI_INTEGER_MINUS_ONE,
03299 TI_NULL_POINTER,
03300
03301 TI_SIZE_ZERO,
03302 TI_SIZE_ONE,
03303
03304 TI_BITSIZE_ZERO,
03305 TI_BITSIZE_ONE,
03306 TI_BITSIZE_UNIT,
03307
03308 TI_PUBLIC,
03309 TI_PROTECTED,
03310 TI_PRIVATE,
03311
03312 TI_BOOLEAN_FALSE,
03313 TI_BOOLEAN_TRUE,
03314
03315 TI_COMPLEX_INTEGER_TYPE,
03316 TI_COMPLEX_FLOAT_TYPE,
03317 TI_COMPLEX_DOUBLE_TYPE,
03318 TI_COMPLEX_LONG_DOUBLE_TYPE,
03319
03320 TI_FLOAT_TYPE,
03321 TI_DOUBLE_TYPE,
03322 TI_LONG_DOUBLE_TYPE,
03323
03324 TI_FLOAT_PTR_TYPE,
03325 TI_DOUBLE_PTR_TYPE,
03326 TI_LONG_DOUBLE_PTR_TYPE,
03327 TI_INTEGER_PTR_TYPE,
03328
03329 TI_VOID_TYPE,
03330 TI_PTR_TYPE,
03331 TI_CONST_PTR_TYPE,
03332 TI_SIZE_TYPE,
03333 TI_PID_TYPE,
03334 TI_PTRDIFF_TYPE,
03335 TI_VA_LIST_TYPE,
03336 TI_VA_LIST_GPR_COUNTER_FIELD,
03337 TI_VA_LIST_FPR_COUNTER_FIELD,
03338 TI_BOOLEAN_TYPE,
03339 TI_FILEPTR_TYPE,
03340
03341 TI_DFLOAT32_TYPE,
03342 TI_DFLOAT64_TYPE,
03343 TI_DFLOAT128_TYPE,
03344 TI_DFLOAT32_PTR_TYPE,
03345 TI_DFLOAT64_PTR_TYPE,
03346 TI_DFLOAT128_PTR_TYPE,
03347
03348 TI_VOID_LIST_NODE,
03349
03350 TI_MAIN_IDENTIFIER,
03351
03352 TI_MAX
03353 };
03354
03355 extern GTY(()) tree global_trees[TI_MAX];
03356
03357 #define error_mark_node global_trees[TI_ERROR_MARK]
03358
03359 #define intQI_type_node global_trees[TI_INTQI_TYPE]
03360 #define intHI_type_node global_trees[TI_INTHI_TYPE]
03361 #define intSI_type_node global_trees[TI_INTSI_TYPE]
03362 #define intDI_type_node global_trees[TI_INTDI_TYPE]
03363 #define intTI_type_node global_trees[TI_INTTI_TYPE]
03364
03365 #define unsigned_intQI_type_node global_trees[TI_UINTQI_TYPE]
03366 #define unsigned_intHI_type_node global_trees[TI_UINTHI_TYPE]
03367 #define unsigned_intSI_type_node global_trees[TI_UINTSI_TYPE]
03368 #define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
03369 #define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE]
03370
03371 #define integer_zero_node global_trees[TI_INTEGER_ZERO]
03372 #define integer_one_node global_trees[TI_INTEGER_ONE]
03373 #define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
03374 #define size_zero_node global_trees[TI_SIZE_ZERO]
03375 #define size_one_node global_trees[TI_SIZE_ONE]
03376 #define bitsize_zero_node global_trees[TI_BITSIZE_ZERO]
03377 #define bitsize_one_node global_trees[TI_BITSIZE_ONE]
03378 #define bitsize_unit_node global_trees[TI_BITSIZE_UNIT]
03379
03380 /* Base access nodes. */
03381 #define access_public_node global_trees[TI_PUBLIC]
03382 #define access_protected_node global_trees[TI_PROTECTED]
03383 #define access_private_node global_trees[TI_PRIVATE]
03384
03385 #define null_pointer_node global_trees[TI_NULL_POINTER]
03386
03387 #define float_type_node global_trees[TI_FLOAT_TYPE]
03388 #define double_type_node global_trees[TI_DOUBLE_TYPE]
03389 #define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE]
03390
03391 #define float_ptr_type_node global_trees[TI_FLOAT_PTR_TYPE]
03392 #define double_ptr_type_node global_trees[TI_DOUBLE_PTR_TYPE]
03393 #define long_double_ptr_type_node global_trees[TI_LONG_DOUBLE_PTR_TYPE]
03394 #define integer_ptr_type_node global_trees[TI_INTEGER_PTR_TYPE]
03395
03396 #define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE]
03397 #define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE]
03398 #define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE]
03399 #define complex_long_double_type_node global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
03400
03401 #define void_type_node global_trees[TI_VOID_TYPE]
03402 /* The C type `void *'. */
03403 #define ptr_type_node global_trees[TI_PTR_TYPE]
03404 /* The C type `const void *'. */
03405 #define const_ptr_type_node global_trees[TI_CONST_PTR_TYPE]
03406 /* The C type `size_t'. */
03407 #define size_type_node global_trees[TI_SIZE_TYPE]
03408 #define pid_type_node global_trees[TI_PID_TYPE]
03409 #define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
03410 #define va_list_type_node global_trees[TI_VA_LIST_TYPE]
03411 #define va_list_gpr_counter_field global_trees[TI_VA_LIST_GPR_COUNTER_FIELD]
03412 #define va_list_fpr_counter_field global_trees[TI_VA_LIST_FPR_COUNTER_FIELD]
03413 /* The C type `FILE *'. */
03414 #define fileptr_type_node global_trees[TI_FILEPTR_TYPE]
03415
03416 #define boolean_type_node global_trees[TI_BOOLEAN_TYPE]
03417 #define boolean_false_node global_trees[TI_BOOLEAN_FALSE]
03418 #define boolean_true_node global_trees[TI_BOOLEAN_TRUE]
03419
03420 /* The decimal floating point types. */
03421 #define dfloat32_type_node global_trees[TI_DFLOAT32_TYPE]
03422 #define dfloat64_type_node global_trees[TI_DFLOAT64_TYPE]
03423 #define dfloat128_type_node global_trees[TI_DFLOAT128_TYPE]
03424 #define dfloat32_ptr_type_node global_trees[TI_DFLOAT32_PTR_TYPE]
03425 #define dfloat64_ptr_type_node global_trees[TI_DFLOAT64_PTR_TYPE]
03426 #define dfloat128_ptr_type_node global_trees[TI_DFLOAT128_PTR_TYPE]
03427
03428 /* The node that should be placed at the end of a parameter list to
03429 indicate that the function does not take a variable number of
03430 arguments. The TREE_VALUE will be void_type_node and there will be
03431 no TREE_CHAIN. Language-independent code should not assume
03432 anything else about this node. */
03433 #define void_list_node global_trees[TI_VOID_LIST_NODE]
03434
03435 #define main_identifier_node global_trees[TI_MAIN_IDENTIFIER]
03436 #define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
03437
03438 /* An enumeration of the standard C integer types. These must be
03439 ordered so that shorter types appear before longer ones, and so
03440 that signed types appear before unsigned ones, for the correct
03441 functioning of interpret_integer() in c-lex.c. */
03442 enum integer_type_kind
03443 {
03444 itk_char,
03445 itk_signed_char,
03446 itk_unsigned_char,
03447 itk_short,
03448 itk_unsigned_short,
03449 itk_int,
03450 itk_unsigned_int,
03451 itk_long,
03452 itk_unsigned_long,
03453 itk_long_long,
03454 itk_unsigned_long_long,
03455 itk_none
03456 };
03457
03458 typedef enum integer_type_kind integer_type_kind;
03459
03460 /* The standard C integer types. Use integer_type_kind to index into
03461 this array. */
03462 extern GTY(()) tree integer_types[itk_none];
03463
03464 #define char_type_node integer_types[itk_char]
03465 #define signed_char_type_node integer_types[itk_signed_char]
03466 #define unsigned_char_type_node integer_types[itk_unsigned_char]
03467 #define short_integer_type_node integer_types[itk_short]
03468 #define short_unsigned_type_node integer_types[itk_unsigned_short]
03469 #define integer_type_node integer_types[itk_int]
03470 #define unsigned_type_node integer_types[itk_unsigned_int]
03471 #define long_integer_type_node integer_types[itk_long]
03472 #define long_unsigned_type_node integer_types[itk_unsigned_long]
03473 #define long_long_integer_type_node integer_types[itk_long_long]
03474 #define long_long_unsigned_type_node integer_types[itk_unsigned_long_long]
03475
03476 /* Set to the default thread-local storage (tls) model to use. */
03477
03478 extern enum tls_model flag_tls_default;
03479
03480
03481 /* A pointer-to-function member type looks like:
03482
03483 struct {
03484 __P __pfn;
03485 ptrdiff_t __delta;
03486 };
03487
03488 If __pfn is NULL, it is a NULL pointer-to-member-function.
03489
03490 (Because the vtable is always the first thing in the object, we
03491 don't need its offset.) If the function is virtual, then PFN is
03492 one plus twice the index into the vtable; otherwise, it is just a
03493 pointer to the function.
03494
03495 Unfortunately, using the lowest bit of PFN doesn't work in
03496 architectures that don't impose alignment requirements on function
03497 addresses, or that use the lowest bit to tell one ISA from another,
03498 for example. For such architectures, we use the lowest bit of
03499 DELTA instead of the lowest bit of the PFN, and DELTA will be
03500 multiplied by 2. */
03501
03502 enum ptrmemfunc_vbit_where_t
03503 {
03504 ptrmemfunc_vbit_in_pfn,
03505 ptrmemfunc_vbit_in_delta
03506 };
03507
03508 #define NULL_TREE (tree) NULL
03509
03510 extern tree decl_assembler_name (tree);
03511
03512 /* Compute the number of bytes occupied by 'node'. This routine only
03513 looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH. */
03514
03515 extern size_t tree_size (tree);
03516
03517 /* Compute the number of bytes occupied by a tree with code CODE. This
03518 function cannot be used for TREE_VEC or PHI_NODE codes, which are of
03519 variable length. */
03520 extern size_t tree_code_size (enum tree_code);
03521
03522 /* Lowest level primitive for allocating a node.
03523 The TREE_CODE is the only argument. Contents are initialized
03524 to zero except for a few of the common fields. */
03525
03526 extern tree make_node_stat (enum tree_code MEM_STAT_DECL);
03527 #define make_node(t) make_node_stat (t MEM_STAT_INFO)
03528
03529 /* Make a copy of a node, with all the same contents. */
03530
03531 extern tree copy_node_stat (tree MEM_STAT_DECL);
03532 #define copy_node(t) copy_node_stat (t MEM_STAT_INFO)
03533
03534 /* Make a copy of a chain of TREE_LIST nodes. */
03535
03536 extern tree copy_list (tree);
03537
03538 /* Make a BINFO. */
03539 extern tree make_tree_binfo_stat (unsigned MEM_STAT_DECL);
03540 #define make_tree_binfo(t) make_tree_binfo_stat (t MEM_STAT_INFO)
03541
03542 /* Make a TREE_VEC. */
03543
03544 extern tree make_tree_vec_stat (int MEM_STAT_DECL);
03545 #define make_tree_vec(t) make_tree_vec_stat (t MEM_STAT_INFO)
03546
03547 /* Tree nodes for SSA analysis. */
03548
03549 extern void init_phinodes (void);
03550 extern void fini_phinodes (void);
03551 extern void release_phi_node (tree);
03552 #ifdef GATHER_STATISTICS
03553 extern void phinodes_print_statistics (void);
03554 #endif
03555
03556 extern void init_ssanames (void);
03557 extern void fini_ssanames (void);
03558 extern tree make_ssa_name (tree, tree);
03559 extern tree duplicate_ssa_name (tree, tree);
03560 extern void duplicate_ssa_name_ptr_info (tree, struct ptr_info_def *);
03561 extern void release_ssa_name (tree);
03562 extern void release_defs (tree);
03563 extern void replace_ssa_name_symbol (tree, tree);
03564
03565 #ifdef GATHER_STATISTICS
03566 extern void ssanames_print_statistics (void);
03567 #endif
03568
03569 /* Return the (unique) IDENTIFIER_NODE node for a given name.
03570 The name is supplied as a char *. */
03571
03572 extern tree get_identifier (const char *);
03573
03574 #if GCC_VERSION >= 3000
03575 #define get_identifier(str) \
03576 (__builtin_constant_p (str) \
03577 ? get_identifier_with_length ((str), strlen (str)) \
03578 : get_identifier (str))
03579 #endif
03580
03581
03582 /* Identical to get_identifier, except that the length is assumed
03583 known. */
03584
03585 extern tree get_identifier_with_length (const char *, size_t);
03586
03587 /* If an identifier with the name TEXT (a null-terminated string) has
03588 previously been referred to, return that node; otherwise return
03589 NULL_TREE. */
03590
03591 extern tree maybe_get_identifier (const char *);
03592
03593 /* Construct various types of nodes. */
03594
03595 extern tree build_nt (enum tree_code, ...);
03596
03597 extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL);
03598 #define build0(c,t) build0_stat (c,t MEM_STAT_INFO)
03599 extern tree build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);
03600 #define build1(c,t1,t2) build1_stat (c,t1,t2 MEM_STAT_INFO)
03601 extern tree build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL);
03602 #define build2(c,t1,t2,t3) build2_stat (c,t1,t2,t3 MEM_STAT_INFO)
03603 extern tree build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
03604 #define build3(c,t1,t2,t3,t4) build3_stat (c,t1,t2,t3,t4 MEM_STAT_INFO)
03605 extern tree build4_stat (enum tree_code, tree, tree, tree, tree,
03606 tree MEM_STAT_DECL);
03607 #define build4(c,t1,t2,t3,t4,t5) build4_stat (c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
03608 extern tree build5_stat (enum tree_code, tree, tree, tree, tree, tree,
03609 tree MEM_STAT_DECL);
03610 #define build5(c,t1,t2,t3,t4,t5,t6) build5_stat (c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO)
03611 extern tree build7_stat (enum tree_code, tree, tree, tree, tree, tree,
03612 tree, tree, tree MEM_STAT_DECL);
03613 #define build7(c,t1,t2,t3,t4,t5,t6,t7,t8) \
03614 build7_stat (c,t1,t2,t3,t4,t5,t6,t7,t8 MEM_STAT_INFO)
03615
03616 extern tree build_int_cst (tree, HOST_WIDE_INT);
03617 extern tree build_int_cst_type (tree, HOST_WIDE_INT);
03618 extern tree build_int_cstu (tree, unsigned HOST_WIDE_INT);
03619 extern tree build_int_cst_wide (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
03620 extern tree build_vector (tree, tree);
03621 extern tree build_vector_from_ctor (tree, VEC(constructor_elt,gc) *);
03622 extern tree build_constructor (tree, VEC(constructor_elt,gc) *);
03623 extern tree build_constructor_single (tree, tree, tree);
03624 extern tree build_constructor_from_list (tree, tree);
03625 extern tree build_real_from_int_cst (tree, tree);
03626 extern tree build_complex (tree, tree, tree);
03627 extern tree build_one_cst (tree);
03628 extern tree build_string (int, const char *);
03629 extern tree build_tree_list_stat (tree, tree MEM_STAT_DECL);
03630 #define build_tree_list(t,q) build_tree_list_stat(t,q MEM_STAT_INFO)
03631 extern tree build_decl_stat (enum tree_code, tree, tree MEM_STAT_DECL);
03632 extern tree build_fn_decl (const char *, tree);
03633 #define build_decl(c,t,q) build_decl_stat (c,t,q MEM_STAT_INFO)
03634 extern tree build_block (tree, tree, tree, tree);
03635 #ifndef USE_MAPPED_LOCATION
03636 extern void annotate_with_file_line (tree, const char *, int);
03637 extern void annotate_with_locus (tree, location_t);
03638 #endif
03639 extern tree build_empty_stmt (void);
03640 extern tree build_omp_clause (enum omp_clause_code);
03641
03642 /* Construct various nodes representing data types. */
03643
03644 extern tree make_signed_type (int);
03645 extern tree make_unsigned_type (int);
03646 extern tree signed_type_for (tree);
03647 extern tree unsigned_type_for (tree);
03648 extern void initialize_sizetypes (bool);
03649 extern void set_sizetype (tree);
03650 extern void fixup_unsigned_type (tree);
03651 extern tree build_pointer_type_for_mode (tree, enum machine_mode, bool);
03652 extern tree build_pointer_type (tree);
03653 extern tree build_reference_type_for_mode (tree, enum machine_mode, bool);
03654 extern tree build_reference_type (tree);
03655 extern tree build_vector_type_for_mode (tree, enum machine_mode);
03656 extern tree build_vector_type (tree innertype, int nunits);
03657 extern tree build_type_no_quals (tree);
03658 extern tree build_index_type (tree);
03659 extern tree build_index_2_type (tree, tree);
03660 extern tree build_array_type (tree, tree);
03661 extern tree build_function_type (tree, tree);
03662 extern tree build_function_type_list (tree, ...);
03663 extern tree build_method_type_directly (tree, tree, tree);
03664 extern tree build_method_type (tree, tree);
03665 extern tree build_offset_type (tree, tree);
03666 extern tree build_complex_type (tree);
03667 extern tree build_resx (int);
03668 extern tree array_type_nelts (tree);
03669 extern bool in_array_bounds_p (tree);
03670 extern bool range_in_array_bounds_p (tree);
03671
03672 extern tree value_member (tree, tree);
03673 extern tree purpose_member (tree, tree);
03674
03675 extern int attribute_list_equal (tree, tree);
03676 extern int attribute_list_contained (tree, tree);
03677 extern int tree_int_cst_equal (tree, tree);
03678 extern int tree_int_cst_lt (tree, tree);
03679 extern int tree_int_cst_compare (tree, tree);
03680 extern int host_integerp (tree, int);
03681 extern HOST_WIDE_INT tree_low_cst (tree, int);
03682 extern int tree_int_cst_msb (tree);
03683 extern int tree_int_cst_sgn (tree);
03684 extern int tree_int_cst_sign_bit (tree);
03685 extern int tree_expr_nonnegative_p (tree);
03686 extern int tree_expr_nonnegative_warnv_p (tree, bool *);
03687 extern bool may_negate_without_overflow_p (tree);
03688 extern tree get_inner_array_type (tree);
03689
03690 /* From expmed.c. Since rtl.h is included after tree.h, we can't
03691 put the prototype here. Rtl.h does declare the prototype if
03692 tree.h had been included. */
03693
03694 extern tree make_tree (tree, rtx);
03695
03696 /* Return a type like TTYPE except that its TYPE_ATTRIBUTES
03697 is ATTRIBUTE.
03698
03699 Such modified types already made are recorded so that duplicates
03700 are not made. */
03701
03702 extern tree build_type_attribute_variant (tree, tree);
03703 extern tree build_decl_attribute_variant (tree, tree);
03704
03705 /* Structure describing an attribute and a function to handle it. */
03706 struct attribute_spec
03707 {
03708 /* The name of the attribute (without any leading or trailing __),
03709 or NULL to mark the end of a table of attributes. */
03710 const char *const name;
03711 /* The minimum length of the list of arguments of the attribute. */
03712 const int min_length;
03713 /* The maximum length of the list of arguments of the attribute
03714 (-1 for no maximum). */
03715 const int max_length;
03716 /* Whether this attribute requires a DECL. If it does, it will be passed
03717 from types of DECLs, function return types and array element types to
03718 the DECLs, function types and array types respectively; but when
03719 applied to a type in any other circumstances, it will be ignored with
03720 a warning. (If greater control is desired for a given attribute,
03721 this should be false, and the flags argument to the handler may be
03722 used to gain greater control in that case.) */
03723 const bool decl_required;
03724 /* Whether this attribute requires a type. If it does, it will be passed
03725 from a DECL to the type of that DECL. */
03726 const bool type_required;
03727 /* Whether this attribute requires a function (or method) type. If it does,
03728 it will be passed from a function pointer type to the target type,
03729 and from a function return type (which is not itself a function
03730 pointer type) to the function type. */
03731 const bool function_type_required;
03732 /* Function to handle this attribute. NODE points to the node to which
03733 the attribute is to be applied. If a DECL, it should be modified in
03734 place; if a TYPE, a copy should be created. NAME is the name of the
03735 attribute (possibly with leading or trailing __). ARGS is the TREE_LIST
03736 of the arguments (which may be NULL). FLAGS gives further information
03737 about the context of the attribute. Afterwards, the attributes will
03738 be added to the DECL_ATTRIBUTES or TYPE_ATTRIBUTES, as appropriate,
03739 unless *NO_ADD_ATTRS is set to true (which should be done on error,
03740 as well as in any other cases when the attributes should not be added
03741 to the DECL or TYPE). Depending on FLAGS, any attributes to be
03742 applied to another type or DECL later may be returned;
03743 otherwise the return value should be NULL_TREE. This pointer may be
03744 NULL if no special handling is required beyond the checks implied
03745 by the rest of this structure. */
03746 tree (*const handler) (tree *node, tree name, tree args,
03747 int flags, bool *no_add_attrs);
03748 };
03749
03750 /* Flags that may be passed in the third argument of decl_attributes, and
03751 to handler functions for attributes. */
03752 enum attribute_flags
03753 {
03754 /* The type passed in is the type of a DECL, and any attributes that
03755 should be passed in again to be applied to the DECL rather than the
03756 type should be returned. */
03757 ATTR_FLAG_DECL_NEXT = 1,
03758 /* The type passed in is a function return type, and any attributes that
03759 should be passed in again to be applied to the function type rather
03760 than the return type should be returned. */
03761 ATTR_FLAG_FUNCTION_NEXT = 2,
03762 /* The type passed in is an array element type, and any attributes that
03763 should be passed in again to be applied to the array type rather
03764 than the element type should be returned. */
03765 ATTR_FLAG_ARRAY_NEXT = 4,
03766 /* The type passed in is a structure, union or enumeration type being
03767 created, and should be modified in place. */
03768 ATTR_FLAG_TYPE_IN_PLACE = 8,
03769 /* The attributes are being applied by default to a library function whose
03770 name indicates known behavior, and should be silently ignored if they
03771 are not in fact compatible with the function type. */
03772 ATTR_FLAG_BUILT_IN = 16
03773 };
03774
03775 /* Default versions of target-overridable functions. */
03776
03777 extern tree merge_decl_attributes (tree, tree);
03778 extern tree merge_type_attributes (tree, tree);
03779
03780 /* Given a tree node and a string, return nonzero if the tree node is
03781 a valid attribute name for the string. */
03782
03783 extern int is_attribute_p (const char *, tree);
03784
03785 /* Given an attribute name and a list of attributes, return the list element
03786 of the attribute or NULL_TREE if not found. */
03787
03788 extern tree lookup_attribute (const char *, tree);
03789
03790 /* Remove any instances of attribute ATTR_NAME in LIST and return the
03791 modified list. */
03792
03793 extern tree remove_attribute (const char *, tree);
03794
03795 /* Given two attributes lists, return a list of their union. */
03796
03797 extern tree merge_attributes (tree, tree);
03798
03799 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
03800 /* Given two Windows decl attributes lists, possibly including
03801 dllimport, return a list of their union . */
03802 extern tree merge_dllimport_decl_attributes (tree, tree);
03803
03804 /* Handle a "dllimport" or "dllexport" attribute. */
03805 extern tree handle_dll_attribute (tree *, tree, tree, int, bool *);
03806 #endif
03807
03808 /* Check whether CAND is suitable to be returned from get_qualified_type
03809 (BASE, TYPE_QUALS). */
03810
03811 extern bool check_qualified_type (tree, tree, int);
03812
03813 /* Return a version of the TYPE, qualified as indicated by the
03814 TYPE_QUALS, if one exists. If no qualified version exists yet,
03815 return NULL_TREE. */
03816
03817 extern tree get_qualified_type (tree, int);
03818
03819 /* Like get_qualified_type, but creates the type if it does not
03820 exist. This function never returns NULL_TREE. */
03821
03822 extern tree build_qualified_type (tree, int);
03823
03824 /* Like build_qualified_type, but only deals with the `const' and
03825 `volatile' qualifiers. This interface is retained for backwards
03826 compatibility with the various front-ends; new code should use
03827 build_qualified_type instead. */
03828
03829 #define build_type_variant(TYPE, CONST_P, VOLATILE_P) \
03830 build_qualified_type ((TYPE), \
03831 ((CONST_P) ? TYPE_QUAL_CONST : 0) \
03832 | ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
03833
03834 /* Make a copy of a type node. */
03835
03836 extern tree build_distinct_type_copy (tree);
03837 extern tree build_variant_type_copy (tree);
03838
03839 /* Finish up a builtin RECORD_TYPE. Give it a name and provide its
03840 fields. Optionally specify an alignment, and then lay it out. */
03841
03842 extern void finish_builtin_struct (tree, const char *,
03843 tree, tree);
03844
03845 /* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
03846 TYPE_ALIGN and TYPE_MODE fields. If called more than once on one
03847 node, does nothing except for the first time. */
03848
03849 extern void layout_type (tree);
03850
03851 /* These functions allow a front-end to perform a manual layout of a
03852 RECORD_TYPE. (For instance, if the placement of subsequent fields
03853 depends on the placement of fields so far.) Begin by calling
03854 start_record_layout. Then, call place_field for each of the
03855 fields. Then, call finish_record_layout. See layout_type for the
03856 default way in which these functions are used. */
03857
03858 typedef struct record_layout_info_s
03859 {
03860 /* The RECORD_TYPE that we are laying out. */
03861 tree t;
03862 /* The offset into the record so far, in bytes, not including bits in
03863 BITPOS. */
03864 tree offset;
03865 /* The last known alignment of SIZE. */
03866 unsigned int offset_align;
03867 /* The bit position within the last OFFSET_ALIGN bits, in bits. */
03868 tree bitpos;
03869 /* The alignment of the record so far, in bits. */
03870 unsigned int record_align;
03871 /* The alignment of the record so far, ignoring #pragma pack and
03872 __attribute__ ((packed)), in bits. */
03873 unsigned int unpacked_align;
03874 /* The previous field layed out. */
03875 tree prev_field;
03876 /* The static variables (i.e., class variables, as opposed to
03877 instance variables) encountered in T. */
03878 tree pending_statics;
03879 /* Bits remaining in the current alignment group */
03880 int remaining_in_alignment;
03881 /* True if we've seen a packed field that didn't have normal
03882 alignment anyway. */
03883 int packed_maybe_necessary;
03884 } *record_layout_info;
03885
03886 extern void set_lang_adjust_rli (void (*) (record_layout_info));
03887 extern record_layout_info start_record_layout (tree);
03888 extern tree bit_from_pos (tree, tree);
03889 extern tree byte_from_pos (tree, tree);
03890 extern void pos_from_bit (tree *, tree *, unsigned int, tree);
03891 extern void normalize_offset (tree *, tree *, unsigned int);
03892 extern tree rli_size_unit_so_far (record_layout_info);
03893 extern tree rli_size_so_far (record_layout_info);
03894 extern void normalize_rli (record_layout_info);
03895 extern void place_field (record_layout_info, tree);
03896 extern void compute_record_mode (tree);
03897 extern void finish_record_layout (record_layout_info, int);
03898
03899 /* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
03900 return a canonicalized ..._TYPE node, so that duplicates are not made.
03901 How the hash code is computed is up to the caller, as long as any two
03902 callers that could hash identical-looking type nodes agree. */
03903
03904 extern tree type_hash_canon (unsigned int, tree);
03905
03906 /* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node,
03907 calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE
03908 fields. Call this only once for any given decl node.
03909
03910 Second argument is the boundary that this field can be assumed to
03911 be starting at (in bits). Zero means it can be assumed aligned
03912 on any boundary that may be needed. */
03913
03914 extern void layout_decl (tree, unsigned);
03915
03916 /* Given a VAR_DECL, PARM_DECL or RESULT_DECL, clears the results of
03917 a previous call to layout_decl and calls it again. */
03918
03919 extern void relayout_decl (tree);
03920
03921 /* Return the mode for data of a given size SIZE and mode class CLASS.
03922 If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
03923 The value is BLKmode if no other mode is found. This is like
03924 mode_for_size, but is passed a tree. */
03925
03926 extern enum machine_mode mode_for_size_tree (tree, enum mode_class, int);
03927
03928 /* Return an expr equal to X but certainly not valid as an lvalue. */
03929
03930 extern tree non_lvalue (tree);
03931
03932 extern tree convert (tree, tree);
03933 extern unsigned int expr_align (tree);
03934 extern tree expr_first (tree);
03935 extern tree expr_last (tree);
03936 extern tree expr_only (tree);
03937 extern tree size_in_bytes (tree);
03938 extern HOST_WIDE_INT int_size_in_bytes (tree);
03939 extern HOST_WIDE_INT max_int_size_in_bytes (tree);
03940 extern tree bit_position (tree);
03941 extern HOST_WIDE_INT int_bit_position (tree);
03942 extern tree byte_position (tree);
03943 extern HOST_WIDE_INT int_byte_position (tree);
03944
03945 /* Define data structures, macros, and functions for handling sizes
03946 and the various types used to represent sizes. */
03947
03948 enum size_type_kind
03949 {
03950 SIZETYPE, /* Normal representation of sizes in bytes. */
03951 SSIZETYPE, /* Signed representation of sizes in bytes. */
03952 BITSIZETYPE, /* Normal representation of sizes in bits. */
03953 SBITSIZETYPE, /* Signed representation of sizes in bits. */
03954 TYPE_KIND_LAST};
03955
03956 extern GTY(()) tree sizetype_tab[(int) TYPE_KIND_LAST];
03957
03958 #define sizetype sizetype_tab[(int) SIZETYPE]
03959 #define bitsizetype sizetype_tab[(int) BITSIZETYPE]
03960 #define ssizetype sizetype_tab[(int) SSIZETYPE]
03961 #define sbitsizetype sizetype_tab[(int) SBITSIZETYPE]
03962
03963 extern tree size_int_kind (HOST_WIDE_INT, enum size_type_kind);
03964 extern tree size_binop (enum tree_code, tree, tree);
03965 extern tree size_diffop (tree, tree);
03966
03967 #define size_int(L) size_int_kind (L, SIZETYPE)
03968 #define ssize_int(L) size_int_kind (L, SSIZETYPE)
03969 #define bitsize_int(L) size_int_kind (L, BITSIZETYPE)
03970 #define sbitsize_int(L) size_int_kind (L, SBITSIZETYPE)
03971
03972 extern tree round_up (tree, int);
03973 extern tree round_down (tree, int);
03974 extern tree get_pending_sizes (void);
03975 extern void put_pending_size (tree);
03976 extern void put_pending_sizes (tree);
03977
03978 /* Type for sizes of data-type. */
03979
03980 #define BITS_PER_UNIT_LOG \
03981 ((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \
03982 + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \
03983 + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256))
03984
03985 /* If nonzero, an upper limit on alignment of structure fields, in bits, */
03986 extern unsigned int maximum_field_alignment;
03987 /* and its original value in bytes, specified via -fpack-struct=<value>. */
03988 extern unsigned int initial_max_fld_align;
03989
03990 /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
03991 by making the last node in X point to Y.
03992 Returns X, except if X is 0 returns Y. */
03993
03994 extern tree chainon (tree, tree);
03995
03996 /* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN. */
03997
03998 extern tree tree_cons_stat (tree, tree, tree MEM_STAT_DECL);
03999 #define tree_cons(t,q,w) tree_cons_stat (t,q,w MEM_STAT_INFO)
04000
04001 /* Return the last tree node in a chain. */
04002
04003 extern tree tree_last (tree);
04004
04005 /* Reverse the order of elements in a chain, and return the new head. */
04006
04007 extern tree nreverse (tree);
04008
04009 /* Returns the length of a chain of nodes
04010 (number of chain pointers to follow before reaching a null pointer). */
04011
04012 extern int list_length (tree);
04013
04014 /* Returns the number of FIELD_DECLs in a type. */
04015
04016 extern int fields_length (tree);
04017
04018 /* Given an initializer INIT, return TRUE if INIT is zero or some
04019 aggregate of zeros. Otherwise return FALSE. */
04020
04021 extern bool initializer_zerop (tree);
04022
04023 /* Examine CTOR to discover:
04024 * how many scalar fields are set to nonzero values,
04025 and place it in *P_NZ_ELTS;
04026 * how many scalar fields in total are in CTOR,
04027 and place it in *P_ELT_COUNT.
04028 * if a type is a union, and the initializer from the constructor
04029 is not the largest element in the union, then set *p_must_clear.
04030
04031 Return whether or not CTOR is a valid static constant initializer, the same
04032 as "initializer_constant_valid_p (CTOR, TREE_TYPE (CTOR)) != 0". */
04033
04034 extern bool categorize_ctor_elements (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
04035 bool *);
04036
04037 extern HOST_WIDE_INT count_type_elements (tree, bool);
04038
04039 /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */
04040
04041 extern int integer_zerop (tree);
04042
04043 /* integer_onep (tree x) is nonzero if X is an integer constant of value 1. */
04044
04045 extern int integer_onep (tree);
04046
04047 /* integer_all_onesp (tree x) is nonzero if X is an integer constant
04048 all of whose significant bits are 1. */
04049
04050 extern int integer_all_onesp (tree);
04051
04052 /* integer_pow2p (tree x) is nonzero is X is an integer constant with
04053 exactly one bit 1. */
04054
04055 extern int integer_pow2p (tree);
04056
04057 /* integer_nonzerop (tree x) is nonzero if X is an integer constant
04058 with a nonzero value. */
04059
04060 extern int integer_nonzerop (tree);
04061
04062 extern bool zero_p (tree);
04063 extern bool cst_and_fits_in_hwi (tree);
04064 extern tree num_ending_zeros (tree);
04065
04066 /* staticp (tree x) is nonzero if X is a reference to data allocated
04067 at a fixed address in memory. Returns the outermost data. */
04068
04069 extern tree staticp (tree);
04070
04071 /* save_expr (EXP) returns an expression equivalent to EXP
04072 but it can be used multiple times within context CTX
04073 and only evaluate EXP once. */
04074
04075 extern tree save_expr (tree);
04076
04077 /* Look inside EXPR and into any simple arithmetic operations. Return
04078 the innermost non-arithmetic node. */
04079
04080 extern tree skip_simple_arithmetic (tree);
04081
04082 /* Return which tree structure is used by T. */
04083
04084 enum tree_node_structure_enum tree_node_structure (tree);
04085
04086 /* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
04087 or offset that depends on a field within a record.
04088
04089 Note that we only allow such expressions within simple arithmetic
04090 or a COND_EXPR. */
04091
04092 extern bool contains_placeholder_p (tree);
04093
04094 /* This macro calls the above function but short-circuits the common
04095 case of a constant to save time. Also check for null. */
04096
04097 #define CONTAINS_PLACEHOLDER_P(EXP) \
04098 ((EXP) != 0 && ! TREE_CONSTANT (EXP) && contains_placeholder_p (EXP))
04099
04100 /* Return 1 if any part of the computation of TYPE involves a PLACEHOLDER_EXPR.
04101 This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and field
04102 positions. */
04103
04104 extern bool type_contains_placeholder_p (tree);
04105
04106 /* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
04107 return a tree with all occurrences of references to F in a
04108 PLACEHOLDER_EXPR replaced by R. Note that we assume here that EXP
04109 contains only arithmetic expressions. */
04110
04111 extern tree substitute_in_expr (tree, tree, tree);
04112
04113 /* This macro calls the above function but short-circuits the common
04114 case of a constant to save time and also checks for NULL. */
04115
04116 #define SUBSTITUTE_IN_EXPR(EXP, F, R) \
04117 ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) : substitute_in_expr (EXP, F, R))
04118
04119 /* Similar, but look for a PLACEHOLDER_EXPR in EXP and find a replacement
04120 for it within OBJ, a tree that is an object or a chain of references. */
04121
04122 extern tree substitute_placeholder_in_expr (tree, tree);
04123
04124 /* This macro calls the above function but short-circuits the common
04125 case of a constant to save time and also checks for NULL. */
04126
04127 #define SUBSTITUTE_PLACEHOLDER_IN_EXPR(EXP, OBJ) \
04128 ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) \
04129 : substitute_placeholder_in_expr (EXP, OBJ))
04130
04131 /* variable_size (EXP) is like save_expr (EXP) except that it
04132 is for the special case of something that is part of a
04133 variable size for a data type. It makes special arrangements
04134 to compute the value at the right time when the data type
04135 belongs to a function parameter. */
04136
04137 extern tree variable_size (tree);
04138
04139 /* stabilize_reference (EXP) returns a reference equivalent to EXP
04140 but it can be used multiple times
04141 and only evaluate the subexpressions once. */
04142
04143 extern tree stabilize_reference (tree);
04144
04145 /* Subroutine of stabilize_reference; this is called for subtrees of
04146 references. Any expression with side-effects must be put in a SAVE_EXPR
04147 to ensure that it is only evaluated once. */
04148
04149 extern tree stabilize_reference_1 (tree);
04150
04151 /* Return EXP, stripped of any conversions to wider types
04152 in such a way that the result of converting to type FOR_TYPE
04153 is the same as if EXP were converted to FOR_TYPE.
04154 If FOR_TYPE is 0, it signifies EXP's type. */
04155
04156 extern tree get_unwidened (tree, tree);
04157
04158 /* Return OP or a simpler expression for a narrower value
04159 which can be sign-extended or zero-extended to give back OP.
04160 Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended
04161 or 0 if the value should be sign-extended. */
04162
04163 extern tree get_narrower (tree, int *);
04164
04165 /* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
04166 look for nested component-refs or array-refs at constant positions
04167 and find the ultimate containing object, which is returned. */
04168
04169 extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
04170 tree *, enum machine_mode *, int *, int *,
04171 bool);
04172
04173 /* Return 1 if T is an expression that get_inner_reference handles. */
04174
04175 extern int handled_component_p (tree);
04176
04177 /* Return a tree of sizetype representing the size, in bytes, of the element
04178 of EXP, an ARRAY_REF. */
04179
04180 extern tree array_ref_element_size (tree);
04181
04182 /* Return a tree representing the lower bound of the array mentioned in
04183 EXP, an ARRAY_REF. */
04184
04185 extern tree array_ref_low_bound (tree);
04186
04187 /* Return a tree representing the upper bound of the array mentioned in
04188 EXP, an ARRAY_REF. */
04189
04190 extern tree array_ref_up_bound (tree);
04191
04192 /* Return a tree representing the offset, in bytes, of the field referenced
04193 by EXP. This does not include any offset in DECL_FIELD_BIT_OFFSET. */
04194
04195 extern tree component_ref_field_offset (tree);
04196
04197 /* Given a DECL or TYPE, return the scope in which it was declared, or
04198 NUL_TREE if there is no containing scope. */
04199
04200 extern tree get_containing_scope (tree);
04201
04202 /* Return the FUNCTION_DECL which provides this _DECL with its context,
04203 or zero if none. */
04204 extern tree decl_function_context (tree);
04205
04206 /* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides
04207 this _DECL with its context, or zero if none. */
04208 extern tree decl_type_context (tree);
04209
04210 /* Return 1 if EXPR is the real constant zero. */
04211 extern int real_zerop (tree);
04212
04213 /* Declare commonly used variables for tree structure. */
04214
04215 /* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
04216 Zero means allow extended lvalues. */
04217
04218 extern int pedantic_lvalues;
04219
04220 /* Points to the FUNCTION_DECL of the function whose body we are reading. */
04221
04222 extern GTY(()) tree current_function_decl;
04223
04224 /* Nonzero means a FUNC_BEGIN label was emitted. */
04225 extern GTY(()) const char * current_function_func_begin_label;
04226
04227 /* In tree.c */
04228 extern unsigned crc32_string (unsigned, const char *);
04229 extern void clean_symbol_name (char *);
04230 extern tree get_file_function_name_long (const char *);
04231 extern tree get_callee_fndecl (tree);
04232 extern void change_decl_assembler_name (tree, tree);
04233 extern int type_num_arguments (tree);
04234 extern bool associative_tree_code (enum tree_code);
04235 extern bool commutative_tree_code (enum tree_code);
04236 extern tree upper_bound_in_type (tree, tree);
04237 extern tree lower_bound_in_type (tree, tree);
04238 extern int operand_equal_for_phi_arg_p (tree, tree);
04239 extern bool empty_body_p (tree);
04240
04241 /* In stmt.c */
04242
04243 extern void expand_expr_stmt (tree);
04244 extern int warn_if_unused_value (tree, location_t);
04245 extern void expand_label (tree);
04246 extern void expand_goto (tree);
04247
04248 extern rtx expand_stack_save (void);
04249 extern void expand_stack_restore (tree);
04250 extern void expand_return (tree);
04251 extern int is_body_block (tree);
04252
04253 /* In tree-eh.c */
04254 extern void using_eh_for_cleanups (void);
04255
04256 /* In fold-const.c */
04257
04258 /* Non-zero if we are folding constants inside an initializer; zero
04259 otherwise. */
04260 extern int folding_initializer;
04261
04262 /* Fold constants as much as possible in an expression.
04263 Returns the simplified expression.
04264 Acts only on the top level of the expression;
04265 if the argument itself cannot be simplified, its
04266 subexpressions are not changed. */
04267
04268 extern tree fold (tree);
04269 extern tree fold_unary (enum tree_code, tree, tree);
04270 extern tree fold_binary (enum tree_code, tree, tree, tree);
04271 extern tree fold_ternary (enum tree_code, tree, tree, tree, tree);
04272 extern tree fold_build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);
04273 #define fold_build1(c,t1,t2) fold_build1_stat (c, t1, t2 MEM_STAT_INFO)
04274 extern tree fold_build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL);
04275 #define fold_build2(c,t1,t2,t3) fold_build2_stat (c, t1, t2, t3 MEM_STAT_INFO)
04276 extern tree fold_build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
04277 #define fold_build3(c,t1,t2,t3,t4) fold_build3_stat (c, t1, t2, t3, t4 MEM_STAT_INFO)
04278 extern tree fold_build1_initializer (enum tree_code, tree, tree);
04279 extern tree fold_build2_initializer (enum tree_code, tree, tree, tree);
04280 extern tree fold_build3_initializer (enum tree_code, tree, tree, tree, tree);
04281 extern tree fold_convert (tree, tree);
04282 extern tree fold_single_bit_test (enum tree_code, tree, tree, tree);
04283 extern tree fold_ignored_result (tree);
04284 extern tree fold_abs_const (tree, tree);
04285 extern tree fold_indirect_ref_1 (tree, tree);
04286 extern void fold_defer_overflow_warnings (void);
04287 extern void fold_undefer_overflow_warnings (bool, tree, int);
04288 extern void fold_undefer_and_ignore_overflow_warnings (void);
04289 extern bool fold_deferring_overflow_warnings_p (void);
04290
04291 extern tree force_fit_type (tree, int, bool, bool);
04292
04293 extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04294 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04295 unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
04296 bool);
04297 #define add_double(l1,h1,l2,h2,lv,hv) \
04298 add_double_with_sign (l1, h1, l2, h2, lv, hv, false)
04299 extern int neg_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04300 unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
04301 extern int mul_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04302 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04303 unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
04304 bool);
04305 #define mul_double(l1,h1,l2,h2,lv,hv) \
04306 mul_double_with_sign (l1, h1, l2, h2, lv, hv, false)
04307 extern void lshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04308 HOST_WIDE_INT, unsigned int,
04309 unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, int);
04310 extern void rshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04311 HOST_WIDE_INT, unsigned int,
04312 unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, int);
04313 extern void lrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04314 HOST_WIDE_INT, unsigned int,
04315 unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
04316 extern void rrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
04317 HOST_WIDE_INT, unsigned int,
04318 unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
04319
04320 extern int div_and_round_double (enum tree_code, int, unsigned HOST_WIDE_INT,
04321 HOST_WIDE_INT, unsigned HOST_WIDE_INT,
04322 HOST_WIDE_INT, unsigned HOST_WIDE_INT *,
04323 HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
04324 HOST_WIDE_INT *);
04325
04326 enum operand_equal_flag
04327 {
04328 OEP_ONLY_CONST = 1,
04329 OEP_PURE_SAME = 2
04330 };
04331
04332 extern int operand_equal_p (tree, tree, unsigned int);
04333
04334 extern tree omit_one_operand (tree, tree, tree);
04335 extern tree omit_two_operands (tree, tree, tree, tree);
04336 extern tree invert_truthvalue (tree);
04337 extern tree fold_truth_not_expr (tree);
04338 extern tree fold_unary_to_constant (enum tree_code, tree, tree);
04339 extern tree fold_binary_to_constant (enum tree_code, tree, tree, tree);
04340 extern tree fold_read_from_constant_string (tree);
04341 extern tree int_const_binop (enum tree_code, tree, tree, int);
04342 extern tree build_fold_addr_expr (tree);
04343 extern tree fold_build_cleanup_point_expr (tree type, tree expr);
04344 extern tree fold_strip_sign_ops (tree);
04345 extern tree build_fold_addr_expr_with_type (tree, tree);
04346 extern tree build_fold_indirect_ref (tree);
04347 extern tree fold_indirect_ref (tree);
04348 extern tree constant_boolean_node (int, tree);
04349 extern tree build_low_bits_mask (tree, unsigned);
04350
04351 extern bool tree_swap_operands_p (tree, tree, bool);
04352 extern void swap_tree_operands (tree, tree *, tree *);
04353 extern enum tree_code swap_tree_comparison (enum tree_code);
04354
04355 extern bool ptr_difference_const (tree, tree, HOST_WIDE_INT *);
04356 extern enum tree_code invert_tree_comparison (enum tree_code, bool);
04357
04358 extern bool tree_expr_nonzero_p (tree);
04359 extern bool tree_expr_nonzero_warnv_p (tree, bool *);
04360
04361 /* In builtins.c */
04362 extern tree fold_builtin (tree, tree, bool);
04363 extern tree fold_builtin_fputs (tree, bool, bool, tree);
04364 extern tree fold_builtin_strcpy (tree, tree, tree);
04365 extern tree fold_builtin_strncpy (tree, tree, tree);
04366 extern tree fold_builtin_memory_chk (tree, tree, tree, bool,
04367 enum built_in_function);
04368 extern tree fold_builtin_stxcpy_chk (tree, tree, tree, bool,
04369 enum built_in_function);
04370 extern tree fold_builtin_strncpy_chk (tree, tree);
04371 extern tree fold_builtin_snprintf_chk (tree, tree, enum built_in_function);
04372 extern bool fold_builtin_next_arg (tree);
04373 extern enum built_in_function builtin_mathfn_code (tree);
04374 extern tree build_function_call_expr (tree, tree);
04375 extern tree mathfn_built_in (tree, enum built_in_function fn);
04376 extern tree strip_float_extensions (tree);
04377 extern tree c_strlen (tree, int);
04378 extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *);
04379 extern tree build_va_arg_indirect_ref (tree);
04380 tree build_string_literal (int, const char *);
04381
04382 /* In convert.c */
04383 extern tree strip_float_extensions (tree);
04384
04385 /* In alias.c */
04386 extern void record_component_aliases (tree);
04387 extern HOST_WIDE_INT get_alias_set (tree);
04388 extern int alias_sets_conflict_p (HOST_WIDE_INT, HOST_WIDE_INT);
04389 extern int alias_sets_might_conflict_p (HOST_WIDE_INT, HOST_WIDE_INT);
04390 extern int objects_must_conflict_p (tree, tree);
04391
04392 /* In tree.c */
04393 extern int really_constant_p (tree);
04394 extern int int_fits_type_p (tree, tree);
04395 extern bool variably_modified_type_p (tree, tree);
04396 extern int tree_log2 (tree);
04397 extern int tree_floor_log2 (tree);
04398 extern int simple_cst_equal (tree, tree);
04399 extern hashval_t iterative_hash_expr (tree, hashval_t);
04400 extern int compare_tree_int (tree, unsigned HOST_WIDE_INT);
04401 extern int type_list_equal (tree, tree);
04402 extern int chain_member (tree, tree);
04403 extern tree type_hash_lookup (unsigned int, tree);
04404 extern void type_hash_add (unsigned int, tree);
04405 extern int simple_cst_list_equal (tree, tree);
04406 extern void dump_tree_statistics (void);
04407 extern void expand_function_end (void);
04408 extern void expand_function_start (tree);
04409 extern void stack_protect_prologue (void);
04410 extern void stack_protect_epilogue (void);
04411 extern void recompute_tree_invariant_for_addr_expr (tree);
04412 extern bool is_global_var (tree t);
04413 extern bool needs_to_live_in_memory (tree);
04414 extern tree reconstruct_complex_type (tree, tree);
04415
04416 extern int real_onep (tree);
04417 extern int real_twop (tree);
04418 extern int real_minus_onep (tree);
04419 extern void init_ttree (void);
04420 extern void build_common_tree_nodes (bool, bool);
04421 extern void build_common_tree_nodes_2 (int);
04422 extern void build_common_builtin_nodes (void);
04423 extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
04424 extern tree build_range_type (tree, tree, tree);
04425 extern HOST_WIDE_INT int_cst_value (tree);
04426 extern tree tree_fold_gcd (tree, tree);
04427 extern tree build_addr (tree, tree);
04428
04429 extern bool fields_compatible_p (tree, tree);
04430 extern tree find_compatible_field (tree, tree);
04431
04432 /* In function.c */
04433 extern void expand_main_function (void);
04434 extern void init_dummy_function_start (void);
04435 extern void expand_dummy_function_end (void);
04436 extern unsigned int init_function_for_compilation (void);
04437 extern void allocate_struct_function (tree);
04438 extern void init_function_start (tree);
04439 extern bool use_register_for_decl (tree);
04440 extern void setjmp_vars_warning (tree);
04441 extern void setjmp_args_warning (void);
04442 extern void init_temp_slots (void);
04443 extern void free_temp_slots (void);
04444 extern void pop_temp_slots (void);
04445 extern void push_temp_slots (void);
04446 extern void preserve_temp_slots (rtx);
04447 extern int aggregate_value_p (tree, tree);
04448 extern void push_function_context (void);
04449 extern void pop_function_context (void);
04450 extern void push_function_context_to (tree);
04451 extern void pop_function_context_from (tree);
04452 extern tree gimplify_parameters (void);
04453
04454 /* In print-rtl.c */
04455 #ifdef BUFSIZ
04456 extern void print_rtl (FILE *, rtx);
04457 #endif
04458
04459 /* In print-tree.c */
04460 extern void debug_tree (tree);
04461 #ifdef BUFSIZ
04462 extern void dump_addr (FILE*, const char *, void *);
04463 extern void print_node (FILE *, const char *, tree, int);
04464 extern void print_node_brief (FILE *, const char *, tree, int);
04465 extern void indent_to (FILE *, int);
04466 #endif
04467
04468 /* In tree-inline.c: */
04469 extern bool debug_find_tree (tree, tree);
04470 /* This is in tree-inline.c since the routine uses
04471 data structures from the inliner. */
04472 extern tree unsave_expr_now (tree);
04473 extern tree build_duplicate_type (tree);
04474
04475 /* In emit-rtl.c */
04476 extern rtx emit_line_note (location_t);
04477
04478 /* In calls.c */
04479
04480 /* Nonzero if this is a call to a function whose return value depends
04481 solely on its arguments, has no side effects, and does not read
04482 global memory. */
04483 #define ECF_CONST 1
04484 /* Nonzero if this call will never return. */
04485 #define ECF_NORETURN 2
04486 /* Nonzero if this is a call to malloc or a related function. */
04487 #define ECF_MALLOC 4
04488 /* Nonzero if it is plausible that this is a call to alloca. */
04489 #define ECF_MAY_BE_ALLOCA 8
04490 /* Nonzero if this is a call to a function that won't throw an exception. */
04491 #define ECF_NOTHROW 16
04492 /* Nonzero if this is a call to setjmp or a related function. */
04493 #define ECF_RETURNS_TWICE 32
04494 /* Nonzero if this call replaces the current stack frame. */
04495 #define ECF_SIBCALL 64
04496 /* Nonzero if this is a call to "pure" function (like const function,
04497 but may read memory. */
04498 #define ECF_PURE 128
04499 /* Nonzero if this is a call to a function that returns with the stack
04500 pointer depressed. */
04501 #define ECF_SP_DEPRESSED 256
04502 /* Create libcall block around the call. */
04503 #define ECF_LIBCALL_BLOCK 512
04504 /* Function does not read or write memory (but may have side effects, so
04505 it does not necessarily fit ECF_CONST). */
04506 #define ECF_NOVOPS 1024
04507
04508 extern int flags_from_decl_or_type (tree);
04509 extern int call_expr_flags (tree);
04510
04511 extern int setjmp_call_p (tree);
04512 extern bool alloca_call_p (tree);
04513 extern bool must_pass_in_stack_var_size (enum machine_mode, tree);
04514 extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, tree);
04515
04516 /* In attribs.c. */
04517
04518 /* Process the attributes listed in ATTRIBUTES and install them in *NODE,
04519 which is either a DECL (including a TYPE_DECL) or a TYPE. If a DECL,
04520 it should be modified in place; if a TYPE, a copy should be created
04521 unless ATTR_FLAG_TYPE_IN_PLACE is set in FLAGS. FLAGS gives further
04522 information, in the form of a bitwise OR of flags in enum attribute_flags
04523 from tree.h. Depending on these flags, some attributes may be
04524 returned to be applied at a later stage (for example, to apply
04525 a decl attribute to the declaration rather than to its type). */
04526 extern tree decl_attributes (tree *, tree, int);
04527
04528 /* In integrate.c */
04529 extern void set_decl_abstract_flags (tree, int);
04530 extern void set_decl_origin_self (tree);
04531
04532 /* In stor-layout.c */
04533 extern void set_min_and_max_values_for_integral_type (tree, int, bool);
04534 extern void fixup_signed_type (tree);
04535 extern void internal_reference_types (void);
04536 extern unsigned int update_alignment_for_field (record_layout_info, tree,
04537 unsigned int);
04538 /* varasm.c */
04539 extern void make_decl_rtl (tree);
04540 extern void make_decl_one_only (tree);
04541 extern int supports_one_only (void);
04542 extern void resolve_unique_section (tree, int, int);
04543 extern void mark_referenced (tree);
04544 extern void mark_decl_referenced (tree);
04545 extern void notice_global_symbol (tree);
04546 extern void set_user_assembler_name (tree, const char *);
04547 extern void process_pending_assemble_externals (void);
04548 extern void finish_aliases_1 (void);
04549 extern void finish_aliases_2 (void);
04550
04551 /* In stmt.c */
04552 extern void expand_computed_goto (tree);
04553 extern bool parse_output_constraint (const char **, int, int, int,
04554 bool *, bool *, bool *);
04555 extern bool parse_input_constraint (const char **, int, int, int, int,
04556 const char * const *, bool *, bool *);
04557 extern void expand_asm_expr (tree);
04558 extern tree resolve_asm_operand_names (tree, tree, tree);
04559 extern void expand_case (tree);
04560 extern void expand_decl (tree);
04561 extern void expand_anon_union_decl (tree, tree, tree);
04562 #ifdef HARD_CONST
04563 /* Silly ifdef to avoid having all includers depend on hard-reg-set.h. */
04564 extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);
04565 #endif
04566
04567 /* In gimplify.c. */
04568 extern tree create_artificial_label (void);
04569 extern void gimplify_function_tree (tree);
04570 extern const char *get_name (tree);
04571 extern tree unshare_expr (tree);
04572 extern void sort_case_labels (tree);
04573
04574 /* If KIND=='I', return a suitable global initializer (constructor) name.
04575 If KIND=='D', return a suitable global clean-up (destructor) name. */
04576 extern tree get_file_function_name (int);
04577
04578 /* Interface of the DWARF2 unwind info support. */
04579
04580 /* Generate a new label for the CFI info to refer to. */
04581
04582 extern char *dwarf2out_cfi_label (void);
04583
04584 /* Entry point to update the canonical frame address (CFA). */
04585
04586 extern void dwarf2out_def_cfa (const char *, unsigned, HOST_WIDE_INT);
04587
04588 /* Add the CFI for saving a register window. */
04589
04590 extern void dwarf2out_window_save (const char *);
04591
04592 /* Add a CFI to update the running total of the size of arguments pushed
04593 onto the stack. */
04594
04595 extern void dwarf2out_args_size (const char *, HOST_WIDE_INT);
04596
04597 /* Entry point for saving a register to the stack. */
04598
04599 extern void dwarf2out_reg_save (const char *, unsigned, HOST_WIDE_INT);
04600
04601 /* Entry point for saving the return address in the stack. */
04602
04603 extern void dwarf2out_return_save (const char *, HOST_WIDE_INT);
04604
04605 /* Entry point for saving the return address in a register. */
04606
04607 extern void dwarf2out_return_reg (const char *, unsigned);
04608
04609 /* Entry point for saving the first register into the second. */
04610
04611 extern void dwarf2out_reg_save_reg (const char *, rtx, rtx);
04612
04613 /* In tree-inline.c */
04614
04615 /* The type of a set of already-visited pointers. Functions for creating
04616 and manipulating it are declared in pointer-set.h */
04617 struct pointer_set_t;
04618
04619 /* The type of a callback function for walking over tree structure. */
04620
04621 typedef tree (*walk_tree_fn) (tree *, int *, void *);
04622 extern tree walk_tree (tree*, walk_tree_fn, void*, struct pointer_set_t*);
04623 extern tree walk_tree_without_duplicates (tree*, walk_tree_fn, void*);
04624
04625 /* Assign the RTX to declaration. */
04626
04627 extern void set_decl_rtl (tree, rtx);
04628 extern void set_decl_incoming_rtl (tree, rtx);
04629
04630 /* Enum and arrays used for tree allocation stats.
04631 Keep in sync with tree.c:tree_node_kind_names. */
04632 typedef enum
04633 {
04634 d_kind,
04635 t_kind,
04636 b_kind,
04637 s_kind,
04638 r_kind,
04639 e_kind,
04640 c_kind,
04641 id_kind,
04642 perm_list_kind,
04643 temp_list_kind,
04644 vec_kind,
04645 binfo_kind,
04646 phi_kind,
04647 ssa_name_kind,
04648 constr_kind,
04649 x_kind,
04650 lang_decl,
04651 lang_type,
04652 omp_clause_kind,
04653 all_kinds
04654 } tree_node_kind;
04655
04656 extern int tree_node_counts[];
04657 extern int tree_node_sizes[];
04658
04659 /* True if we are in gimple form and the actions of the folders need to
04660 be restricted. False if we are not in gimple form and folding is not
04661 restricted to creating gimple expressions. */
04662 extern bool in_gimple_form;
04663
04664 /* In tree-gimple.c. */
04665 extern tree get_base_address (tree t);
04666
04667 /* In tree-vectorizer.c. */
04668 extern void vect_set_verbosity_level (const char *);
04669
04670 struct tree_map GTY(())
04671 {
04672 unsigned int hash;
04673 tree from;
04674 tree to;
04675 };
04676
04677 extern unsigned int tree_map_hash (const void *);
04678 extern int tree_map_marked_p (const void *);
04679 extern int tree_map_eq (const void *, const void *);
04680
04681 /* In tree-ssa-address.c. */
04682 extern tree tree_mem_ref_addr (tree, tree);
04683 extern void copy_mem_ref_info (tree, tree);
04684
04685 /* In tree-vrp.c */
04686 extern bool ssa_name_nonzero_p (tree);
04687 extern bool ssa_name_nonnegative_p (tree);
04688
04689 /* In tree-object-size.c. */
04690 extern void init_object_sizes (void);
04691 extern void fini_object_sizes (void);
04692 extern unsigned HOST_WIDE_INT compute_builtin_object_size (tree, int);
04693
04694 /* In expr.c. */
04695 extern unsigned HOST_WIDE_INT highest_pow2_factor (tree);
04696
04697 #ifdef KEY
04698 /* Bug 1392 */
04699 #include "gspin-gcc-interface.h"
04700 /* gspin global variables */
04701 extern int flag_spin_file;
04702 /* gspin function declarations */
04703 extern void gspin (tree t);
04704 extern gs_t gs_x (tree node);
04705 extern gs_t gs_x_func_decl (tree node);
04706 extern void gspin_gxx_emits_decl (tree t);
04707 extern void gspin_gxx_emits_thunk_decl (tree t);
04708 extern void gspin_gxx_emits_asm (char *str);
04709 extern void gspin_init_global_trees_list (void);
04710 extern int gspin_invoked (tree t);
04711 extern void gs_set_flag_value (tree t, unsigned int flag, bool value);
04712 extern void gs_set_program_flag_value (unsigned int flag, bool value);
04713 extern bool lang_cplus (void);
04714 #endif
04715
04716 #endif /* GCC_TREE_H */