compiler: only build thunk struct type when it is needed
[official-gcc.git] / gcc / tree-pretty-print.cc
blobe7a8c9481a6463b7016441b66ea68e6e604052f0
1 /* Pretty formatting of GENERIC trees in C syntax.
2 Copyright (C) 2001-2022 Free Software Foundation, Inc.
3 Adapted from c-pretty-print.cc 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
10 version.
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
15 for more details.
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/>. */
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "backend.h"
25 #include "rtl.h"
26 #include "tree.h"
27 #include "predict.h"
28 #include "cgraph.h"
29 #include "tree-pretty-print.h"
30 #include "stor-layout.h"
31 #include "langhooks.h"
32 #include "tree-iterator.h"
33 #include "dumpfile.h"
34 #include "internal-fn.h"
35 #include "gomp-constants.h"
36 #include "gimple.h"
37 #include "fold-const.h"
39 /* Routines in this file get invoked via the default tree printer
40 used by diagnostics and thus they are called from pp_printf which
41 isn't reentrant. Avoid using pp_printf in this file. */
42 #pragma GCC poison pp_printf
44 /* Disable warnings about quoting issues in the pp_xxx calls below
45 that (intentionally) don't follow GCC diagnostic conventions. */
46 #if __GNUC__ >= 10
47 # pragma GCC diagnostic push
48 # pragma GCC diagnostic ignored "-Wformat-diag"
49 #endif
51 /* Local functions, macros and variables. */
52 static const char *op_symbol (const_tree);
53 static void newline_and_indent (pretty_printer *, int);
54 static void maybe_init_pretty_print (FILE *);
55 static void print_struct_decl (pretty_printer *, const_tree, int, dump_flags_t);
56 static void do_niy (pretty_printer *, const_tree, int, dump_flags_t);
58 #define INDENT(SPACE) do { \
59 int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
61 #define NIY do_niy (pp, node, spc, flags)
63 static pretty_printer *tree_pp;
65 /* Try to print something for an unknown tree code. */
67 static void
68 do_niy (pretty_printer *pp, const_tree node, int spc, dump_flags_t flags)
70 int i, len;
72 pp_string (pp, "<<< Unknown tree: ");
73 pp_string (pp, get_tree_code_name (TREE_CODE (node)));
75 if (EXPR_P (node))
77 len = TREE_OPERAND_LENGTH (node);
78 for (i = 0; i < len; ++i)
80 newline_and_indent (pp, spc+2);
81 dump_generic_node (pp, TREE_OPERAND (node, i), spc+2, flags, false);
85 pp_string (pp, " >>>");
88 /* Debugging function to print out a generic expression. */
90 DEBUG_FUNCTION void
91 debug_generic_expr (tree t)
93 print_generic_expr (stderr, t, TDF_VOPS|TDF_MEMSYMS);
94 fprintf (stderr, "\n");
97 /* Debugging function to print out a generic statement. */
99 DEBUG_FUNCTION void
100 debug_generic_stmt (tree t)
102 print_generic_stmt (stderr, t, TDF_VOPS|TDF_MEMSYMS);
103 fprintf (stderr, "\n");
106 /* Debugging function to print out a chain of trees . */
108 DEBUG_FUNCTION void
109 debug_tree_chain (tree t)
111 hash_set<tree> seen;
113 while (t)
115 print_generic_expr (stderr, t, TDF_VOPS|TDF_MEMSYMS|TDF_UID);
116 fprintf (stderr, " ");
117 t = TREE_CHAIN (t);
118 if (seen.add (t))
120 fprintf (stderr, "... [cycled back to ");
121 print_generic_expr (stderr, t, TDF_VOPS|TDF_MEMSYMS|TDF_UID);
122 fprintf (stderr, "]");
123 break;
126 fprintf (stderr, "\n");
129 /* Prints declaration DECL to the FILE with details specified by FLAGS. */
130 void
131 print_generic_decl (FILE *file, tree decl, dump_flags_t flags)
133 maybe_init_pretty_print (file);
134 print_declaration (tree_pp, decl, 2, flags);
135 pp_write_text_to_stream (tree_pp);
138 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
139 to show in the dump. See TDF_* in dumpfile.h. */
141 void
142 print_generic_stmt (FILE *file, tree t, dump_flags_t flags)
144 maybe_init_pretty_print (file);
145 dump_generic_node (tree_pp, t, 0, flags, true);
146 pp_newline_and_flush (tree_pp);
149 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
150 to show in the dump. See TDF_* in dumpfile.h. The output is indented by
151 INDENT spaces. */
153 void
154 print_generic_stmt_indented (FILE *file, tree t, dump_flags_t flags, int indent)
156 int i;
158 maybe_init_pretty_print (file);
160 for (i = 0; i < indent; i++)
161 pp_space (tree_pp);
162 dump_generic_node (tree_pp, t, indent, flags, true);
163 pp_newline_and_flush (tree_pp);
166 /* Print a single expression T on file FILE. FLAGS specifies details to show
167 in the dump. See TDF_* in dumpfile.h. */
169 void
170 print_generic_expr (FILE *file, tree t, dump_flags_t flags)
172 maybe_init_pretty_print (file);
173 dump_generic_node (tree_pp, t, 0, flags, false);
174 pp_flush (tree_pp);
177 /* Print a single expression T to string, and return it. The caller
178 must free the returned memory. */
180 char *
181 print_generic_expr_to_str (tree t)
183 pretty_printer pp;
184 dump_generic_node (&pp, t, 0, TDF_VOPS|TDF_MEMSYMS, false);
185 return xstrdup (pp_formatted_text (&pp));
188 /* Dump NAME, an IDENTIFIER_POINTER, sanitized so that D<num> sequences
189 in it are replaced with Dxxxx, as long as they are at the start or
190 preceded by $ and at the end or followed by $. See make_fancy_name
191 in tree-sra.cc. */
193 static void
194 dump_fancy_name (pretty_printer *pp, tree name)
196 int cnt = 0;
197 int length = IDENTIFIER_LENGTH (name);
198 const char *n = IDENTIFIER_POINTER (name);
201 n = strchr (n, 'D');
202 if (n == NULL)
203 break;
204 if (ISDIGIT (n[1])
205 && (n == IDENTIFIER_POINTER (name) || n[-1] == '$'))
207 int l = 2;
208 while (ISDIGIT (n[l]))
209 l++;
210 if (n[l] == '\0' || n[l] == '$')
212 cnt++;
213 length += 5 - l;
215 n += l;
217 else
218 n++;
220 while (1);
221 if (cnt == 0)
223 pp_tree_identifier (pp, name);
224 return;
227 char *str = XNEWVEC (char, length + 1);
228 char *p = str;
229 const char *q;
230 q = n = IDENTIFIER_POINTER (name);
233 q = strchr (q, 'D');
234 if (q == NULL)
235 break;
236 if (ISDIGIT (q[1])
237 && (q == IDENTIFIER_POINTER (name) || q[-1] == '$'))
239 int l = 2;
240 while (ISDIGIT (q[l]))
241 l++;
242 if (q[l] == '\0' || q[l] == '$')
244 memcpy (p, n, q - n);
245 memcpy (p + (q - n), "Dxxxx", 5);
246 p += (q - n) + 5;
247 n = q + l;
249 q += l;
251 else
252 q++;
254 while (1);
255 memcpy (p, n, IDENTIFIER_LENGTH (name) - (n - IDENTIFIER_POINTER (name)));
256 str[length] = '\0';
257 if (pp_translate_identifiers (pp))
259 const char *text = identifier_to_locale (str);
260 pp_append_text (pp, text, text + strlen (text));
262 else
263 pp_append_text (pp, str, str + length);
264 XDELETEVEC (str);
267 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
268 in FLAGS. */
270 static void
271 dump_decl_name (pretty_printer *pp, tree node, dump_flags_t flags)
273 tree name = DECL_NAME (node);
274 if (name)
276 if ((flags & TDF_ASMNAME)
277 && HAS_DECL_ASSEMBLER_NAME_P (node)
278 && DECL_ASSEMBLER_NAME_SET_P (node))
279 pp_tree_identifier (pp, DECL_ASSEMBLER_NAME_RAW (node));
280 /* For -fcompare-debug don't dump DECL_NAMELESS names at all,
281 -g might have created more fancy names and their indexes
282 could get out of sync. Usually those should be DECL_IGNORED_P
283 too, SRA can create even non-DECL_IGNORED_P DECL_NAMELESS fancy
284 names, let's hope those never get out of sync after doing the
285 dump_fancy_name sanitization. */
286 else if ((flags & TDF_COMPARE_DEBUG)
287 && DECL_NAMELESS (node)
288 && DECL_IGNORED_P (node))
289 name = NULL_TREE;
290 /* For DECL_NAMELESS names look for embedded uids in the
291 names and sanitize them for TDF_NOUID. */
292 else if ((flags & TDF_NOUID) && DECL_NAMELESS (node))
293 dump_fancy_name (pp, name);
294 else
295 pp_tree_identifier (pp, name);
297 char uid_sep = (flags & TDF_GIMPLE) ? '_' : '.';
298 if ((flags & TDF_UID) || name == NULL_TREE)
300 if (TREE_CODE (node) == LABEL_DECL && LABEL_DECL_UID (node) != -1)
302 pp_character (pp, 'L');
303 pp_character (pp, uid_sep);
304 pp_decimal_int (pp, (int) LABEL_DECL_UID (node));
306 else if (TREE_CODE (node) == DEBUG_EXPR_DECL)
308 if (flags & TDF_NOUID)
309 pp_string (pp, "D#xxxx");
310 else
312 pp_string (pp, "D#");
313 pp_decimal_int (pp, (int) DEBUG_TEMP_UID (node));
316 else
318 char c = TREE_CODE (node) == CONST_DECL ? 'C' : 'D';
319 pp_character (pp, c);
320 pp_character (pp, uid_sep);
321 if (flags & TDF_NOUID)
322 pp_string (pp, "xxxx");
323 else
324 pp_scalar (pp, "%u", DECL_UID (node));
327 if ((flags & TDF_ALIAS) && DECL_PT_UID (node) != DECL_UID (node))
329 if (flags & TDF_NOUID)
330 pp_string (pp, "ptD.xxxx");
331 else
333 pp_string (pp, "ptD.");
334 pp_scalar (pp, "%u", DECL_PT_UID (node));
339 /* Like the above, but used for pretty printing function calls. */
341 static void
342 dump_function_name (pretty_printer *pp, tree node, dump_flags_t flags)
344 if (CONVERT_EXPR_P (node))
345 node = TREE_OPERAND (node, 0);
346 if (DECL_NAME (node) && (flags & TDF_ASMNAME) == 0)
348 pp_string (pp, lang_hooks.decl_printable_name (node, 1));
349 if (flags & TDF_UID)
351 char uid_sep = (flags & TDF_GIMPLE) ? '_' : '.';
352 pp_character (pp, 'D');
353 pp_character (pp, uid_sep);
354 pp_scalar (pp, "%u", DECL_UID (node));
357 else
358 dump_decl_name (pp, node, flags);
361 /* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and
362 FLAGS are as in dump_generic_node. */
364 static void
365 dump_function_declaration (pretty_printer *pp, tree node,
366 int spc, dump_flags_t flags)
368 bool wrote_arg = false;
369 tree arg;
371 pp_space (pp);
372 pp_left_paren (pp);
374 /* Print the argument types. */
375 arg = TYPE_ARG_TYPES (node);
376 while (arg && arg != void_list_node && arg != error_mark_node)
378 if (wrote_arg)
380 pp_comma (pp);
381 pp_space (pp);
383 wrote_arg = true;
384 dump_generic_node (pp, TREE_VALUE (arg), spc, flags, false);
385 arg = TREE_CHAIN (arg);
388 /* Drop the trailing void_type_node if we had any previous argument. */
389 if (arg == void_list_node && !wrote_arg)
390 pp_string (pp, "void");
391 /* Properly dump vararg function types. */
392 else if (!arg && wrote_arg)
393 pp_string (pp, ", ...");
394 /* Avoid printing any arg for unprototyped functions. */
396 pp_right_paren (pp);
399 /* Dump the domain associated with an array. */
401 static void
402 dump_array_domain (pretty_printer *pp, tree domain, int spc, dump_flags_t flags)
404 pp_left_bracket (pp);
405 if (domain)
407 tree min = TYPE_MIN_VALUE (domain);
408 tree max = TYPE_MAX_VALUE (domain);
410 if (min && max
411 && integer_zerop (min)
412 && tree_fits_shwi_p (max))
413 pp_wide_integer (pp, tree_to_shwi (max) + 1);
414 else
416 if (min)
417 dump_generic_node (pp, min, spc, flags, false);
418 pp_colon (pp);
419 if (max)
420 dump_generic_node (pp, max, spc, flags, false);
423 else
424 pp_string (pp, "<unknown>");
425 pp_right_bracket (pp);
429 /* Dump OpenMP iterators ITER. */
431 static void
432 dump_omp_iterators (pretty_printer *pp, tree iter, int spc, dump_flags_t flags)
434 pp_string (pp, "iterator(");
435 for (tree it = iter; it; it = TREE_CHAIN (it))
437 if (it != iter)
438 pp_string (pp, ", ");
439 dump_generic_node (pp, TREE_TYPE (TREE_VEC_ELT (it, 0)), spc, flags,
440 false);
441 pp_space (pp);
442 dump_generic_node (pp, TREE_VEC_ELT (it, 0), spc, flags, false);
443 pp_equal (pp);
444 dump_generic_node (pp, TREE_VEC_ELT (it, 1), spc, flags, false);
445 pp_colon (pp);
446 dump_generic_node (pp, TREE_VEC_ELT (it, 2), spc, flags, false);
447 pp_colon (pp);
448 dump_generic_node (pp, TREE_VEC_ELT (it, 3), spc, flags, false);
450 pp_right_paren (pp);
454 /* Dump OMP clause CLAUSE, without following OMP_CLAUSE_CHAIN.
456 PP, CLAUSE, SPC and FLAGS are as in dump_generic_node. */
458 static void
459 dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
461 const char *name;
462 const char *modifier = NULL;
463 switch (OMP_CLAUSE_CODE (clause))
465 case OMP_CLAUSE_PRIVATE:
466 name = "private";
467 goto print_remap;
468 case OMP_CLAUSE_SHARED:
469 name = "shared";
470 goto print_remap;
471 case OMP_CLAUSE_FIRSTPRIVATE:
472 name = "firstprivate";
473 goto print_remap;
474 case OMP_CLAUSE_LASTPRIVATE:
475 name = "lastprivate";
476 if (OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (clause))
477 modifier = "conditional:";
478 goto print_remap;
479 case OMP_CLAUSE_COPYIN:
480 name = "copyin";
481 goto print_remap;
482 case OMP_CLAUSE_COPYPRIVATE:
483 name = "copyprivate";
484 goto print_remap;
485 case OMP_CLAUSE_UNIFORM:
486 name = "uniform";
487 goto print_remap;
488 case OMP_CLAUSE_USE_DEVICE_PTR:
489 name = "use_device_ptr";
490 if (OMP_CLAUSE_USE_DEVICE_PTR_IF_PRESENT (clause))
491 modifier = "if_present:";
492 goto print_remap;
493 case OMP_CLAUSE_USE_DEVICE_ADDR:
494 name = "use_device_addr";
495 goto print_remap;
496 case OMP_CLAUSE_HAS_DEVICE_ADDR:
497 name = "has_device_addr";
498 goto print_remap;
499 case OMP_CLAUSE_IS_DEVICE_PTR:
500 name = "is_device_ptr";
501 goto print_remap;
502 case OMP_CLAUSE_INCLUSIVE:
503 name = "inclusive";
504 goto print_remap;
505 case OMP_CLAUSE_EXCLUSIVE:
506 name = "exclusive";
507 goto print_remap;
508 case OMP_CLAUSE__LOOPTEMP_:
509 name = "_looptemp_";
510 goto print_remap;
511 case OMP_CLAUSE__REDUCTEMP_:
512 name = "_reductemp_";
513 goto print_remap;
514 case OMP_CLAUSE__CONDTEMP_:
515 name = "_condtemp_";
516 goto print_remap;
517 case OMP_CLAUSE__SCANTEMP_:
518 name = "_scantemp_";
519 goto print_remap;
520 case OMP_CLAUSE_ENTER:
521 if (OMP_CLAUSE_ENTER_TO (clause))
522 name = "to";
523 else
524 name = "enter";
525 goto print_remap;
526 case OMP_CLAUSE_LINK:
527 name = "link";
528 goto print_remap;
529 case OMP_CLAUSE_NONTEMPORAL:
530 name = "nontemporal";
531 goto print_remap;
532 print_remap:
533 pp_string (pp, name);
534 pp_left_paren (pp);
535 if (modifier)
536 pp_string (pp, modifier);
537 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
538 spc, flags, false);
539 pp_right_paren (pp);
540 break;
542 case OMP_CLAUSE_TASK_REDUCTION:
543 case OMP_CLAUSE_IN_REDUCTION:
544 pp_string (pp, OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_IN_REDUCTION
545 ? "in_" : "task_");
546 /* FALLTHRU */
547 case OMP_CLAUSE_REDUCTION:
548 pp_string (pp, "reduction(");
549 if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_REDUCTION)
551 if (OMP_CLAUSE_REDUCTION_TASK (clause))
552 pp_string (pp, "task,");
553 else if (OMP_CLAUSE_REDUCTION_INSCAN (clause))
554 pp_string (pp, "inscan,");
556 if (OMP_CLAUSE_REDUCTION_CODE (clause) != ERROR_MARK)
558 pp_string (pp,
559 op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause)));
560 pp_colon (pp);
562 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
563 spc, flags, false);
564 pp_right_paren (pp);
565 break;
567 case OMP_CLAUSE_IF:
568 pp_string (pp, "if(");
569 switch (OMP_CLAUSE_IF_MODIFIER (clause))
571 case ERROR_MARK: break;
572 case VOID_CST: pp_string (pp, "cancel:"); break;
573 case OMP_PARALLEL: pp_string (pp, "parallel:"); break;
574 case OMP_SIMD: pp_string (pp, "simd:"); break;
575 case OMP_TASK: pp_string (pp, "task:"); break;
576 case OMP_TASKLOOP: pp_string (pp, "taskloop:"); break;
577 case OMP_TARGET_DATA: pp_string (pp, "target data:"); break;
578 case OMP_TARGET: pp_string (pp, "target:"); break;
579 case OMP_TARGET_UPDATE: pp_string (pp, "target update:"); break;
580 case OMP_TARGET_ENTER_DATA:
581 pp_string (pp, "target enter data:"); break;
582 case OMP_TARGET_EXIT_DATA: pp_string (pp, "target exit data:"); break;
583 default: gcc_unreachable ();
585 dump_generic_node (pp, OMP_CLAUSE_IF_EXPR (clause),
586 spc, flags, false);
587 pp_right_paren (pp);
588 break;
590 case OMP_CLAUSE_NUM_THREADS:
591 pp_string (pp, "num_threads(");
592 dump_generic_node (pp, OMP_CLAUSE_NUM_THREADS_EXPR (clause),
593 spc, flags, false);
594 pp_right_paren (pp);
595 break;
597 case OMP_CLAUSE_NOWAIT:
598 pp_string (pp, "nowait");
599 break;
600 case OMP_CLAUSE_ORDERED:
601 pp_string (pp, "ordered");
602 if (OMP_CLAUSE_ORDERED_EXPR (clause))
604 pp_left_paren (pp);
605 dump_generic_node (pp, OMP_CLAUSE_ORDERED_EXPR (clause),
606 spc, flags, false);
607 pp_right_paren (pp);
609 break;
611 case OMP_CLAUSE_DEFAULT:
612 pp_string (pp, "default(");
613 switch (OMP_CLAUSE_DEFAULT_KIND (clause))
615 case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
616 break;
617 case OMP_CLAUSE_DEFAULT_SHARED:
618 pp_string (pp, "shared");
619 break;
620 case OMP_CLAUSE_DEFAULT_NONE:
621 pp_string (pp, "none");
622 break;
623 case OMP_CLAUSE_DEFAULT_PRIVATE:
624 pp_string (pp, "private");
625 break;
626 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE:
627 pp_string (pp, "firstprivate");
628 break;
629 case OMP_CLAUSE_DEFAULT_PRESENT:
630 pp_string (pp, "present");
631 break;
632 default:
633 gcc_unreachable ();
635 pp_right_paren (pp);
636 break;
638 case OMP_CLAUSE_SCHEDULE:
639 pp_string (pp, "schedule(");
640 if (OMP_CLAUSE_SCHEDULE_KIND (clause)
641 & (OMP_CLAUSE_SCHEDULE_MONOTONIC
642 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC))
644 if (OMP_CLAUSE_SCHEDULE_KIND (clause)
645 & OMP_CLAUSE_SCHEDULE_MONOTONIC)
646 pp_string (pp, "monotonic");
647 else
648 pp_string (pp, "nonmonotonic");
649 if (OMP_CLAUSE_SCHEDULE_SIMD (clause))
650 pp_comma (pp);
651 else
652 pp_colon (pp);
654 if (OMP_CLAUSE_SCHEDULE_SIMD (clause))
655 pp_string (pp, "simd:");
657 switch (OMP_CLAUSE_SCHEDULE_KIND (clause) & OMP_CLAUSE_SCHEDULE_MASK)
659 case OMP_CLAUSE_SCHEDULE_STATIC:
660 pp_string (pp, "static");
661 break;
662 case OMP_CLAUSE_SCHEDULE_DYNAMIC:
663 pp_string (pp, "dynamic");
664 break;
665 case OMP_CLAUSE_SCHEDULE_GUIDED:
666 pp_string (pp, "guided");
667 break;
668 case OMP_CLAUSE_SCHEDULE_RUNTIME:
669 pp_string (pp, "runtime");
670 break;
671 case OMP_CLAUSE_SCHEDULE_AUTO:
672 pp_string (pp, "auto");
673 break;
674 default:
675 gcc_unreachable ();
677 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause))
679 pp_comma (pp);
680 dump_generic_node (pp, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause),
681 spc, flags, false);
683 pp_right_paren (pp);
684 break;
686 case OMP_CLAUSE_UNTIED:
687 pp_string (pp, "untied");
688 break;
690 case OMP_CLAUSE_COLLAPSE:
691 pp_string (pp, "collapse(");
692 dump_generic_node (pp, OMP_CLAUSE_COLLAPSE_EXPR (clause),
693 spc, flags, false);
694 pp_right_paren (pp);
695 break;
697 case OMP_CLAUSE_FINAL:
698 pp_string (pp, "final(");
699 dump_generic_node (pp, OMP_CLAUSE_FINAL_EXPR (clause),
700 spc, flags, false);
701 pp_right_paren (pp);
702 break;
704 case OMP_CLAUSE_MERGEABLE:
705 pp_string (pp, "mergeable");
706 break;
708 case OMP_CLAUSE_LINEAR:
709 pp_string (pp, "linear(");
710 if (OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause))
711 switch (OMP_CLAUSE_LINEAR_KIND (clause))
713 case OMP_CLAUSE_LINEAR_DEFAULT:
714 break;
715 case OMP_CLAUSE_LINEAR_REF:
716 pp_string (pp, "ref(");
717 break;
718 case OMP_CLAUSE_LINEAR_VAL:
719 pp_string (pp, "val(");
720 break;
721 case OMP_CLAUSE_LINEAR_UVAL:
722 pp_string (pp, "uval(");
723 break;
724 default:
725 gcc_unreachable ();
727 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
728 spc, flags, false);
729 if (OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause)
730 && OMP_CLAUSE_LINEAR_KIND (clause) != OMP_CLAUSE_LINEAR_DEFAULT)
731 pp_right_paren (pp);
732 pp_colon (pp);
733 if (!OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause)
734 && OMP_CLAUSE_LINEAR_KIND (clause) != OMP_CLAUSE_LINEAR_DEFAULT)
735 switch (OMP_CLAUSE_LINEAR_KIND (clause))
737 case OMP_CLAUSE_LINEAR_REF:
738 pp_string (pp, "ref,step(");
739 break;
740 case OMP_CLAUSE_LINEAR_VAL:
741 pp_string (pp, "val,step(");
742 break;
743 case OMP_CLAUSE_LINEAR_UVAL:
744 pp_string (pp, "uval,step(");
745 break;
746 default:
747 gcc_unreachable ();
749 dump_generic_node (pp, OMP_CLAUSE_LINEAR_STEP (clause),
750 spc, flags, false);
751 if (!OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause)
752 && OMP_CLAUSE_LINEAR_KIND (clause) != OMP_CLAUSE_LINEAR_DEFAULT)
753 pp_right_paren (pp);
754 pp_right_paren (pp);
755 break;
757 case OMP_CLAUSE_ALIGNED:
758 pp_string (pp, "aligned(");
759 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
760 spc, flags, false);
761 if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause))
763 pp_colon (pp);
764 dump_generic_node (pp, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause),
765 spc, flags, false);
767 pp_right_paren (pp);
768 break;
770 case OMP_CLAUSE_ALLOCATE:
771 pp_string (pp, "allocate(");
772 if (OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause))
774 pp_string (pp, "allocator(");
775 dump_generic_node (pp, OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause),
776 spc, flags, false);
777 pp_right_paren (pp);
779 if (OMP_CLAUSE_ALLOCATE_ALIGN (clause))
781 if (OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause))
782 pp_comma (pp);
783 pp_string (pp, "align(");
784 dump_generic_node (pp, OMP_CLAUSE_ALLOCATE_ALIGN (clause),
785 spc, flags, false);
786 pp_right_paren (pp);
788 if (OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause)
789 || OMP_CLAUSE_ALLOCATE_ALIGN (clause))
790 pp_colon (pp);
791 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
792 spc, flags, false);
793 pp_right_paren (pp);
794 break;
796 case OMP_CLAUSE_AFFINITY:
797 pp_string (pp, "affinity(");
799 tree t = OMP_CLAUSE_DECL (clause);
800 if (TREE_CODE (t) == TREE_LIST
801 && TREE_PURPOSE (t)
802 && TREE_CODE (TREE_PURPOSE (t)) == TREE_VEC)
804 dump_omp_iterators (pp, TREE_PURPOSE (t), spc, flags);
805 pp_colon (pp);
806 t = TREE_VALUE (t);
808 dump_generic_node (pp, t, spc, flags, false);
810 pp_right_paren (pp);
811 break;
812 case OMP_CLAUSE_DEPEND:
813 pp_string (pp, "depend(");
814 switch (OMP_CLAUSE_DEPEND_KIND (clause))
816 case OMP_CLAUSE_DEPEND_DEPOBJ:
817 name = "depobj";
818 break;
819 case OMP_CLAUSE_DEPEND_IN:
820 name = "in";
821 break;
822 case OMP_CLAUSE_DEPEND_OUT:
823 name = "out";
824 break;
825 case OMP_CLAUSE_DEPEND_INOUT:
826 name = "inout";
827 break;
828 case OMP_CLAUSE_DEPEND_MUTEXINOUTSET:
829 name = "mutexinoutset";
830 break;
831 case OMP_CLAUSE_DEPEND_INOUTSET:
832 name = "inoutset";
833 break;
834 case OMP_CLAUSE_DEPEND_LAST:
835 name = "__internal__";
836 break;
837 default:
838 gcc_unreachable ();
841 tree t = OMP_CLAUSE_DECL (clause);
842 if (TREE_CODE (t) == TREE_LIST
843 && TREE_PURPOSE (t)
844 && TREE_CODE (TREE_PURPOSE (t)) == TREE_VEC)
846 dump_omp_iterators (pp, TREE_PURPOSE (t), spc, flags);
847 pp_colon (pp);
848 t = TREE_VALUE (t);
850 if (name[0])
852 pp_string (pp, name);
853 pp_colon (pp);
855 if (t == null_pointer_node)
856 pp_string (pp, "omp_all_memory");
857 else
858 dump_generic_node (pp, t, spc, flags, false);
859 pp_right_paren (pp);
861 break;
863 case OMP_CLAUSE_DOACROSS:
864 pp_string (pp, OMP_CLAUSE_DOACROSS_DEPEND (clause)
865 ? "depend(" : "doacross(");
866 switch (OMP_CLAUSE_DOACROSS_KIND (clause))
868 case OMP_CLAUSE_DOACROSS_SOURCE:
869 if (OMP_CLAUSE_DOACROSS_DEPEND (clause))
870 pp_string (pp, "source)");
871 else
872 pp_string (pp, "source:)");
873 break;
874 case OMP_CLAUSE_DOACROSS_SINK:
875 pp_string (pp, "sink:");
876 if (OMP_CLAUSE_DECL (clause) == NULL_TREE)
878 pp_string (pp, "omp_cur_iteration-1)");
879 break;
881 for (tree t = OMP_CLAUSE_DECL (clause); t; t = TREE_CHAIN (t))
882 if (TREE_CODE (t) == TREE_LIST)
884 dump_generic_node (pp, TREE_VALUE (t), spc, flags, false);
885 if (TREE_PURPOSE (t) != integer_zero_node)
887 if (OMP_CLAUSE_DOACROSS_SINK_NEGATIVE (t))
888 pp_minus (pp);
889 else
890 pp_plus (pp);
891 dump_generic_node (pp, TREE_PURPOSE (t), spc, flags,
892 false);
894 if (TREE_CHAIN (t))
895 pp_comma (pp);
897 else
898 gcc_unreachable ();
899 pp_right_paren (pp);
900 break;
901 default:
902 gcc_unreachable ();
904 break;
906 case OMP_CLAUSE_MAP:
907 pp_string (pp, "map(");
908 switch (OMP_CLAUSE_MAP_KIND (clause))
910 case GOMP_MAP_ALLOC:
911 case GOMP_MAP_POINTER:
912 case GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION:
913 pp_string (pp, "alloc");
914 break;
915 case GOMP_MAP_IF_PRESENT:
916 pp_string (pp, "no_alloc");
917 break;
918 case GOMP_MAP_TO:
919 case GOMP_MAP_TO_PSET:
920 pp_string (pp, "to");
921 break;
922 case GOMP_MAP_FROM:
923 pp_string (pp, "from");
924 break;
925 case GOMP_MAP_TOFROM:
926 pp_string (pp, "tofrom");
927 break;
928 case GOMP_MAP_FORCE_ALLOC:
929 pp_string (pp, "force_alloc");
930 break;
931 case GOMP_MAP_FORCE_TO:
932 pp_string (pp, "force_to");
933 break;
934 case GOMP_MAP_FORCE_FROM:
935 pp_string (pp, "force_from");
936 break;
937 case GOMP_MAP_FORCE_TOFROM:
938 pp_string (pp, "force_tofrom");
939 break;
940 case GOMP_MAP_FORCE_PRESENT:
941 pp_string (pp, "force_present");
942 break;
943 case GOMP_MAP_DELETE:
944 pp_string (pp, "delete");
945 break;
946 case GOMP_MAP_FORCE_DEVICEPTR:
947 pp_string (pp, "force_deviceptr");
948 break;
949 case GOMP_MAP_ALWAYS_TO:
950 pp_string (pp, "always,to");
951 break;
952 case GOMP_MAP_ALWAYS_FROM:
953 pp_string (pp, "always,from");
954 break;
955 case GOMP_MAP_ALWAYS_TOFROM:
956 pp_string (pp, "always,tofrom");
957 break;
958 case GOMP_MAP_RELEASE:
959 pp_string (pp, "release");
960 break;
961 case GOMP_MAP_FIRSTPRIVATE_POINTER:
962 pp_string (pp, "firstprivate");
963 break;
964 case GOMP_MAP_FIRSTPRIVATE_REFERENCE:
965 pp_string (pp, "firstprivate ref");
966 break;
967 case GOMP_MAP_STRUCT:
968 pp_string (pp, "struct");
969 break;
970 case GOMP_MAP_ALWAYS_POINTER:
971 pp_string (pp, "always_pointer");
972 break;
973 case GOMP_MAP_DEVICE_RESIDENT:
974 pp_string (pp, "device_resident");
975 break;
976 case GOMP_MAP_LINK:
977 pp_string (pp, "link");
978 break;
979 case GOMP_MAP_ATTACH:
980 pp_string (pp, "attach");
981 break;
982 case GOMP_MAP_DETACH:
983 pp_string (pp, "detach");
984 break;
985 case GOMP_MAP_FORCE_DETACH:
986 pp_string (pp, "force_detach");
987 break;
988 case GOMP_MAP_ATTACH_DETACH:
989 pp_string (pp, "attach_detach");
990 break;
991 case GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION:
992 pp_string (pp, "attach_zero_length_array_section");
993 break;
994 default:
995 gcc_unreachable ();
997 pp_colon (pp);
998 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
999 spc, flags, false);
1000 print_clause_size:
1001 if (OMP_CLAUSE_SIZE (clause))
1003 switch (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP
1004 ? OMP_CLAUSE_MAP_KIND (clause) : GOMP_MAP_TO)
1006 case GOMP_MAP_POINTER:
1007 case GOMP_MAP_FIRSTPRIVATE_POINTER:
1008 case GOMP_MAP_FIRSTPRIVATE_REFERENCE:
1009 case GOMP_MAP_ALWAYS_POINTER:
1010 pp_string (pp, " [pointer assign, bias: ");
1011 break;
1012 case GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION:
1013 pp_string (pp, " [pointer assign, zero-length array section, bias: ");
1014 break;
1015 case GOMP_MAP_TO_PSET:
1016 pp_string (pp, " [pointer set, len: ");
1017 break;
1018 case GOMP_MAP_ATTACH:
1019 case GOMP_MAP_DETACH:
1020 case GOMP_MAP_FORCE_DETACH:
1021 case GOMP_MAP_ATTACH_DETACH:
1022 case GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION:
1023 pp_string (pp, " [bias: ");
1024 break;
1025 default:
1026 pp_string (pp, " [len: ");
1027 break;
1029 dump_generic_node (pp, OMP_CLAUSE_SIZE (clause),
1030 spc, flags, false);
1031 pp_right_bracket (pp);
1033 if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP
1034 && OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P (clause))
1035 pp_string (pp, "[implicit]");
1036 pp_right_paren (pp);
1037 break;
1039 case OMP_CLAUSE_FROM:
1040 pp_string (pp, "from(");
1041 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
1042 spc, flags, false);
1043 goto print_clause_size;
1045 case OMP_CLAUSE_TO:
1046 pp_string (pp, "to(");
1047 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
1048 spc, flags, false);
1049 goto print_clause_size;
1051 case OMP_CLAUSE__CACHE_:
1052 pp_string (pp, "(");
1053 dump_generic_node (pp, OMP_CLAUSE_DECL (clause),
1054 spc, flags, false);
1055 goto print_clause_size;
1057 case OMP_CLAUSE_NUM_TEAMS:
1058 pp_string (pp, "num_teams(");
1059 if (OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR (clause))
1061 dump_generic_node (pp, OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR (clause),
1062 spc, flags, false);
1063 pp_colon (pp);
1065 dump_generic_node (pp, OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR (clause),
1066 spc, flags, false);
1067 pp_right_paren (pp);
1068 break;
1070 case OMP_CLAUSE_THREAD_LIMIT:
1071 pp_string (pp, "thread_limit(");
1072 dump_generic_node (pp, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause),
1073 spc, flags, false);
1074 pp_right_paren (pp);
1075 break;
1077 case OMP_CLAUSE_DEVICE:
1078 pp_string (pp, "device(");
1079 if (OMP_CLAUSE_DEVICE_ANCESTOR (clause))
1080 pp_string (pp, "ancestor:");
1081 dump_generic_node (pp, OMP_CLAUSE_DEVICE_ID (clause),
1082 spc, flags, false);
1083 pp_right_paren (pp);
1084 break;
1086 case OMP_CLAUSE_DIST_SCHEDULE:
1087 pp_string (pp, "dist_schedule(static");
1088 if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause))
1090 pp_comma (pp);
1091 dump_generic_node (pp,
1092 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause),
1093 spc, flags, false);
1095 pp_right_paren (pp);
1096 break;
1098 case OMP_CLAUSE_PROC_BIND:
1099 pp_string (pp, "proc_bind(");
1100 switch (OMP_CLAUSE_PROC_BIND_KIND (clause))
1102 case OMP_CLAUSE_PROC_BIND_MASTER:
1103 /* Same enum value: case OMP_CLAUSE_PROC_BIND_PRIMARY: */
1104 /* TODO: Change to 'primary' for OpenMP 5.1. */
1105 pp_string (pp, "master");
1106 break;
1107 case OMP_CLAUSE_PROC_BIND_CLOSE:
1108 pp_string (pp, "close");
1109 break;
1110 case OMP_CLAUSE_PROC_BIND_SPREAD:
1111 pp_string (pp, "spread");
1112 break;
1113 default:
1114 gcc_unreachable ();
1116 pp_right_paren (pp);
1117 break;
1119 case OMP_CLAUSE_DEVICE_TYPE:
1120 pp_string (pp, "device_type(");
1121 switch (OMP_CLAUSE_DEVICE_TYPE_KIND (clause))
1123 case OMP_CLAUSE_DEVICE_TYPE_HOST:
1124 pp_string (pp, "host");
1125 break;
1126 case OMP_CLAUSE_DEVICE_TYPE_NOHOST:
1127 pp_string (pp, "nohost");
1128 break;
1129 case OMP_CLAUSE_DEVICE_TYPE_ANY:
1130 pp_string (pp, "any");
1131 break;
1132 default:
1133 gcc_unreachable ();
1135 pp_right_paren (pp);
1136 break;
1138 case OMP_CLAUSE_SAFELEN:
1139 pp_string (pp, "safelen(");
1140 dump_generic_node (pp, OMP_CLAUSE_SAFELEN_EXPR (clause),
1141 spc, flags, false);
1142 pp_right_paren (pp);
1143 break;
1145 case OMP_CLAUSE_SIMDLEN:
1146 pp_string (pp, "simdlen(");
1147 dump_generic_node (pp, OMP_CLAUSE_SIMDLEN_EXPR (clause),
1148 spc, flags, false);
1149 pp_right_paren (pp);
1150 break;
1152 case OMP_CLAUSE_PRIORITY:
1153 pp_string (pp, "priority(");
1154 dump_generic_node (pp, OMP_CLAUSE_PRIORITY_EXPR (clause),
1155 spc, flags, false);
1156 pp_right_paren (pp);
1157 break;
1159 case OMP_CLAUSE_GRAINSIZE:
1160 pp_string (pp, "grainsize(");
1161 if (OMP_CLAUSE_GRAINSIZE_STRICT (clause))
1162 pp_string (pp, "strict:");
1163 dump_generic_node (pp, OMP_CLAUSE_GRAINSIZE_EXPR (clause),
1164 spc, flags, false);
1165 pp_right_paren (pp);
1166 break;
1168 case OMP_CLAUSE_NUM_TASKS:
1169 pp_string (pp, "num_tasks(");
1170 if (OMP_CLAUSE_NUM_TASKS_STRICT (clause))
1171 pp_string (pp, "strict:");
1172 dump_generic_node (pp, OMP_CLAUSE_NUM_TASKS_EXPR (clause),
1173 spc, flags, false);
1174 pp_right_paren (pp);
1175 break;
1177 case OMP_CLAUSE_HINT:
1178 pp_string (pp, "hint(");
1179 dump_generic_node (pp, OMP_CLAUSE_HINT_EXPR (clause),
1180 spc, flags, false);
1181 pp_right_paren (pp);
1182 break;
1184 case OMP_CLAUSE_FILTER:
1185 pp_string (pp, "filter(");
1186 dump_generic_node (pp, OMP_CLAUSE_FILTER_EXPR (clause),
1187 spc, flags, false);
1188 pp_right_paren (pp);
1189 break;
1191 case OMP_CLAUSE_DEFAULTMAP:
1192 pp_string (pp, "defaultmap(");
1193 switch (OMP_CLAUSE_DEFAULTMAP_BEHAVIOR (clause))
1195 case OMP_CLAUSE_DEFAULTMAP_ALLOC:
1196 pp_string (pp, "alloc");
1197 break;
1198 case OMP_CLAUSE_DEFAULTMAP_TO:
1199 pp_string (pp, "to");
1200 break;
1201 case OMP_CLAUSE_DEFAULTMAP_FROM:
1202 pp_string (pp, "from");
1203 break;
1204 case OMP_CLAUSE_DEFAULTMAP_TOFROM:
1205 pp_string (pp, "tofrom");
1206 break;
1207 case OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE:
1208 pp_string (pp, "firstprivate");
1209 break;
1210 case OMP_CLAUSE_DEFAULTMAP_NONE:
1211 pp_string (pp, "none");
1212 break;
1213 case OMP_CLAUSE_DEFAULTMAP_DEFAULT:
1214 pp_string (pp, "default");
1215 break;
1216 default:
1217 gcc_unreachable ();
1219 switch (OMP_CLAUSE_DEFAULTMAP_CATEGORY (clause))
1221 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED:
1222 break;
1223 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR:
1224 pp_string (pp, ":scalar");
1225 break;
1226 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_AGGREGATE:
1227 pp_string (pp, ":aggregate");
1228 break;
1229 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALLOCATABLE:
1230 pp_string (pp, ":allocatable");
1231 break;
1232 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_POINTER:
1233 pp_string (pp, ":pointer");
1234 break;
1235 default:
1236 gcc_unreachable ();
1238 pp_right_paren (pp);
1239 break;
1241 case OMP_CLAUSE_ORDER:
1242 pp_string (pp, "order(");
1243 if (OMP_CLAUSE_ORDER_UNCONSTRAINED (clause))
1244 pp_string (pp, "unconstrained:");
1245 else if (OMP_CLAUSE_ORDER_REPRODUCIBLE (clause))
1246 pp_string (pp, "reproducible:");
1247 pp_string (pp, "concurrent)");
1248 break;
1250 case OMP_CLAUSE_BIND:
1251 pp_string (pp, "bind(");
1252 switch (OMP_CLAUSE_BIND_KIND (clause))
1254 case OMP_CLAUSE_BIND_TEAMS:
1255 pp_string (pp, "teams");
1256 break;
1257 case OMP_CLAUSE_BIND_PARALLEL:
1258 pp_string (pp, "parallel");
1259 break;
1260 case OMP_CLAUSE_BIND_THREAD:
1261 pp_string (pp, "thread");
1262 break;
1263 default:
1264 gcc_unreachable ();
1266 pp_right_paren (pp);
1267 break;
1269 case OMP_CLAUSE__SIMDUID_:
1270 pp_string (pp, "_simduid_(");
1271 dump_generic_node (pp, OMP_CLAUSE__SIMDUID__DECL (clause),
1272 spc, flags, false);
1273 pp_right_paren (pp);
1274 break;
1276 case OMP_CLAUSE__SIMT_:
1277 pp_string (pp, "_simt_");
1278 break;
1280 case OMP_CLAUSE_GANG:
1281 pp_string (pp, "gang");
1282 if (OMP_CLAUSE_GANG_EXPR (clause) != NULL_TREE)
1284 pp_string (pp, "(num: ");
1285 dump_generic_node (pp, OMP_CLAUSE_GANG_EXPR (clause),
1286 spc, flags, false);
1288 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause) != NULL_TREE)
1290 if (OMP_CLAUSE_GANG_EXPR (clause) == NULL_TREE)
1291 pp_left_paren (pp);
1292 else
1293 pp_space (pp);
1294 pp_string (pp, "static:");
1295 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause)
1296 == integer_minus_one_node)
1297 pp_character (pp, '*');
1298 else
1299 dump_generic_node (pp, OMP_CLAUSE_GANG_STATIC_EXPR (clause),
1300 spc, flags, false);
1302 if (OMP_CLAUSE_GANG_EXPR (clause) != NULL_TREE
1303 || OMP_CLAUSE_GANG_STATIC_EXPR (clause) != NULL_TREE)
1304 pp_right_paren (pp);
1305 break;
1307 case OMP_CLAUSE_ASYNC:
1308 pp_string (pp, "async");
1309 if (OMP_CLAUSE_ASYNC_EXPR (clause))
1311 pp_character(pp, '(');
1312 dump_generic_node (pp, OMP_CLAUSE_ASYNC_EXPR (clause),
1313 spc, flags, false);
1314 pp_character(pp, ')');
1316 break;
1318 case OMP_CLAUSE_AUTO:
1319 case OMP_CLAUSE_SEQ:
1320 pp_string (pp, omp_clause_code_name[OMP_CLAUSE_CODE (clause)]);
1321 break;
1323 case OMP_CLAUSE_WAIT:
1324 pp_string (pp, "wait(");
1325 dump_generic_node (pp, OMP_CLAUSE_WAIT_EXPR (clause),
1326 spc, flags, false);
1327 pp_character(pp, ')');
1328 break;
1330 case OMP_CLAUSE_WORKER:
1331 pp_string (pp, "worker");
1332 if (OMP_CLAUSE_WORKER_EXPR (clause) != NULL_TREE)
1334 pp_left_paren (pp);
1335 dump_generic_node (pp, OMP_CLAUSE_WORKER_EXPR (clause),
1336 spc, flags, false);
1337 pp_right_paren (pp);
1339 break;
1341 case OMP_CLAUSE_VECTOR:
1342 pp_string (pp, "vector");
1343 if (OMP_CLAUSE_VECTOR_EXPR (clause) != NULL_TREE)
1345 pp_left_paren (pp);
1346 dump_generic_node (pp, OMP_CLAUSE_VECTOR_EXPR (clause),
1347 spc, flags, false);
1348 pp_right_paren (pp);
1350 break;
1352 case OMP_CLAUSE_NUM_GANGS:
1353 pp_string (pp, "num_gangs(");
1354 dump_generic_node (pp, OMP_CLAUSE_NUM_GANGS_EXPR (clause),
1355 spc, flags, false);
1356 pp_character (pp, ')');
1357 break;
1359 case OMP_CLAUSE_NUM_WORKERS:
1360 pp_string (pp, "num_workers(");
1361 dump_generic_node (pp, OMP_CLAUSE_NUM_WORKERS_EXPR (clause),
1362 spc, flags, false);
1363 pp_character (pp, ')');
1364 break;
1366 case OMP_CLAUSE_VECTOR_LENGTH:
1367 pp_string (pp, "vector_length(");
1368 dump_generic_node (pp, OMP_CLAUSE_VECTOR_LENGTH_EXPR (clause),
1369 spc, flags, false);
1370 pp_character (pp, ')');
1371 break;
1373 case OMP_CLAUSE_INBRANCH:
1374 pp_string (pp, "inbranch");
1375 break;
1376 case OMP_CLAUSE_NOTINBRANCH:
1377 pp_string (pp, "notinbranch");
1378 break;
1379 case OMP_CLAUSE_FOR:
1380 pp_string (pp, "for");
1381 break;
1382 case OMP_CLAUSE_PARALLEL:
1383 pp_string (pp, "parallel");
1384 break;
1385 case OMP_CLAUSE_SECTIONS:
1386 pp_string (pp, "sections");
1387 break;
1388 case OMP_CLAUSE_TASKGROUP:
1389 pp_string (pp, "taskgroup");
1390 break;
1391 case OMP_CLAUSE_NOGROUP:
1392 pp_string (pp, "nogroup");
1393 break;
1394 case OMP_CLAUSE_THREADS:
1395 pp_string (pp, "threads");
1396 break;
1397 case OMP_CLAUSE_SIMD:
1398 pp_string (pp, "simd");
1399 break;
1400 case OMP_CLAUSE_INDEPENDENT:
1401 pp_string (pp, "independent");
1402 break;
1403 case OMP_CLAUSE_TILE:
1404 pp_string (pp, "tile(");
1405 dump_generic_node (pp, OMP_CLAUSE_TILE_LIST (clause),
1406 spc, flags, false);
1407 pp_right_paren (pp);
1408 break;
1410 case OMP_CLAUSE_IF_PRESENT:
1411 pp_string (pp, "if_present");
1412 break;
1413 case OMP_CLAUSE_FINALIZE:
1414 pp_string (pp, "finalize");
1415 break;
1416 case OMP_CLAUSE_NOHOST:
1417 pp_string (pp, "nohost");
1418 break;
1419 case OMP_CLAUSE_DETACH:
1420 pp_string (pp, "detach(");
1421 dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags,
1422 false);
1423 pp_right_paren (pp);
1424 break;
1426 default:
1427 gcc_unreachable ();
1432 /* Dump chain of OMP clauses.
1434 PP, SPC and FLAGS are as in dump_generic_node. */
1436 void
1437 dump_omp_clauses (pretty_printer *pp, tree clause, int spc, dump_flags_t flags,
1438 bool leading_space)
1440 while (clause)
1442 if (leading_space)
1443 pp_space (pp);
1444 dump_omp_clause (pp, clause, spc, flags);
1445 leading_space = true;
1447 clause = OMP_CLAUSE_CHAIN (clause);
1452 /* Dump location LOC to PP. */
1454 void
1455 dump_location (pretty_printer *pp, location_t loc)
1457 expanded_location xloc = expand_location (loc);
1458 int discriminator = get_discriminator_from_loc (loc);
1460 pp_left_bracket (pp);
1461 if (xloc.file)
1463 pp_string (pp, xloc.file);
1464 pp_string (pp, ":");
1466 pp_decimal_int (pp, xloc.line);
1467 pp_colon (pp);
1468 pp_decimal_int (pp, xloc.column);
1469 if (discriminator)
1471 pp_string (pp, " discrim ");
1472 pp_decimal_int (pp, discriminator);
1474 pp_string (pp, "] ");
1478 /* Dump lexical block BLOCK. PP, SPC and FLAGS are as in
1479 dump_generic_node. */
1481 static void
1482 dump_block_node (pretty_printer *pp, tree block, int spc, dump_flags_t flags)
1484 tree t;
1486 pp_string (pp, "BLOCK #");
1487 pp_decimal_int (pp, BLOCK_NUMBER (block));
1488 pp_character (pp, ' ');
1490 if (flags & TDF_ADDRESS)
1492 pp_character (pp, '[');
1493 pp_scalar (pp, "%p", (void *) block);
1494 pp_string (pp, "] ");
1497 if (TREE_ASM_WRITTEN (block))
1498 pp_string (pp, "[written] ");
1500 if (flags & TDF_SLIM)
1501 return;
1503 if (BLOCK_SOURCE_LOCATION (block))
1504 dump_location (pp, BLOCK_SOURCE_LOCATION (block));
1506 newline_and_indent (pp, spc + 2);
1508 if (BLOCK_SUPERCONTEXT (block))
1510 pp_string (pp, "SUPERCONTEXT: ");
1511 dump_generic_node (pp, BLOCK_SUPERCONTEXT (block), 0,
1512 flags | TDF_SLIM, false);
1513 newline_and_indent (pp, spc + 2);
1516 if (BLOCK_SUBBLOCKS (block))
1518 pp_string (pp, "SUBBLOCKS: ");
1519 for (t = BLOCK_SUBBLOCKS (block); t; t = BLOCK_CHAIN (t))
1521 dump_generic_node (pp, t, 0, flags | TDF_SLIM, false);
1522 pp_space (pp);
1524 newline_and_indent (pp, spc + 2);
1527 if (BLOCK_CHAIN (block))
1529 pp_string (pp, "SIBLINGS: ");
1530 for (t = BLOCK_CHAIN (block); t; t = BLOCK_CHAIN (t))
1532 dump_generic_node (pp, t, 0, flags | TDF_SLIM, false);
1533 pp_space (pp);
1535 newline_and_indent (pp, spc + 2);
1538 if (BLOCK_VARS (block))
1540 pp_string (pp, "VARS: ");
1541 for (t = BLOCK_VARS (block); t; t = TREE_CHAIN (t))
1543 dump_generic_node (pp, t, 0, flags, false);
1544 pp_space (pp);
1546 newline_and_indent (pp, spc + 2);
1549 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block)) > 0)
1551 unsigned i;
1552 vec<tree, va_gc> *nlv = BLOCK_NONLOCALIZED_VARS (block);
1554 pp_string (pp, "NONLOCALIZED_VARS: ");
1555 FOR_EACH_VEC_ELT (*nlv, i, t)
1557 dump_generic_node (pp, t, 0, flags, false);
1558 pp_space (pp);
1560 newline_and_indent (pp, spc + 2);
1563 if (BLOCK_ABSTRACT_ORIGIN (block))
1565 pp_string (pp, "ABSTRACT_ORIGIN: ");
1566 dump_generic_node (pp, BLOCK_ABSTRACT_ORIGIN (block), 0,
1567 flags | TDF_SLIM, false);
1568 newline_and_indent (pp, spc + 2);
1571 if (BLOCK_FRAGMENT_ORIGIN (block))
1573 pp_string (pp, "FRAGMENT_ORIGIN: ");
1574 dump_generic_node (pp, BLOCK_FRAGMENT_ORIGIN (block), 0,
1575 flags | TDF_SLIM, false);
1576 newline_and_indent (pp, spc + 2);
1579 if (BLOCK_FRAGMENT_CHAIN (block))
1581 pp_string (pp, "FRAGMENT_CHAIN: ");
1582 for (t = BLOCK_FRAGMENT_CHAIN (block); t; t = BLOCK_FRAGMENT_CHAIN (t))
1584 dump_generic_node (pp, t, 0, flags | TDF_SLIM, false);
1585 pp_space (pp);
1587 newline_and_indent (pp, spc + 2);
1591 /* Dump #pragma omp atomic memory order clause. */
1593 void
1594 dump_omp_atomic_memory_order (pretty_printer *pp, enum omp_memory_order mo)
1596 switch (mo & OMP_MEMORY_ORDER_MASK)
1598 case OMP_MEMORY_ORDER_RELAXED:
1599 pp_string (pp, " relaxed");
1600 break;
1601 case OMP_MEMORY_ORDER_SEQ_CST:
1602 pp_string (pp, " seq_cst");
1603 break;
1604 case OMP_MEMORY_ORDER_ACQ_REL:
1605 pp_string (pp, " acq_rel");
1606 break;
1607 case OMP_MEMORY_ORDER_ACQUIRE:
1608 pp_string (pp, " acquire");
1609 break;
1610 case OMP_MEMORY_ORDER_RELEASE:
1611 pp_string (pp, " release");
1612 break;
1613 case OMP_MEMORY_ORDER_UNSPECIFIED:
1614 break;
1615 default:
1616 gcc_unreachable ();
1618 switch (mo & OMP_FAIL_MEMORY_ORDER_MASK)
1620 case OMP_FAIL_MEMORY_ORDER_RELAXED:
1621 pp_string (pp, " fail(relaxed)");
1622 break;
1623 case OMP_FAIL_MEMORY_ORDER_SEQ_CST:
1624 pp_string (pp, " fail(seq_cst)");
1625 break;
1626 case OMP_FAIL_MEMORY_ORDER_ACQUIRE:
1627 pp_string (pp, " fail(acquire)");
1628 break;
1629 case OMP_FAIL_MEMORY_ORDER_UNSPECIFIED:
1630 break;
1631 default:
1632 gcc_unreachable ();
1636 /* Helper to dump a MEM_REF node. */
1638 static void
1639 dump_mem_ref (pretty_printer *pp, tree node, int spc, dump_flags_t flags)
1641 if (TREE_CODE (node) == MEM_REF && (flags & TDF_GIMPLE))
1643 pp_string (pp, "__MEM <");
1644 dump_generic_node (pp, TREE_TYPE (node),
1645 spc, flags | TDF_SLIM, false);
1646 if (TYPE_ALIGN (TREE_TYPE (node))
1647 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node))))
1649 pp_string (pp, ", ");
1650 pp_decimal_int (pp, TYPE_ALIGN (TREE_TYPE (node)));
1652 pp_greater (pp);
1653 pp_string (pp, " (");
1654 if (TREE_TYPE (TREE_OPERAND (node, 0))
1655 != TREE_TYPE (TREE_OPERAND (node, 1)))
1657 pp_left_paren (pp);
1658 dump_generic_node (pp, TREE_TYPE (TREE_OPERAND (node, 1)),
1659 spc, flags | TDF_SLIM, false);
1660 pp_right_paren (pp);
1662 dump_generic_node (pp, TREE_OPERAND (node, 0),
1663 spc, flags | TDF_SLIM, false);
1664 if (! integer_zerop (TREE_OPERAND (node, 1)))
1666 pp_string (pp, " + ");
1667 dump_generic_node (pp, TREE_OPERAND (node, 1),
1668 spc, flags | TDF_SLIM, false);
1670 pp_right_paren (pp);
1672 else if (TREE_CODE (node) == MEM_REF
1673 && integer_zerop (TREE_OPERAND (node, 1))
1674 /* Dump the types of INTEGER_CSTs explicitly, for we can't
1675 infer them and MEM_ATTR caching will share MEM_REFs
1676 with differently-typed op0s. */
1677 && TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST
1678 /* Released SSA_NAMES have no TREE_TYPE. */
1679 && TREE_TYPE (TREE_OPERAND (node, 0)) != NULL_TREE
1680 /* Same pointer types, but ignoring POINTER_TYPE vs.
1681 REFERENCE_TYPE. */
1682 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0)))
1683 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1))))
1684 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 0)))
1685 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 1))))
1686 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 0)))
1687 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 1))))
1688 /* Same value types ignoring qualifiers. */
1689 && (TYPE_MAIN_VARIANT (TREE_TYPE (node))
1690 == TYPE_MAIN_VARIANT
1691 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1)))))
1692 && (!(flags & TDF_ALIAS)
1693 || MR_DEPENDENCE_CLIQUE (node) == 0))
1695 if (TREE_CODE (TREE_OPERAND (node, 0)) != ADDR_EXPR)
1697 /* Enclose pointers to arrays in parentheses. */
1698 tree op0 = TREE_OPERAND (node, 0);
1699 tree op0type = TREE_TYPE (op0);
1700 if (POINTER_TYPE_P (op0type)
1701 && TREE_CODE (TREE_TYPE (op0type)) == ARRAY_TYPE)
1702 pp_left_paren (pp);
1703 pp_star (pp);
1704 dump_generic_node (pp, op0, spc, flags, false);
1705 if (POINTER_TYPE_P (op0type)
1706 && TREE_CODE (TREE_TYPE (op0type)) == ARRAY_TYPE)
1707 pp_right_paren (pp);
1709 else
1710 dump_generic_node (pp,
1711 TREE_OPERAND (TREE_OPERAND (node, 0), 0),
1712 spc, flags, false);
1714 else
1716 pp_string (pp, "MEM");
1718 tree nodetype = TREE_TYPE (node);
1719 tree op0 = TREE_OPERAND (node, 0);
1720 tree op1 = TREE_OPERAND (node, 1);
1721 tree op1type = TYPE_MAIN_VARIANT (TREE_TYPE (op1));
1723 tree op0size = TYPE_SIZE (nodetype);
1724 tree op1size = TYPE_SIZE (TREE_TYPE (op1type));
1726 if (!op0size || !op1size
1727 || !operand_equal_p (op0size, op1size, 0))
1729 pp_string (pp, " <");
1730 /* If the size of the type of the operand is not the same
1731 as the size of the MEM_REF expression include the type
1732 of the latter similar to the TDF_GIMPLE output to make
1733 it clear how many bytes of memory are being accessed. */
1734 dump_generic_node (pp, nodetype, spc, flags | TDF_SLIM, false);
1735 pp_string (pp, "> ");
1738 pp_string (pp, "[(");
1739 dump_generic_node (pp, op1type, spc, flags | TDF_SLIM, false);
1740 pp_right_paren (pp);
1741 dump_generic_node (pp, op0, spc, flags, false);
1742 if (!integer_zerop (op1))
1744 pp_string (pp, " + ");
1745 dump_generic_node (pp, op1, spc, flags, false);
1747 if (TREE_CODE (node) == TARGET_MEM_REF)
1749 tree tmp = TMR_INDEX2 (node);
1750 if (tmp)
1752 pp_string (pp, " + ");
1753 dump_generic_node (pp, tmp, spc, flags, false);
1755 tmp = TMR_INDEX (node);
1756 if (tmp)
1758 pp_string (pp, " + ");
1759 dump_generic_node (pp, tmp, spc, flags, false);
1760 tmp = TMR_STEP (node);
1761 pp_string (pp, " * ");
1762 if (tmp)
1763 dump_generic_node (pp, tmp, spc, flags, false);
1764 else
1765 pp_string (pp, "1");
1768 if ((flags & TDF_ALIAS)
1769 && MR_DEPENDENCE_CLIQUE (node) != 0)
1771 pp_string (pp, " clique ");
1772 pp_unsigned_wide_integer (pp, MR_DEPENDENCE_CLIQUE (node));
1773 pp_string (pp, " base ");
1774 pp_unsigned_wide_integer (pp, MR_DEPENDENCE_BASE (node));
1776 pp_right_bracket (pp);
1780 /* Helper function for dump_generic_node. Dump INIT or COND expression for
1781 OpenMP loop non-rectangular iterators. */
1783 void
1784 dump_omp_loop_non_rect_expr (pretty_printer *pp, tree node, int spc,
1785 dump_flags_t flags)
1787 gcc_assert (TREE_CODE (node) == TREE_VEC);
1788 dump_generic_node (pp, TREE_VEC_ELT (node, 0), spc, flags, false);
1789 pp_string (pp, " * ");
1790 if (op_prio (TREE_VEC_ELT (node, 1)) <= op_code_prio (MULT_EXPR))
1792 pp_left_paren (pp);
1793 dump_generic_node (pp, TREE_VEC_ELT (node, 1), spc, flags, false);
1794 pp_right_paren (pp);
1796 else
1797 dump_generic_node (pp, TREE_VEC_ELT (node, 1), spc, flags, false);
1798 pp_string (pp, " + ");
1799 if (op_prio (TREE_VEC_ELT (node, 1)) <= op_code_prio (PLUS_EXPR))
1801 pp_left_paren (pp);
1802 dump_generic_node (pp, TREE_VEC_ELT (node, 2), spc, flags, false);
1803 pp_right_paren (pp);
1805 else
1806 dump_generic_node (pp, TREE_VEC_ELT (node, 2), spc, flags, false);
1809 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
1810 indent. FLAGS specifies details to show in the dump (see TDF_* in
1811 dumpfile.h). If IS_STMT is true, the object printed is considered
1812 to be a statement and it is terminated by ';' if appropriate. */
1815 dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
1816 bool is_stmt)
1818 tree type;
1819 tree op0, op1;
1820 const char *str;
1821 bool is_expr;
1822 enum tree_code code;
1824 if (node == NULL_TREE)
1825 return spc;
1827 is_expr = EXPR_P (node);
1829 if (is_stmt && (flags & TDF_STMTADDR))
1831 pp_string (pp, "<&");
1832 pp_scalar (pp, "%p", (void *)node);
1833 pp_string (pp, "> ");
1836 if ((flags & TDF_LINENO) && EXPR_HAS_LOCATION (node))
1837 dump_location (pp, EXPR_LOCATION (node));
1839 code = TREE_CODE (node);
1840 switch (code)
1842 case ERROR_MARK:
1843 pp_string (pp, "<<< error >>>");
1844 break;
1846 case IDENTIFIER_NODE:
1847 pp_tree_identifier (pp, node);
1848 break;
1850 case TREE_LIST:
1851 while (node && node != error_mark_node)
1853 if (TREE_PURPOSE (node))
1855 dump_generic_node (pp, TREE_PURPOSE (node), spc, flags, false);
1856 pp_space (pp);
1858 dump_generic_node (pp, TREE_VALUE (node), spc, flags, false);
1859 node = TREE_CHAIN (node);
1860 if (node && TREE_CODE (node) == TREE_LIST)
1862 pp_comma (pp);
1863 pp_space (pp);
1866 break;
1868 case TREE_BINFO:
1869 dump_generic_node (pp, BINFO_TYPE (node), spc, flags, false);
1870 break;
1872 case TREE_VEC:
1874 size_t i;
1875 if (TREE_VEC_LENGTH (node) > 0)
1877 size_t len = TREE_VEC_LENGTH (node);
1878 for (i = 0; i < len - 1; i++)
1880 dump_generic_node (pp, TREE_VEC_ELT (node, i), spc, flags,
1881 false);
1882 pp_comma (pp);
1883 pp_space (pp);
1885 dump_generic_node (pp, TREE_VEC_ELT (node, len - 1), spc,
1886 flags, false);
1889 break;
1891 case VOID_TYPE:
1892 case INTEGER_TYPE:
1893 case REAL_TYPE:
1894 case FIXED_POINT_TYPE:
1895 case COMPLEX_TYPE:
1896 case VECTOR_TYPE:
1897 case ENUMERAL_TYPE:
1898 case BOOLEAN_TYPE:
1899 case OPAQUE_TYPE:
1901 unsigned int quals = TYPE_QUALS (node);
1902 enum tree_code_class tclass;
1904 if (quals & TYPE_QUAL_ATOMIC)
1905 pp_string (pp, "atomic ");
1906 if (quals & TYPE_QUAL_CONST)
1907 pp_string (pp, "const ");
1908 if (quals & TYPE_QUAL_VOLATILE)
1909 pp_string (pp, "volatile ");
1910 if (quals & TYPE_QUAL_RESTRICT)
1911 pp_string (pp, "restrict ");
1913 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node)))
1915 pp_string (pp, "<address-space-");
1916 pp_decimal_int (pp, TYPE_ADDR_SPACE (node));
1917 pp_string (pp, "> ");
1920 tclass = TREE_CODE_CLASS (TREE_CODE (node));
1922 if (tclass == tcc_declaration)
1924 if (DECL_NAME (node))
1925 dump_decl_name (pp, node, flags);
1926 else
1927 pp_string (pp, "<unnamed type decl>");
1929 else if (tclass == tcc_type)
1931 if (TYPE_NAME (node))
1933 if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
1934 pp_tree_identifier (pp, TYPE_NAME (node));
1935 else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
1936 && DECL_NAME (TYPE_NAME (node)))
1937 dump_decl_name (pp, TYPE_NAME (node), flags);
1938 else
1939 pp_string (pp, "<unnamed type>");
1941 else if (TREE_CODE (node) == VECTOR_TYPE)
1943 pp_string (pp, "vector");
1944 pp_left_paren (pp);
1945 pp_wide_integer (pp, TYPE_VECTOR_SUBPARTS (node));
1946 pp_string (pp, ") ");
1947 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
1949 else if (TREE_CODE (node) == INTEGER_TYPE)
1951 if (TYPE_PRECISION (node) == CHAR_TYPE_SIZE)
1952 pp_string (pp, (TYPE_UNSIGNED (node)
1953 ? "unsigned char"
1954 : "signed char"));
1955 else if (TYPE_PRECISION (node) == SHORT_TYPE_SIZE)
1956 pp_string (pp, (TYPE_UNSIGNED (node)
1957 ? "unsigned short"
1958 : "signed short"));
1959 else if (TYPE_PRECISION (node) == INT_TYPE_SIZE)
1960 pp_string (pp, (TYPE_UNSIGNED (node)
1961 ? "unsigned int"
1962 : "signed int"));
1963 else if (TYPE_PRECISION (node) == LONG_TYPE_SIZE)
1964 pp_string (pp, (TYPE_UNSIGNED (node)
1965 ? "unsigned long"
1966 : "signed long"));
1967 else if (TYPE_PRECISION (node) == LONG_LONG_TYPE_SIZE)
1968 pp_string (pp, (TYPE_UNSIGNED (node)
1969 ? "unsigned long long"
1970 : "signed long long"));
1971 else if (TYPE_PRECISION (node) >= CHAR_TYPE_SIZE
1972 && pow2p_hwi (TYPE_PRECISION (node)))
1974 pp_string (pp, (TYPE_UNSIGNED (node) ? "uint" : "int"));
1975 pp_decimal_int (pp, TYPE_PRECISION (node));
1976 pp_string (pp, "_t");
1978 else
1980 pp_string (pp, (TYPE_UNSIGNED (node)
1981 ? "<unnamed-unsigned:"
1982 : "<unnamed-signed:"));
1983 pp_decimal_int (pp, TYPE_PRECISION (node));
1984 pp_greater (pp);
1987 else if (TREE_CODE (node) == COMPLEX_TYPE)
1989 pp_string (pp, "__complex__ ");
1990 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
1992 else if (TREE_CODE (node) == REAL_TYPE)
1994 pp_string (pp, "<float:");
1995 pp_decimal_int (pp, TYPE_PRECISION (node));
1996 pp_greater (pp);
1998 else if (TREE_CODE (node) == FIXED_POINT_TYPE)
2000 pp_string (pp, "<fixed-point-");
2001 pp_string (pp, TYPE_SATURATING (node) ? "sat:" : "nonsat:");
2002 pp_decimal_int (pp, TYPE_PRECISION (node));
2003 pp_greater (pp);
2005 else if (TREE_CODE (node) == BOOLEAN_TYPE)
2007 pp_string (pp, (TYPE_UNSIGNED (node)
2008 ? "<unsigned-boolean:"
2009 : "<signed-boolean:"));
2010 pp_decimal_int (pp, TYPE_PRECISION (node));
2011 pp_greater (pp);
2013 else if (TREE_CODE (node) == VOID_TYPE)
2014 pp_string (pp, "void");
2015 else
2016 pp_string (pp, "<unnamed type>");
2018 break;
2021 case POINTER_TYPE:
2022 case REFERENCE_TYPE:
2023 str = (TREE_CODE (node) == POINTER_TYPE ? "*" : "&");
2025 if (TREE_TYPE (node) == NULL)
2027 pp_string (pp, str);
2028 pp_string (pp, "<null type>");
2030 else if (TREE_CODE (TREE_TYPE (node)) == FUNCTION_TYPE)
2032 tree fnode = TREE_TYPE (node);
2034 dump_generic_node (pp, TREE_TYPE (fnode), spc, flags, false);
2035 pp_space (pp);
2036 pp_left_paren (pp);
2037 pp_string (pp, str);
2038 if (TYPE_IDENTIFIER (node))
2039 dump_generic_node (pp, TYPE_NAME (node), spc, flags, false);
2040 else if (flags & TDF_NOUID)
2041 pp_string (pp, "<Txxxx>");
2042 else
2044 pp_string (pp, "<T");
2045 pp_scalar (pp, "%x", TYPE_UID (node));
2046 pp_character (pp, '>');
2049 pp_right_paren (pp);
2050 dump_function_declaration (pp, fnode, spc, flags);
2052 else
2054 unsigned int quals = TYPE_QUALS (node);
2056 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
2057 pp_space (pp);
2058 pp_string (pp, str);
2060 if (quals & TYPE_QUAL_CONST)
2061 pp_string (pp, " const");
2062 if (quals & TYPE_QUAL_VOLATILE)
2063 pp_string (pp, " volatile");
2064 if (quals & TYPE_QUAL_RESTRICT)
2065 pp_string (pp, " restrict");
2067 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node)))
2069 pp_string (pp, " <address-space-");
2070 pp_decimal_int (pp, TYPE_ADDR_SPACE (node));
2071 pp_greater (pp);
2074 if (TYPE_REF_CAN_ALIAS_ALL (node))
2075 pp_string (pp, " {ref-all}");
2077 break;
2079 case OFFSET_TYPE:
2080 NIY;
2081 break;
2083 case MEM_REF:
2084 case TARGET_MEM_REF:
2085 dump_mem_ref (pp, node, spc, flags);
2086 break;
2088 case ARRAY_TYPE:
2090 unsigned int quals = TYPE_QUALS (node);
2091 tree tmp;
2093 if (quals & TYPE_QUAL_ATOMIC)
2094 pp_string (pp, "atomic ");
2095 if (quals & TYPE_QUAL_CONST)
2096 pp_string (pp, "const ");
2097 if (quals & TYPE_QUAL_VOLATILE)
2098 pp_string (pp, "volatile ");
2100 /* Print the innermost component type. */
2101 for (tmp = TREE_TYPE (node); TREE_CODE (tmp) == ARRAY_TYPE;
2102 tmp = TREE_TYPE (tmp))
2105 /* Avoid to print recursively the array. */
2106 /* FIXME : Not implemented correctly, see print_struct_decl. */
2107 if (TREE_CODE (tmp) != POINTER_TYPE || TREE_TYPE (tmp) != node)
2108 dump_generic_node (pp, tmp, spc, flags, false);
2110 /* Print the dimensions. */
2111 for (tmp = node; TREE_CODE (tmp) == ARRAY_TYPE; tmp = TREE_TYPE (tmp))
2112 dump_array_domain (pp, TYPE_DOMAIN (tmp), spc, flags);
2113 break;
2116 case RECORD_TYPE:
2117 case UNION_TYPE:
2118 case QUAL_UNION_TYPE:
2120 unsigned int quals = TYPE_QUALS (node);
2122 if (quals & TYPE_QUAL_ATOMIC)
2123 pp_string (pp, "atomic ");
2124 if (quals & TYPE_QUAL_CONST)
2125 pp_string (pp, "const ");
2126 if (quals & TYPE_QUAL_VOLATILE)
2127 pp_string (pp, "volatile ");
2129 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node)))
2131 pp_string (pp, "<address-space-");
2132 pp_decimal_int (pp, TYPE_ADDR_SPACE (node));
2133 pp_string (pp, "> ");
2136 /* Print the name of the structure. */
2137 if (TREE_CODE (node) == RECORD_TYPE)
2138 pp_string (pp, "struct ");
2139 else if (TREE_CODE (node) == UNION_TYPE)
2140 pp_string (pp, "union ");
2142 if (TYPE_NAME (node))
2143 dump_generic_node (pp, TYPE_NAME (node), spc, flags, false);
2144 else if (!(flags & TDF_SLIM))
2145 /* FIXME: If we eliminate the 'else' above and attempt
2146 to show the fields for named types, we may get stuck
2147 following a cycle of pointers to structs. The alleged
2148 self-reference check in print_struct_decl will not detect
2149 cycles involving more than one pointer or struct type. */
2150 print_struct_decl (pp, node, spc, flags);
2151 break;
2154 case LANG_TYPE:
2155 NIY;
2156 break;
2158 case INTEGER_CST:
2159 if (flags & TDF_GIMPLE
2160 && (POINTER_TYPE_P (TREE_TYPE (node))
2161 || (TYPE_PRECISION (TREE_TYPE (node))
2162 < TYPE_PRECISION (integer_type_node))
2163 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node))) == -1
2164 || tree_int_cst_sgn (node) < 0))
2166 pp_string (pp, "_Literal (");
2167 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
2168 pp_string (pp, ") ");
2170 if (TREE_CODE (TREE_TYPE (node)) == POINTER_TYPE
2171 && ! (flags & TDF_GIMPLE))
2173 /* In the case of a pointer, one may want to divide by the
2174 size of the pointed-to type. Unfortunately, this not
2175 straightforward. The C front-end maps expressions
2177 (int *) 5
2178 int *p; (p + 5)
2180 in such a way that the two INTEGER_CST nodes for "5" have
2181 different values but identical types. In the latter
2182 case, the 5 is multiplied by sizeof (int) in c-common.cc
2183 (pointer_int_sum) to convert it to a byte address, and
2184 yet the type of the node is left unchanged. Argh. What
2185 is consistent though is that the number value corresponds
2186 to bytes (UNITS) offset.
2188 NB: Neither of the following divisors can be trivially
2189 used to recover the original literal:
2191 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
2192 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
2193 pp_wide_integer (pp, TREE_INT_CST_LOW (node));
2194 pp_string (pp, "B"); /* pseudo-unit */
2196 else if (tree_fits_shwi_p (node))
2197 pp_wide_integer (pp, tree_to_shwi (node));
2198 else if (tree_fits_uhwi_p (node))
2199 pp_unsigned_wide_integer (pp, tree_to_uhwi (node));
2200 else
2202 wide_int val = wi::to_wide (node);
2204 if (wi::neg_p (val, TYPE_SIGN (TREE_TYPE (node))))
2206 pp_minus (pp);
2207 val = -val;
2209 print_hex (val, pp_buffer (pp)->digit_buffer);
2210 pp_string (pp, pp_buffer (pp)->digit_buffer);
2212 if ((flags & TDF_GIMPLE)
2213 && ! (POINTER_TYPE_P (TREE_TYPE (node))
2214 || (TYPE_PRECISION (TREE_TYPE (node))
2215 < TYPE_PRECISION (integer_type_node))
2216 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node))) == -1))
2218 if (TYPE_UNSIGNED (TREE_TYPE (node)))
2219 pp_character (pp, 'u');
2220 if (TYPE_PRECISION (TREE_TYPE (node))
2221 == TYPE_PRECISION (unsigned_type_node))
2223 else if (TYPE_PRECISION (TREE_TYPE (node))
2224 == TYPE_PRECISION (long_unsigned_type_node))
2225 pp_character (pp, 'l');
2226 else if (TYPE_PRECISION (TREE_TYPE (node))
2227 == TYPE_PRECISION (long_long_unsigned_type_node))
2228 pp_string (pp, "ll");
2230 if (TREE_OVERFLOW (node))
2231 pp_string (pp, "(OVF)");
2232 break;
2234 case POLY_INT_CST:
2235 pp_string (pp, "POLY_INT_CST [");
2236 dump_generic_node (pp, POLY_INT_CST_COEFF (node, 0), spc, flags, false);
2237 for (unsigned int i = 1; i < NUM_POLY_INT_COEFFS; ++i)
2239 pp_string (pp, ", ");
2240 dump_generic_node (pp, POLY_INT_CST_COEFF (node, i),
2241 spc, flags, false);
2243 pp_string (pp, "]");
2244 break;
2246 case REAL_CST:
2247 /* Code copied from print_node. */
2249 REAL_VALUE_TYPE d;
2250 if (TREE_OVERFLOW (node))
2251 pp_string (pp, " overflow");
2253 d = TREE_REAL_CST (node);
2254 if (REAL_VALUE_ISINF (d))
2255 pp_string (pp, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf");
2256 else if (REAL_VALUE_ISNAN (d))
2257 pp_string (pp, " Nan");
2258 else
2260 char string[100];
2261 real_to_decimal (string, &d, sizeof (string), 0, 1);
2262 pp_string (pp, string);
2264 break;
2267 case FIXED_CST:
2269 char string[100];
2270 fixed_to_decimal (string, TREE_FIXED_CST_PTR (node), sizeof (string));
2271 pp_string (pp, string);
2272 break;
2275 case COMPLEX_CST:
2276 pp_string (pp, "__complex__ (");
2277 dump_generic_node (pp, TREE_REALPART (node), spc, flags, false);
2278 pp_string (pp, ", ");
2279 dump_generic_node (pp, TREE_IMAGPART (node), spc, flags, false);
2280 pp_right_paren (pp);
2281 break;
2283 case STRING_CST:
2285 pp_string (pp, "\"");
2286 if (unsigned nbytes = TREE_STRING_LENGTH (node))
2287 pretty_print_string (pp, TREE_STRING_POINTER (node), nbytes);
2288 pp_string (pp, "\"");
2289 break;
2292 case VECTOR_CST:
2294 unsigned i;
2295 if (flags & TDF_GIMPLE)
2297 pp_string (pp, "_Literal (");
2298 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
2299 pp_string (pp, ") ");
2301 pp_string (pp, "{ ");
2302 unsigned HOST_WIDE_INT nunits;
2303 if (!VECTOR_CST_NELTS (node).is_constant (&nunits))
2304 nunits = vector_cst_encoded_nelts (node);
2305 for (i = 0; i < nunits; ++i)
2307 if (i != 0)
2308 pp_string (pp, ", ");
2309 dump_generic_node (pp, VECTOR_CST_ELT (node, i),
2310 spc, flags, false);
2312 if (!VECTOR_CST_NELTS (node).is_constant ())
2313 pp_string (pp, ", ...");
2314 pp_string (pp, " }");
2316 break;
2318 case FUNCTION_TYPE:
2319 case METHOD_TYPE:
2320 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
2321 pp_space (pp);
2322 if (TREE_CODE (node) == METHOD_TYPE)
2324 if (TYPE_METHOD_BASETYPE (node))
2325 dump_generic_node (pp, TYPE_NAME (TYPE_METHOD_BASETYPE (node)),
2326 spc, flags, false);
2327 else
2328 pp_string (pp, "<null method basetype>");
2329 pp_colon_colon (pp);
2331 if (TYPE_IDENTIFIER (node))
2332 dump_generic_node (pp, TYPE_NAME (node), spc, flags, false);
2333 else if (TYPE_NAME (node) && DECL_NAME (TYPE_NAME (node)))
2334 dump_decl_name (pp, TYPE_NAME (node), flags);
2335 else if (flags & TDF_NOUID)
2336 pp_string (pp, "<Txxxx>");
2337 else
2339 pp_string (pp, "<T");
2340 pp_scalar (pp, "%x", TYPE_UID (node));
2341 pp_character (pp, '>');
2343 dump_function_declaration (pp, node, spc, flags);
2344 break;
2346 case FUNCTION_DECL:
2347 case CONST_DECL:
2348 dump_decl_name (pp, node, flags);
2349 break;
2351 case LABEL_DECL:
2352 if (DECL_NAME (node))
2353 dump_decl_name (pp, node, flags);
2354 else if (LABEL_DECL_UID (node) != -1)
2356 if (flags & TDF_GIMPLE)
2358 pp_character (pp, 'L');
2359 pp_decimal_int (pp, (int) LABEL_DECL_UID (node));
2361 else
2363 pp_string (pp, "<L");
2364 pp_decimal_int (pp, (int) LABEL_DECL_UID (node));
2365 pp_character (pp, '>');
2368 else
2370 if (flags & TDF_NOUID)
2371 pp_string (pp, "<D.xxxx>");
2372 else
2374 if (flags & TDF_GIMPLE)
2376 pp_character (pp, 'D');
2377 pp_scalar (pp, "%u", DECL_UID (node));
2379 else
2381 pp_string (pp, "<D.");
2382 pp_scalar (pp, "%u", DECL_UID (node));
2383 pp_character (pp, '>');
2387 break;
2389 case TYPE_DECL:
2390 if (DECL_IS_UNDECLARED_BUILTIN (node))
2392 /* Don't print the declaration of built-in types. */
2393 break;
2395 if (DECL_NAME (node))
2396 dump_decl_name (pp, node, flags);
2397 else if (TYPE_NAME (TREE_TYPE (node)) != node)
2399 pp_string (pp, (TREE_CODE (TREE_TYPE (node)) == UNION_TYPE
2400 ? "union" : "struct "));
2401 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
2403 else
2404 pp_string (pp, "<anon>");
2405 break;
2407 case VAR_DECL:
2408 case PARM_DECL:
2409 case FIELD_DECL:
2410 case DEBUG_EXPR_DECL:
2411 case NAMESPACE_DECL:
2412 case NAMELIST_DECL:
2413 dump_decl_name (pp, node, flags);
2414 break;
2416 case RESULT_DECL:
2417 pp_string (pp, "<retval>");
2418 break;
2420 case COMPONENT_REF:
2421 op0 = TREE_OPERAND (node, 0);
2422 str = ".";
2423 if (op0
2424 && (TREE_CODE (op0) == INDIRECT_REF
2425 || (TREE_CODE (op0) == MEM_REF
2426 && TREE_CODE (TREE_OPERAND (op0, 0)) != ADDR_EXPR
2427 && integer_zerop (TREE_OPERAND (op0, 1))
2428 /* Dump the types of INTEGER_CSTs explicitly, for we
2429 can't infer them and MEM_ATTR caching will share
2430 MEM_REFs with differently-typed op0s. */
2431 && TREE_CODE (TREE_OPERAND (op0, 0)) != INTEGER_CST
2432 /* Released SSA_NAMES have no TREE_TYPE. */
2433 && TREE_TYPE (TREE_OPERAND (op0, 0)) != NULL_TREE
2434 /* Same pointer types, but ignoring POINTER_TYPE vs.
2435 REFERENCE_TYPE. */
2436 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 0)))
2437 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1))))
2438 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0, 0)))
2439 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0, 1))))
2440 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0, 0)))
2441 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0, 1))))
2442 /* Same value types ignoring qualifiers. */
2443 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0))
2444 == TYPE_MAIN_VARIANT
2445 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1)))))
2446 && MR_DEPENDENCE_CLIQUE (op0) == 0)))
2448 op0 = TREE_OPERAND (op0, 0);
2449 str = "->";
2451 if (op_prio (op0) < op_prio (node))
2452 pp_left_paren (pp);
2453 dump_generic_node (pp, op0, spc, flags, false);
2454 if (op_prio (op0) < op_prio (node))
2455 pp_right_paren (pp);
2456 pp_string (pp, str);
2457 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
2458 op0 = component_ref_field_offset (node);
2459 if (op0 && TREE_CODE (op0) != INTEGER_CST)
2461 pp_string (pp, "{off: ");
2462 dump_generic_node (pp, op0, spc, flags, false);
2463 pp_right_brace (pp);
2465 break;
2467 case BIT_FIELD_REF:
2468 if (flags & TDF_GIMPLE)
2470 pp_string (pp, "__BIT_FIELD_REF <");
2471 dump_generic_node (pp, TREE_TYPE (node),
2472 spc, flags | TDF_SLIM, false);
2473 if (TYPE_ALIGN (TREE_TYPE (node))
2474 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node))))
2476 pp_string (pp, ", ");
2477 pp_decimal_int (pp, TYPE_ALIGN (TREE_TYPE (node)));
2479 pp_greater (pp);
2480 pp_string (pp, " (");
2481 dump_generic_node (pp, TREE_OPERAND (node, 0), spc,
2482 flags | TDF_SLIM, false);
2483 pp_string (pp, ", ");
2484 dump_generic_node (pp, TREE_OPERAND (node, 1), spc,
2485 flags | TDF_SLIM, false);
2486 pp_string (pp, ", ");
2487 dump_generic_node (pp, TREE_OPERAND (node, 2), spc,
2488 flags | TDF_SLIM, false);
2489 pp_right_paren (pp);
2491 else
2493 pp_string (pp, "BIT_FIELD_REF <");
2494 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
2495 pp_string (pp, ", ");
2496 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
2497 pp_string (pp, ", ");
2498 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
2499 pp_greater (pp);
2501 break;
2503 case BIT_INSERT_EXPR:
2504 pp_string (pp, "BIT_INSERT_EXPR <");
2505 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
2506 pp_string (pp, ", ");
2507 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
2508 pp_string (pp, ", ");
2509 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
2510 pp_string (pp, " (");
2511 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node, 1))))
2512 pp_decimal_int (pp,
2513 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node, 1))));
2514 else
2515 dump_generic_node (pp, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node, 1))),
2516 spc, flags, false);
2517 pp_string (pp, " bits)>");
2518 break;
2520 case ARRAY_REF:
2521 case ARRAY_RANGE_REF:
2522 op0 = TREE_OPERAND (node, 0);
2523 if (op_prio (op0) < op_prio (node))
2524 pp_left_paren (pp);
2525 dump_generic_node (pp, op0, spc, flags, false);
2526 if (op_prio (op0) < op_prio (node))
2527 pp_right_paren (pp);
2528 pp_left_bracket (pp);
2529 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
2530 if (TREE_CODE (node) == ARRAY_RANGE_REF)
2531 pp_string (pp, " ...");
2532 pp_right_bracket (pp);
2534 op0 = array_ref_low_bound (node);
2535 op1 = array_ref_element_size (node);
2537 if (!integer_zerop (op0)
2538 || TREE_OPERAND (node, 2)
2539 || TREE_OPERAND (node, 3))
2541 pp_string (pp, "{lb: ");
2542 dump_generic_node (pp, op0, spc, flags, false);
2543 pp_string (pp, " sz: ");
2544 dump_generic_node (pp, op1, spc, flags, false);
2545 pp_right_brace (pp);
2547 break;
2549 case CONSTRUCTOR:
2551 unsigned HOST_WIDE_INT ix;
2552 tree field, val;
2553 bool is_struct_init = false;
2554 bool is_array_init = false;
2555 widest_int curidx;
2556 if (flags & TDF_GIMPLE)
2558 pp_string (pp, "_Literal (");
2559 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
2560 pp_string (pp, ") ");
2562 pp_left_brace (pp);
2563 if (TREE_CLOBBER_P (node))
2565 pp_string (pp, "CLOBBER");
2566 if (CLOBBER_KIND (node) == CLOBBER_EOL)
2567 pp_string (pp, "(eol)");
2569 else if (TREE_CODE (TREE_TYPE (node)) == RECORD_TYPE
2570 || TREE_CODE (TREE_TYPE (node)) == UNION_TYPE)
2571 is_struct_init = true;
2572 else if (TREE_CODE (TREE_TYPE (node)) == ARRAY_TYPE
2573 && TYPE_DOMAIN (TREE_TYPE (node))
2574 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node)))
2575 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node))))
2576 == INTEGER_CST)
2578 tree minv = TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node)));
2579 is_array_init = true;
2580 curidx = wi::to_widest (minv);
2582 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node), ix, field, val)
2584 if (field)
2586 if (is_struct_init)
2588 pp_dot (pp);
2589 dump_generic_node (pp, field, spc, flags, false);
2590 pp_equal (pp);
2592 else if (is_array_init
2593 && (TREE_CODE (field) != INTEGER_CST
2594 || curidx != wi::to_widest (field)))
2596 pp_left_bracket (pp);
2597 if (TREE_CODE (field) == RANGE_EXPR)
2599 dump_generic_node (pp, TREE_OPERAND (field, 0), spc,
2600 flags, false);
2601 pp_string (pp, " ... ");
2602 dump_generic_node (pp, TREE_OPERAND (field, 1), spc,
2603 flags, false);
2604 if (TREE_CODE (TREE_OPERAND (field, 1)) == INTEGER_CST)
2605 curidx = wi::to_widest (TREE_OPERAND (field, 1));
2607 else
2608 dump_generic_node (pp, field, spc, flags, false);
2609 if (TREE_CODE (field) == INTEGER_CST)
2610 curidx = wi::to_widest (field);
2611 pp_string (pp, "]=");
2614 if (is_array_init)
2615 curidx += 1;
2616 if (val && TREE_CODE (val) == ADDR_EXPR)
2617 if (TREE_CODE (TREE_OPERAND (val, 0)) == FUNCTION_DECL)
2618 val = TREE_OPERAND (val, 0);
2619 if (val && TREE_CODE (val) == FUNCTION_DECL)
2620 dump_decl_name (pp, val, flags);
2621 else
2622 dump_generic_node (pp, val, spc, flags, false);
2623 if (ix != CONSTRUCTOR_NELTS (node) - 1)
2625 pp_comma (pp);
2626 pp_space (pp);
2629 pp_right_brace (pp);
2631 break;
2633 case COMPOUND_EXPR:
2635 tree *tp;
2636 if (flags & TDF_SLIM)
2638 pp_string (pp, "<COMPOUND_EXPR>");
2639 break;
2642 dump_generic_node (pp, TREE_OPERAND (node, 0),
2643 spc, flags, !(flags & TDF_SLIM));
2644 if (flags & TDF_SLIM)
2645 newline_and_indent (pp, spc);
2646 else
2648 pp_comma (pp);
2649 pp_space (pp);
2652 for (tp = &TREE_OPERAND (node, 1);
2653 TREE_CODE (*tp) == COMPOUND_EXPR;
2654 tp = &TREE_OPERAND (*tp, 1))
2656 dump_generic_node (pp, TREE_OPERAND (*tp, 0),
2657 spc, flags, !(flags & TDF_SLIM));
2658 if (flags & TDF_SLIM)
2659 newline_and_indent (pp, spc);
2660 else
2662 pp_comma (pp);
2663 pp_space (pp);
2667 dump_generic_node (pp, *tp, spc, flags, !(flags & TDF_SLIM));
2669 break;
2671 case STATEMENT_LIST:
2673 tree_stmt_iterator si;
2674 bool first = true;
2676 if (flags & TDF_SLIM)
2678 pp_string (pp, "<STATEMENT_LIST>");
2679 break;
2682 for (si = tsi_start (node); !tsi_end_p (si); tsi_next (&si))
2684 if (!first)
2685 newline_and_indent (pp, spc);
2686 else
2687 first = false;
2688 dump_generic_node (pp, tsi_stmt (si), spc, flags, true);
2691 break;
2693 case MODIFY_EXPR:
2694 case INIT_EXPR:
2695 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags,
2696 false);
2697 pp_space (pp);
2698 pp_equal (pp);
2699 pp_space (pp);
2700 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags,
2701 false);
2702 break;
2704 case TARGET_EXPR:
2705 pp_string (pp, "TARGET_EXPR <");
2706 dump_generic_node (pp, TARGET_EXPR_SLOT (node), spc, flags, false);
2707 pp_comma (pp);
2708 pp_space (pp);
2709 dump_generic_node (pp, TARGET_EXPR_INITIAL (node), spc, flags, false);
2710 pp_greater (pp);
2711 break;
2713 case DECL_EXPR:
2714 print_declaration (pp, DECL_EXPR_DECL (node), spc, flags);
2715 is_stmt = false;
2716 break;
2718 case COND_EXPR:
2719 if (TREE_TYPE (node) == NULL || TREE_TYPE (node) == void_type_node)
2721 pp_string (pp, "if (");
2722 dump_generic_node (pp, COND_EXPR_COND (node), spc, flags, false);
2723 pp_right_paren (pp);
2724 /* The lowered cond_exprs should always be printed in full. */
2725 if (COND_EXPR_THEN (node)
2726 && (IS_EMPTY_STMT (COND_EXPR_THEN (node))
2727 || TREE_CODE (COND_EXPR_THEN (node)) == GOTO_EXPR)
2728 && COND_EXPR_ELSE (node)
2729 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node))
2730 || TREE_CODE (COND_EXPR_ELSE (node)) == GOTO_EXPR))
2732 pp_space (pp);
2733 dump_generic_node (pp, COND_EXPR_THEN (node),
2734 0, flags, true);
2735 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node)))
2737 pp_string (pp, " else ");
2738 dump_generic_node (pp, COND_EXPR_ELSE (node),
2739 0, flags, true);
2742 else if (!(flags & TDF_SLIM))
2744 /* Output COND_EXPR_THEN. */
2745 if (COND_EXPR_THEN (node))
2747 newline_and_indent (pp, spc+2);
2748 pp_left_brace (pp);
2749 newline_and_indent (pp, spc+4);
2750 dump_generic_node (pp, COND_EXPR_THEN (node), spc+4,
2751 flags, true);
2752 newline_and_indent (pp, spc+2);
2753 pp_right_brace (pp);
2756 /* Output COND_EXPR_ELSE. */
2757 if (COND_EXPR_ELSE (node)
2758 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node)))
2760 newline_and_indent (pp, spc);
2761 pp_string (pp, "else");
2762 newline_and_indent (pp, spc+2);
2763 pp_left_brace (pp);
2764 newline_and_indent (pp, spc+4);
2765 dump_generic_node (pp, COND_EXPR_ELSE (node), spc+4,
2766 flags, true);
2767 newline_and_indent (pp, spc+2);
2768 pp_right_brace (pp);
2771 is_expr = false;
2773 else
2775 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
2776 pp_space (pp);
2777 pp_question (pp);
2778 pp_space (pp);
2779 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
2780 pp_space (pp);
2781 pp_colon (pp);
2782 pp_space (pp);
2783 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
2785 break;
2787 case BIND_EXPR:
2788 pp_left_brace (pp);
2789 if (!(flags & TDF_SLIM))
2791 if (BIND_EXPR_VARS (node))
2793 pp_newline (pp);
2795 for (op0 = BIND_EXPR_VARS (node); op0; op0 = DECL_CHAIN (op0))
2797 print_declaration (pp, op0, spc+2, flags);
2798 pp_newline (pp);
2802 newline_and_indent (pp, spc+2);
2803 dump_generic_node (pp, BIND_EXPR_BODY (node), spc+2, flags, true);
2804 newline_and_indent (pp, spc);
2805 pp_right_brace (pp);
2807 is_expr = false;
2808 break;
2810 case CALL_EXPR:
2811 if (CALL_EXPR_FN (node) != NULL_TREE)
2812 print_call_name (pp, CALL_EXPR_FN (node), flags);
2813 else
2815 pp_dot (pp);
2816 pp_string (pp, internal_fn_name (CALL_EXPR_IFN (node)));
2819 /* Print parameters. */
2820 pp_space (pp);
2821 pp_left_paren (pp);
2823 tree arg;
2824 call_expr_arg_iterator iter;
2825 FOR_EACH_CALL_EXPR_ARG (arg, iter, node)
2827 dump_generic_node (pp, arg, spc, flags, false);
2828 if (more_call_expr_args_p (&iter))
2830 pp_comma (pp);
2831 pp_space (pp);
2835 if (CALL_EXPR_VA_ARG_PACK (node))
2837 if (call_expr_nargs (node) > 0)
2839 pp_comma (pp);
2840 pp_space (pp);
2842 pp_string (pp, "__builtin_va_arg_pack ()");
2844 pp_right_paren (pp);
2846 op1 = CALL_EXPR_STATIC_CHAIN (node);
2847 if (op1)
2849 pp_string (pp, " [static-chain: ");
2850 dump_generic_node (pp, op1, spc, flags, false);
2851 pp_right_bracket (pp);
2854 if (CALL_EXPR_RETURN_SLOT_OPT (node))
2855 pp_string (pp, " [return slot optimization]");
2856 if (CALL_EXPR_TAILCALL (node))
2857 pp_string (pp, " [tail call]");
2858 break;
2860 case WITH_CLEANUP_EXPR:
2861 NIY;
2862 break;
2864 case CLEANUP_POINT_EXPR:
2865 pp_string (pp, "<<cleanup_point ");
2866 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
2867 pp_string (pp, ">>");
2868 break;
2870 case PLACEHOLDER_EXPR:
2871 pp_string (pp, "<PLACEHOLDER_EXPR ");
2872 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
2873 pp_greater (pp);
2874 break;
2876 /* Binary arithmetic and logic expressions. */
2877 case WIDEN_PLUS_EXPR:
2878 case WIDEN_MINUS_EXPR:
2879 case WIDEN_SUM_EXPR:
2880 case WIDEN_MULT_EXPR:
2881 case MULT_EXPR:
2882 case MULT_HIGHPART_EXPR:
2883 case PLUS_EXPR:
2884 case POINTER_PLUS_EXPR:
2885 case POINTER_DIFF_EXPR:
2886 case MINUS_EXPR:
2887 case TRUNC_DIV_EXPR:
2888 case CEIL_DIV_EXPR:
2889 case FLOOR_DIV_EXPR:
2890 case ROUND_DIV_EXPR:
2891 case TRUNC_MOD_EXPR:
2892 case CEIL_MOD_EXPR:
2893 case FLOOR_MOD_EXPR:
2894 case ROUND_MOD_EXPR:
2895 case RDIV_EXPR:
2896 case EXACT_DIV_EXPR:
2897 case LSHIFT_EXPR:
2898 case RSHIFT_EXPR:
2899 case LROTATE_EXPR:
2900 case RROTATE_EXPR:
2901 case WIDEN_LSHIFT_EXPR:
2902 case BIT_IOR_EXPR:
2903 case BIT_XOR_EXPR:
2904 case BIT_AND_EXPR:
2905 case TRUTH_ANDIF_EXPR:
2906 case TRUTH_ORIF_EXPR:
2907 case TRUTH_AND_EXPR:
2908 case TRUTH_OR_EXPR:
2909 case TRUTH_XOR_EXPR:
2910 case LT_EXPR:
2911 case LE_EXPR:
2912 case GT_EXPR:
2913 case GE_EXPR:
2914 case EQ_EXPR:
2915 case NE_EXPR:
2916 case UNLT_EXPR:
2917 case UNLE_EXPR:
2918 case UNGT_EXPR:
2919 case UNGE_EXPR:
2920 case UNEQ_EXPR:
2921 case LTGT_EXPR:
2922 case ORDERED_EXPR:
2923 case UNORDERED_EXPR:
2925 const char *op = op_symbol (node);
2926 op0 = TREE_OPERAND (node, 0);
2927 op1 = TREE_OPERAND (node, 1);
2929 /* When the operands are expressions with less priority,
2930 keep semantics of the tree representation. */
2931 if (op_prio (op0) <= op_prio (node))
2933 pp_left_paren (pp);
2934 dump_generic_node (pp, op0, spc, flags, false);
2935 pp_right_paren (pp);
2937 else
2938 dump_generic_node (pp, op0, spc, flags, false);
2940 pp_space (pp);
2941 pp_string (pp, op);
2942 pp_space (pp);
2944 /* When the operands are expressions with less priority,
2945 keep semantics of the tree representation. */
2946 if (op_prio (op1) <= op_prio (node))
2948 pp_left_paren (pp);
2949 dump_generic_node (pp, op1, spc, flags, false);
2950 pp_right_paren (pp);
2952 else
2953 dump_generic_node (pp, op1, spc, flags, false);
2955 break;
2957 /* Unary arithmetic and logic expressions. */
2958 case ADDR_EXPR:
2959 if (flags & TDF_GIMPLE_VAL)
2961 pp_string (pp, "_Literal (");
2962 dump_generic_node (pp, TREE_TYPE (node), spc,
2963 flags & ~TDF_GIMPLE_VAL, false);
2964 pp_character (pp, ')');
2966 /* Fallthru. */
2967 case NEGATE_EXPR:
2968 case BIT_NOT_EXPR:
2969 case TRUTH_NOT_EXPR:
2970 case PREDECREMENT_EXPR:
2971 case PREINCREMENT_EXPR:
2972 case INDIRECT_REF:
2973 if (!(flags & TDF_GIMPLE)
2974 && TREE_CODE (node) == ADDR_EXPR
2975 && (TREE_CODE (TREE_OPERAND (node, 0)) == STRING_CST
2976 || TREE_CODE (TREE_OPERAND (node, 0)) == FUNCTION_DECL))
2977 /* Do not output '&' for strings and function pointers when not
2978 dumping GIMPLE FE syntax. */
2980 else
2981 pp_string (pp, op_symbol (node));
2983 if (op_prio (TREE_OPERAND (node, 0)) < op_prio (node))
2985 pp_left_paren (pp);
2986 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
2987 pp_right_paren (pp);
2989 else
2990 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
2991 break;
2993 case POSTDECREMENT_EXPR:
2994 case POSTINCREMENT_EXPR:
2995 if (op_prio (TREE_OPERAND (node, 0)) < op_prio (node))
2997 pp_left_paren (pp);
2998 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
2999 pp_right_paren (pp);
3001 else
3002 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3003 pp_string (pp, op_symbol (node));
3004 break;
3006 case MIN_EXPR:
3007 pp_string (pp, "MIN_EXPR <");
3008 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3009 pp_string (pp, ", ");
3010 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3011 pp_greater (pp);
3012 break;
3014 case MAX_EXPR:
3015 pp_string (pp, "MAX_EXPR <");
3016 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3017 pp_string (pp, ", ");
3018 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3019 pp_greater (pp);
3020 break;
3022 case ABS_EXPR:
3023 pp_string (pp, "ABS_EXPR <");
3024 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3025 pp_greater (pp);
3026 break;
3028 case ABSU_EXPR:
3029 pp_string (pp, "ABSU_EXPR <");
3030 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3031 pp_greater (pp);
3032 break;
3034 case RANGE_EXPR:
3035 NIY;
3036 break;
3038 case ADDR_SPACE_CONVERT_EXPR:
3039 case FIXED_CONVERT_EXPR:
3040 case FIX_TRUNC_EXPR:
3041 case FLOAT_EXPR:
3042 CASE_CONVERT:
3043 type = TREE_TYPE (node);
3044 op0 = TREE_OPERAND (node, 0);
3045 if (type != TREE_TYPE (op0))
3047 pp_left_paren (pp);
3048 dump_generic_node (pp, type, spc, flags, false);
3049 pp_string (pp, ") ");
3051 if (op_prio (op0) < op_prio (node))
3052 pp_left_paren (pp);
3053 dump_generic_node (pp, op0, spc, flags, false);
3054 if (op_prio (op0) < op_prio (node))
3055 pp_right_paren (pp);
3056 break;
3058 case VIEW_CONVERT_EXPR:
3059 if (flags & TDF_GIMPLE)
3060 pp_string (pp, "__VIEW_CONVERT <");
3061 else
3062 pp_string (pp, "VIEW_CONVERT_EXPR<");
3063 dump_generic_node (pp, TREE_TYPE (node), spc, flags, false);
3064 pp_string (pp, ">(");
3065 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3066 pp_right_paren (pp);
3067 break;
3069 case PAREN_EXPR:
3070 pp_string (pp, "((");
3071 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3072 pp_string (pp, "))");
3073 break;
3075 case NON_LVALUE_EXPR:
3076 pp_string (pp, "NON_LVALUE_EXPR <");
3077 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3078 pp_greater (pp);
3079 break;
3081 case SAVE_EXPR:
3082 pp_string (pp, "SAVE_EXPR <");
3083 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3084 pp_greater (pp);
3085 break;
3087 case COMPLEX_EXPR:
3088 pp_string (pp, "COMPLEX_EXPR <");
3089 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3090 pp_string (pp, ", ");
3091 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3092 pp_greater (pp);
3093 break;
3095 case CONJ_EXPR:
3096 pp_string (pp, "CONJ_EXPR <");
3097 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3098 pp_greater (pp);
3099 break;
3101 case REALPART_EXPR:
3102 if (flags & TDF_GIMPLE)
3104 pp_string (pp, "__real ");
3105 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3107 else
3109 pp_string (pp, "REALPART_EXPR <");
3110 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3111 pp_greater (pp);
3113 break;
3115 case IMAGPART_EXPR:
3116 if (flags & TDF_GIMPLE)
3118 pp_string (pp, "__imag ");
3119 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3121 else
3123 pp_string (pp, "IMAGPART_EXPR <");
3124 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3125 pp_greater (pp);
3127 break;
3129 case VA_ARG_EXPR:
3130 pp_string (pp, "VA_ARG_EXPR <");
3131 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3132 pp_greater (pp);
3133 break;
3135 case TRY_FINALLY_EXPR:
3136 case TRY_CATCH_EXPR:
3137 pp_string (pp, "try");
3138 newline_and_indent (pp, spc+2);
3139 pp_left_brace (pp);
3140 newline_and_indent (pp, spc+4);
3141 dump_generic_node (pp, TREE_OPERAND (node, 0), spc+4, flags, true);
3142 newline_and_indent (pp, spc+2);
3143 pp_right_brace (pp);
3144 newline_and_indent (pp, spc);
3145 if (TREE_CODE (node) == TRY_CATCH_EXPR)
3147 node = TREE_OPERAND (node, 1);
3148 pp_string (pp, "catch");
3150 else
3152 gcc_assert (TREE_CODE (node) == TRY_FINALLY_EXPR);
3153 node = TREE_OPERAND (node, 1);
3154 pp_string (pp, "finally");
3155 if (TREE_CODE (node) == EH_ELSE_EXPR)
3157 newline_and_indent (pp, spc+2);
3158 pp_left_brace (pp);
3159 newline_and_indent (pp, spc+4);
3160 dump_generic_node (pp, TREE_OPERAND (node, 0), spc+4,
3161 flags, true);
3162 newline_and_indent (pp, spc+2);
3163 pp_right_brace (pp);
3164 newline_and_indent (pp, spc);
3165 node = TREE_OPERAND (node, 1);
3166 pp_string (pp, "else");
3169 newline_and_indent (pp, spc+2);
3170 pp_left_brace (pp);
3171 newline_and_indent (pp, spc+4);
3172 dump_generic_node (pp, node, spc+4, flags, true);
3173 newline_and_indent (pp, spc+2);
3174 pp_right_brace (pp);
3175 is_expr = false;
3176 break;
3178 case CATCH_EXPR:
3179 pp_string (pp, "catch (");
3180 dump_generic_node (pp, CATCH_TYPES (node), spc+2, flags, false);
3181 pp_right_paren (pp);
3182 newline_and_indent (pp, spc+2);
3183 pp_left_brace (pp);
3184 newline_and_indent (pp, spc+4);
3185 dump_generic_node (pp, CATCH_BODY (node), spc+4, flags, true);
3186 newline_and_indent (pp, spc+2);
3187 pp_right_brace (pp);
3188 is_expr = false;
3189 break;
3191 case EH_FILTER_EXPR:
3192 pp_string (pp, "<<<eh_filter (");
3193 dump_generic_node (pp, EH_FILTER_TYPES (node), spc+2, flags, false);
3194 pp_string (pp, ")>>>");
3195 newline_and_indent (pp, spc+2);
3196 pp_left_brace (pp);
3197 newline_and_indent (pp, spc+4);
3198 dump_generic_node (pp, EH_FILTER_FAILURE (node), spc+4, flags, true);
3199 newline_and_indent (pp, spc+2);
3200 pp_right_brace (pp);
3201 is_expr = false;
3202 break;
3204 case LABEL_EXPR:
3205 op0 = TREE_OPERAND (node, 0);
3206 /* If this is for break or continue, don't bother printing it. */
3207 if (DECL_NAME (op0))
3209 const char *name = IDENTIFIER_POINTER (DECL_NAME (op0));
3210 if (strcmp (name, "break") == 0
3211 || strcmp (name, "continue") == 0)
3212 break;
3214 dump_generic_node (pp, op0, spc, flags, false);
3215 pp_colon (pp);
3216 if (DECL_NONLOCAL (op0))
3217 pp_string (pp, " [non-local]");
3218 break;
3220 case LOOP_EXPR:
3221 pp_string (pp, "while (1)");
3222 if (!(flags & TDF_SLIM))
3224 newline_and_indent (pp, spc+2);
3225 pp_left_brace (pp);
3226 newline_and_indent (pp, spc+4);
3227 dump_generic_node (pp, LOOP_EXPR_BODY (node), spc+4, flags, true);
3228 newline_and_indent (pp, spc+2);
3229 pp_right_brace (pp);
3231 is_expr = false;
3232 break;
3234 case PREDICT_EXPR:
3235 pp_string (pp, "// predicted ");
3236 if (PREDICT_EXPR_OUTCOME (node))
3237 pp_string (pp, "likely by ");
3238 else
3239 pp_string (pp, "unlikely by ");
3240 pp_string (pp, predictor_name (PREDICT_EXPR_PREDICTOR (node)));
3241 pp_string (pp, " predictor.");
3242 break;
3244 case ANNOTATE_EXPR:
3245 pp_string (pp, "ANNOTATE_EXPR <");
3246 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3247 switch ((enum annot_expr_kind) TREE_INT_CST_LOW (TREE_OPERAND (node, 1)))
3249 case annot_expr_ivdep_kind:
3250 pp_string (pp, ", ivdep");
3251 break;
3252 case annot_expr_unroll_kind:
3254 pp_string (pp, ", unroll ");
3255 pp_decimal_int (pp,
3256 (int) TREE_INT_CST_LOW (TREE_OPERAND (node, 2)));
3257 break;
3259 case annot_expr_no_vector_kind:
3260 pp_string (pp, ", no-vector");
3261 break;
3262 case annot_expr_vector_kind:
3263 pp_string (pp, ", vector");
3264 break;
3265 case annot_expr_parallel_kind:
3266 pp_string (pp, ", parallel");
3267 break;
3268 default:
3269 gcc_unreachable ();
3271 pp_greater (pp);
3272 break;
3274 case RETURN_EXPR:
3275 pp_string (pp, "return");
3276 op0 = TREE_OPERAND (node, 0);
3277 if (op0)
3279 pp_space (pp);
3280 if (TREE_CODE (op0) == MODIFY_EXPR)
3281 dump_generic_node (pp, TREE_OPERAND (op0, 1),
3282 spc, flags, false);
3283 else
3284 dump_generic_node (pp, op0, spc, flags, false);
3286 break;
3288 case EXIT_EXPR:
3289 pp_string (pp, "if (");
3290 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3291 pp_string (pp, ") break");
3292 break;
3294 case SWITCH_EXPR:
3295 pp_string (pp, "switch (");
3296 dump_generic_node (pp, SWITCH_COND (node), spc, flags, false);
3297 pp_right_paren (pp);
3298 if (!(flags & TDF_SLIM))
3300 newline_and_indent (pp, spc+2);
3301 pp_left_brace (pp);
3302 if (SWITCH_BODY (node))
3304 newline_and_indent (pp, spc+4);
3305 dump_generic_node (pp, SWITCH_BODY (node), spc+4, flags,
3306 true);
3308 newline_and_indent (pp, spc+2);
3309 pp_right_brace (pp);
3311 is_expr = false;
3312 break;
3314 case GOTO_EXPR:
3315 op0 = GOTO_DESTINATION (node);
3316 if (TREE_CODE (op0) != SSA_NAME && DECL_P (op0) && DECL_NAME (op0))
3318 const char *name = IDENTIFIER_POINTER (DECL_NAME (op0));
3319 if (strcmp (name, "break") == 0
3320 || strcmp (name, "continue") == 0)
3322 pp_string (pp, name);
3323 break;
3326 pp_string (pp, "goto ");
3327 dump_generic_node (pp, op0, spc, flags, false);
3328 break;
3330 case ASM_EXPR:
3331 pp_string (pp, "__asm__");
3332 if (ASM_VOLATILE_P (node))
3333 pp_string (pp, " __volatile__");
3334 pp_left_paren (pp);
3335 dump_generic_node (pp, ASM_STRING (node), spc, flags, false);
3336 pp_colon (pp);
3337 dump_generic_node (pp, ASM_OUTPUTS (node), spc, flags, false);
3338 pp_colon (pp);
3339 dump_generic_node (pp, ASM_INPUTS (node), spc, flags, false);
3340 if (ASM_CLOBBERS (node))
3342 pp_colon (pp);
3343 dump_generic_node (pp, ASM_CLOBBERS (node), spc, flags, false);
3345 pp_right_paren (pp);
3346 break;
3348 case CASE_LABEL_EXPR:
3349 if (CASE_LOW (node) && CASE_HIGH (node))
3351 pp_string (pp, "case ");
3352 dump_generic_node (pp, CASE_LOW (node), spc, flags, false);
3353 pp_string (pp, " ... ");
3354 dump_generic_node (pp, CASE_HIGH (node), spc, flags, false);
3356 else if (CASE_LOW (node))
3358 pp_string (pp, "case ");
3359 dump_generic_node (pp, CASE_LOW (node), spc, flags, false);
3361 else
3362 pp_string (pp, "default");
3363 pp_colon (pp);
3364 break;
3366 case OBJ_TYPE_REF:
3367 pp_string (pp, "OBJ_TYPE_REF(");
3368 dump_generic_node (pp, OBJ_TYPE_REF_EXPR (node), spc, flags, false);
3369 pp_semicolon (pp);
3370 /* We omit the class type for -fcompare-debug because we may
3371 drop TYPE_BINFO early depending on debug info, and then
3372 virtual_method_call_p would return false, whereas when
3373 TYPE_BINFO is preserved it may still return true and then
3374 we'd print the class type. Compare tree and rtl dumps for
3375 libstdc++-prettyprinters/shared_ptr.cc with and without -g,
3376 for example, at occurrences of OBJ_TYPE_REF. */
3377 if (!(flags & (TDF_SLIM | TDF_COMPARE_DEBUG))
3378 && virtual_method_call_p (node, true))
3380 pp_string (pp, "(");
3381 dump_generic_node (pp, obj_type_ref_class (node, true),
3382 spc, flags, false);
3383 pp_string (pp, ")");
3385 dump_generic_node (pp, OBJ_TYPE_REF_OBJECT (node), spc, flags, false);
3386 pp_arrow (pp);
3387 dump_generic_node (pp, OBJ_TYPE_REF_TOKEN (node), spc, flags, false);
3388 pp_right_paren (pp);
3389 break;
3391 case SSA_NAME:
3392 if (SSA_NAME_IDENTIFIER (node))
3394 if ((flags & TDF_NOUID)
3395 && SSA_NAME_VAR (node)
3396 && DECL_NAMELESS (SSA_NAME_VAR (node)))
3397 dump_fancy_name (pp, SSA_NAME_IDENTIFIER (node));
3398 else if (! (flags & TDF_GIMPLE)
3399 || SSA_NAME_VAR (node))
3400 dump_generic_node (pp, SSA_NAME_IDENTIFIER (node),
3401 spc, flags, false);
3403 pp_underscore (pp);
3404 pp_decimal_int (pp, SSA_NAME_VERSION (node));
3405 if (SSA_NAME_IS_DEFAULT_DEF (node))
3406 pp_string (pp, "(D)");
3407 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node))
3408 pp_string (pp, "(ab)");
3409 break;
3411 case WITH_SIZE_EXPR:
3412 pp_string (pp, "WITH_SIZE_EXPR <");
3413 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3414 pp_string (pp, ", ");
3415 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3416 pp_greater (pp);
3417 break;
3419 case ASSERT_EXPR:
3420 pp_string (pp, "ASSERT_EXPR <");
3421 dump_generic_node (pp, ASSERT_EXPR_VAR (node), spc, flags, false);
3422 pp_string (pp, ", ");
3423 dump_generic_node (pp, ASSERT_EXPR_COND (node), spc, flags, false);
3424 pp_greater (pp);
3425 break;
3427 case SCEV_KNOWN:
3428 pp_string (pp, "scev_known");
3429 break;
3431 case SCEV_NOT_KNOWN:
3432 pp_string (pp, "scev_not_known");
3433 break;
3435 case POLYNOMIAL_CHREC:
3436 pp_left_brace (pp);
3437 dump_generic_node (pp, CHREC_LEFT (node), spc, flags, false);
3438 pp_string (pp, ", +, ");
3439 dump_generic_node (pp, CHREC_RIGHT (node), spc, flags, false);
3440 pp_string (pp, "}_");
3441 pp_scalar (pp, "%u", CHREC_VARIABLE (node));
3442 is_stmt = false;
3443 break;
3445 case REALIGN_LOAD_EXPR:
3446 pp_string (pp, "REALIGN_LOAD <");
3447 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3448 pp_string (pp, ", ");
3449 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3450 pp_string (pp, ", ");
3451 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
3452 pp_greater (pp);
3453 break;
3455 case VEC_COND_EXPR:
3456 pp_string (pp, " VEC_COND_EXPR < ");
3457 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3458 pp_string (pp, " , ");
3459 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3460 pp_string (pp, " , ");
3461 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
3462 pp_string (pp, " > ");
3463 break;
3465 case VEC_PERM_EXPR:
3466 pp_string (pp, " VEC_PERM_EXPR < ");
3467 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3468 pp_string (pp, " , ");
3469 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3470 pp_string (pp, " , ");
3471 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
3472 pp_string (pp, " > ");
3473 break;
3475 case DOT_PROD_EXPR:
3476 pp_string (pp, " DOT_PROD_EXPR < ");
3477 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3478 pp_string (pp, ", ");
3479 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3480 pp_string (pp, ", ");
3481 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
3482 pp_string (pp, " > ");
3483 break;
3485 case WIDEN_MULT_PLUS_EXPR:
3486 pp_string (pp, " WIDEN_MULT_PLUS_EXPR < ");
3487 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3488 pp_string (pp, ", ");
3489 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3490 pp_string (pp, ", ");
3491 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
3492 pp_string (pp, " > ");
3493 break;
3495 case WIDEN_MULT_MINUS_EXPR:
3496 pp_string (pp, " WIDEN_MULT_MINUS_EXPR < ");
3497 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3498 pp_string (pp, ", ");
3499 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3500 pp_string (pp, ", ");
3501 dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false);
3502 pp_string (pp, " > ");
3503 break;
3505 case OACC_PARALLEL:
3506 pp_string (pp, "#pragma acc parallel");
3507 goto dump_omp_clauses_body;
3509 case OACC_KERNELS:
3510 pp_string (pp, "#pragma acc kernels");
3511 goto dump_omp_clauses_body;
3513 case OACC_SERIAL:
3514 pp_string (pp, "#pragma acc serial");
3515 goto dump_omp_clauses_body;
3517 case OACC_DATA:
3518 pp_string (pp, "#pragma acc data");
3519 dump_omp_clauses (pp, OACC_DATA_CLAUSES (node), spc, flags);
3520 goto dump_omp_body;
3522 case OACC_HOST_DATA:
3523 pp_string (pp, "#pragma acc host_data");
3524 dump_omp_clauses (pp, OACC_HOST_DATA_CLAUSES (node), spc, flags);
3525 goto dump_omp_body;
3527 case OACC_DECLARE:
3528 pp_string (pp, "#pragma acc declare");
3529 dump_omp_clauses (pp, OACC_DECLARE_CLAUSES (node), spc, flags);
3530 break;
3532 case OACC_UPDATE:
3533 pp_string (pp, "#pragma acc update");
3534 dump_omp_clauses (pp, OACC_UPDATE_CLAUSES (node), spc, flags);
3535 break;
3537 case OACC_ENTER_DATA:
3538 pp_string (pp, "#pragma acc enter data");
3539 dump_omp_clauses (pp, OACC_ENTER_DATA_CLAUSES (node), spc, flags);
3540 break;
3542 case OACC_EXIT_DATA:
3543 pp_string (pp, "#pragma acc exit data");
3544 dump_omp_clauses (pp, OACC_EXIT_DATA_CLAUSES (node), spc, flags);
3545 break;
3547 case OACC_CACHE:
3548 pp_string (pp, "#pragma acc cache");
3549 dump_omp_clauses (pp, OACC_CACHE_CLAUSES (node), spc, flags);
3550 break;
3552 case OMP_PARALLEL:
3553 pp_string (pp, "#pragma omp parallel");
3554 dump_omp_clauses (pp, OMP_PARALLEL_CLAUSES (node), spc, flags);
3555 goto dump_omp_body;
3557 dump_omp_clauses_body:
3558 dump_omp_clauses (pp, OMP_CLAUSES (node), spc, flags);
3559 goto dump_omp_body;
3561 dump_omp_body:
3562 if (!(flags & TDF_SLIM) && OMP_BODY (node))
3564 newline_and_indent (pp, spc + 2);
3565 pp_left_brace (pp);
3566 newline_and_indent (pp, spc + 4);
3567 dump_generic_node (pp, OMP_BODY (node), spc + 4, flags, false);
3568 newline_and_indent (pp, spc + 2);
3569 pp_right_brace (pp);
3571 is_expr = false;
3572 break;
3574 case OMP_TASK:
3575 pp_string (pp, OMP_TASK_BODY (node) ? "#pragma omp task"
3576 : "#pragma omp taskwait");
3577 dump_omp_clauses (pp, OMP_TASK_CLAUSES (node), spc, flags);
3578 goto dump_omp_body;
3580 case OMP_FOR:
3581 pp_string (pp, "#pragma omp for");
3582 goto dump_omp_loop;
3584 case OMP_SIMD:
3585 pp_string (pp, "#pragma omp simd");
3586 goto dump_omp_loop;
3588 case OMP_DISTRIBUTE:
3589 pp_string (pp, "#pragma omp distribute");
3590 goto dump_omp_loop;
3592 case OMP_TASKLOOP:
3593 pp_string (pp, "#pragma omp taskloop");
3594 goto dump_omp_loop;
3596 case OMP_LOOP:
3597 pp_string (pp, "#pragma omp loop");
3598 goto dump_omp_loop;
3600 case OACC_LOOP:
3601 pp_string (pp, "#pragma acc loop");
3602 goto dump_omp_loop;
3604 case OMP_TEAMS:
3605 pp_string (pp, "#pragma omp teams");
3606 dump_omp_clauses (pp, OMP_TEAMS_CLAUSES (node), spc, flags);
3607 goto dump_omp_body;
3609 case OMP_TARGET_DATA:
3610 pp_string (pp, "#pragma omp target data");
3611 dump_omp_clauses (pp, OMP_TARGET_DATA_CLAUSES (node), spc, flags);
3612 goto dump_omp_body;
3614 case OMP_TARGET_ENTER_DATA:
3615 pp_string (pp, "#pragma omp target enter data");
3616 dump_omp_clauses (pp, OMP_TARGET_ENTER_DATA_CLAUSES (node), spc, flags);
3617 is_expr = false;
3618 break;
3620 case OMP_TARGET_EXIT_DATA:
3621 pp_string (pp, "#pragma omp target exit data");
3622 dump_omp_clauses (pp, OMP_TARGET_EXIT_DATA_CLAUSES (node), spc, flags);
3623 is_expr = false;
3624 break;
3626 case OMP_TARGET:
3627 pp_string (pp, "#pragma omp target");
3628 dump_omp_clauses (pp, OMP_TARGET_CLAUSES (node), spc, flags);
3629 goto dump_omp_body;
3631 case OMP_TARGET_UPDATE:
3632 pp_string (pp, "#pragma omp target update");
3633 dump_omp_clauses (pp, OMP_TARGET_UPDATE_CLAUSES (node), spc, flags);
3634 is_expr = false;
3635 break;
3637 dump_omp_loop:
3638 dump_omp_clauses (pp, OMP_FOR_CLAUSES (node), spc, flags);
3639 if (!(flags & TDF_SLIM))
3641 int i;
3643 if (OMP_FOR_PRE_BODY (node))
3645 newline_and_indent (pp, spc + 2);
3646 pp_left_brace (pp);
3647 spc += 4;
3648 newline_and_indent (pp, spc);
3649 dump_generic_node (pp, OMP_FOR_PRE_BODY (node),
3650 spc, flags, false);
3652 if (OMP_FOR_INIT (node))
3654 spc -= 2;
3655 for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (node)); i++)
3657 spc += 2;
3658 newline_and_indent (pp, spc);
3659 pp_string (pp, "for (");
3660 tree init = TREE_VEC_ELT (OMP_FOR_INIT (node), i);
3661 if (TREE_CODE (init) != MODIFY_EXPR
3662 || TREE_CODE (TREE_OPERAND (init, 1)) != TREE_VEC)
3663 dump_generic_node (pp, init, spc, flags, false);
3664 else
3666 dump_generic_node (pp, TREE_OPERAND (init, 0),
3667 spc, flags, false);
3668 pp_string (pp, " = ");
3669 dump_omp_loop_non_rect_expr (pp, TREE_OPERAND (init, 1),
3670 spc, flags);
3672 pp_string (pp, "; ");
3673 tree cond = TREE_VEC_ELT (OMP_FOR_COND (node), i);
3674 if (!COMPARISON_CLASS_P (cond)
3675 || TREE_CODE (TREE_OPERAND (cond, 1)) != TREE_VEC)
3676 dump_generic_node (pp, cond, spc, flags, false);
3677 else
3679 dump_generic_node (pp, TREE_OPERAND (cond, 0),
3680 spc, flags, false);
3681 const char *op = op_symbol (cond);
3682 pp_space (pp);
3683 pp_string (pp, op);
3684 pp_space (pp);
3685 dump_omp_loop_non_rect_expr (pp, TREE_OPERAND (cond, 1),
3686 spc, flags);
3688 pp_string (pp, "; ");
3689 dump_generic_node (pp,
3690 TREE_VEC_ELT (OMP_FOR_INCR (node), i),
3691 spc, flags, false);
3692 pp_right_paren (pp);
3695 if (OMP_FOR_BODY (node))
3697 newline_and_indent (pp, spc + 2);
3698 pp_left_brace (pp);
3699 newline_and_indent (pp, spc + 4);
3700 dump_generic_node (pp, OMP_FOR_BODY (node), spc + 4, flags,
3701 false);
3702 newline_and_indent (pp, spc + 2);
3703 pp_right_brace (pp);
3705 if (OMP_FOR_INIT (node))
3706 spc -= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node)) - 2;
3707 if (OMP_FOR_PRE_BODY (node))
3709 spc -= 4;
3710 newline_and_indent (pp, spc + 2);
3711 pp_right_brace (pp);
3714 is_expr = false;
3715 break;
3717 case OMP_SECTIONS:
3718 pp_string (pp, "#pragma omp sections");
3719 dump_omp_clauses (pp, OMP_SECTIONS_CLAUSES (node), spc, flags);
3720 goto dump_omp_body;
3722 case OMP_SECTION:
3723 pp_string (pp, "#pragma omp section");
3724 goto dump_omp_body;
3726 case OMP_SCAN:
3727 if (OMP_SCAN_CLAUSES (node))
3729 pp_string (pp, "#pragma omp scan");
3730 dump_omp_clauses (pp, OMP_SCAN_CLAUSES (node), spc, flags);
3732 goto dump_omp_body;
3734 case OMP_MASTER:
3735 pp_string (pp, "#pragma omp master");
3736 goto dump_omp_body;
3738 case OMP_MASKED:
3739 pp_string (pp, "#pragma omp masked");
3740 dump_omp_clauses (pp, OMP_MASKED_CLAUSES (node), spc, flags);
3741 goto dump_omp_body;
3743 case OMP_TASKGROUP:
3744 pp_string (pp, "#pragma omp taskgroup");
3745 dump_omp_clauses (pp, OMP_TASKGROUP_CLAUSES (node), spc, flags);
3746 goto dump_omp_body;
3748 case OMP_ORDERED:
3749 pp_string (pp, "#pragma omp ordered");
3750 dump_omp_clauses (pp, OMP_ORDERED_CLAUSES (node), spc, flags);
3751 goto dump_omp_body;
3753 case OMP_CRITICAL:
3754 pp_string (pp, "#pragma omp critical");
3755 if (OMP_CRITICAL_NAME (node))
3757 pp_space (pp);
3758 pp_left_paren (pp);
3759 dump_generic_node (pp, OMP_CRITICAL_NAME (node), spc,
3760 flags, false);
3761 pp_right_paren (pp);
3763 dump_omp_clauses (pp, OMP_CRITICAL_CLAUSES (node), spc, flags);
3764 goto dump_omp_body;
3766 case OMP_ATOMIC:
3767 pp_string (pp, "#pragma omp atomic");
3768 if (OMP_ATOMIC_WEAK (node))
3769 pp_string (pp, " weak");
3770 dump_omp_atomic_memory_order (pp, OMP_ATOMIC_MEMORY_ORDER (node));
3771 newline_and_indent (pp, spc + 2);
3772 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3773 pp_space (pp);
3774 pp_equal (pp);
3775 pp_space (pp);
3776 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3777 break;
3779 case OMP_ATOMIC_READ:
3780 pp_string (pp, "#pragma omp atomic read");
3781 dump_omp_atomic_memory_order (pp, OMP_ATOMIC_MEMORY_ORDER (node));
3782 newline_and_indent (pp, spc + 2);
3783 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3784 pp_space (pp);
3785 break;
3787 case OMP_ATOMIC_CAPTURE_OLD:
3788 case OMP_ATOMIC_CAPTURE_NEW:
3789 pp_string (pp, "#pragma omp atomic capture");
3790 if (OMP_ATOMIC_WEAK (node))
3791 pp_string (pp, " weak");
3792 dump_omp_atomic_memory_order (pp, OMP_ATOMIC_MEMORY_ORDER (node));
3793 newline_and_indent (pp, spc + 2);
3794 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3795 pp_space (pp);
3796 pp_equal (pp);
3797 pp_space (pp);
3798 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3799 break;
3801 case OMP_SINGLE:
3802 pp_string (pp, "#pragma omp single");
3803 dump_omp_clauses (pp, OMP_SINGLE_CLAUSES (node), spc, flags);
3804 goto dump_omp_body;
3806 case OMP_SCOPE:
3807 pp_string (pp, "#pragma omp scope");
3808 dump_omp_clauses (pp, OMP_SCOPE_CLAUSES (node), spc, flags);
3809 goto dump_omp_body;
3811 case OMP_CLAUSE:
3812 /* If we come here, we're dumping something that's not an OMP construct,
3813 for example, OMP clauses attached to a function's '__attribute__'.
3814 Dump the whole OMP clause chain. */
3815 dump_omp_clauses (pp, node, spc, flags, false);
3816 is_expr = false;
3817 break;
3819 case TRANSACTION_EXPR:
3820 if (TRANSACTION_EXPR_OUTER (node))
3821 pp_string (pp, "__transaction_atomic [[outer]]");
3822 else if (TRANSACTION_EXPR_RELAXED (node))
3823 pp_string (pp, "__transaction_relaxed");
3824 else
3825 pp_string (pp, "__transaction_atomic");
3826 if (!(flags & TDF_SLIM) && TRANSACTION_EXPR_BODY (node))
3828 newline_and_indent (pp, spc);
3829 pp_left_brace (pp);
3830 newline_and_indent (pp, spc + 2);
3831 dump_generic_node (pp, TRANSACTION_EXPR_BODY (node),
3832 spc + 2, flags, false);
3833 newline_and_indent (pp, spc);
3834 pp_right_brace (pp);
3836 is_expr = false;
3837 break;
3839 case VEC_SERIES_EXPR:
3840 case VEC_WIDEN_MULT_HI_EXPR:
3841 case VEC_WIDEN_MULT_LO_EXPR:
3842 case VEC_WIDEN_PLUS_HI_EXPR:
3843 case VEC_WIDEN_PLUS_LO_EXPR:
3844 case VEC_WIDEN_MINUS_HI_EXPR:
3845 case VEC_WIDEN_MINUS_LO_EXPR:
3846 case VEC_WIDEN_MULT_EVEN_EXPR:
3847 case VEC_WIDEN_MULT_ODD_EXPR:
3848 case VEC_WIDEN_LSHIFT_HI_EXPR:
3849 case VEC_WIDEN_LSHIFT_LO_EXPR:
3850 pp_space (pp);
3851 for (str = get_tree_code_name (code); *str; str++)
3852 pp_character (pp, TOUPPER (*str));
3853 pp_string (pp, " < ");
3854 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3855 pp_string (pp, ", ");
3856 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3857 pp_string (pp, " > ");
3858 break;
3860 case VEC_DUPLICATE_EXPR:
3861 pp_space (pp);
3862 for (str = get_tree_code_name (code); *str; str++)
3863 pp_character (pp, TOUPPER (*str));
3864 pp_string (pp, " < ");
3865 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3866 pp_string (pp, " > ");
3867 break;
3869 case VEC_UNPACK_HI_EXPR:
3870 pp_string (pp, " VEC_UNPACK_HI_EXPR < ");
3871 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3872 pp_string (pp, " > ");
3873 break;
3875 case VEC_UNPACK_LO_EXPR:
3876 pp_string (pp, " VEC_UNPACK_LO_EXPR < ");
3877 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3878 pp_string (pp, " > ");
3879 break;
3881 case VEC_UNPACK_FLOAT_HI_EXPR:
3882 pp_string (pp, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3883 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3884 pp_string (pp, " > ");
3885 break;
3887 case VEC_UNPACK_FLOAT_LO_EXPR:
3888 pp_string (pp, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3889 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3890 pp_string (pp, " > ");
3891 break;
3893 case VEC_UNPACK_FIX_TRUNC_HI_EXPR:
3894 pp_string (pp, " VEC_UNPACK_FIX_TRUNC_HI_EXPR < ");
3895 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3896 pp_string (pp, " > ");
3897 break;
3899 case VEC_UNPACK_FIX_TRUNC_LO_EXPR:
3900 pp_string (pp, " VEC_UNPACK_FIX_TRUNC_LO_EXPR < ");
3901 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3902 pp_string (pp, " > ");
3903 break;
3905 case VEC_PACK_TRUNC_EXPR:
3906 pp_string (pp, " VEC_PACK_TRUNC_EXPR < ");
3907 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3908 pp_string (pp, ", ");
3909 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3910 pp_string (pp, " > ");
3911 break;
3913 case VEC_PACK_SAT_EXPR:
3914 pp_string (pp, " VEC_PACK_SAT_EXPR < ");
3915 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3916 pp_string (pp, ", ");
3917 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3918 pp_string (pp, " > ");
3919 break;
3921 case VEC_PACK_FIX_TRUNC_EXPR:
3922 pp_string (pp, " VEC_PACK_FIX_TRUNC_EXPR < ");
3923 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3924 pp_string (pp, ", ");
3925 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3926 pp_string (pp, " > ");
3927 break;
3929 case VEC_PACK_FLOAT_EXPR:
3930 pp_string (pp, " VEC_PACK_FLOAT_EXPR < ");
3931 dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
3932 pp_string (pp, ", ");
3933 dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false);
3934 pp_string (pp, " > ");
3935 break;
3937 case BLOCK:
3938 dump_block_node (pp, node, spc, flags);
3939 break;
3941 case DEBUG_BEGIN_STMT:
3942 pp_string (pp, "# DEBUG BEGIN STMT");
3943 break;
3945 default:
3946 NIY;
3949 if (is_stmt && is_expr)
3950 pp_semicolon (pp);
3952 return spc;
3955 /* Print the declaration of a variable. */
3957 void
3958 print_declaration (pretty_printer *pp, tree t, int spc, dump_flags_t flags)
3960 INDENT (spc);
3962 if (TREE_CODE(t) == NAMELIST_DECL)
3964 pp_string(pp, "namelist ");
3965 dump_decl_name (pp, t, flags);
3966 pp_semicolon (pp);
3967 return;
3970 if (TREE_CODE (t) == TYPE_DECL)
3971 pp_string (pp, "typedef ");
3973 if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL) && DECL_REGISTER (t))
3974 pp_string (pp, "register ");
3976 if (TREE_PUBLIC (t) && DECL_EXTERNAL (t))
3977 pp_string (pp, "extern ");
3978 else if (TREE_STATIC (t))
3979 pp_string (pp, "static ");
3981 /* Print the type and name. */
3982 if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
3984 tree tmp;
3986 /* Print array's type. */
3987 tmp = TREE_TYPE (t);
3988 while (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE)
3989 tmp = TREE_TYPE (tmp);
3990 dump_generic_node (pp, TREE_TYPE (tmp), spc, flags, false);
3992 /* Print variable's name. */
3993 pp_space (pp);
3994 dump_generic_node (pp, t, spc, flags, false);
3996 /* Print the dimensions. */
3997 tmp = TREE_TYPE (t);
3998 while (TREE_CODE (tmp) == ARRAY_TYPE)
4000 dump_array_domain (pp, TYPE_DOMAIN (tmp), spc, flags);
4001 tmp = TREE_TYPE (tmp);
4004 else if (TREE_CODE (t) == FUNCTION_DECL)
4006 dump_generic_node (pp, TREE_TYPE (TREE_TYPE (t)), spc, flags, false);
4007 pp_space (pp);
4008 dump_decl_name (pp, t, flags);
4009 dump_function_declaration (pp, TREE_TYPE (t), spc, flags);
4011 else
4013 /* Print type declaration. */
4014 dump_generic_node (pp, TREE_TYPE (t), spc, flags, false);
4016 /* Print variable's name. */
4017 pp_space (pp);
4018 dump_generic_node (pp, t, spc, flags, false);
4021 if (VAR_P (t) && DECL_HARD_REGISTER (t))
4023 pp_string (pp, " __asm__ ");
4024 pp_left_paren (pp);
4025 dump_generic_node (pp, DECL_ASSEMBLER_NAME (t), spc, flags, false);
4026 pp_right_paren (pp);
4029 /* The initial value of a function serves to determine whether the function
4030 is declared or defined. So the following does not apply to function
4031 nodes. */
4032 if (TREE_CODE (t) != FUNCTION_DECL)
4034 /* Print the initial value. */
4035 if (DECL_INITIAL (t))
4037 pp_space (pp);
4038 pp_equal (pp);
4039 pp_space (pp);
4040 if (!(flags & TDF_SLIM))
4041 dump_generic_node (pp, DECL_INITIAL (t), spc, flags, false);
4042 else
4043 pp_string (pp, "<<< omitted >>>");
4047 if (VAR_P (t) && DECL_HAS_VALUE_EXPR_P (t))
4049 pp_string (pp, " [value-expr: ");
4050 dump_generic_node (pp, DECL_VALUE_EXPR (t), spc, flags, false);
4051 pp_right_bracket (pp);
4054 pp_semicolon (pp);
4058 /* Prints a structure: name, fields, and methods.
4059 FIXME: Still incomplete. */
4061 static void
4062 print_struct_decl (pretty_printer *pp, const_tree node, int spc,
4063 dump_flags_t flags)
4065 /* Print the name of the structure. */
4066 if (TYPE_NAME (node))
4068 INDENT (spc);
4069 if (TREE_CODE (node) == RECORD_TYPE)
4070 pp_string (pp, "struct ");
4071 else if ((TREE_CODE (node) == UNION_TYPE
4072 || TREE_CODE (node) == QUAL_UNION_TYPE))
4073 pp_string (pp, "union ");
4075 dump_generic_node (pp, TYPE_NAME (node), spc, TDF_NONE, false);
4078 /* Print the contents of the structure. */
4079 pp_newline (pp);
4080 INDENT (spc);
4081 pp_left_brace (pp);
4082 pp_newline (pp);
4084 /* Print the fields of the structure. */
4086 tree tmp;
4087 tmp = TYPE_FIELDS (node);
4088 while (tmp)
4090 /* Avoid to print recursively the structure. */
4091 /* FIXME : Not implemented correctly...,
4092 what about the case when we have a cycle in the contain graph? ...
4093 Maybe this could be solved by looking at the scope in which the
4094 structure was declared. */
4095 if (TREE_TYPE (tmp) != node
4096 && (TREE_CODE (TREE_TYPE (tmp)) != POINTER_TYPE
4097 || TREE_TYPE (TREE_TYPE (tmp)) != node))
4099 print_declaration (pp, tmp, spc+2, flags);
4100 pp_newline (pp);
4102 tmp = DECL_CHAIN (tmp);
4105 INDENT (spc);
4106 pp_right_brace (pp);
4109 /* Return the priority of the operator CODE.
4111 From lowest to highest precedence with either left-to-right (L-R)
4112 or right-to-left (R-L) associativity]:
4114 1 [L-R] ,
4115 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
4116 3 [R-L] ?:
4117 4 [L-R] ||
4118 5 [L-R] &&
4119 6 [L-R] |
4120 7 [L-R] ^
4121 8 [L-R] &
4122 9 [L-R] == !=
4123 10 [L-R] < <= > >=
4124 11 [L-R] << >>
4125 12 [L-R] + -
4126 13 [L-R] * / %
4127 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
4128 15 [L-R] fn() [] -> .
4130 unary +, - and * have higher precedence than the corresponding binary
4131 operators. */
4134 op_code_prio (enum tree_code code)
4136 switch (code)
4138 case TREE_LIST:
4139 case COMPOUND_EXPR:
4140 case BIND_EXPR:
4141 return 1;
4143 case MODIFY_EXPR:
4144 case INIT_EXPR:
4145 return 2;
4147 case COND_EXPR:
4148 return 3;
4150 case TRUTH_OR_EXPR:
4151 case TRUTH_ORIF_EXPR:
4152 return 4;
4154 case TRUTH_AND_EXPR:
4155 case TRUTH_ANDIF_EXPR:
4156 return 5;
4158 case BIT_IOR_EXPR:
4159 return 6;
4161 case BIT_XOR_EXPR:
4162 case TRUTH_XOR_EXPR:
4163 return 7;
4165 case BIT_AND_EXPR:
4166 return 8;
4168 case EQ_EXPR:
4169 case NE_EXPR:
4170 return 9;
4172 case UNLT_EXPR:
4173 case UNLE_EXPR:
4174 case UNGT_EXPR:
4175 case UNGE_EXPR:
4176 case UNEQ_EXPR:
4177 case LTGT_EXPR:
4178 case ORDERED_EXPR:
4179 case UNORDERED_EXPR:
4180 case LT_EXPR:
4181 case LE_EXPR:
4182 case GT_EXPR:
4183 case GE_EXPR:
4184 return 10;
4186 case LSHIFT_EXPR:
4187 case RSHIFT_EXPR:
4188 case LROTATE_EXPR:
4189 case RROTATE_EXPR:
4190 case VEC_WIDEN_LSHIFT_HI_EXPR:
4191 case VEC_WIDEN_LSHIFT_LO_EXPR:
4192 case WIDEN_LSHIFT_EXPR:
4193 return 11;
4195 case WIDEN_SUM_EXPR:
4196 case PLUS_EXPR:
4197 case POINTER_PLUS_EXPR:
4198 case POINTER_DIFF_EXPR:
4199 case MINUS_EXPR:
4200 return 12;
4202 case VEC_WIDEN_MULT_HI_EXPR:
4203 case VEC_WIDEN_MULT_LO_EXPR:
4204 case WIDEN_MULT_EXPR:
4205 case DOT_PROD_EXPR:
4206 case WIDEN_MULT_PLUS_EXPR:
4207 case WIDEN_MULT_MINUS_EXPR:
4208 case MULT_EXPR:
4209 case MULT_HIGHPART_EXPR:
4210 case TRUNC_DIV_EXPR:
4211 case CEIL_DIV_EXPR:
4212 case FLOOR_DIV_EXPR:
4213 case ROUND_DIV_EXPR:
4214 case RDIV_EXPR:
4215 case EXACT_DIV_EXPR:
4216 case TRUNC_MOD_EXPR:
4217 case CEIL_MOD_EXPR:
4218 case FLOOR_MOD_EXPR:
4219 case ROUND_MOD_EXPR:
4220 return 13;
4222 case TRUTH_NOT_EXPR:
4223 case BIT_NOT_EXPR:
4224 case POSTINCREMENT_EXPR:
4225 case POSTDECREMENT_EXPR:
4226 case PREINCREMENT_EXPR:
4227 case PREDECREMENT_EXPR:
4228 case NEGATE_EXPR:
4229 case INDIRECT_REF:
4230 case ADDR_EXPR:
4231 case FLOAT_EXPR:
4232 CASE_CONVERT:
4233 case FIX_TRUNC_EXPR:
4234 case TARGET_EXPR:
4235 return 14;
4237 case CALL_EXPR:
4238 case ARRAY_REF:
4239 case ARRAY_RANGE_REF:
4240 case COMPONENT_REF:
4241 return 15;
4243 /* Special expressions. */
4244 case MIN_EXPR:
4245 case MAX_EXPR:
4246 case ABS_EXPR:
4247 case REALPART_EXPR:
4248 case IMAGPART_EXPR:
4249 case VEC_UNPACK_HI_EXPR:
4250 case VEC_UNPACK_LO_EXPR:
4251 case VEC_UNPACK_FLOAT_HI_EXPR:
4252 case VEC_UNPACK_FLOAT_LO_EXPR:
4253 case VEC_UNPACK_FIX_TRUNC_HI_EXPR:
4254 case VEC_UNPACK_FIX_TRUNC_LO_EXPR:
4255 case VEC_PACK_TRUNC_EXPR:
4256 case VEC_PACK_SAT_EXPR:
4257 return 16;
4259 default:
4260 /* Return an arbitrarily high precedence to avoid surrounding single
4261 VAR_DECLs in ()s. */
4262 return 9999;
4266 /* Return the priority of the operator OP. */
4269 op_prio (const_tree op)
4271 enum tree_code code;
4273 if (op == NULL)
4274 return 9999;
4276 code = TREE_CODE (op);
4277 if (code == SAVE_EXPR || code == NON_LVALUE_EXPR)
4278 return op_prio (TREE_OPERAND (op, 0));
4280 return op_code_prio (code);
4283 /* Return the symbol associated with operator CODE. */
4285 const char *
4286 op_symbol_code (enum tree_code code)
4288 switch (code)
4290 case MODIFY_EXPR:
4291 return "=";
4293 case TRUTH_OR_EXPR:
4294 case TRUTH_ORIF_EXPR:
4295 return "||";
4297 case TRUTH_AND_EXPR:
4298 case TRUTH_ANDIF_EXPR:
4299 return "&&";
4301 case BIT_IOR_EXPR:
4302 return "|";
4304 case TRUTH_XOR_EXPR:
4305 case BIT_XOR_EXPR:
4306 return "^";
4308 case ADDR_EXPR:
4309 case BIT_AND_EXPR:
4310 return "&";
4312 case ORDERED_EXPR:
4313 return "ord";
4314 case UNORDERED_EXPR:
4315 return "unord";
4317 case EQ_EXPR:
4318 return "==";
4319 case UNEQ_EXPR:
4320 return "u==";
4322 case NE_EXPR:
4323 return "!=";
4325 case LT_EXPR:
4326 return "<";
4327 case UNLT_EXPR:
4328 return "u<";
4330 case LE_EXPR:
4331 return "<=";
4332 case UNLE_EXPR:
4333 return "u<=";
4335 case GT_EXPR:
4336 return ">";
4337 case UNGT_EXPR:
4338 return "u>";
4340 case GE_EXPR:
4341 return ">=";
4342 case UNGE_EXPR:
4343 return "u>=";
4345 case LTGT_EXPR:
4346 return "<>";
4348 case LSHIFT_EXPR:
4349 return "<<";
4351 case RSHIFT_EXPR:
4352 return ">>";
4354 case LROTATE_EXPR:
4355 return "r<<";
4357 case RROTATE_EXPR:
4358 return "r>>";
4360 case WIDEN_LSHIFT_EXPR:
4361 return "w<<";
4363 case WIDEN_PLUS_EXPR:
4364 return "w+";
4366 case WIDEN_MINUS_EXPR:
4367 return "w-";
4369 case POINTER_PLUS_EXPR:
4370 return "+";
4372 case PLUS_EXPR:
4373 return "+";
4375 case WIDEN_SUM_EXPR:
4376 return "w+";
4378 case WIDEN_MULT_EXPR:
4379 return "w*";
4381 case MULT_HIGHPART_EXPR:
4382 return "h*";
4384 case NEGATE_EXPR:
4385 case MINUS_EXPR:
4386 case POINTER_DIFF_EXPR:
4387 return "-";
4389 case BIT_NOT_EXPR:
4390 return "~";
4392 case TRUTH_NOT_EXPR:
4393 return "!";
4395 case MULT_EXPR:
4396 case INDIRECT_REF:
4397 return "*";
4399 case TRUNC_DIV_EXPR:
4400 case RDIV_EXPR:
4401 return "/";
4403 case CEIL_DIV_EXPR:
4404 return "/[cl]";
4406 case FLOOR_DIV_EXPR:
4407 return "/[fl]";
4409 case ROUND_DIV_EXPR:
4410 return "/[rd]";
4412 case EXACT_DIV_EXPR:
4413 return "/[ex]";
4415 case TRUNC_MOD_EXPR:
4416 return "%";
4418 case CEIL_MOD_EXPR:
4419 return "%[cl]";
4421 case FLOOR_MOD_EXPR:
4422 return "%[fl]";
4424 case ROUND_MOD_EXPR:
4425 return "%[rd]";
4427 case PREDECREMENT_EXPR:
4428 return " --";
4430 case PREINCREMENT_EXPR:
4431 return " ++";
4433 case POSTDECREMENT_EXPR:
4434 return "-- ";
4436 case POSTINCREMENT_EXPR:
4437 return "++ ";
4439 case MAX_EXPR:
4440 return "max";
4442 case MIN_EXPR:
4443 return "min";
4445 default:
4446 return "<<< ??? >>>";
4450 /* Return the symbol associated with operator OP. */
4452 static const char *
4453 op_symbol (const_tree op)
4455 return op_symbol_code (TREE_CODE (op));
4458 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
4459 the gimple_call_fn of a GIMPLE_CALL. */
4461 void
4462 print_call_name (pretty_printer *pp, tree node, dump_flags_t flags)
4464 tree op0 = node;
4465 int spc = 0;
4467 if (TREE_CODE (op0) == NON_LVALUE_EXPR)
4468 op0 = TREE_OPERAND (op0, 0);
4470 again:
4471 switch (TREE_CODE (op0))
4473 case VAR_DECL:
4474 case PARM_DECL:
4475 case FUNCTION_DECL:
4476 dump_function_name (pp, op0, flags);
4477 break;
4479 case ADDR_EXPR:
4480 case INDIRECT_REF:
4481 CASE_CONVERT:
4482 op0 = TREE_OPERAND (op0, 0);
4483 goto again;
4485 case COND_EXPR:
4486 pp_left_paren (pp);
4487 dump_generic_node (pp, TREE_OPERAND (op0, 0), 0, flags, false);
4488 pp_string (pp, ") ? ");
4489 dump_generic_node (pp, TREE_OPERAND (op0, 1), 0, flags, false);
4490 pp_string (pp, " : ");
4491 dump_generic_node (pp, TREE_OPERAND (op0, 2), 0, flags, false);
4492 break;
4494 case ARRAY_REF:
4495 if (TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
4496 dump_function_name (pp, TREE_OPERAND (op0, 0), flags);
4497 else
4498 dump_generic_node (pp, op0, 0, flags, false);
4499 break;
4501 case MEM_REF:
4502 if (integer_zerop (TREE_OPERAND (op0, 1)))
4504 op0 = TREE_OPERAND (op0, 0);
4505 goto again;
4507 /* Fallthru. */
4508 case COMPONENT_REF:
4509 case SSA_NAME:
4510 case OBJ_TYPE_REF:
4511 dump_generic_node (pp, op0, 0, flags, false);
4512 break;
4514 default:
4515 NIY;
4519 /* Print the first N characters in the array STR, replacing non-printable
4520 characters (including embedded nuls) with unambiguous escape sequences. */
4522 void
4523 pretty_print_string (pretty_printer *pp, const char *str, size_t n)
4525 if (str == NULL)
4526 return;
4528 for ( ; n; --n, ++str)
4530 switch (str[0])
4532 case '\b':
4533 pp_string (pp, "\\b");
4534 break;
4536 case '\f':
4537 pp_string (pp, "\\f");
4538 break;
4540 case '\n':
4541 pp_string (pp, "\\n");
4542 break;
4544 case '\r':
4545 pp_string (pp, "\\r");
4546 break;
4548 case '\t':
4549 pp_string (pp, "\\t");
4550 break;
4552 case '\v':
4553 pp_string (pp, "\\v");
4554 break;
4556 case '\\':
4557 pp_string (pp, "\\\\");
4558 break;
4560 case '\"':
4561 pp_string (pp, "\\\"");
4562 break;
4564 case '\'':
4565 pp_string (pp, "\\'");
4566 break;
4568 default:
4569 if (str[0] || n > 1)
4571 if (!ISPRINT (str[0]))
4573 char buf[5];
4574 sprintf (buf, "\\x%02x", (unsigned char)str[0]);
4575 pp_string (pp, buf);
4577 else
4578 pp_character (pp, str[0]);
4579 break;
4585 static void
4586 maybe_init_pretty_print (FILE *file)
4588 if (!tree_pp)
4590 tree_pp = new pretty_printer ();
4591 pp_needs_newline (tree_pp) = true;
4592 pp_translate_identifiers (tree_pp) = false;
4595 tree_pp->buffer->stream = file;
4598 static void
4599 newline_and_indent (pretty_printer *pp, int spc)
4601 pp_newline (pp);
4602 INDENT (spc);
4605 /* Print the identifier ID to PRETTY-PRINTER. */
4607 void
4608 pp_tree_identifier (pretty_printer *pp, tree id)
4610 if (pp_translate_identifiers (pp))
4612 const char *text = identifier_to_locale (IDENTIFIER_POINTER (id));
4613 pp_append_text (pp, text, text + strlen (text));
4615 else
4616 pp_append_text (pp, IDENTIFIER_POINTER (id),
4617 IDENTIFIER_POINTER (id) + IDENTIFIER_LENGTH (id));
4620 /* A helper function that is used to dump function information before the
4621 function dump. */
4623 void
4624 dump_function_header (FILE *dump_file, tree fdecl, dump_flags_t flags)
4626 const char *dname, *aname;
4627 struct cgraph_node *node = cgraph_node::get (fdecl);
4628 struct function *fun = DECL_STRUCT_FUNCTION (fdecl);
4630 dname = lang_hooks.decl_printable_name (fdecl, 1);
4632 if (DECL_ASSEMBLER_NAME_SET_P (fdecl))
4633 aname = (IDENTIFIER_POINTER
4634 (DECL_ASSEMBLER_NAME (fdecl)));
4635 else
4636 aname = "<unset-asm-name>";
4638 fprintf (dump_file, "\n;; Function %s (%s, funcdef_no=%d",
4639 dname, aname, fun->funcdef_no);
4640 if (!(flags & TDF_NOUID))
4641 fprintf (dump_file, ", decl_uid=%d", DECL_UID (fdecl));
4642 if (node)
4644 fprintf (dump_file, ", cgraph_uid=%d", node->get_uid ());
4645 fprintf (dump_file, ", symbol_order=%d)%s\n\n", node->order,
4646 node->frequency == NODE_FREQUENCY_HOT
4647 ? " (hot)"
4648 : node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
4649 ? " (unlikely executed)"
4650 : node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
4651 ? " (executed once)"
4652 : "");
4654 else
4655 fprintf (dump_file, ")\n\n");
4658 /* Dump double_int D to pretty_printer PP. UNS is true
4659 if D is unsigned and false otherwise. */
4660 void
4661 pp_double_int (pretty_printer *pp, double_int d, bool uns)
4663 if (d.fits_shwi ())
4664 pp_wide_integer (pp, d.low);
4665 else if (d.fits_uhwi ())
4666 pp_unsigned_wide_integer (pp, d.low);
4667 else
4669 unsigned HOST_WIDE_INT low = d.low;
4670 HOST_WIDE_INT high = d.high;
4671 if (!uns && d.is_negative ())
4673 pp_minus (pp);
4674 high = ~high + !low;
4675 low = -low;
4677 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4678 systems? */
4679 sprintf (pp_buffer (pp)->digit_buffer,
4680 HOST_WIDE_INT_PRINT_DOUBLE_HEX,
4681 (unsigned HOST_WIDE_INT) high, low);
4682 pp_string (pp, pp_buffer (pp)->digit_buffer);
4686 #if __GNUC__ >= 10
4687 # pragma GCC diagnostic pop
4688 #endif