00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "config.h"
00024 #include "system.h"
00025 #include "coretypes.h"
00026 #include "tm.h"
00027 #include "tree.h"
00028 #include "real.h"
00029 #include "ggc.h"
00030 #include "langhooks.h"
00031
00032
00033
00034
00035 #define HASH_SIZE 37
00036
00037 struct bucket
00038 {
00039 tree node;
00040 struct bucket *next;
00041 };
00042
00043 static struct bucket **table;
00044
00045
00046
00047
00048
00049 void
00050 debug_tree (tree node)
00051 {
00052 table = xcalloc (HASH_SIZE, sizeof (struct bucket *));
00053 print_node (stderr, "", node, 0);
00054 free (table);
00055 table = 0;
00056 putc ('\n', stderr);
00057 }
00058
00059
00060
00061 void
00062 print_node_brief (FILE *file, const char *prefix, tree node, int indent)
00063 {
00064 enum tree_code_class class;
00065
00066 if (node == 0)
00067 return;
00068
00069 class = TREE_CODE_CLASS (TREE_CODE (node));
00070
00071
00072
00073 if (indent > 0)
00074 fprintf (file, " ");
00075 fprintf (file, "%s <%s " HOST_PTR_PRINTF,
00076 prefix, tree_code_name[(int) TREE_CODE (node)], (char *) node);
00077
00078 if (class == tcc_declaration)
00079 {
00080 if (DECL_NAME (node))
00081 fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
00082 else if (TREE_CODE (node) == LABEL_DECL
00083 && LABEL_DECL_UID (node) != -1)
00084 fprintf (file, " L." HOST_WIDE_INT_PRINT_DEC, LABEL_DECL_UID (node));
00085 else
00086 fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
00087 DECL_UID (node));
00088 }
00089 else if (class == tcc_type)
00090 {
00091 if (TYPE_NAME (node))
00092 {
00093 if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
00094 fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node)));
00095 else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
00096 && DECL_NAME (TYPE_NAME (node)))
00097 fprintf (file, " %s",
00098 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))));
00099 }
00100 }
00101 if (TREE_CODE (node) == IDENTIFIER_NODE)
00102 fprintf (file, " %s", IDENTIFIER_POINTER (node));
00103
00104
00105 if (TREE_CODE (node) == INTEGER_CST)
00106 {
00107 if (TREE_CONSTANT_OVERFLOW (node))
00108 fprintf (file, " overflow");
00109
00110 fprintf (file, " ");
00111 if (TREE_INT_CST_HIGH (node) == 0)
00112 fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node));
00113 else if (TREE_INT_CST_HIGH (node) == -1
00114 && TREE_INT_CST_LOW (node) != 0)
00115 fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
00116 -TREE_INT_CST_LOW (node));
00117 else
00118 fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
00119 TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node));
00120 }
00121 if (TREE_CODE (node) == REAL_CST)
00122 {
00123 REAL_VALUE_TYPE d;
00124
00125 if (TREE_OVERFLOW (node))
00126 fprintf (file, " overflow");
00127
00128 d = TREE_REAL_CST (node);
00129 if (REAL_VALUE_ISINF (d))
00130 fprintf (file, " Inf");
00131 else if (REAL_VALUE_ISNAN (d))
00132 fprintf (file, " Nan");
00133 else
00134 {
00135 char string[60];
00136 real_to_decimal (string, &d, sizeof (string), 0, 1);
00137 fprintf (file, " %s", string);
00138 }
00139 }
00140
00141 fprintf (file, ">");
00142 }
00143
00144 void
00145 indent_to (FILE *file, int column)
00146 {
00147 int i;
00148
00149
00150 if (column > 0)
00151 fprintf (file, "\n");
00152 for (i = 0; i < column; i++)
00153 fprintf (file, " ");
00154 }
00155
00156
00157
00158
00159 void
00160 print_node (FILE *file, const char *prefix, tree node, int indent)
00161 {
00162 int hash;
00163 struct bucket *b;
00164 enum machine_mode mode;
00165 enum tree_code_class class;
00166 int len;
00167 int i;
00168 expanded_location xloc;
00169
00170 if (node == 0)
00171 return;
00172
00173 class = TREE_CODE_CLASS (TREE_CODE (node));
00174
00175
00176
00177
00178
00179 if (indent > 24)
00180 {
00181 print_node_brief (file, prefix, node, indent);
00182 return;
00183 }
00184
00185 if (indent > 8 && (class == tcc_type || class == tcc_declaration))
00186 {
00187 print_node_brief (file, prefix, node, indent);
00188 return;
00189 }
00190
00191
00192 if (TREE_CODE (node) == ERROR_MARK)
00193 {
00194 print_node_brief (file, prefix, node, indent);
00195 return;
00196 }
00197
00198 hash = ((unsigned long) node) % HASH_SIZE;
00199
00200
00201 for (b = table[hash]; b; b = b->next)
00202 if (b->node == node)
00203 {
00204 print_node_brief (file, prefix, node, indent);
00205 return;
00206 }
00207
00208
00209 b = xmalloc (sizeof (struct bucket));
00210 b->node = node;
00211 b->next = table[hash];
00212 table[hash] = b;
00213
00214
00215 indent_to (file, indent);
00216
00217
00218 fprintf (file, "%s <%s " HOST_PTR_PRINTF,
00219 prefix, tree_code_name[(int) TREE_CODE (node)], (void *) node);
00220
00221
00222 if (class == tcc_declaration)
00223 {
00224 if (DECL_NAME (node))
00225 fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
00226 else if (TREE_CODE (node) == LABEL_DECL
00227 && LABEL_DECL_UID (node) != -1)
00228 fprintf (file, " L." HOST_WIDE_INT_PRINT_DEC, LABEL_DECL_UID (node));
00229 else
00230 fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
00231 DECL_UID (node));
00232 }
00233 else if (class == tcc_type)
00234 {
00235 if (TYPE_NAME (node))
00236 {
00237 if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
00238 fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node)));
00239 else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
00240 && DECL_NAME (TYPE_NAME (node)))
00241 fprintf (file, " %s",
00242 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))));
00243 }
00244 }
00245 if (TREE_CODE (node) == IDENTIFIER_NODE)
00246 fprintf (file, " %s", IDENTIFIER_POINTER (node));
00247
00248 if (TREE_CODE (node) == INTEGER_CST)
00249 {
00250 if (indent <= 4)
00251 print_node_brief (file, "type", TREE_TYPE (node), indent + 4);
00252 }
00253 else
00254 {
00255 print_node (file, "type", TREE_TYPE (node), indent + 4);
00256 if (TREE_TYPE (node))
00257 indent_to (file, indent + 3);
00258 }
00259
00260 if (!TYPE_P (node) && TREE_SIDE_EFFECTS (node))
00261 fputs (" side-effects", file);
00262
00263 if (TYPE_P (node) ? TYPE_READONLY (node) : TREE_READONLY (node))
00264 fputs (" readonly", file);
00265 if (!TYPE_P (node) && TREE_CONSTANT (node))
00266 fputs (" constant", file);
00267 else if (TYPE_P (node) && TYPE_SIZES_GIMPLIFIED (node))
00268 fputs (" sizes-gimplified", file);
00269
00270 if (TREE_INVARIANT (node))
00271 fputs (" invariant", file);
00272 if (TREE_ADDRESSABLE (node))
00273 fputs (" addressable", file);
00274 if (TREE_THIS_VOLATILE (node))
00275 fputs (" volatile", file);
00276 if (TREE_ASM_WRITTEN (node))
00277 fputs (" asm_written", file);
00278 if (TREE_USED (node))
00279 fputs (" used", file);
00280 if (TREE_NOTHROW (node))
00281 fputs (TYPE_P (node) ? " align-ok" : " nothrow", file);
00282 if (TREE_PUBLIC (node))
00283 fputs (" public", file);
00284 if (TREE_PRIVATE (node))
00285 fputs (" private", file);
00286 if (TREE_PROTECTED (node))
00287 fputs (" protected", file);
00288 if (TREE_STATIC (node))
00289 fputs (" static", file);
00290 if (TREE_DEPRECATED (node))
00291 fputs (" deprecated", file);
00292 if (TREE_VISITED (node))
00293 fputs (" visited", file);
00294 if (TREE_LANG_FLAG_0 (node))
00295 fputs (" tree_0", file);
00296 if (TREE_LANG_FLAG_1 (node))
00297 fputs (" tree_1", file);
00298 if (TREE_LANG_FLAG_2 (node))
00299 fputs (" tree_2", file);
00300 if (TREE_LANG_FLAG_3 (node))
00301 fputs (" tree_3", file);
00302 if (TREE_LANG_FLAG_4 (node))
00303 fputs (" tree_4", file);
00304 if (TREE_LANG_FLAG_5 (node))
00305 fputs (" tree_5", file);
00306 if (TREE_LANG_FLAG_6 (node))
00307 fputs (" tree_6", file);
00308
00309
00310
00311 switch (TREE_CODE_CLASS (TREE_CODE (node)))
00312 {
00313 case tcc_declaration:
00314 mode = DECL_MODE (node);
00315
00316 if (DECL_UNSIGNED (node))
00317 fputs (" unsigned", file);
00318 if (DECL_IGNORED_P (node))
00319 fputs (" ignored", file);
00320 if (DECL_ABSTRACT (node))
00321 fputs (" abstract", file);
00322 if (DECL_IN_SYSTEM_HEADER (node))
00323 fputs (" in_system_header", file);
00324 if (DECL_COMMON (node))
00325 fputs (" common", file);
00326 if (DECL_EXTERNAL (node))
00327 fputs (" external", file);
00328 if (DECL_WEAK (node))
00329 fputs (" weak", file);
00330 if (DECL_REGISTER (node) && TREE_CODE (node) != FIELD_DECL
00331 && TREE_CODE (node) != FUNCTION_DECL
00332 && TREE_CODE (node) != LABEL_DECL)
00333 fputs (" regdecl", file);
00334 if (DECL_NONLOCAL (node))
00335 fputs (" nonlocal", file);
00336
00337 if (TREE_CODE (node) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
00338 fputs (" suppress-debug", file);
00339
00340 if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
00341 fputs (DECL_DECLARED_INLINE_P (node) ? " inline" : " autoinline", file);
00342 if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
00343 fputs (" built-in", file);
00344 if (TREE_CODE (node) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node))
00345 fputs (" no-static-chain", file);
00346
00347 if (TREE_CODE (node) == FIELD_DECL && DECL_PACKED (node))
00348 fputs (" packed", file);
00349 if (TREE_CODE (node) == FIELD_DECL && DECL_BIT_FIELD (node))
00350 fputs (" bit-field", file);
00351 if (TREE_CODE (node) == FIELD_DECL && DECL_NONADDRESSABLE_P (node))
00352 fputs (" nonaddressable", file);
00353
00354 if (TREE_CODE (node) == LABEL_DECL && DECL_ERROR_ISSUED (node))
00355 fputs (" error-issued", file);
00356
00357 if (TREE_CODE (node) == VAR_DECL && DECL_IN_TEXT_SECTION (node))
00358 fputs (" in-text-section", file);
00359 if (TREE_CODE (node) == VAR_DECL && DECL_THREAD_LOCAL (node))
00360 fputs (" thread-local", file);
00361
00362 if (TREE_CODE (node) == PARM_DECL && DECL_TRANSPARENT_UNION (node))
00363 fputs (" transparent-union", file);
00364
00365 if (DECL_VIRTUAL_P (node))
00366 fputs (" virtual", file);
00367 if (DECL_DEFER_OUTPUT (node))
00368 fputs (" defer-output", file);
00369
00370 if (DECL_PRESERVE_P (node))
00371 fputs (" preserve", file);
00372
00373 if (DECL_LANG_FLAG_0 (node))
00374 fputs (" decl_0", file);
00375 if (DECL_LANG_FLAG_1 (node))
00376 fputs (" decl_1", file);
00377 if (DECL_LANG_FLAG_2 (node))
00378 fputs (" decl_2", file);
00379 if (DECL_LANG_FLAG_3 (node))
00380 fputs (" decl_3", file);
00381 if (DECL_LANG_FLAG_4 (node))
00382 fputs (" decl_4", file);
00383 if (DECL_LANG_FLAG_5 (node))
00384 fputs (" decl_5", file);
00385 if (DECL_LANG_FLAG_6 (node))
00386 fputs (" decl_6", file);
00387 if (DECL_LANG_FLAG_7 (node))
00388 fputs (" decl_7", file);
00389
00390 fprintf (file, " %s", GET_MODE_NAME (mode));
00391 xloc = expand_location (DECL_SOURCE_LOCATION (node));
00392 fprintf (file, " file %s line %d", xloc.file, xloc.line);
00393
00394 print_node (file, "size", DECL_SIZE (node), indent + 4);
00395 print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4);
00396
00397 if (TREE_CODE (node) != FUNCTION_DECL
00398 || DECL_INLINE (node) || DECL_BUILT_IN (node))
00399 indent_to (file, indent + 3);
00400
00401 if (TREE_CODE (node) != FUNCTION_DECL)
00402 {
00403 if (DECL_USER_ALIGN (node))
00404 fprintf (file, " user");
00405
00406 fprintf (file, " align %d", DECL_ALIGN (node));
00407 if (TREE_CODE (node) == FIELD_DECL)
00408 fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED,
00409 DECL_OFFSET_ALIGN (node));
00410 }
00411 else if (DECL_BUILT_IN (node))
00412 {
00413 if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD)
00414 fprintf (file, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node));
00415 else
00416 fprintf (file, " built-in %s:%s",
00417 built_in_class_names[(int) DECL_BUILT_IN_CLASS (node)],
00418 built_in_names[(int) DECL_FUNCTION_CODE (node)]);
00419 }
00420
00421 if (DECL_POINTER_ALIAS_SET_KNOWN_P (node))
00422 fprintf (file, " alias set " HOST_WIDE_INT_PRINT_DEC,
00423 DECL_POINTER_ALIAS_SET (node));
00424
00425 if (TREE_CODE (node) == FIELD_DECL)
00426 {
00427 print_node (file, "offset", DECL_FIELD_OFFSET (node), indent + 4);
00428 print_node (file, "bit offset", DECL_FIELD_BIT_OFFSET (node),
00429 indent + 4);
00430 }
00431
00432 print_node_brief (file, "context", DECL_CONTEXT (node), indent + 4);
00433 print_node_brief (file, "attributes",
00434 DECL_ATTRIBUTES (node), indent + 4);
00435 print_node_brief (file, "abstract_origin",
00436 DECL_ABSTRACT_ORIGIN (node), indent + 4);
00437
00438 print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4);
00439 print_node (file, "result", DECL_RESULT_FLD (node), indent + 4);
00440 print_node_brief (file, "initial", DECL_INITIAL (node), indent + 4);
00441
00442 lang_hooks.print_decl (file, node, indent);
00443
00444 if (DECL_RTL_SET_P (node))
00445 {
00446 indent_to (file, indent + 4);
00447 print_rtl (file, DECL_RTL (node));
00448 }
00449
00450 if (TREE_CODE (node) == PARM_DECL)
00451 {
00452 print_node (file, "arg-type", DECL_ARG_TYPE (node), indent + 4);
00453 print_node (file, "arg-type-as-written",
00454 DECL_ARG_TYPE_AS_WRITTEN (node), indent + 4);
00455
00456 if (DECL_INCOMING_RTL (node) != 0)
00457 {
00458 indent_to (file, indent + 4);
00459 fprintf (file, "incoming-rtl ");
00460 print_rtl (file, DECL_INCOMING_RTL (node));
00461 }
00462 }
00463 else if (TREE_CODE (node) == FUNCTION_DECL
00464 && DECL_STRUCT_FUNCTION (node) != 0)
00465 {
00466 indent_to (file, indent + 4);
00467 fprintf (file, "saved-insns " HOST_PTR_PRINTF,
00468 (void *) DECL_STRUCT_FUNCTION (node));
00469 }
00470
00471
00472 if (indent == 4)
00473 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
00474 else
00475 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
00476 break;
00477
00478 case tcc_type:
00479 if (TYPE_UNSIGNED (node))
00480 fputs (" unsigned", file);
00481
00482
00483
00484 if ((TREE_CODE (node) == RECORD_TYPE
00485 || TREE_CODE (node) == UNION_TYPE
00486 || TREE_CODE (node) == QUAL_UNION_TYPE)
00487 && TYPE_NO_FORCE_BLK (node))
00488 fputs (" no-force-blk", file);
00489 else if (TREE_CODE (node) == INTEGER_TYPE
00490 && TYPE_IS_SIZETYPE (node))
00491 fputs (" sizetype", file);
00492 else if (TREE_CODE (node) == FUNCTION_TYPE
00493 && TYPE_RETURNS_STACK_DEPRESSED (node))
00494 fputs (" returns-stack-depressed", file);
00495
00496 if (TYPE_STRING_FLAG (node))
00497 fputs (" string-flag", file);
00498 if (TYPE_NEEDS_CONSTRUCTING (node))
00499 fputs (" needs-constructing", file);
00500
00501
00502
00503 if (TREE_CODE (node) == UNION_TYPE && TYPE_TRANSPARENT_UNION (node))
00504 fputs (" transparent-union", file);
00505 else if (TREE_CODE (node) == ARRAY_TYPE
00506 && TYPE_NONALIASED_COMPONENT (node))
00507 fputs (" nonaliased-component", file);
00508
00509 if (TYPE_PACKED (node))
00510 fputs (" packed", file);
00511
00512 if (TYPE_RESTRICT (node))
00513 fputs (" restrict", file);
00514
00515 if (TYPE_LANG_FLAG_0 (node))
00516 fputs (" type_0", file);
00517 if (TYPE_LANG_FLAG_1 (node))
00518 fputs (" type_1", file);
00519 if (TYPE_LANG_FLAG_2 (node))
00520 fputs (" type_2", file);
00521 if (TYPE_LANG_FLAG_3 (node))
00522 fputs (" type_3", file);
00523 if (TYPE_LANG_FLAG_4 (node))
00524 fputs (" type_4", file);
00525 if (TYPE_LANG_FLAG_5 (node))
00526 fputs (" type_5", file);
00527 if (TYPE_LANG_FLAG_6 (node))
00528 fputs (" type_6", file);
00529
00530 mode = TYPE_MODE (node);
00531 fprintf (file, " %s", GET_MODE_NAME (mode));
00532
00533 print_node (file, "size", TYPE_SIZE (node), indent + 4);
00534 print_node (file, "unit size", TYPE_SIZE_UNIT (node), indent + 4);
00535 indent_to (file, indent + 3);
00536
00537 if (TYPE_USER_ALIGN (node))
00538 fprintf (file, " user");
00539
00540 fprintf (file, " align %d symtab %d alias set " HOST_WIDE_INT_PRINT_DEC,
00541 TYPE_ALIGN (node), TYPE_SYMTAB_ADDRESS (node),
00542 TYPE_ALIAS_SET (node));
00543
00544 print_node (file, "attributes", TYPE_ATTRIBUTES (node), indent + 4);
00545
00546 if (INTEGRAL_TYPE_P (node) || TREE_CODE (node) == REAL_TYPE)
00547 {
00548 fprintf (file, " precision %d", TYPE_PRECISION (node));
00549 print_node_brief (file, "min", TYPE_MIN_VALUE (node), indent + 4);
00550 print_node_brief (file, "max", TYPE_MAX_VALUE (node), indent + 4);
00551 }
00552
00553 if (TREE_CODE (node) == ENUMERAL_TYPE)
00554 print_node (file, "values", TYPE_VALUES (node), indent + 4);
00555 else if (TREE_CODE (node) == ARRAY_TYPE)
00556 print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
00557 else if (TREE_CODE (node) == VECTOR_TYPE)
00558 fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node));
00559 else if (TREE_CODE (node) == RECORD_TYPE
00560 || TREE_CODE (node) == UNION_TYPE
00561 || TREE_CODE (node) == QUAL_UNION_TYPE)
00562 print_node (file, "fields", TYPE_FIELDS (node), indent + 4);
00563 else if (TREE_CODE (node) == FUNCTION_TYPE
00564 || TREE_CODE (node) == METHOD_TYPE)
00565 {
00566 if (TYPE_METHOD_BASETYPE (node))
00567 print_node_brief (file, "method basetype",
00568 TYPE_METHOD_BASETYPE (node), indent + 4);
00569 print_node (file, "arg-types", TYPE_ARG_TYPES (node), indent + 4);
00570 }
00571 else if (TREE_CODE (node) == OFFSET_TYPE)
00572 print_node_brief (file, "basetype", TYPE_OFFSET_BASETYPE (node),
00573 indent + 4);
00574
00575 if (TYPE_CONTEXT (node))
00576 print_node_brief (file, "context", TYPE_CONTEXT (node), indent + 4);
00577
00578 lang_hooks.print_type (file, node, indent);
00579
00580 if (TYPE_POINTER_TO (node) || TREE_CHAIN (node))
00581 indent_to (file, indent + 3);
00582
00583 print_node_brief (file, "pointer_to_this", TYPE_POINTER_TO (node),
00584 indent + 4);
00585 print_node_brief (file, "reference_to_this", TYPE_REFERENCE_TO (node),
00586 indent + 4);
00587 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
00588 break;
00589
00590 case tcc_expression:
00591 case tcc_comparison:
00592 case tcc_unary:
00593 case tcc_binary:
00594 case tcc_reference:
00595 case tcc_statement:
00596 if (TREE_CODE (node) == BIT_FIELD_REF && BIT_FIELD_REF_UNSIGNED (node))
00597 fputs (" unsigned", file);
00598 if (TREE_CODE (node) == BIND_EXPR)
00599 {
00600 print_node (file, "vars", TREE_OPERAND (node, 0), indent + 4);
00601 print_node (file, "body", TREE_OPERAND (node, 1), indent + 4);
00602 print_node (file, "block", TREE_OPERAND (node, 2), indent + 4);
00603 break;
00604 }
00605
00606 len = TREE_CODE_LENGTH (TREE_CODE (node));
00607
00608 for (i = 0; i < len; i++)
00609 {
00610 char temp[10];
00611
00612 sprintf (temp, "arg %d", i);
00613 print_node (file, temp, TREE_OPERAND (node, i), indent + 4);
00614 }
00615
00616 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
00617 break;
00618
00619 case tcc_constant:
00620 case tcc_exceptional:
00621 switch (TREE_CODE (node))
00622 {
00623 case INTEGER_CST:
00624 if (TREE_CONSTANT_OVERFLOW (node))
00625 fprintf (file, " overflow");
00626
00627 fprintf (file, " ");
00628 if (TREE_INT_CST_HIGH (node) == 0)
00629 fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED,
00630 TREE_INT_CST_LOW (node));
00631 else if (TREE_INT_CST_HIGH (node) == -1
00632 && TREE_INT_CST_LOW (node) != 0)
00633 fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
00634 -TREE_INT_CST_LOW (node));
00635 else
00636 fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
00637 TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node));
00638 break;
00639
00640 case REAL_CST:
00641 {
00642 REAL_VALUE_TYPE d;
00643
00644 if (TREE_OVERFLOW (node))
00645 fprintf (file, " overflow");
00646
00647 d = TREE_REAL_CST (node);
00648 if (REAL_VALUE_ISINF (d))
00649 fprintf (file, " Inf");
00650 else if (REAL_VALUE_ISNAN (d))
00651 fprintf (file, " Nan");
00652 else
00653 {
00654 char string[64];
00655 real_to_decimal (string, &d, sizeof (string), 0, 1);
00656 fprintf (file, " %s", string);
00657 }
00658 }
00659 break;
00660
00661 case VECTOR_CST:
00662 {
00663 tree vals = TREE_VECTOR_CST_ELTS (node);
00664 char buf[10];
00665 tree link;
00666 int i;
00667
00668 i = 0;
00669 for (link = vals; link; link = TREE_CHAIN (link), ++i)
00670 {
00671 sprintf (buf, "elt%d: ", i);
00672 print_node (file, buf, TREE_VALUE (link), indent + 4);
00673 }
00674 }
00675 break;
00676
00677 case COMPLEX_CST:
00678 print_node (file, "real", TREE_REALPART (node), indent + 4);
00679 print_node (file, "imag", TREE_IMAGPART (node), indent + 4);
00680 break;
00681
00682 case STRING_CST:
00683 {
00684 const char *p = TREE_STRING_POINTER (node);
00685 int i = TREE_STRING_LENGTH (node);
00686 fputs (" \"", file);
00687 while (--i >= 0)
00688 {
00689 char ch = *p++;
00690 if (ch >= ' ' && ch < 127)
00691 putc (ch, file);
00692 else
00693 fprintf(file, "\\%03o", ch & 0xFF);
00694 }
00695 fputc ('\"', file);
00696 }
00697
00698 if (indent == 4)
00699 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
00700 else
00701 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
00702 break;
00703
00704 case IDENTIFIER_NODE:
00705 lang_hooks.print_identifier (file, node, indent);
00706 break;
00707
00708 case TREE_LIST:
00709 print_node (file, "purpose", TREE_PURPOSE (node), indent + 4);
00710 print_node (file, "value", TREE_VALUE (node), indent + 4);
00711 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
00712 break;
00713
00714 case TREE_VEC:
00715 len = TREE_VEC_LENGTH (node);
00716 for (i = 0; i < len; i++)
00717 if (TREE_VEC_ELT (node, i))
00718 {
00719 char temp[10];
00720 sprintf (temp, "elt %d", i);
00721 indent_to (file, indent + 4);
00722 print_node_brief (file, temp, TREE_VEC_ELT (node, i), 0);
00723 }
00724 break;
00725
00726 case BLOCK:
00727 print_node (file, "vars", BLOCK_VARS (node), indent + 4);
00728 print_node (file, "supercontext", BLOCK_SUPERCONTEXT (node),
00729 indent + 4);
00730 print_node (file, "subblocks", BLOCK_SUBBLOCKS (node), indent + 4);
00731 print_node (file, "chain", BLOCK_CHAIN (node), indent + 4);
00732 print_node (file, "abstract_origin",
00733 BLOCK_ABSTRACT_ORIGIN (node), indent + 4);
00734 break;
00735
00736 case SSA_NAME:
00737 print_node_brief (file, "var", SSA_NAME_VAR (node), indent + 4);
00738 print_node_brief (file, "def_stmt",
00739 SSA_NAME_DEF_STMT (node), indent + 4);
00740
00741 indent_to (file, indent + 4);
00742 fprintf (file, "version %u", SSA_NAME_VERSION (node));
00743 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node))
00744 fprintf (file, " in-abnormal-phi");
00745 if (SSA_NAME_IN_FREE_LIST (node))
00746 fprintf (file, " in-free-list");
00747
00748 if (SSA_NAME_PTR_INFO (node)
00749 || SSA_NAME_VALUE (node)
00750 || SSA_NAME_AUX (node))
00751 {
00752 indent_to (file, indent + 3);
00753 if (SSA_NAME_PTR_INFO (node))
00754 fprintf (file, " ptr-info %p",
00755 (void *) SSA_NAME_PTR_INFO (node));
00756 if (SSA_NAME_VALUE (node))
00757 fprintf (file, " value %p",
00758 (void *) SSA_NAME_VALUE (node));
00759 if (SSA_NAME_AUX (node))
00760 fprintf (file, " aux %p", SSA_NAME_AUX (node));
00761 }
00762 break;
00763
00764 default:
00765 if (EXCEPTIONAL_CLASS_P (node))
00766 lang_hooks.print_xnode (file, node, indent);
00767 break;
00768 }
00769
00770 break;
00771 }
00772
00773 if (EXPR_HAS_LOCATION (node))
00774 {
00775 expanded_location xloc = expand_location (EXPR_LOCATION (node));
00776 indent_to (file, indent+4);
00777 fprintf (file, "%s:%d", xloc.file, xloc.line);
00778 }
00779
00780 fprintf (file, ">");
00781 }