1 /* Pretty formatting of GENERIC trees in C syntax.
2 Copyright (C) 2001-2013 Free Software Foundation, Inc.
3 Adapted from c-pretty-print.c by Diego Novillo <dnovillo@redhat.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
26 #include "tree-pretty-print.h"
29 #include "langhooks.h"
30 #include "tree-iterator.h"
31 #include "tree-chrec.h"
33 #include "value-prof.h"
36 #include <new> // For placement-new.
38 /* Local functions, macros and variables. */
39 static const char *op_symbol (const_tree
);
40 static void pretty_print_string (pretty_printer
*, const char*);
41 static void newline_and_indent (pretty_printer
*, int);
42 static void maybe_init_pretty_print (FILE *);
43 static void print_struct_decl (pretty_printer
*, const_tree
, int, int);
44 static void do_niy (pretty_printer
*, const_tree
);
46 #define INDENT(SPACE) do { \
47 int i; for (i = 0; i<SPACE; i++) pp_space (buffer); } while (0)
49 #define NIY do_niy(buffer,node)
51 static pretty_printer buffer
;
52 static int initialized
= 0;
54 /* Try to print something for an unknown tree code. */
57 do_niy (pretty_printer
*buffer
, const_tree node
)
61 pp_string (buffer
, "<<< Unknown tree: ");
62 pp_string (buffer
, tree_code_name
[(int) TREE_CODE (node
)]);
66 len
= TREE_OPERAND_LENGTH (node
);
67 for (i
= 0; i
< len
; ++i
)
69 newline_and_indent (buffer
, 2);
70 dump_generic_node (buffer
, TREE_OPERAND (node
, i
), 2, 0, false);
74 pp_string (buffer
, " >>>");
77 /* Debugging function to print out a generic expression. */
80 debug_generic_expr (tree t
)
82 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
83 fprintf (stderr
, "\n");
86 /* Debugging function to print out a generic statement. */
89 debug_generic_stmt (tree t
)
91 print_generic_stmt (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
92 fprintf (stderr
, "\n");
95 /* Debugging function to print out a chain of trees . */
98 debug_tree_chain (tree t
)
100 struct pointer_set_t
*seen
= pointer_set_create ();
104 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
105 fprintf (stderr
, " ");
107 if (pointer_set_insert (seen
, t
))
109 fprintf (stderr
, "... [cycled back to ");
110 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
111 fprintf (stderr
, "]");
115 fprintf (stderr
, "\n");
117 pointer_set_destroy (seen
);
120 /* Prints declaration DECL to the FILE with details specified by FLAGS. */
122 print_generic_decl (FILE *file
, tree decl
, int flags
)
124 maybe_init_pretty_print (file
);
125 print_declaration (&buffer
, decl
, 2, flags
);
126 pp_write_text_to_stream (&buffer
);
129 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
130 to show in the dump. See TDF_* in dumpfile.h. */
133 print_generic_stmt (FILE *file
, tree t
, int flags
)
135 maybe_init_pretty_print (file
);
136 dump_generic_node (&buffer
, t
, 0, flags
, true);
137 pp_newline_and_flush (&buffer
);
140 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
141 to show in the dump. See TDF_* in dumpfile.h. The output is indented by
145 print_generic_stmt_indented (FILE *file
, tree t
, int flags
, int indent
)
149 maybe_init_pretty_print (file
);
151 for (i
= 0; i
< indent
; i
++)
153 dump_generic_node (&buffer
, t
, indent
, flags
, true);
154 pp_newline_and_flush (&buffer
);
157 /* Print a single expression T on file FILE. FLAGS specifies details to show
158 in the dump. See TDF_* in dumpfile.h. */
161 print_generic_expr (FILE *file
, tree t
, int flags
)
163 maybe_init_pretty_print (file
);
164 dump_generic_node (&buffer
, t
, 0, flags
, false);
168 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
172 dump_decl_name (pretty_printer
*buffer
, tree node
, int flags
)
174 if (DECL_NAME (node
))
176 if ((flags
& TDF_ASMNAME
) && DECL_ASSEMBLER_NAME_SET_P (node
))
177 pp_tree_identifier (buffer
, DECL_ASSEMBLER_NAME (node
));
179 pp_tree_identifier (buffer
, DECL_NAME (node
));
181 if ((flags
& TDF_UID
) || DECL_NAME (node
) == NULL_TREE
)
183 if (TREE_CODE (node
) == LABEL_DECL
&& LABEL_DECL_UID (node
) != -1)
184 pp_printf (buffer
, "L.%d", (int) LABEL_DECL_UID (node
));
185 else if (TREE_CODE (node
) == DEBUG_EXPR_DECL
)
187 if (flags
& TDF_NOUID
)
188 pp_string (buffer
, "D#xxxx");
190 pp_printf (buffer
, "D#%i", DEBUG_TEMP_UID (node
));
194 char c
= TREE_CODE (node
) == CONST_DECL
? 'C' : 'D';
195 if (flags
& TDF_NOUID
)
196 pp_printf (buffer
, "%c.xxxx", c
);
198 pp_printf (buffer
, "%c.%u", c
, DECL_UID (node
));
201 if ((flags
& TDF_ALIAS
) && DECL_PT_UID (node
) != DECL_UID (node
))
203 if (flags
& TDF_NOUID
)
204 pp_printf (buffer
, "ptD.xxxx");
206 pp_printf (buffer
, "ptD.%u", DECL_PT_UID (node
));
210 /* Like the above, but used for pretty printing function calls. */
213 dump_function_name (pretty_printer
*buffer
, tree node
, int flags
)
215 if (TREE_CODE (node
) == NOP_EXPR
)
216 node
= TREE_OPERAND (node
, 0);
217 if (DECL_NAME (node
) && (flags
& TDF_ASMNAME
) == 0)
218 pp_string (buffer
, lang_hooks
.decl_printable_name (node
, 1));
220 dump_decl_name (buffer
, node
, flags
);
223 /* Dump a function declaration. NODE is the FUNCTION_TYPE. BUFFER, SPC and
224 FLAGS are as in dump_generic_node. */
227 dump_function_declaration (pretty_printer
*buffer
, tree node
,
230 bool wrote_arg
= false;
234 pp_left_paren (buffer
);
236 /* Print the argument types. */
237 arg
= TYPE_ARG_TYPES (node
);
238 while (arg
&& arg
!= void_list_node
&& arg
!= error_mark_node
)
246 dump_generic_node (buffer
, TREE_VALUE (arg
), spc
, flags
, false);
247 arg
= TREE_CHAIN (arg
);
250 /* Drop the trailing void_type_node if we had any previous argument. */
251 if (arg
== void_list_node
&& !wrote_arg
)
252 pp_string (buffer
, "void");
253 /* Properly dump vararg function types. */
254 else if (!arg
&& wrote_arg
)
255 pp_string (buffer
, ", ...");
256 /* Avoid printing any arg for unprototyped functions. */
258 pp_right_paren (buffer
);
261 /* Dump the domain associated with an array. */
264 dump_array_domain (pretty_printer
*buffer
, tree domain
, int spc
, int flags
)
266 pp_left_bracket (buffer
);
269 tree min
= TYPE_MIN_VALUE (domain
);
270 tree max
= TYPE_MAX_VALUE (domain
);
273 && integer_zerop (min
)
274 && host_integerp (max
, 0))
275 pp_wide_integer (buffer
, TREE_INT_CST_LOW (max
) + 1);
279 dump_generic_node (buffer
, min
, spc
, flags
, false);
282 dump_generic_node (buffer
, max
, spc
, flags
, false);
286 pp_string (buffer
, "<unknown>");
287 pp_right_bracket (buffer
);
291 /* Dump OpenMP clause CLAUSE. BUFFER, CLAUSE, SPC and FLAGS are as in
292 dump_generic_node. */
295 dump_omp_clause (pretty_printer
*buffer
, tree clause
, int spc
, int flags
)
299 switch (OMP_CLAUSE_CODE (clause
))
301 case OMP_CLAUSE_PRIVATE
:
304 case OMP_CLAUSE_SHARED
:
307 case OMP_CLAUSE_FIRSTPRIVATE
:
308 name
= "firstprivate";
310 case OMP_CLAUSE_LASTPRIVATE
:
311 name
= "lastprivate";
313 case OMP_CLAUSE_COPYIN
:
316 case OMP_CLAUSE_COPYPRIVATE
:
317 name
= "copyprivate";
319 case OMP_CLAUSE_UNIFORM
:
323 pp_string (buffer
, name
);
324 pp_left_paren (buffer
);
325 dump_generic_node (buffer
, OMP_CLAUSE_DECL (clause
),
327 pp_right_paren (buffer
);
330 case OMP_CLAUSE_REDUCTION
:
331 pp_string (buffer
, "reduction(");
332 pp_string (buffer
, op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause
)));
334 dump_generic_node (buffer
, OMP_CLAUSE_DECL (clause
),
336 pp_right_paren (buffer
);
340 pp_string (buffer
, "if(");
341 dump_generic_node (buffer
, OMP_CLAUSE_IF_EXPR (clause
),
343 pp_right_paren (buffer
);
346 case OMP_CLAUSE_NUM_THREADS
:
347 pp_string (buffer
, "num_threads(");
348 dump_generic_node (buffer
, OMP_CLAUSE_NUM_THREADS_EXPR (clause
),
350 pp_right_paren (buffer
);
353 case OMP_CLAUSE_NOWAIT
:
354 pp_string (buffer
, "nowait");
356 case OMP_CLAUSE_ORDERED
:
357 pp_string (buffer
, "ordered");
360 case OMP_CLAUSE_DEFAULT
:
361 pp_string (buffer
, "default(");
362 switch (OMP_CLAUSE_DEFAULT_KIND (clause
))
364 case OMP_CLAUSE_DEFAULT_UNSPECIFIED
:
366 case OMP_CLAUSE_DEFAULT_SHARED
:
367 pp_string (buffer
, "shared");
369 case OMP_CLAUSE_DEFAULT_NONE
:
370 pp_string (buffer
, "none");
372 case OMP_CLAUSE_DEFAULT_PRIVATE
:
373 pp_string (buffer
, "private");
375 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
:
376 pp_string (buffer
, "firstprivate");
381 pp_right_paren (buffer
);
384 case OMP_CLAUSE_SCHEDULE
:
385 pp_string (buffer
, "schedule(");
386 switch (OMP_CLAUSE_SCHEDULE_KIND (clause
))
388 case OMP_CLAUSE_SCHEDULE_STATIC
:
389 pp_string (buffer
, "static");
391 case OMP_CLAUSE_SCHEDULE_DYNAMIC
:
392 pp_string (buffer
, "dynamic");
394 case OMP_CLAUSE_SCHEDULE_GUIDED
:
395 pp_string (buffer
, "guided");
397 case OMP_CLAUSE_SCHEDULE_RUNTIME
:
398 pp_string (buffer
, "runtime");
400 case OMP_CLAUSE_SCHEDULE_AUTO
:
401 pp_string (buffer
, "auto");
406 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
))
409 dump_generic_node (buffer
,
410 OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
),
413 pp_right_paren (buffer
);
416 case OMP_CLAUSE_UNTIED
:
417 pp_string (buffer
, "untied");
420 case OMP_CLAUSE_COLLAPSE
:
421 pp_string (buffer
, "collapse(");
422 dump_generic_node (buffer
,
423 OMP_CLAUSE_COLLAPSE_EXPR (clause
),
425 pp_right_paren (buffer
);
428 case OMP_CLAUSE_FINAL
:
429 pp_string (buffer
, "final(");
430 dump_generic_node (buffer
, OMP_CLAUSE_FINAL_EXPR (clause
),
432 pp_right_paren (buffer
);
435 case OMP_CLAUSE_MERGEABLE
:
436 pp_string (buffer
, "mergeable");
439 case OMP_CLAUSE_LINEAR
:
440 pp_string (buffer
, "linear(");
441 dump_generic_node (buffer
, OMP_CLAUSE_DECL (clause
),
443 pp_character (buffer
, ':');
444 dump_generic_node (buffer
, OMP_CLAUSE_LINEAR_STEP (clause
),
446 pp_character (buffer
, ')');
449 case OMP_CLAUSE_SAFELEN
:
450 pp_string (buffer
, "safelen(");
451 dump_generic_node (buffer
, OMP_CLAUSE_SAFELEN_EXPR (clause
),
453 pp_character (buffer
, ')');
456 case OMP_CLAUSE__SIMDUID_
:
457 pp_string (buffer
, "_simduid_(");
458 dump_generic_node (buffer
, OMP_CLAUSE__SIMDUID__DECL (clause
),
460 pp_character (buffer
, ')');
464 /* Should never happen. */
465 dump_generic_node (buffer
, clause
, spc
, flags
, false);
471 /* Dump the list of OpenMP clauses. BUFFER, SPC and FLAGS are as in
472 dump_generic_node. */
475 dump_omp_clauses (pretty_printer
*buffer
, tree clause
, int spc
, int flags
)
483 dump_omp_clause (buffer
, clause
, spc
, flags
);
484 clause
= OMP_CLAUSE_CHAIN (clause
);
492 /* Dump location LOC to BUFFER. */
495 dump_location (pretty_printer
*buffer
, location_t loc
)
497 expanded_location xloc
= expand_location (loc
);
499 pp_left_bracket (buffer
);
502 pp_string (buffer
, xloc
.file
);
503 pp_string (buffer
, " : ");
505 pp_decimal_int (buffer
, xloc
.line
);
506 pp_string (buffer
, "] ");
510 /* Dump lexical block BLOCK. BUFFER, SPC and FLAGS are as in
511 dump_generic_node. */
514 dump_block_node (pretty_printer
*buffer
, tree block
, int spc
, int flags
)
518 pp_printf (buffer
, "BLOCK #%d ", BLOCK_NUMBER (block
));
520 if (flags
& TDF_ADDRESS
)
521 pp_printf (buffer
, "[%p] ", (void *) block
);
523 if (BLOCK_ABSTRACT (block
))
524 pp_string (buffer
, "[abstract] ");
526 if (TREE_ASM_WRITTEN (block
))
527 pp_string (buffer
, "[written] ");
529 if (flags
& TDF_SLIM
)
532 if (BLOCK_SOURCE_LOCATION (block
))
533 dump_location (buffer
, BLOCK_SOURCE_LOCATION (block
));
535 newline_and_indent (buffer
, spc
+ 2);
537 if (BLOCK_SUPERCONTEXT (block
))
539 pp_string (buffer
, "SUPERCONTEXT: ");
540 dump_generic_node (buffer
, BLOCK_SUPERCONTEXT (block
), 0,
541 flags
| TDF_SLIM
, false);
542 newline_and_indent (buffer
, spc
+ 2);
545 if (BLOCK_SUBBLOCKS (block
))
547 pp_string (buffer
, "SUBBLOCKS: ");
548 for (t
= BLOCK_SUBBLOCKS (block
); t
; t
= BLOCK_CHAIN (t
))
550 dump_generic_node (buffer
, t
, 0, flags
| TDF_SLIM
, false);
553 newline_and_indent (buffer
, spc
+ 2);
556 if (BLOCK_CHAIN (block
))
558 pp_string (buffer
, "SIBLINGS: ");
559 for (t
= BLOCK_CHAIN (block
); t
; t
= BLOCK_CHAIN (t
))
561 dump_generic_node (buffer
, t
, 0, flags
| TDF_SLIM
, false);
564 newline_and_indent (buffer
, spc
+ 2);
567 if (BLOCK_VARS (block
))
569 pp_string (buffer
, "VARS: ");
570 for (t
= BLOCK_VARS (block
); t
; t
= TREE_CHAIN (t
))
572 dump_generic_node (buffer
, t
, 0, flags
, false);
575 newline_and_indent (buffer
, spc
+ 2);
578 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block
)) > 0)
581 vec
<tree
, va_gc
> *nlv
= BLOCK_NONLOCALIZED_VARS (block
);
583 pp_string (buffer
, "NONLOCALIZED_VARS: ");
584 FOR_EACH_VEC_ELT (*nlv
, i
, t
)
586 dump_generic_node (buffer
, t
, 0, flags
, false);
589 newline_and_indent (buffer
, spc
+ 2);
592 if (BLOCK_ABSTRACT_ORIGIN (block
))
594 pp_string (buffer
, "ABSTRACT_ORIGIN: ");
595 dump_generic_node (buffer
, BLOCK_ABSTRACT_ORIGIN (block
), 0,
596 flags
| TDF_SLIM
, false);
597 newline_and_indent (buffer
, spc
+ 2);
600 if (BLOCK_FRAGMENT_ORIGIN (block
))
602 pp_string (buffer
, "FRAGMENT_ORIGIN: ");
603 dump_generic_node (buffer
, BLOCK_FRAGMENT_ORIGIN (block
), 0,
604 flags
| TDF_SLIM
, false);
605 newline_and_indent (buffer
, spc
+ 2);
608 if (BLOCK_FRAGMENT_CHAIN (block
))
610 pp_string (buffer
, "FRAGMENT_CHAIN: ");
611 for (t
= BLOCK_FRAGMENT_CHAIN (block
); t
; t
= BLOCK_FRAGMENT_CHAIN (t
))
613 dump_generic_node (buffer
, t
, 0, flags
| TDF_SLIM
, false);
616 newline_and_indent (buffer
, spc
+ 2);
621 /* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of
622 indent. FLAGS specifies details to show in the dump (see TDF_* in
623 dumpfile.h). If IS_STMT is true, the object printed is considered
624 to be a statement and it is terminated by ';' if appropriate. */
627 dump_generic_node (pretty_printer
*buffer
, tree node
, int spc
, int flags
,
636 if (node
== NULL_TREE
)
639 is_expr
= EXPR_P (node
);
641 if (is_stmt
&& (flags
& TDF_STMTADDR
))
642 pp_printf (buffer
, "<&%p> ", (void *)node
);
644 if ((flags
& TDF_LINENO
) && EXPR_HAS_LOCATION (node
))
645 dump_location (buffer
, EXPR_LOCATION (node
));
647 code
= TREE_CODE (node
);
651 pp_string (buffer
, "<<< error >>>");
654 case IDENTIFIER_NODE
:
655 pp_tree_identifier (buffer
, node
);
659 while (node
&& node
!= error_mark_node
)
661 if (TREE_PURPOSE (node
))
663 dump_generic_node (buffer
, TREE_PURPOSE (node
), spc
, flags
, false);
666 dump_generic_node (buffer
, TREE_VALUE (node
), spc
, flags
, false);
667 node
= TREE_CHAIN (node
);
668 if (node
&& TREE_CODE (node
) == TREE_LIST
)
677 dump_generic_node (buffer
, BINFO_TYPE (node
), spc
, flags
, false);
683 if (TREE_VEC_LENGTH (node
) > 0)
685 size_t len
= TREE_VEC_LENGTH (node
);
686 for (i
= 0; i
< len
- 1; i
++)
688 dump_generic_node (buffer
, TREE_VEC_ELT (node
, i
), spc
, flags
,
693 dump_generic_node (buffer
, TREE_VEC_ELT (node
, len
- 1), spc
,
702 case FIXED_POINT_TYPE
:
708 unsigned int quals
= TYPE_QUALS (node
);
709 enum tree_code_class tclass
;
711 if (quals
& TYPE_QUAL_CONST
)
712 pp_string (buffer
, "const ");
713 else if (quals
& TYPE_QUAL_VOLATILE
)
714 pp_string (buffer
, "volatile ");
715 else if (quals
& TYPE_QUAL_RESTRICT
)
716 pp_string (buffer
, "restrict ");
718 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
720 pp_string (buffer
, "<address-space-");
721 pp_decimal_int (buffer
, TYPE_ADDR_SPACE (node
));
722 pp_string (buffer
, "> ");
725 tclass
= TREE_CODE_CLASS (TREE_CODE (node
));
727 if (tclass
== tcc_declaration
)
729 if (DECL_NAME (node
))
730 dump_decl_name (buffer
, node
, flags
);
732 pp_string (buffer
, "<unnamed type decl>");
734 else if (tclass
== tcc_type
)
736 if (TYPE_NAME (node
))
738 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
739 pp_tree_identifier (buffer
, TYPE_NAME (node
));
740 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
741 && DECL_NAME (TYPE_NAME (node
)))
742 dump_decl_name (buffer
, TYPE_NAME (node
), flags
);
744 pp_string (buffer
, "<unnamed type>");
746 else if (TREE_CODE (node
) == VECTOR_TYPE
)
748 pp_string (buffer
, "vector");
749 pp_left_paren (buffer
);
750 pp_wide_integer (buffer
, TYPE_VECTOR_SUBPARTS (node
));
751 pp_string (buffer
, ") ");
752 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
754 else if (TREE_CODE (node
) == INTEGER_TYPE
)
756 if (TYPE_PRECISION (node
) == CHAR_TYPE_SIZE
)
757 pp_string (buffer
, (TYPE_UNSIGNED (node
)
760 else if (TYPE_PRECISION (node
) == SHORT_TYPE_SIZE
)
761 pp_string (buffer
, (TYPE_UNSIGNED (node
)
764 else if (TYPE_PRECISION (node
) == INT_TYPE_SIZE
)
765 pp_string (buffer
, (TYPE_UNSIGNED (node
)
768 else if (TYPE_PRECISION (node
) == LONG_TYPE_SIZE
)
769 pp_string (buffer
, (TYPE_UNSIGNED (node
)
772 else if (TYPE_PRECISION (node
) == LONG_LONG_TYPE_SIZE
)
773 pp_string (buffer
, (TYPE_UNSIGNED (node
)
774 ? "unsigned long long"
775 : "signed long long"));
776 else if (TYPE_PRECISION (node
) >= CHAR_TYPE_SIZE
777 && exact_log2 (TYPE_PRECISION (node
)) != -1)
779 pp_string (buffer
, (TYPE_UNSIGNED (node
) ? "uint" : "int"));
780 pp_decimal_int (buffer
, TYPE_PRECISION (node
));
781 pp_string (buffer
, "_t");
785 pp_string (buffer
, (TYPE_UNSIGNED (node
)
786 ? "<unnamed-unsigned:"
787 : "<unnamed-signed:"));
788 pp_decimal_int (buffer
, TYPE_PRECISION (node
));
792 else if (TREE_CODE (node
) == COMPLEX_TYPE
)
794 pp_string (buffer
, "__complex__ ");
795 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
797 else if (TREE_CODE (node
) == REAL_TYPE
)
799 pp_string (buffer
, "<float:");
800 pp_decimal_int (buffer
, TYPE_PRECISION (node
));
803 else if (TREE_CODE (node
) == FIXED_POINT_TYPE
)
805 pp_string (buffer
, "<fixed-point-");
806 pp_string (buffer
, TYPE_SATURATING (node
) ? "sat:" : "nonsat:");
807 pp_decimal_int (buffer
, TYPE_PRECISION (node
));
810 else if (TREE_CODE (node
) == VOID_TYPE
)
811 pp_string (buffer
, "void");
813 pp_string (buffer
, "<unnamed type>");
820 str
= (TREE_CODE (node
) == POINTER_TYPE
? "*" : "&");
822 if (TREE_TYPE (node
) == NULL
)
824 pp_string (buffer
, str
);
825 pp_string (buffer
, "<null type>");
827 else if (TREE_CODE (TREE_TYPE (node
)) == FUNCTION_TYPE
)
829 tree fnode
= TREE_TYPE (node
);
831 dump_generic_node (buffer
, TREE_TYPE (fnode
), spc
, flags
, false);
833 pp_left_paren (buffer
);
834 pp_string (buffer
, str
);
835 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
836 dump_decl_name (buffer
, TYPE_NAME (node
), flags
);
837 else if (flags
& TDF_NOUID
)
838 pp_printf (buffer
, "<Txxxx>");
840 pp_printf (buffer
, "<T%x>", TYPE_UID (node
));
842 pp_right_paren (buffer
);
843 dump_function_declaration (buffer
, fnode
, spc
, flags
);
847 unsigned int quals
= TYPE_QUALS (node
);
849 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
851 pp_string (buffer
, str
);
853 if (quals
& TYPE_QUAL_CONST
)
854 pp_string (buffer
, " const");
855 if (quals
& TYPE_QUAL_VOLATILE
)
856 pp_string (buffer
, " volatile");
857 if (quals
& TYPE_QUAL_RESTRICT
)
858 pp_string (buffer
, " restrict");
860 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
862 pp_string (buffer
, " <address-space-");
863 pp_decimal_int (buffer
, TYPE_ADDR_SPACE (node
));
867 if (TYPE_REF_CAN_ALIAS_ALL (node
))
868 pp_string (buffer
, " {ref-all}");
878 if (integer_zerop (TREE_OPERAND (node
, 1))
879 /* Dump the types of INTEGER_CSTs explicitly, for we can't
880 infer them and MEM_ATTR caching will share MEM_REFs
881 with differently-typed op0s. */
882 && TREE_CODE (TREE_OPERAND (node
, 0)) != INTEGER_CST
883 /* Released SSA_NAMES have no TREE_TYPE. */
884 && TREE_TYPE (TREE_OPERAND (node
, 0)) != NULL_TREE
885 /* Same pointer types, but ignoring POINTER_TYPE vs.
887 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 0)))
888 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))
889 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 0)))
890 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 1))))
891 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 0)))
892 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 1))))
893 /* Same value types ignoring qualifiers. */
894 && (TYPE_MAIN_VARIANT (TREE_TYPE (node
))
896 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))))
898 if (TREE_CODE (TREE_OPERAND (node
, 0)) != ADDR_EXPR
)
901 dump_generic_node (buffer
, TREE_OPERAND (node
, 0),
905 dump_generic_node (buffer
,
906 TREE_OPERAND (TREE_OPERAND (node
, 0), 0),
913 pp_string (buffer
, "MEM[");
914 pp_left_paren (buffer
);
915 ptype
= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (node
, 1)));
916 dump_generic_node (buffer
, ptype
,
917 spc
, flags
| TDF_SLIM
, false);
918 pp_right_paren (buffer
);
919 dump_generic_node (buffer
, TREE_OPERAND (node
, 0),
921 if (!integer_zerop (TREE_OPERAND (node
, 1)))
923 pp_string (buffer
, " + ");
924 dump_generic_node (buffer
, TREE_OPERAND (node
, 1),
927 pp_right_bracket (buffer
);
934 const char *sep
= "";
937 pp_string (buffer
, "MEM[");
939 if (TREE_CODE (TMR_BASE (node
)) == ADDR_EXPR
)
941 pp_string (buffer
, sep
);
943 pp_string (buffer
, "symbol: ");
944 dump_generic_node (buffer
, TREE_OPERAND (TMR_BASE (node
), 0),
949 pp_string (buffer
, sep
);
951 pp_string (buffer
, "base: ");
952 dump_generic_node (buffer
, TMR_BASE (node
), spc
, flags
, false);
954 tmp
= TMR_INDEX2 (node
);
957 pp_string (buffer
, sep
);
959 pp_string (buffer
, "base: ");
960 dump_generic_node (buffer
, tmp
, spc
, flags
, false);
962 tmp
= TMR_INDEX (node
);
965 pp_string (buffer
, sep
);
967 pp_string (buffer
, "index: ");
968 dump_generic_node (buffer
, tmp
, spc
, flags
, false);
970 tmp
= TMR_STEP (node
);
973 pp_string (buffer
, sep
);
975 pp_string (buffer
, "step: ");
976 dump_generic_node (buffer
, tmp
, spc
, flags
, false);
978 tmp
= TMR_OFFSET (node
);
981 pp_string (buffer
, sep
);
983 pp_string (buffer
, "offset: ");
984 dump_generic_node (buffer
, tmp
, spc
, flags
, false);
986 pp_right_bracket (buffer
);
994 /* Print the innermost component type. */
995 for (tmp
= TREE_TYPE (node
); TREE_CODE (tmp
) == ARRAY_TYPE
;
996 tmp
= TREE_TYPE (tmp
))
998 dump_generic_node (buffer
, tmp
, spc
, flags
, false);
1000 /* Print the dimensions. */
1001 for (tmp
= node
; TREE_CODE (tmp
) == ARRAY_TYPE
; tmp
= TREE_TYPE (tmp
))
1002 dump_array_domain (buffer
, TYPE_DOMAIN (tmp
), spc
, flags
);
1008 case QUAL_UNION_TYPE
:
1010 unsigned int quals
= TYPE_QUALS (node
);
1012 if (quals
& TYPE_QUAL_CONST
)
1013 pp_string (buffer
, "const ");
1014 if (quals
& TYPE_QUAL_VOLATILE
)
1015 pp_string (buffer
, "volatile ");
1017 /* Print the name of the structure. */
1018 if (TREE_CODE (node
) == RECORD_TYPE
)
1019 pp_string (buffer
, "struct ");
1020 else if (TREE_CODE (node
) == UNION_TYPE
)
1021 pp_string (buffer
, "union ");
1023 if (TYPE_NAME (node
))
1024 dump_generic_node (buffer
, TYPE_NAME (node
), spc
, flags
, false);
1025 else if (!(flags
& TDF_SLIM
))
1026 /* FIXME: If we eliminate the 'else' above and attempt
1027 to show the fields for named types, we may get stuck
1028 following a cycle of pointers to structs. The alleged
1029 self-reference check in print_struct_decl will not detect
1030 cycles involving more than one pointer or struct type. */
1031 print_struct_decl (buffer
, node
, spc
, flags
);
1040 if (TREE_CODE (TREE_TYPE (node
)) == POINTER_TYPE
)
1042 /* In the case of a pointer, one may want to divide by the
1043 size of the pointed-to type. Unfortunately, this not
1044 straightforward. The C front-end maps expressions
1049 in such a way that the two INTEGER_CST nodes for "5" have
1050 different values but identical types. In the latter
1051 case, the 5 is multiplied by sizeof (int) in c-common.c
1052 (pointer_int_sum) to convert it to a byte address, and
1053 yet the type of the node is left unchanged. Argh. What
1054 is consistent though is that the number value corresponds
1055 to bytes (UNITS) offset.
1057 NB: Neither of the following divisors can be trivially
1058 used to recover the original literal:
1060 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
1061 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
1062 pp_wide_integer (buffer
, TREE_INT_CST_LOW (node
));
1063 pp_string (buffer
, "B"); /* pseudo-unit */
1066 pp_double_int (buffer
, tree_to_double_int (node
),
1067 TYPE_UNSIGNED (TREE_TYPE (node
)));
1071 /* Code copied from print_node. */
1074 if (TREE_OVERFLOW (node
))
1075 pp_string (buffer
, " overflow");
1077 #if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC)
1078 d
= TREE_REAL_CST (node
);
1079 if (REAL_VALUE_ISINF (d
))
1080 pp_string (buffer
, REAL_VALUE_NEGATIVE (d
) ? " -Inf" : " Inf");
1081 else if (REAL_VALUE_ISNAN (d
))
1082 pp_string (buffer
, " Nan");
1086 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
1087 pp_string (buffer
, string
);
1092 unsigned char *p
= (unsigned char *) &TREE_REAL_CST (node
);
1093 pp_string (buffer
, "0x");
1094 for (i
= 0; i
< sizeof TREE_REAL_CST (node
); i
++)
1095 output_formatted_integer (buffer
, "%02x", *p
++);
1104 fixed_to_decimal (string
, TREE_FIXED_CST_PTR (node
), sizeof (string
));
1105 pp_string (buffer
, string
);
1110 pp_string (buffer
, "__complex__ (");
1111 dump_generic_node (buffer
, TREE_REALPART (node
), spc
, flags
, false);
1112 pp_string (buffer
, ", ");
1113 dump_generic_node (buffer
, TREE_IMAGPART (node
), spc
, flags
, false);
1114 pp_right_paren (buffer
);
1118 pp_string (buffer
, "\"");
1119 pretty_print_string (buffer
, TREE_STRING_POINTER (node
));
1120 pp_string (buffer
, "\"");
1126 pp_string (buffer
, "{ ");
1127 for (i
= 0; i
< VECTOR_CST_NELTS (node
); ++i
)
1130 pp_string (buffer
, ", ");
1131 dump_generic_node (buffer
, VECTOR_CST_ELT (node
, i
),
1134 pp_string (buffer
, " }");
1140 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
1142 if (TREE_CODE (node
) == METHOD_TYPE
)
1144 if (TYPE_METHOD_BASETYPE (node
))
1145 dump_decl_name (buffer
, TYPE_NAME (TYPE_METHOD_BASETYPE (node
)),
1148 pp_string (buffer
, "<null method basetype>");
1149 pp_colon_colon (buffer
);
1151 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1152 dump_decl_name (buffer
, TYPE_NAME (node
), flags
);
1153 else if (flags
& TDF_NOUID
)
1154 pp_printf (buffer
, "<Txxxx>");
1156 pp_printf (buffer
, "<T%x>", TYPE_UID (node
));
1157 dump_function_declaration (buffer
, node
, spc
, flags
);
1162 dump_decl_name (buffer
, node
, flags
);
1166 if (DECL_NAME (node
))
1167 dump_decl_name (buffer
, node
, flags
);
1168 else if (LABEL_DECL_UID (node
) != -1)
1169 pp_printf (buffer
, "<L%d>", (int) LABEL_DECL_UID (node
));
1172 if (flags
& TDF_NOUID
)
1173 pp_string (buffer
, "<D.xxxx>");
1175 pp_printf (buffer
, "<D.%u>", DECL_UID (node
));
1180 if (DECL_IS_BUILTIN (node
))
1182 /* Don't print the declaration of built-in types. */
1185 if (DECL_NAME (node
))
1186 dump_decl_name (buffer
, node
, flags
);
1187 else if (TYPE_NAME (TREE_TYPE (node
)) != node
)
1189 if ((TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
1190 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
1191 && TYPE_METHODS (TREE_TYPE (node
)))
1193 /* The type is a c++ class: all structures have at least
1195 pp_string (buffer
, "class ");
1196 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
1201 (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
1202 ? "union" : "struct "));
1203 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
1207 pp_string (buffer
, "<anon>");
1213 case DEBUG_EXPR_DECL
:
1214 case NAMESPACE_DECL
:
1215 dump_decl_name (buffer
, node
, flags
);
1219 pp_string (buffer
, "<retval>");
1223 op0
= TREE_OPERAND (node
, 0);
1226 && (TREE_CODE (op0
) == INDIRECT_REF
1227 || (TREE_CODE (op0
) == MEM_REF
1228 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
1229 && integer_zerop (TREE_OPERAND (op0
, 1))
1230 /* Dump the types of INTEGER_CSTs explicitly, for we
1231 can't infer them and MEM_ATTR caching will share
1232 MEM_REFs with differently-typed op0s. */
1233 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
1234 /* Released SSA_NAMES have no TREE_TYPE. */
1235 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
1236 /* Same pointer types, but ignoring POINTER_TYPE vs.
1238 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1239 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1240 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1241 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1242 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1243 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1244 /* Same value types ignoring qualifiers. */
1245 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
1246 == TYPE_MAIN_VARIANT
1247 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))))))
1249 op0
= TREE_OPERAND (op0
, 0);
1252 if (op_prio (op0
) < op_prio (node
))
1253 pp_left_paren (buffer
);
1254 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1255 if (op_prio (op0
) < op_prio (node
))
1256 pp_right_paren (buffer
);
1257 pp_string (buffer
, str
);
1258 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1259 op0
= component_ref_field_offset (node
);
1260 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
1262 pp_string (buffer
, "{off: ");
1263 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1264 pp_right_brace (buffer
);
1269 pp_string (buffer
, "BIT_FIELD_REF <");
1270 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1271 pp_string (buffer
, ", ");
1272 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1273 pp_string (buffer
, ", ");
1274 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1275 pp_greater (buffer
);
1279 case ARRAY_RANGE_REF
:
1280 op0
= TREE_OPERAND (node
, 0);
1281 if (op_prio (op0
) < op_prio (node
))
1282 pp_left_paren (buffer
);
1283 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1284 if (op_prio (op0
) < op_prio (node
))
1285 pp_right_paren (buffer
);
1286 pp_left_bracket (buffer
);
1287 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1288 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
1289 pp_string (buffer
, " ...");
1290 pp_right_bracket (buffer
);
1292 op0
= array_ref_low_bound (node
);
1293 op1
= array_ref_element_size (node
);
1295 if (!integer_zerop (op0
)
1296 || TREE_OPERAND (node
, 2)
1297 || TREE_OPERAND (node
, 3))
1299 pp_string (buffer
, "{lb: ");
1300 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1301 pp_string (buffer
, " sz: ");
1302 dump_generic_node (buffer
, op1
, spc
, flags
, false);
1303 pp_right_brace (buffer
);
1309 unsigned HOST_WIDE_INT ix
;
1311 bool is_struct_init
= false;
1312 bool is_array_init
= false;
1313 double_int curidx
= double_int_zero
;
1314 pp_left_brace (buffer
);
1315 if (TREE_CLOBBER_P (node
))
1316 pp_string (buffer
, "CLOBBER");
1317 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
1318 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
1319 is_struct_init
= true;
1320 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
1321 && TYPE_DOMAIN (TREE_TYPE (node
))
1322 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
1323 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
1326 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
1327 is_array_init
= true;
1328 curidx
= tree_to_double_int (minv
);
1330 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
1337 dump_generic_node (buffer
, field
, spc
, flags
, false);
1340 else if (is_array_init
1341 && (TREE_CODE (field
) != INTEGER_CST
1342 || tree_to_double_int (field
) != curidx
))
1344 pp_left_bracket (buffer
);
1345 if (TREE_CODE (field
) == RANGE_EXPR
)
1347 dump_generic_node (buffer
, TREE_OPERAND (field
, 0), spc
,
1349 pp_string (buffer
, " ... ");
1350 dump_generic_node (buffer
, TREE_OPERAND (field
, 1), spc
,
1352 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
1353 curidx
= tree_to_double_int (TREE_OPERAND (field
, 1));
1356 dump_generic_node (buffer
, field
, spc
, flags
, false);
1357 if (TREE_CODE (field
) == INTEGER_CST
)
1358 curidx
= tree_to_double_int (field
);
1359 pp_string (buffer
, "]=");
1363 curidx
+= double_int_one
;
1364 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
1365 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
1366 val
= TREE_OPERAND (val
, 0);
1367 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
1368 dump_decl_name (buffer
, val
, flags
);
1370 dump_generic_node (buffer
, val
, spc
, flags
, false);
1371 if (ix
!= vec_safe_length (CONSTRUCTOR_ELTS (node
)) - 1)
1377 pp_right_brace (buffer
);
1384 if (flags
& TDF_SLIM
)
1386 pp_string (buffer
, "<COMPOUND_EXPR>");
1390 dump_generic_node (buffer
, TREE_OPERAND (node
, 0),
1391 spc
, flags
, !(flags
& TDF_SLIM
));
1392 if (flags
& TDF_SLIM
)
1393 newline_and_indent (buffer
, spc
);
1400 for (tp
= &TREE_OPERAND (node
, 1);
1401 TREE_CODE (*tp
) == COMPOUND_EXPR
;
1402 tp
= &TREE_OPERAND (*tp
, 1))
1404 dump_generic_node (buffer
, TREE_OPERAND (*tp
, 0),
1405 spc
, flags
, !(flags
& TDF_SLIM
));
1406 if (flags
& TDF_SLIM
)
1407 newline_and_indent (buffer
, spc
);
1415 dump_generic_node (buffer
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
1419 case STATEMENT_LIST
:
1421 tree_stmt_iterator si
;
1424 if (flags
& TDF_SLIM
)
1426 pp_string (buffer
, "<STATEMENT_LIST>");
1430 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
1433 newline_and_indent (buffer
, spc
);
1436 dump_generic_node (buffer
, tsi_stmt (si
), spc
, flags
, true);
1443 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
,
1448 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
,
1453 pp_string (buffer
, "TARGET_EXPR <");
1454 dump_generic_node (buffer
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
1457 dump_generic_node (buffer
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
1458 pp_greater (buffer
);
1462 print_declaration (buffer
, DECL_EXPR_DECL (node
), spc
, flags
);
1467 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
1469 pp_string (buffer
, "if (");
1470 dump_generic_node (buffer
, COND_EXPR_COND (node
), spc
, flags
, false);
1471 pp_right_paren (buffer
);
1472 /* The lowered cond_exprs should always be printed in full. */
1473 if (COND_EXPR_THEN (node
)
1474 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
1475 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
1476 && COND_EXPR_ELSE (node
)
1477 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
1478 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
1481 dump_generic_node (buffer
, COND_EXPR_THEN (node
),
1483 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
1485 pp_string (buffer
, " else ");
1486 dump_generic_node (buffer
, COND_EXPR_ELSE (node
),
1490 else if (!(flags
& TDF_SLIM
))
1492 /* Output COND_EXPR_THEN. */
1493 if (COND_EXPR_THEN (node
))
1495 newline_and_indent (buffer
, spc
+2);
1496 pp_left_brace (buffer
);
1497 newline_and_indent (buffer
, spc
+4);
1498 dump_generic_node (buffer
, COND_EXPR_THEN (node
), spc
+4,
1500 newline_and_indent (buffer
, spc
+2);
1501 pp_right_brace (buffer
);
1504 /* Output COND_EXPR_ELSE. */
1505 if (COND_EXPR_ELSE (node
)
1506 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
1508 newline_and_indent (buffer
, spc
);
1509 pp_string (buffer
, "else");
1510 newline_and_indent (buffer
, spc
+2);
1511 pp_left_brace (buffer
);
1512 newline_and_indent (buffer
, spc
+4);
1513 dump_generic_node (buffer
, COND_EXPR_ELSE (node
), spc
+4,
1515 newline_and_indent (buffer
, spc
+2);
1516 pp_right_brace (buffer
);
1523 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1525 pp_question (buffer
);
1527 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1531 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1536 pp_left_brace (buffer
);
1537 if (!(flags
& TDF_SLIM
))
1539 if (BIND_EXPR_VARS (node
))
1541 pp_newline (buffer
);
1543 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
1545 print_declaration (buffer
, op0
, spc
+2, flags
);
1546 pp_newline (buffer
);
1550 newline_and_indent (buffer
, spc
+2);
1551 dump_generic_node (buffer
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
1552 newline_and_indent (buffer
, spc
);
1553 pp_right_brace (buffer
);
1559 print_call_name (buffer
, CALL_EXPR_FN (node
), flags
);
1561 /* Print parameters. */
1563 pp_left_paren (buffer
);
1566 call_expr_arg_iterator iter
;
1567 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
1569 dump_generic_node (buffer
, arg
, spc
, flags
, false);
1570 if (more_call_expr_args_p (&iter
))
1577 if (CALL_EXPR_VA_ARG_PACK (node
))
1579 if (call_expr_nargs (node
) > 0)
1584 pp_string (buffer
, "__builtin_va_arg_pack ()");
1586 pp_right_paren (buffer
);
1588 op1
= CALL_EXPR_STATIC_CHAIN (node
);
1591 pp_string (buffer
, " [static-chain: ");
1592 dump_generic_node (buffer
, op1
, spc
, flags
, false);
1593 pp_right_bracket (buffer
);
1596 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
1597 pp_string (buffer
, " [return slot optimization]");
1598 if (CALL_EXPR_TAILCALL (node
))
1599 pp_string (buffer
, " [tail call]");
1602 case WITH_CLEANUP_EXPR
:
1606 case CLEANUP_POINT_EXPR
:
1607 pp_string (buffer
, "<<cleanup_point ");
1608 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1609 pp_string (buffer
, ">>");
1612 case PLACEHOLDER_EXPR
:
1613 pp_string (buffer
, "<PLACEHOLDER_EXPR ");
1614 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
1615 pp_greater (buffer
);
1618 /* Binary arithmetic and logic expressions. */
1619 case WIDEN_SUM_EXPR
:
1620 case WIDEN_MULT_EXPR
:
1622 case MULT_HIGHPART_EXPR
:
1624 case POINTER_PLUS_EXPR
:
1626 case TRUNC_DIV_EXPR
:
1628 case FLOOR_DIV_EXPR
:
1629 case ROUND_DIV_EXPR
:
1630 case TRUNC_MOD_EXPR
:
1632 case FLOOR_MOD_EXPR
:
1633 case ROUND_MOD_EXPR
:
1635 case EXACT_DIV_EXPR
:
1640 case VEC_LSHIFT_EXPR
:
1641 case VEC_RSHIFT_EXPR
:
1642 case WIDEN_LSHIFT_EXPR
:
1646 case TRUTH_ANDIF_EXPR
:
1647 case TRUTH_ORIF_EXPR
:
1648 case TRUTH_AND_EXPR
:
1650 case TRUTH_XOR_EXPR
:
1664 case UNORDERED_EXPR
:
1666 const char *op
= op_symbol (node
);
1667 op0
= TREE_OPERAND (node
, 0);
1668 op1
= TREE_OPERAND (node
, 1);
1670 /* When the operands are expressions with less priority,
1671 keep semantics of the tree representation. */
1672 if (op_prio (op0
) <= op_prio (node
))
1674 pp_left_paren (buffer
);
1675 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1676 pp_right_paren (buffer
);
1679 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1682 pp_string (buffer
, op
);
1685 /* When the operands are expressions with less priority,
1686 keep semantics of the tree representation. */
1687 if (op_prio (op1
) <= op_prio (node
))
1689 pp_left_paren (buffer
);
1690 dump_generic_node (buffer
, op1
, spc
, flags
, false);
1691 pp_right_paren (buffer
);
1694 dump_generic_node (buffer
, op1
, spc
, flags
, false);
1698 /* Unary arithmetic and logic expressions. */
1701 case TRUTH_NOT_EXPR
:
1703 case PREDECREMENT_EXPR
:
1704 case PREINCREMENT_EXPR
:
1706 if (TREE_CODE (node
) == ADDR_EXPR
1707 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
1708 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
1709 ; /* Do not output '&' for strings and function pointers. */
1711 pp_string (buffer
, op_symbol (node
));
1713 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
1715 pp_left_paren (buffer
);
1716 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1717 pp_right_paren (buffer
);
1720 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1723 case POSTDECREMENT_EXPR
:
1724 case POSTINCREMENT_EXPR
:
1725 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
1727 pp_left_paren (buffer
);
1728 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1729 pp_right_paren (buffer
);
1732 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1733 pp_string (buffer
, op_symbol (node
));
1737 pp_string (buffer
, "MIN_EXPR <");
1738 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1739 pp_string (buffer
, ", ");
1740 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1741 pp_greater (buffer
);
1745 pp_string (buffer
, "MAX_EXPR <");
1746 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1747 pp_string (buffer
, ", ");
1748 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1749 pp_greater (buffer
);
1753 pp_string (buffer
, "ABS_EXPR <");
1754 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1755 pp_greater (buffer
);
1762 case ADDR_SPACE_CONVERT_EXPR
:
1763 case FIXED_CONVERT_EXPR
:
1764 case FIX_TRUNC_EXPR
:
1767 type
= TREE_TYPE (node
);
1768 op0
= TREE_OPERAND (node
, 0);
1769 if (type
!= TREE_TYPE (op0
))
1771 pp_left_paren (buffer
);
1772 dump_generic_node (buffer
, type
, spc
, flags
, false);
1773 pp_string (buffer
, ") ");
1775 if (op_prio (op0
) < op_prio (node
))
1776 pp_left_paren (buffer
);
1777 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1778 if (op_prio (op0
) < op_prio (node
))
1779 pp_right_paren (buffer
);
1782 case VIEW_CONVERT_EXPR
:
1783 pp_string (buffer
, "VIEW_CONVERT_EXPR<");
1784 dump_generic_node (buffer
, TREE_TYPE (node
), spc
, flags
, false);
1785 pp_string (buffer
, ">(");
1786 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1787 pp_right_paren (buffer
);
1791 pp_string (buffer
, "((");
1792 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1793 pp_string (buffer
, "))");
1796 case NON_LVALUE_EXPR
:
1797 pp_string (buffer
, "NON_LVALUE_EXPR <");
1798 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1799 pp_greater (buffer
);
1803 pp_string (buffer
, "SAVE_EXPR <");
1804 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1805 pp_greater (buffer
);
1809 pp_string (buffer
, "COMPLEX_EXPR <");
1810 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1811 pp_string (buffer
, ", ");
1812 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1813 pp_greater (buffer
);
1817 pp_string (buffer
, "CONJ_EXPR <");
1818 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1819 pp_greater (buffer
);
1823 pp_string (buffer
, "REALPART_EXPR <");
1824 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1825 pp_greater (buffer
);
1829 pp_string (buffer
, "IMAGPART_EXPR <");
1830 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1831 pp_greater (buffer
);
1835 pp_string (buffer
, "VA_ARG_EXPR <");
1836 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1837 pp_greater (buffer
);
1840 case TRY_FINALLY_EXPR
:
1841 case TRY_CATCH_EXPR
:
1842 pp_string (buffer
, "try");
1843 newline_and_indent (buffer
, spc
+2);
1844 pp_left_brace (buffer
);
1845 newline_and_indent (buffer
, spc
+4);
1846 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
1847 newline_and_indent (buffer
, spc
+2);
1848 pp_right_brace (buffer
);
1849 newline_and_indent (buffer
, spc
);
1851 (TREE_CODE (node
) == TRY_CATCH_EXPR
) ? "catch" : "finally");
1852 newline_and_indent (buffer
, spc
+2);
1853 pp_left_brace (buffer
);
1854 newline_and_indent (buffer
, spc
+4);
1855 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
+4, flags
, true);
1856 newline_and_indent (buffer
, spc
+2);
1857 pp_right_brace (buffer
);
1862 pp_string (buffer
, "catch (");
1863 dump_generic_node (buffer
, CATCH_TYPES (node
), spc
+2, flags
, false);
1864 pp_right_paren (buffer
);
1865 newline_and_indent (buffer
, spc
+2);
1866 pp_left_brace (buffer
);
1867 newline_and_indent (buffer
, spc
+4);
1868 dump_generic_node (buffer
, CATCH_BODY (node
), spc
+4, flags
, true);
1869 newline_and_indent (buffer
, spc
+2);
1870 pp_right_brace (buffer
);
1874 case EH_FILTER_EXPR
:
1875 pp_string (buffer
, "<<<eh_filter (");
1876 dump_generic_node (buffer
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
1877 pp_string (buffer
, ")>>>");
1878 newline_and_indent (buffer
, spc
+2);
1879 pp_left_brace (buffer
);
1880 newline_and_indent (buffer
, spc
+4);
1881 dump_generic_node (buffer
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
1882 newline_and_indent (buffer
, spc
+2);
1883 pp_right_brace (buffer
);
1888 op0
= TREE_OPERAND (node
, 0);
1889 /* If this is for break or continue, don't bother printing it. */
1890 if (DECL_NAME (op0
))
1892 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
1893 if (strcmp (name
, "break") == 0
1894 || strcmp (name
, "continue") == 0)
1897 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1899 if (DECL_NONLOCAL (op0
))
1900 pp_string (buffer
, " [non-local]");
1904 pp_string (buffer
, "while (1)");
1905 if (!(flags
& TDF_SLIM
))
1907 newline_and_indent (buffer
, spc
+2);
1908 pp_left_brace (buffer
);
1909 newline_and_indent (buffer
, spc
+4);
1910 dump_generic_node (buffer
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
1911 newline_and_indent (buffer
, spc
+2);
1912 pp_right_brace (buffer
);
1918 pp_string (buffer
, "// predicted ");
1919 if (PREDICT_EXPR_OUTCOME (node
))
1920 pp_string (buffer
, "likely by ");
1922 pp_string (buffer
, "unlikely by ");
1923 pp_string (buffer
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
1924 pp_string (buffer
, " predictor.");
1928 pp_string (buffer
, "return");
1929 op0
= TREE_OPERAND (node
, 0);
1933 if (TREE_CODE (op0
) == MODIFY_EXPR
)
1934 dump_generic_node (buffer
, TREE_OPERAND (op0
, 1),
1937 dump_generic_node (buffer
, op0
, spc
, flags
, false);
1942 pp_string (buffer
, "if (");
1943 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1944 pp_string (buffer
, ") break");
1948 pp_string (buffer
, "switch (");
1949 dump_generic_node (buffer
, SWITCH_COND (node
), spc
, flags
, false);
1950 pp_right_paren (buffer
);
1951 if (!(flags
& TDF_SLIM
))
1953 newline_and_indent (buffer
, spc
+2);
1954 pp_left_brace (buffer
);
1955 if (SWITCH_BODY (node
))
1957 newline_and_indent (buffer
, spc
+4);
1958 dump_generic_node (buffer
, SWITCH_BODY (node
), spc
+4, flags
,
1963 tree vec
= SWITCH_LABELS (node
);
1964 size_t i
, n
= TREE_VEC_LENGTH (vec
);
1965 for (i
= 0; i
< n
; ++i
)
1967 tree elt
= TREE_VEC_ELT (vec
, i
);
1968 newline_and_indent (buffer
, spc
+4);
1971 dump_generic_node (buffer
, elt
, spc
+4, flags
, false);
1972 pp_string (buffer
, " goto ");
1973 dump_generic_node (buffer
, CASE_LABEL (elt
), spc
+4,
1975 pp_semicolon (buffer
);
1978 pp_string (buffer
, "case ???: goto ???;");
1981 newline_and_indent (buffer
, spc
+2);
1982 pp_right_brace (buffer
);
1988 op0
= GOTO_DESTINATION (node
);
1989 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
1991 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
1992 if (strcmp (name
, "break") == 0
1993 || strcmp (name
, "continue") == 0)
1995 pp_string (buffer
, name
);
1999 pp_string (buffer
, "goto ");
2000 dump_generic_node (buffer
, op0
, spc
, flags
, false);
2004 pp_string (buffer
, "__asm__");
2005 if (ASM_VOLATILE_P (node
))
2006 pp_string (buffer
, " __volatile__");
2007 pp_left_paren (buffer
);
2008 dump_generic_node (buffer
, ASM_STRING (node
), spc
, flags
, false);
2010 dump_generic_node (buffer
, ASM_OUTPUTS (node
), spc
, flags
, false);
2012 dump_generic_node (buffer
, ASM_INPUTS (node
), spc
, flags
, false);
2013 if (ASM_CLOBBERS (node
))
2016 dump_generic_node (buffer
, ASM_CLOBBERS (node
), spc
, flags
, false);
2018 pp_right_paren (buffer
);
2021 case CASE_LABEL_EXPR
:
2022 if (CASE_LOW (node
) && CASE_HIGH (node
))
2024 pp_string (buffer
, "case ");
2025 dump_generic_node (buffer
, CASE_LOW (node
), spc
, flags
, false);
2026 pp_string (buffer
, " ... ");
2027 dump_generic_node (buffer
, CASE_HIGH (node
), spc
, flags
, false);
2029 else if (CASE_LOW (node
))
2031 pp_string (buffer
, "case ");
2032 dump_generic_node (buffer
, CASE_LOW (node
), spc
, flags
, false);
2035 pp_string (buffer
, "default");
2040 pp_string (buffer
, "OBJ_TYPE_REF(");
2041 dump_generic_node (buffer
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
2042 pp_semicolon (buffer
);
2043 dump_generic_node (buffer
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
2045 dump_generic_node (buffer
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
2046 pp_right_paren (buffer
);
2050 if (SSA_NAME_IDENTIFIER (node
))
2051 dump_generic_node (buffer
, SSA_NAME_IDENTIFIER (node
),
2053 pp_underscore (buffer
);
2054 pp_decimal_int (buffer
, SSA_NAME_VERSION (node
));
2055 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
2056 pp_string (buffer
, "(ab)");
2057 else if (SSA_NAME_IS_DEFAULT_DEF (node
))
2058 pp_string (buffer
, "(D)");
2061 case WITH_SIZE_EXPR
:
2062 pp_string (buffer
, "WITH_SIZE_EXPR <");
2063 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2064 pp_string (buffer
, ", ");
2065 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2066 pp_greater (buffer
);
2070 pp_string (buffer
, "ASSERT_EXPR <");
2071 dump_generic_node (buffer
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
2072 pp_string (buffer
, ", ");
2073 dump_generic_node (buffer
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
2074 pp_greater (buffer
);
2078 pp_string (buffer
, "scev_known");
2081 case SCEV_NOT_KNOWN
:
2082 pp_string (buffer
, "scev_not_known");
2085 case POLYNOMIAL_CHREC
:
2086 pp_left_brace (buffer
);
2087 dump_generic_node (buffer
, CHREC_LEFT (node
), spc
, flags
, false);
2088 pp_string (buffer
, ", +, ");
2089 dump_generic_node (buffer
, CHREC_RIGHT (node
), spc
, flags
, false);
2090 pp_string (buffer
, "}_");
2091 dump_generic_node (buffer
, CHREC_VAR (node
), spc
, flags
, false);
2095 case REALIGN_LOAD_EXPR
:
2096 pp_string (buffer
, "REALIGN_LOAD <");
2097 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2098 pp_string (buffer
, ", ");
2099 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2100 pp_string (buffer
, ", ");
2101 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2102 pp_greater (buffer
);
2106 pp_string (buffer
, " VEC_COND_EXPR < ");
2107 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2108 pp_string (buffer
, " , ");
2109 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2110 pp_string (buffer
, " , ");
2111 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2112 pp_string (buffer
, " > ");
2116 pp_string (buffer
, " VEC_PERM_EXPR < ");
2117 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2118 pp_string (buffer
, " , ");
2119 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2120 pp_string (buffer
, " , ");
2121 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2122 pp_string (buffer
, " > ");
2126 pp_string (buffer
, " DOT_PROD_EXPR < ");
2127 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2128 pp_string (buffer
, ", ");
2129 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2130 pp_string (buffer
, ", ");
2131 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2132 pp_string (buffer
, " > ");
2135 case WIDEN_MULT_PLUS_EXPR
:
2136 pp_string (buffer
, " WIDEN_MULT_PLUS_EXPR < ");
2137 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2138 pp_string (buffer
, ", ");
2139 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2140 pp_string (buffer
, ", ");
2141 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2142 pp_string (buffer
, " > ");
2145 case WIDEN_MULT_MINUS_EXPR
:
2146 pp_string (buffer
, " WIDEN_MULT_MINUS_EXPR < ");
2147 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2148 pp_string (buffer
, ", ");
2149 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2150 pp_string (buffer
, ", ");
2151 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2152 pp_string (buffer
, " > ");
2156 pp_string (buffer
, " FMA_EXPR < ");
2157 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2158 pp_string (buffer
, ", ");
2159 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2160 pp_string (buffer
, ", ");
2161 dump_generic_node (buffer
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2162 pp_string (buffer
, " > ");
2166 pp_string (buffer
, "#pragma omp parallel");
2167 dump_omp_clauses (buffer
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
2170 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
2172 newline_and_indent (buffer
, spc
+ 2);
2173 pp_left_brace (buffer
);
2174 newline_and_indent (buffer
, spc
+ 4);
2175 dump_generic_node (buffer
, OMP_BODY (node
), spc
+ 4, flags
, false);
2176 newline_and_indent (buffer
, spc
+ 2);
2177 pp_right_brace (buffer
);
2183 pp_string (buffer
, "#pragma omp task");
2184 dump_omp_clauses (buffer
, OMP_TASK_CLAUSES (node
), spc
, flags
);
2188 pp_string (buffer
, "#pragma omp for");
2192 pp_string (buffer
, "#pragma omp simd");
2196 dump_omp_clauses (buffer
, OMP_FOR_CLAUSES (node
), spc
, flags
);
2198 if (!(flags
& TDF_SLIM
))
2202 if (OMP_FOR_PRE_BODY (node
))
2204 newline_and_indent (buffer
, spc
+ 2);
2205 pp_left_brace (buffer
);
2207 newline_and_indent (buffer
, spc
);
2208 dump_generic_node (buffer
, OMP_FOR_PRE_BODY (node
),
2212 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
2215 newline_and_indent (buffer
, spc
);
2216 pp_string (buffer
, "for (");
2217 dump_generic_node (buffer
, TREE_VEC_ELT (OMP_FOR_INIT (node
), i
),
2219 pp_string (buffer
, "; ");
2220 dump_generic_node (buffer
, TREE_VEC_ELT (OMP_FOR_COND (node
), i
),
2222 pp_string (buffer
, "; ");
2223 dump_generic_node (buffer
, TREE_VEC_ELT (OMP_FOR_INCR (node
), i
),
2225 pp_right_paren (buffer
);
2227 if (OMP_FOR_BODY (node
))
2229 newline_and_indent (buffer
, spc
+ 2);
2230 pp_left_brace (buffer
);
2231 newline_and_indent (buffer
, spc
+ 4);
2232 dump_generic_node (buffer
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
2234 newline_and_indent (buffer
, spc
+ 2);
2235 pp_right_brace (buffer
);
2237 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
2238 if (OMP_FOR_PRE_BODY (node
))
2241 newline_and_indent (buffer
, spc
+ 2);
2242 pp_right_brace (buffer
);
2249 pp_string (buffer
, "#pragma omp sections");
2250 dump_omp_clauses (buffer
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
2254 pp_string (buffer
, "#pragma omp section");
2258 pp_string (buffer
, "#pragma omp master");
2262 pp_string (buffer
, "#pragma omp ordered");
2266 pp_string (buffer
, "#pragma omp critical");
2267 if (OMP_CRITICAL_NAME (node
))
2270 pp_left_paren (buffer
);
2271 dump_generic_node (buffer
, OMP_CRITICAL_NAME (node
), spc
,
2273 pp_right_paren (buffer
);
2278 pp_string (buffer
, "#pragma omp atomic");
2279 newline_and_indent (buffer
, spc
+ 2);
2280 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2284 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2287 case OMP_ATOMIC_READ
:
2288 pp_string (buffer
, "#pragma omp atomic read");
2289 newline_and_indent (buffer
, spc
+ 2);
2290 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2294 case OMP_ATOMIC_CAPTURE_OLD
:
2295 case OMP_ATOMIC_CAPTURE_NEW
:
2296 pp_string (buffer
, "#pragma omp atomic capture");
2297 newline_and_indent (buffer
, spc
+ 2);
2298 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2302 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2306 pp_string (buffer
, "#pragma omp single");
2307 dump_omp_clauses (buffer
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
2311 dump_omp_clause (buffer
, node
, spc
, flags
);
2315 case TRANSACTION_EXPR
:
2316 if (TRANSACTION_EXPR_OUTER (node
))
2317 pp_string (buffer
, "__transaction_atomic [[outer]]");
2318 else if (TRANSACTION_EXPR_RELAXED (node
))
2319 pp_string (buffer
, "__transaction_relaxed");
2321 pp_string (buffer
, "__transaction_atomic");
2322 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
2324 newline_and_indent (buffer
, spc
);
2325 pp_left_brace (buffer
);
2326 newline_and_indent (buffer
, spc
+ 2);
2327 dump_generic_node (buffer
, TRANSACTION_EXPR_BODY (node
),
2328 spc
+ 2, flags
, false);
2329 newline_and_indent (buffer
, spc
);
2330 pp_right_brace (buffer
);
2335 case REDUC_MAX_EXPR
:
2336 pp_string (buffer
, " REDUC_MAX_EXPR < ");
2337 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2338 pp_string (buffer
, " > ");
2341 case REDUC_MIN_EXPR
:
2342 pp_string (buffer
, " REDUC_MIN_EXPR < ");
2343 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2344 pp_string (buffer
, " > ");
2347 case REDUC_PLUS_EXPR
:
2348 pp_string (buffer
, " REDUC_PLUS_EXPR < ");
2349 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2350 pp_string (buffer
, " > ");
2353 case VEC_WIDEN_MULT_HI_EXPR
:
2354 case VEC_WIDEN_MULT_LO_EXPR
:
2355 case VEC_WIDEN_MULT_EVEN_EXPR
:
2356 case VEC_WIDEN_MULT_ODD_EXPR
:
2357 case VEC_WIDEN_LSHIFT_HI_EXPR
:
2358 case VEC_WIDEN_LSHIFT_LO_EXPR
:
2360 for (str
= tree_code_name
[code
]; *str
; str
++)
2361 pp_character (buffer
, TOUPPER (*str
));
2362 pp_string (buffer
, " < ");
2363 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2364 pp_string (buffer
, ", ");
2365 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2366 pp_string (buffer
, " > ");
2369 case VEC_UNPACK_HI_EXPR
:
2370 pp_string (buffer
, " VEC_UNPACK_HI_EXPR < ");
2371 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2372 pp_string (buffer
, " > ");
2375 case VEC_UNPACK_LO_EXPR
:
2376 pp_string (buffer
, " VEC_UNPACK_LO_EXPR < ");
2377 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2378 pp_string (buffer
, " > ");
2381 case VEC_UNPACK_FLOAT_HI_EXPR
:
2382 pp_string (buffer
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
2383 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2384 pp_string (buffer
, " > ");
2387 case VEC_UNPACK_FLOAT_LO_EXPR
:
2388 pp_string (buffer
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
2389 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2390 pp_string (buffer
, " > ");
2393 case VEC_PACK_TRUNC_EXPR
:
2394 pp_string (buffer
, " VEC_PACK_TRUNC_EXPR < ");
2395 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2396 pp_string (buffer
, ", ");
2397 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2398 pp_string (buffer
, " > ");
2401 case VEC_PACK_SAT_EXPR
:
2402 pp_string (buffer
, " VEC_PACK_SAT_EXPR < ");
2403 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2404 pp_string (buffer
, ", ");
2405 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2406 pp_string (buffer
, " > ");
2409 case VEC_PACK_FIX_TRUNC_EXPR
:
2410 pp_string (buffer
, " VEC_PACK_FIX_TRUNC_EXPR < ");
2411 dump_generic_node (buffer
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2412 pp_string (buffer
, ", ");
2413 dump_generic_node (buffer
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2414 pp_string (buffer
, " > ");
2418 dump_block_node (buffer
, node
, spc
, flags
);
2425 if (is_stmt
&& is_expr
)
2426 pp_semicolon (buffer
);
2431 /* Print the declaration of a variable. */
2434 print_declaration (pretty_printer
*buffer
, tree t
, int spc
, int flags
)
2438 if (TREE_CODE (t
) == TYPE_DECL
)
2439 pp_string (buffer
, "typedef ");
2441 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
2442 pp_string (buffer
, "register ");
2444 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
2445 pp_string (buffer
, "extern ");
2446 else if (TREE_STATIC (t
))
2447 pp_string (buffer
, "static ");
2449 /* Print the type and name. */
2450 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
2454 /* Print array's type. */
2455 tmp
= TREE_TYPE (t
);
2456 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
2457 tmp
= TREE_TYPE (tmp
);
2458 dump_generic_node (buffer
, TREE_TYPE (tmp
), spc
, flags
, false);
2460 /* Print variable's name. */
2462 dump_generic_node (buffer
, t
, spc
, flags
, false);
2464 /* Print the dimensions. */
2465 tmp
= TREE_TYPE (t
);
2466 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
2468 dump_array_domain (buffer
, TYPE_DOMAIN (tmp
), spc
, flags
);
2469 tmp
= TREE_TYPE (tmp
);
2472 else if (TREE_CODE (t
) == FUNCTION_DECL
)
2474 dump_generic_node (buffer
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
2476 dump_decl_name (buffer
, t
, flags
);
2477 dump_function_declaration (buffer
, TREE_TYPE (t
), spc
, flags
);
2481 /* Print type declaration. */
2482 dump_generic_node (buffer
, TREE_TYPE (t
), spc
, flags
, false);
2484 /* Print variable's name. */
2486 dump_generic_node (buffer
, t
, spc
, flags
, false);
2489 if (TREE_CODE (t
) == VAR_DECL
&& DECL_HARD_REGISTER (t
))
2491 pp_string (buffer
, " __asm__ ");
2492 pp_left_paren (buffer
);
2493 dump_generic_node (buffer
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
2494 pp_right_paren (buffer
);
2497 /* The initial value of a function serves to determine whether the function
2498 is declared or defined. So the following does not apply to function
2500 if (TREE_CODE (t
) != FUNCTION_DECL
)
2502 /* Print the initial value. */
2503 if (DECL_INITIAL (t
))
2508 dump_generic_node (buffer
, DECL_INITIAL (t
), spc
, flags
, false);
2512 if (TREE_CODE (t
) == VAR_DECL
&& DECL_HAS_VALUE_EXPR_P (t
))
2514 pp_string (buffer
, " [value-expr: ");
2515 dump_generic_node (buffer
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
2516 pp_right_bracket (buffer
);
2519 pp_semicolon (buffer
);
2523 /* Prints a structure: name, fields, and methods.
2524 FIXME: Still incomplete. */
2527 print_struct_decl (pretty_printer
*buffer
, const_tree node
, int spc
, int flags
)
2529 /* Print the name of the structure. */
2530 if (TYPE_NAME (node
))
2533 if (TREE_CODE (node
) == RECORD_TYPE
)
2534 pp_string (buffer
, "struct ");
2535 else if ((TREE_CODE (node
) == UNION_TYPE
2536 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
2537 pp_string (buffer
, "union ");
2539 dump_generic_node (buffer
, TYPE_NAME (node
), spc
, 0, false);
2542 /* Print the contents of the structure. */
2543 pp_newline (buffer
);
2545 pp_left_brace (buffer
);
2546 pp_newline (buffer
);
2548 /* Print the fields of the structure. */
2551 tmp
= TYPE_FIELDS (node
);
2554 /* Avoid to print recursively the structure. */
2555 /* FIXME : Not implemented correctly...,
2556 what about the case when we have a cycle in the contain graph? ...
2557 Maybe this could be solved by looking at the scope in which the
2558 structure was declared. */
2559 if (TREE_TYPE (tmp
) != node
2560 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
2561 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
2563 print_declaration (buffer
, tmp
, spc
+2, flags
);
2564 pp_newline (buffer
);
2566 tmp
= DECL_CHAIN (tmp
);
2570 pp_right_brace (buffer
);
2573 /* Return the priority of the operator CODE.
2575 From lowest to highest precedence with either left-to-right (L-R)
2576 or right-to-left (R-L) associativity]:
2579 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
2591 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
2592 15 [L-R] fn() [] -> .
2594 unary +, - and * have higher precedence than the corresponding binary
2598 op_code_prio (enum tree_code code
)
2615 case TRUTH_ORIF_EXPR
:
2618 case TRUTH_AND_EXPR
:
2619 case TRUTH_ANDIF_EXPR
:
2626 case TRUTH_XOR_EXPR
:
2643 case UNORDERED_EXPR
:
2654 case VEC_WIDEN_LSHIFT_HI_EXPR
:
2655 case VEC_WIDEN_LSHIFT_LO_EXPR
:
2656 case WIDEN_LSHIFT_EXPR
:
2659 case WIDEN_SUM_EXPR
:
2661 case POINTER_PLUS_EXPR
:
2665 case VEC_WIDEN_MULT_HI_EXPR
:
2666 case VEC_WIDEN_MULT_LO_EXPR
:
2667 case WIDEN_MULT_EXPR
:
2669 case WIDEN_MULT_PLUS_EXPR
:
2670 case WIDEN_MULT_MINUS_EXPR
:
2672 case MULT_HIGHPART_EXPR
:
2673 case TRUNC_DIV_EXPR
:
2675 case FLOOR_DIV_EXPR
:
2676 case ROUND_DIV_EXPR
:
2678 case EXACT_DIV_EXPR
:
2679 case TRUNC_MOD_EXPR
:
2681 case FLOOR_MOD_EXPR
:
2682 case ROUND_MOD_EXPR
:
2686 case TRUTH_NOT_EXPR
:
2688 case POSTINCREMENT_EXPR
:
2689 case POSTDECREMENT_EXPR
:
2690 case PREINCREMENT_EXPR
:
2691 case PREDECREMENT_EXPR
:
2697 case FIX_TRUNC_EXPR
:
2703 case ARRAY_RANGE_REF
:
2707 /* Special expressions. */
2713 case REDUC_MAX_EXPR
:
2714 case REDUC_MIN_EXPR
:
2715 case REDUC_PLUS_EXPR
:
2716 case VEC_LSHIFT_EXPR
:
2717 case VEC_RSHIFT_EXPR
:
2718 case VEC_UNPACK_HI_EXPR
:
2719 case VEC_UNPACK_LO_EXPR
:
2720 case VEC_UNPACK_FLOAT_HI_EXPR
:
2721 case VEC_UNPACK_FLOAT_LO_EXPR
:
2722 case VEC_PACK_TRUNC_EXPR
:
2723 case VEC_PACK_SAT_EXPR
:
2727 /* Return an arbitrarily high precedence to avoid surrounding single
2728 VAR_DECLs in ()s. */
2733 /* Return the priority of the operator OP. */
2736 op_prio (const_tree op
)
2738 enum tree_code code
;
2743 code
= TREE_CODE (op
);
2744 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
2745 return op_prio (TREE_OPERAND (op
, 0));
2747 return op_code_prio (code
);
2750 /* Return the symbol associated with operator CODE. */
2753 op_symbol_code (enum tree_code code
)
2761 case TRUTH_ORIF_EXPR
:
2764 case TRUTH_AND_EXPR
:
2765 case TRUTH_ANDIF_EXPR
:
2771 case TRUTH_XOR_EXPR
:
2781 case UNORDERED_EXPR
:
2827 case VEC_LSHIFT_EXPR
:
2830 case VEC_RSHIFT_EXPR
:
2833 case WIDEN_LSHIFT_EXPR
:
2836 case POINTER_PLUS_EXPR
:
2842 case REDUC_PLUS_EXPR
:
2845 case WIDEN_SUM_EXPR
:
2848 case WIDEN_MULT_EXPR
:
2851 case MULT_HIGHPART_EXPR
:
2861 case TRUTH_NOT_EXPR
:
2868 case TRUNC_DIV_EXPR
:
2875 case FLOOR_DIV_EXPR
:
2878 case ROUND_DIV_EXPR
:
2881 case EXACT_DIV_EXPR
:
2884 case TRUNC_MOD_EXPR
:
2890 case FLOOR_MOD_EXPR
:
2893 case ROUND_MOD_EXPR
:
2896 case PREDECREMENT_EXPR
:
2899 case PREINCREMENT_EXPR
:
2902 case POSTDECREMENT_EXPR
:
2905 case POSTINCREMENT_EXPR
:
2915 return "<<< ??? >>>";
2919 /* Return the symbol associated with operator OP. */
2922 op_symbol (const_tree op
)
2924 return op_symbol_code (TREE_CODE (op
));
2927 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
2928 the gimple_call_fn of a GIMPLE_CALL. */
2931 print_call_name (pretty_printer
*buffer
, tree node
, int flags
)
2935 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
2936 op0
= TREE_OPERAND (op0
, 0);
2939 switch (TREE_CODE (op0
))
2944 dump_function_name (buffer
, op0
, flags
);
2950 op0
= TREE_OPERAND (op0
, 0);
2954 pp_left_paren (buffer
);
2955 dump_generic_node (buffer
, TREE_OPERAND (op0
, 0), 0, flags
, false);
2956 pp_string (buffer
, ") ? ");
2957 dump_generic_node (buffer
, TREE_OPERAND (op0
, 1), 0, flags
, false);
2958 pp_string (buffer
, " : ");
2959 dump_generic_node (buffer
, TREE_OPERAND (op0
, 2), 0, flags
, false);
2963 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
2964 dump_function_name (buffer
, TREE_OPERAND (op0
, 0), flags
);
2966 dump_generic_node (buffer
, op0
, 0, flags
, false);
2970 if (integer_zerop (TREE_OPERAND (op0
, 1)))
2972 op0
= TREE_OPERAND (op0
, 0);
2979 dump_generic_node (buffer
, op0
, 0, flags
, false);
2987 /* Parses the string STR and replaces new-lines by '\n', tabs by '\t', ... */
2990 pretty_print_string (pretty_printer
*buffer
, const char *str
)
3000 pp_string (buffer
, "\\b");
3004 pp_string (buffer
, "\\f");
3008 pp_string (buffer
, "\\n");
3012 pp_string (buffer
, "\\r");
3016 pp_string (buffer
, "\\t");
3020 pp_string (buffer
, "\\v");
3024 pp_string (buffer
, "\\\\");
3028 pp_string (buffer
, "\\\"");
3032 pp_string (buffer
, "\\'");
3035 /* No need to handle \0; the loop terminates on \0. */
3038 pp_string (buffer
, "\\1");
3042 pp_string (buffer
, "\\2");
3046 pp_string (buffer
, "\\3");
3050 pp_string (buffer
, "\\4");
3054 pp_string (buffer
, "\\5");
3058 pp_string (buffer
, "\\6");
3062 pp_string (buffer
, "\\7");
3066 pp_character (buffer
, str
[0]);
3074 maybe_init_pretty_print (FILE *file
)
3078 new (&buffer
) pretty_printer ();
3079 pp_needs_newline (&buffer
) = true;
3080 pp_translate_identifiers (&buffer
) = false;
3084 buffer
.buffer
->stream
= file
;
3088 newline_and_indent (pretty_printer
*buffer
, int spc
)
3090 pp_newline (buffer
);
3094 /* Handle a %K format for TEXT. Separate from default_tree_printer so
3095 it can also be used in front ends.
3096 %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded.
3100 percent_K_format (text_info
*text
)
3102 tree t
= va_arg (*text
->args_ptr
, tree
), block
;
3103 gcc_assert (text
->locus
!= NULL
);
3104 *text
->locus
= EXPR_LOCATION (t
);
3105 gcc_assert (pp_ti_abstract_origin (text
) != NULL
);
3106 block
= TREE_BLOCK (t
);
3107 *pp_ti_abstract_origin (text
) = NULL
;
3109 && TREE_CODE (block
) == BLOCK
3110 && BLOCK_ABSTRACT_ORIGIN (block
))
3112 tree ao
= BLOCK_ABSTRACT_ORIGIN (block
);
3114 while (TREE_CODE (ao
) == BLOCK
3115 && BLOCK_ABSTRACT_ORIGIN (ao
)
3116 && BLOCK_ABSTRACT_ORIGIN (ao
) != ao
)
3117 ao
= BLOCK_ABSTRACT_ORIGIN (ao
);
3119 if (TREE_CODE (ao
) == FUNCTION_DECL
)
3121 *pp_ti_abstract_origin (text
) = block
;
3124 block
= BLOCK_SUPERCONTEXT (block
);
3128 /* Print the identifier ID to PRETTY-PRINTER. */
3131 pp_tree_identifier (pretty_printer
*pp
, tree id
)
3133 if (pp_translate_identifiers (pp
))
3135 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
3136 pp_append_text (pp
, text
, text
+ strlen (text
));
3139 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
3140 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
3143 /* A helper function that is used to dump function information before the
3147 dump_function_header (FILE *dump_file
, tree fdecl
, int flags
)
3149 const char *dname
, *aname
;
3150 struct cgraph_node
*node
= cgraph_get_node (fdecl
);
3151 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
3153 dname
= lang_hooks
.decl_printable_name (fdecl
, 2);
3155 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
3156 aname
= (IDENTIFIER_POINTER
3157 (DECL_ASSEMBLER_NAME (fdecl
)));
3159 aname
= "<unset-asm-name>";
3161 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
3162 dname
, aname
, fun
->funcdef_no
);
3163 if (!(flags
& TDF_NOUID
))
3164 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
3167 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->symbol
.order
,
3168 node
->frequency
== NODE_FREQUENCY_HOT
3170 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
3171 ? " (unlikely executed)"
3172 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
3173 ? " (executed once)"
3177 fprintf (dump_file
, ")\n\n");
3180 /* Dump double_int D to pretty_printer PP. UNS is true
3181 if D is unsigned and false otherwise. */
3183 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
3186 pp_wide_integer (pp
, d
.low
);
3187 else if (d
.fits_uhwi ())
3188 pp_unsigned_wide_integer (pp
, d
.low
);
3191 unsigned HOST_WIDE_INT low
= d
.low
;
3192 HOST_WIDE_INT high
= d
.high
;
3193 if (!uns
&& d
.is_negative ())
3196 high
= ~high
+ !low
;
3199 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
3201 sprintf (pp_buffer (pp
)->digit_buffer
,
3202 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
3203 (unsigned HOST_WIDE_INT
) high
, low
);
3204 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);