Mercurial > hg > CbC > CbC_gcc
comparison gcc/print-tree.c @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
48 | 48 |
49 /* Print the node NODE on standard error, for debugging. | 49 /* Print the node NODE on standard error, for debugging. |
50 Most nodes referred to by this one are printed recursively | 50 Most nodes referred to by this one are printed recursively |
51 down to a depth of six. */ | 51 down to a depth of six. */ |
52 | 52 |
53 void | 53 DEBUG_FUNCTION void |
54 debug_tree (tree node) | 54 debug_tree (tree node) |
55 { | 55 { |
56 table = XCNEWVEC (struct bucket *, HASH_SIZE); | 56 table = XCNEWVEC (struct bucket *, HASH_SIZE); |
57 print_node (stderr, "", node, 0); | 57 print_node (stderr, "", node, 0); |
58 free (table); | |
59 table = 0; | |
60 putc ('\n', stderr); | |
61 } | |
62 | |
63 /* Print the vector of trees VEC on standard error, for debugging. | |
64 Most nodes referred to by this one are printed recursively | |
65 down to a depth of six. */ | |
66 | |
67 DEBUG_FUNCTION void | |
68 debug_vec_tree (VEC(tree,gc) *vec) | |
69 { | |
70 table = XCNEWVEC (struct bucket *, HASH_SIZE); | |
71 print_vec_tree (stderr, "", vec, 0); | |
58 free (table); | 72 free (table); |
59 table = 0; | 73 table = 0; |
60 putc ('\n', stderr); | 74 putc ('\n', stderr); |
61 } | 75 } |
62 | 76 |
423 if (code == LABEL_DECL && EH_LANDING_PAD_NR (node)) | 437 if (code == LABEL_DECL && EH_LANDING_PAD_NR (node)) |
424 fprintf (file, " landing-pad:%d", EH_LANDING_PAD_NR (node)); | 438 fprintf (file, " landing-pad:%d", EH_LANDING_PAD_NR (node)); |
425 | 439 |
426 if (code == VAR_DECL && DECL_IN_TEXT_SECTION (node)) | 440 if (code == VAR_DECL && DECL_IN_TEXT_SECTION (node)) |
427 fputs (" in-text-section", file); | 441 fputs (" in-text-section", file); |
442 if (code == VAR_DECL && DECL_IN_CONSTANT_POOL (node)) | |
443 fputs (" in-constant-pool", file); | |
428 if (code == VAR_DECL && DECL_COMMON (node)) | 444 if (code == VAR_DECL && DECL_COMMON (node)) |
429 fputs (" common", file); | 445 fputs (" common", file); |
430 if (code == VAR_DECL && DECL_THREAD_LOCAL_P (node)) | 446 if (code == VAR_DECL && DECL_THREAD_LOCAL_P (node)) |
431 { | 447 { |
432 enum tls_model kind = DECL_TLS_MODEL (node); | 448 enum tls_model kind = DECL_TLS_MODEL (node); |
858 for (i = 0; i < len; i++) | 874 for (i = 0; i < len; i++) |
859 if (TREE_VEC_ELT (node, i)) | 875 if (TREE_VEC_ELT (node, i)) |
860 { | 876 { |
861 char temp[10]; | 877 char temp[10]; |
862 sprintf (temp, "elt %d", i); | 878 sprintf (temp, "elt %d", i); |
863 indent_to (file, indent + 4); | 879 print_node (file, temp, TREE_VEC_ELT (node, i), indent + 4); |
864 print_node_brief (file, temp, TREE_VEC_ELT (node, i), 0); | |
865 } | 880 } |
866 break; | 881 break; |
867 | 882 |
868 case CONSTRUCTOR: | 883 case CONSTRUCTOR: |
869 { | 884 { |
977 fprintf (file, "%s:%d:%d", xloc.file, xloc.line, xloc.column); | 992 fprintf (file, "%s:%d:%d", xloc.file, xloc.line, xloc.column); |
978 } | 993 } |
979 | 994 |
980 fprintf (file, ">"); | 995 fprintf (file, ">"); |
981 } | 996 } |
997 | |
998 /* Print the tree vector VEC in full on file FILE, preceded by PREFIX, | |
999 starting in column INDENT. */ | |
1000 | |
1001 void | |
1002 print_vec_tree (FILE *file, const char *prefix, VEC(tree,gc) *vec, int indent) | |
1003 { | |
1004 tree elt; | |
1005 unsigned ix; | |
1006 | |
1007 /* Indent to the specified column, since this is the long form. */ | |
1008 indent_to (file, indent); | |
1009 | |
1010 /* Print the slot this node is in, and its code, and address. */ | |
1011 fprintf (file, "%s <VEC", prefix); | |
1012 dump_addr (file, " ", vec); | |
1013 | |
1014 FOR_EACH_VEC_ELT (tree, vec, ix, elt) | |
1015 { | |
1016 char temp[10]; | |
1017 sprintf (temp, "elt %d", ix); | |
1018 print_node (file, temp, elt, indent + 4); | |
1019 } | |
1020 } |