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