From: David Malcolm Date: Thu, 4 Dec 2014 21:33:22 +0000 (+0000) Subject: Avoid overuse of name "buffer" in tree-pretty-print.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87aca3a6aed5f33bc3ead975e96ed8db80c45cd6;p=gcc.git Avoid overuse of name "buffer" in tree-pretty-print.c gcc/ChangeLog: * tree-pretty-print.c (INDENT): Rename "buffer" to "pp". (NIY): Likewise. (buffer): Rename this variable to... (tree_pp): ...this. (do_niy): Rename param from "buffer" to "pp". (dump_decl_name): Likewise. (dump_function_name): Likewise. (dump_function_declaration): Likewise. (dump_array_domain): Likewise. (dump_omp_clause): Likewise. (dump_omp_clauses): Likewise. (dump_location): Likewise. (dump_block_node): Likewise. (dump_generic_node): Likewise. (print_declaration): Likewise. (print_struct_decl): Likewise. (print_call_name): Likewise. (pretty_print_string): Likewise. (newline_and_indent): Likewise. (print_generic_decl): Update for renaming of "buffer" to "tree_pp". (print_generic_stmt): Likewise. (print_generic_stmt_indented): Likewise. (print_generic_expr): Likewise. (maybe_init_pretty_print): Likewise. From-SVN: r218405 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 92a46ed03a0..d086e854dd8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,33 @@ +2014-12-04 David Malcolm + + * tree-pretty-print.c (INDENT): Rename "buffer" to "pp". + (NIY): Likewise. + (buffer): Rename this variable to... + (tree_pp): ...this. + + (do_niy): Rename param from "buffer" to "pp". + (dump_decl_name): Likewise. + (dump_function_name): Likewise. + (dump_function_declaration): Likewise. + (dump_array_domain): Likewise. + (dump_omp_clause): Likewise. + (dump_omp_clauses): Likewise. + (dump_location): Likewise. + (dump_block_node): Likewise. + (dump_generic_node): Likewise. + (print_declaration): Likewise. + (print_struct_decl): Likewise. + (print_call_name): Likewise. + (pretty_print_string): Likewise. + (newline_and_indent): Likewise. + + (print_generic_decl): Update for renaming of "buffer" to + "tree_pp". + (print_generic_stmt): Likewise. + (print_generic_stmt_indented): Likewise. + (print_generic_expr): Likewise. + (maybe_init_pretty_print): Likewise. + 2014-12-04 David Malcolm PR jit/63854 diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 41174722740..808c15d8768 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -57,33 +57,33 @@ static void print_struct_decl (pretty_printer *, const_tree, int, int); static void do_niy (pretty_printer *, const_tree); #define INDENT(SPACE) do { \ - int i; for (i = 0; i>>"); + pp_string (pp, " >>>"); } /* Debugging function to print out a generic expression. */ @@ -132,8 +132,8 @@ void print_generic_decl (FILE *file, tree decl, int flags) { maybe_init_pretty_print (file); - print_declaration (buffer, decl, 2, flags); - pp_write_text_to_stream (buffer); + print_declaration (tree_pp, decl, 2, flags); + pp_write_text_to_stream (tree_pp); } /* Print tree T, and its successors, on file FILE. FLAGS specifies details @@ -143,8 +143,8 @@ void print_generic_stmt (FILE *file, tree t, int flags) { maybe_init_pretty_print (file); - dump_generic_node (buffer, t, 0, flags, true); - pp_newline_and_flush (buffer); + dump_generic_node (tree_pp, t, 0, flags, true); + pp_newline_and_flush (tree_pp); } /* Print tree T, and its successors, on file FILE. FLAGS specifies details @@ -159,9 +159,9 @@ print_generic_stmt_indented (FILE *file, tree t, int flags, int indent) maybe_init_pretty_print (file); for (i = 0; i < indent; i++) - pp_space (buffer); - dump_generic_node (buffer, t, indent, flags, true); - pp_newline_and_flush (buffer); + pp_space (tree_pp); + dump_generic_node (tree_pp, t, indent, flags, true); + pp_newline_and_flush (tree_pp); } /* Print a single expression T on file FILE. FLAGS specifies details to show @@ -171,77 +171,77 @@ void print_generic_expr (FILE *file, tree t, int flags) { maybe_init_pretty_print (file); - dump_generic_node (buffer, t, 0, flags, false); - pp_flush (buffer); + dump_generic_node (tree_pp, t, 0, flags, false); + pp_flush (tree_pp); } /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set in FLAGS. */ static void -dump_decl_name (pretty_printer *buffer, tree node, int flags) +dump_decl_name (pretty_printer *pp, tree node, int flags) { if (DECL_NAME (node)) { if ((flags & TDF_ASMNAME) && DECL_ASSEMBLER_NAME_SET_P (node)) - pp_tree_identifier (buffer, DECL_ASSEMBLER_NAME (node)); + pp_tree_identifier (pp, DECL_ASSEMBLER_NAME (node)); else - pp_tree_identifier (buffer, DECL_NAME (node)); + pp_tree_identifier (pp, DECL_NAME (node)); } if ((flags & TDF_UID) || DECL_NAME (node) == NULL_TREE) { if (TREE_CODE (node) == LABEL_DECL && LABEL_DECL_UID (node) != -1) - pp_printf (buffer, "L.%d", (int) LABEL_DECL_UID (node)); + pp_printf (pp, "L.%d", (int) LABEL_DECL_UID (node)); else if (TREE_CODE (node) == DEBUG_EXPR_DECL) { if (flags & TDF_NOUID) - pp_string (buffer, "D#xxxx"); + pp_string (pp, "D#xxxx"); else - pp_printf (buffer, "D#%i", DEBUG_TEMP_UID (node)); + pp_printf (pp, "D#%i", DEBUG_TEMP_UID (node)); } else { char c = TREE_CODE (node) == CONST_DECL ? 'C' : 'D'; if (flags & TDF_NOUID) - pp_printf (buffer, "%c.xxxx", c); + pp_printf (pp, "%c.xxxx", c); else - pp_printf (buffer, "%c.%u", c, DECL_UID (node)); + pp_printf (pp, "%c.%u", c, DECL_UID (node)); } } if ((flags & TDF_ALIAS) && DECL_PT_UID (node) != DECL_UID (node)) { if (flags & TDF_NOUID) - pp_printf (buffer, "ptD.xxxx"); + pp_printf (pp, "ptD.xxxx"); else - pp_printf (buffer, "ptD.%u", DECL_PT_UID (node)); + pp_printf (pp, "ptD.%u", DECL_PT_UID (node)); } } /* Like the above, but used for pretty printing function calls. */ static void -dump_function_name (pretty_printer *buffer, tree node, int flags) +dump_function_name (pretty_printer *pp, tree node, int flags) { if (CONVERT_EXPR_P (node)) node = TREE_OPERAND (node, 0); if (DECL_NAME (node) && (flags & TDF_ASMNAME) == 0) - pp_string (buffer, lang_hooks.decl_printable_name (node, 1)); + pp_string (pp, lang_hooks.decl_printable_name (node, 1)); else - dump_decl_name (buffer, node, flags); + dump_decl_name (pp, node, flags); } -/* Dump a function declaration. NODE is the FUNCTION_TYPE. BUFFER, SPC and +/* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and FLAGS are as in dump_generic_node. */ static void -dump_function_declaration (pretty_printer *buffer, tree node, +dump_function_declaration (pretty_printer *pp, tree node, int spc, int flags) { bool wrote_arg = false; tree arg; - pp_space (buffer); - pp_left_paren (buffer); + pp_space (pp); + pp_left_paren (pp); /* Print the argument types. */ arg = TYPE_ARG_TYPES (node); @@ -249,31 +249,31 @@ dump_function_declaration (pretty_printer *buffer, tree node, { if (wrote_arg) { - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } wrote_arg = true; - dump_generic_node (buffer, TREE_VALUE (arg), spc, flags, false); + dump_generic_node (pp, TREE_VALUE (arg), spc, flags, false); arg = TREE_CHAIN (arg); } /* Drop the trailing void_type_node if we had any previous argument. */ if (arg == void_list_node && !wrote_arg) - pp_string (buffer, "void"); + pp_string (pp, "void"); /* Properly dump vararg function types. */ else if (!arg && wrote_arg) - pp_string (buffer, ", ..."); + pp_string (pp, ", ..."); /* Avoid printing any arg for unprototyped functions. */ - pp_right_paren (buffer); + pp_right_paren (pp); } /* Dump the domain associated with an array. */ static void -dump_array_domain (pretty_printer *buffer, tree domain, int spc, int flags) +dump_array_domain (pretty_printer *pp, tree domain, int spc, int flags) { - pp_left_bracket (buffer); + pp_left_bracket (pp); if (domain) { tree min = TYPE_MIN_VALUE (domain); @@ -282,27 +282,27 @@ dump_array_domain (pretty_printer *buffer, tree domain, int spc, int flags) if (min && max && integer_zerop (min) && tree_fits_shwi_p (max)) - pp_wide_integer (buffer, tree_to_shwi (max) + 1); + pp_wide_integer (pp, tree_to_shwi (max) + 1); else { if (min) - dump_generic_node (buffer, min, spc, flags, false); - pp_colon (buffer); + dump_generic_node (pp, min, spc, flags, false); + pp_colon (pp); if (max) - dump_generic_node (buffer, max, spc, flags, false); + dump_generic_node (pp, max, spc, flags, false); } } else - pp_string (buffer, ""); - pp_right_bracket (buffer); + pp_string (pp, ""); + pp_right_bracket (pp); } -/* Dump OpenMP clause CLAUSE. BUFFER, CLAUSE, SPC and FLAGS are as in +/* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in dump_generic_node. */ static void -dump_omp_clause (pretty_printer *buffer, tree clause, int spc, int flags) +dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags) { const char *name; @@ -333,440 +333,440 @@ dump_omp_clause (pretty_printer *buffer, tree clause, int spc, int flags) name = "_looptemp_"; goto print_remap; print_remap: - pp_string (buffer, name); - pp_left_paren (buffer); - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + pp_string (pp, name); + pp_left_paren (pp); + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_REDUCTION: - pp_string (buffer, "reduction("); + pp_string (pp, "reduction("); if (OMP_CLAUSE_REDUCTION_CODE (clause) != ERROR_MARK) { - pp_string (buffer, + pp_string (pp, op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause))); - pp_colon (buffer); + pp_colon (pp); } - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_IF: - pp_string (buffer, "if("); - dump_generic_node (buffer, OMP_CLAUSE_IF_EXPR (clause), + pp_string (pp, "if("); + dump_generic_node (pp, OMP_CLAUSE_IF_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_NUM_THREADS: - pp_string (buffer, "num_threads("); - dump_generic_node (buffer, OMP_CLAUSE_NUM_THREADS_EXPR (clause), + pp_string (pp, "num_threads("); + dump_generic_node (pp, OMP_CLAUSE_NUM_THREADS_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE__CILK_FOR_COUNT_: - pp_string (buffer, "_Cilk_for_count_("); - dump_generic_node (buffer, OMP_CLAUSE_OPERAND (clause, 0), + pp_string (pp, "_Cilk_for_count_("); + dump_generic_node (pp, OMP_CLAUSE_OPERAND (clause, 0), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_NOWAIT: - pp_string (buffer, "nowait"); + pp_string (pp, "nowait"); break; case OMP_CLAUSE_ORDERED: - pp_string (buffer, "ordered"); + pp_string (pp, "ordered"); break; case OMP_CLAUSE_DEFAULT: - pp_string (buffer, "default("); + pp_string (pp, "default("); switch (OMP_CLAUSE_DEFAULT_KIND (clause)) { case OMP_CLAUSE_DEFAULT_UNSPECIFIED: break; case OMP_CLAUSE_DEFAULT_SHARED: - pp_string (buffer, "shared"); + pp_string (pp, "shared"); break; case OMP_CLAUSE_DEFAULT_NONE: - pp_string (buffer, "none"); + pp_string (pp, "none"); break; case OMP_CLAUSE_DEFAULT_PRIVATE: - pp_string (buffer, "private"); + pp_string (pp, "private"); break; case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE: - pp_string (buffer, "firstprivate"); + pp_string (pp, "firstprivate"); break; default: gcc_unreachable (); } - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_SCHEDULE: - pp_string (buffer, "schedule("); + pp_string (pp, "schedule("); switch (OMP_CLAUSE_SCHEDULE_KIND (clause)) { case OMP_CLAUSE_SCHEDULE_STATIC: - pp_string (buffer, "static"); + pp_string (pp, "static"); break; case OMP_CLAUSE_SCHEDULE_DYNAMIC: - pp_string (buffer, "dynamic"); + pp_string (pp, "dynamic"); break; case OMP_CLAUSE_SCHEDULE_GUIDED: - pp_string (buffer, "guided"); + pp_string (pp, "guided"); break; case OMP_CLAUSE_SCHEDULE_RUNTIME: - pp_string (buffer, "runtime"); + pp_string (pp, "runtime"); break; case OMP_CLAUSE_SCHEDULE_AUTO: - pp_string (buffer, "auto"); + pp_string (pp, "auto"); break; case OMP_CLAUSE_SCHEDULE_CILKFOR: - pp_string (buffer, "cilk-for grain"); + pp_string (pp, "cilk-for grain"); break; default: gcc_unreachable (); } if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause)) { - pp_comma (buffer); - dump_generic_node (buffer, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause), + pp_comma (pp); + dump_generic_node (pp, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause), spc, flags, false); } - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_UNTIED: - pp_string (buffer, "untied"); + pp_string (pp, "untied"); break; case OMP_CLAUSE_COLLAPSE: - pp_string (buffer, "collapse("); - dump_generic_node (buffer, OMP_CLAUSE_COLLAPSE_EXPR (clause), + pp_string (pp, "collapse("); + dump_generic_node (pp, OMP_CLAUSE_COLLAPSE_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_FINAL: - pp_string (buffer, "final("); - dump_generic_node (buffer, OMP_CLAUSE_FINAL_EXPR (clause), + pp_string (pp, "final("); + dump_generic_node (pp, OMP_CLAUSE_FINAL_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_MERGEABLE: - pp_string (buffer, "mergeable"); + pp_string (pp, "mergeable"); break; case OMP_CLAUSE_LINEAR: - pp_string (buffer, "linear("); - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + pp_string (pp, "linear("); + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); - pp_colon (buffer); - dump_generic_node (buffer, OMP_CLAUSE_LINEAR_STEP (clause), + pp_colon (pp); + dump_generic_node (pp, OMP_CLAUSE_LINEAR_STEP (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_ALIGNED: - pp_string (buffer, "aligned("); - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + pp_string (pp, "aligned("); + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause)) { - pp_colon (buffer); - dump_generic_node (buffer, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause), + pp_colon (pp); + dump_generic_node (pp, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause), spc, flags, false); } - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_DEPEND: - pp_string (buffer, "depend("); + pp_string (pp, "depend("); switch (OMP_CLAUSE_DEPEND_KIND (clause)) { case OMP_CLAUSE_DEPEND_IN: - pp_string (buffer, "in"); + pp_string (pp, "in"); break; case OMP_CLAUSE_DEPEND_OUT: - pp_string (buffer, "out"); + pp_string (pp, "out"); break; case OMP_CLAUSE_DEPEND_INOUT: - pp_string (buffer, "inout"); + pp_string (pp, "inout"); break; default: gcc_unreachable (); } - pp_colon (buffer); - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + pp_colon (pp); + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_MAP: - pp_string (buffer, "map("); + pp_string (pp, "map("); switch (OMP_CLAUSE_MAP_KIND (clause)) { case OMP_CLAUSE_MAP_ALLOC: case OMP_CLAUSE_MAP_POINTER: - pp_string (buffer, "alloc"); + pp_string (pp, "alloc"); break; case OMP_CLAUSE_MAP_TO: case OMP_CLAUSE_MAP_TO_PSET: - pp_string (buffer, "to"); + pp_string (pp, "to"); break; case OMP_CLAUSE_MAP_FROM: - pp_string (buffer, "from"); + pp_string (pp, "from"); break; case OMP_CLAUSE_MAP_TOFROM: - pp_string (buffer, "tofrom"); + pp_string (pp, "tofrom"); break; default: gcc_unreachable (); } - pp_colon (buffer); - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + pp_colon (pp); + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); print_clause_size: if (OMP_CLAUSE_SIZE (clause)) { if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP && OMP_CLAUSE_MAP_KIND (clause) == OMP_CLAUSE_MAP_POINTER) - pp_string (buffer, " [pointer assign, bias: "); + pp_string (pp, " [pointer assign, bias: "); else if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP && OMP_CLAUSE_MAP_KIND (clause) == OMP_CLAUSE_MAP_TO_PSET) - pp_string (buffer, " [pointer set, len: "); + pp_string (pp, " [pointer set, len: "); else - pp_string (buffer, " [len: "); - dump_generic_node (buffer, OMP_CLAUSE_SIZE (clause), + pp_string (pp, " [len: "); + dump_generic_node (pp, OMP_CLAUSE_SIZE (clause), spc, flags, false); - pp_right_bracket (buffer); + pp_right_bracket (pp); } - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_FROM: - pp_string (buffer, "from("); - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + pp_string (pp, "from("); + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); goto print_clause_size; case OMP_CLAUSE_TO: - pp_string (buffer, "to("); - dump_generic_node (buffer, OMP_CLAUSE_DECL (clause), + pp_string (pp, "to("); + dump_generic_node (pp, OMP_CLAUSE_DECL (clause), spc, flags, false); goto print_clause_size; case OMP_CLAUSE_NUM_TEAMS: - pp_string (buffer, "num_teams("); - dump_generic_node (buffer, OMP_CLAUSE_NUM_TEAMS_EXPR (clause), + pp_string (pp, "num_teams("); + dump_generic_node (pp, OMP_CLAUSE_NUM_TEAMS_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_THREAD_LIMIT: - pp_string (buffer, "thread_limit("); - dump_generic_node (buffer, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause), + pp_string (pp, "thread_limit("); + dump_generic_node (pp, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_DEVICE: - pp_string (buffer, "device("); - dump_generic_node (buffer, OMP_CLAUSE_DEVICE_ID (clause), + pp_string (pp, "device("); + dump_generic_node (pp, OMP_CLAUSE_DEVICE_ID (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_DIST_SCHEDULE: - pp_string (buffer, "dist_schedule(static"); + pp_string (pp, "dist_schedule(static"); if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause)) { - pp_comma (buffer); - dump_generic_node (buffer, + pp_comma (pp); + dump_generic_node (pp, OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause), spc, flags, false); } - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_PROC_BIND: - pp_string (buffer, "proc_bind("); + pp_string (pp, "proc_bind("); switch (OMP_CLAUSE_PROC_BIND_KIND (clause)) { case OMP_CLAUSE_PROC_BIND_MASTER: - pp_string (buffer, "master"); + pp_string (pp, "master"); break; case OMP_CLAUSE_PROC_BIND_CLOSE: - pp_string (buffer, "close"); + pp_string (pp, "close"); break; case OMP_CLAUSE_PROC_BIND_SPREAD: - pp_string (buffer, "spread"); + pp_string (pp, "spread"); break; default: gcc_unreachable (); } - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_SAFELEN: - pp_string (buffer, "safelen("); - dump_generic_node (buffer, OMP_CLAUSE_SAFELEN_EXPR (clause), + pp_string (pp, "safelen("); + dump_generic_node (pp, OMP_CLAUSE_SAFELEN_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_SIMDLEN: - pp_string (buffer, "simdlen("); - dump_generic_node (buffer, OMP_CLAUSE_SIMDLEN_EXPR (clause), + pp_string (pp, "simdlen("); + dump_generic_node (pp, OMP_CLAUSE_SIMDLEN_EXPR (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE__SIMDUID_: - pp_string (buffer, "_simduid_("); - dump_generic_node (buffer, OMP_CLAUSE__SIMDUID__DECL (clause), + pp_string (pp, "_simduid_("); + dump_generic_node (pp, OMP_CLAUSE__SIMDUID__DECL (clause), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); break; case OMP_CLAUSE_INBRANCH: - pp_string (buffer, "inbranch"); + pp_string (pp, "inbranch"); break; case OMP_CLAUSE_NOTINBRANCH: - pp_string (buffer, "notinbranch"); + pp_string (pp, "notinbranch"); break; case OMP_CLAUSE_FOR: - pp_string (buffer, "for"); + pp_string (pp, "for"); break; case OMP_CLAUSE_PARALLEL: - pp_string (buffer, "parallel"); + pp_string (pp, "parallel"); break; case OMP_CLAUSE_SECTIONS: - pp_string (buffer, "sections"); + pp_string (pp, "sections"); break; case OMP_CLAUSE_TASKGROUP: - pp_string (buffer, "taskgroup"); + pp_string (pp, "taskgroup"); break; default: /* Should never happen. */ - dump_generic_node (buffer, clause, spc, flags, false); + dump_generic_node (pp, clause, spc, flags, false); break; } } -/* Dump the list of OpenMP clauses. BUFFER, SPC and FLAGS are as in +/* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in dump_generic_node. */ void -dump_omp_clauses (pretty_printer *buffer, tree clause, int spc, int flags) +dump_omp_clauses (pretty_printer *pp, tree clause, int spc, int flags) { if (clause == NULL) return; - pp_space (buffer); + pp_space (pp); while (1) { - dump_omp_clause (buffer, clause, spc, flags); + dump_omp_clause (pp, clause, spc, flags); clause = OMP_CLAUSE_CHAIN (clause); if (clause == NULL) return; - pp_space (buffer); + pp_space (pp); } } -/* Dump location LOC to BUFFER. */ +/* Dump location LOC to PP. */ void -dump_location (pretty_printer *buffer, location_t loc) +dump_location (pretty_printer *pp, location_t loc) { expanded_location xloc = expand_location (loc); - pp_left_bracket (buffer); + pp_left_bracket (pp); if (xloc.file) { - pp_string (buffer, xloc.file); - pp_string (buffer, ":"); + pp_string (pp, xloc.file); + pp_string (pp, ":"); } - pp_decimal_int (buffer, xloc.line); - pp_colon (buffer); - pp_decimal_int (buffer, xloc.column); - pp_string (buffer, "] "); + pp_decimal_int (pp, xloc.line); + pp_colon (pp); + pp_decimal_int (pp, xloc.column); + pp_string (pp, "] "); } -/* Dump lexical block BLOCK. BUFFER, SPC and FLAGS are as in +/* Dump lexical block BLOCK. PP, SPC and FLAGS are as in dump_generic_node. */ static void -dump_block_node (pretty_printer *buffer, tree block, int spc, int flags) +dump_block_node (pretty_printer *pp, tree block, int spc, int flags) { tree t; - pp_printf (buffer, "BLOCK #%d ", BLOCK_NUMBER (block)); + pp_printf (pp, "BLOCK #%d ", BLOCK_NUMBER (block)); if (flags & TDF_ADDRESS) - pp_printf (buffer, "[%p] ", (void *) block); + pp_printf (pp, "[%p] ", (void *) block); if (BLOCK_ABSTRACT (block)) - pp_string (buffer, "[abstract] "); + pp_string (pp, "[abstract] "); if (TREE_ASM_WRITTEN (block)) - pp_string (buffer, "[written] "); + pp_string (pp, "[written] "); if (flags & TDF_SLIM) return; if (BLOCK_SOURCE_LOCATION (block)) - dump_location (buffer, BLOCK_SOURCE_LOCATION (block)); + dump_location (pp, BLOCK_SOURCE_LOCATION (block)); - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); if (BLOCK_SUPERCONTEXT (block)) { - pp_string (buffer, "SUPERCONTEXT: "); - dump_generic_node (buffer, BLOCK_SUPERCONTEXT (block), 0, + pp_string (pp, "SUPERCONTEXT: "); + dump_generic_node (pp, BLOCK_SUPERCONTEXT (block), 0, flags | TDF_SLIM, false); - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } if (BLOCK_SUBBLOCKS (block)) { - pp_string (buffer, "SUBBLOCKS: "); + pp_string (pp, "SUBBLOCKS: "); for (t = BLOCK_SUBBLOCKS (block); t; t = BLOCK_CHAIN (t)) { - dump_generic_node (buffer, t, 0, flags | TDF_SLIM, false); - pp_space (buffer); + dump_generic_node (pp, t, 0, flags | TDF_SLIM, false); + pp_space (pp); } - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } if (BLOCK_CHAIN (block)) { - pp_string (buffer, "SIBLINGS: "); + pp_string (pp, "SIBLINGS: "); for (t = BLOCK_CHAIN (block); t; t = BLOCK_CHAIN (t)) { - dump_generic_node (buffer, t, 0, flags | TDF_SLIM, false); - pp_space (buffer); + dump_generic_node (pp, t, 0, flags | TDF_SLIM, false); + pp_space (pp); } - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } if (BLOCK_VARS (block)) { - pp_string (buffer, "VARS: "); + pp_string (pp, "VARS: "); for (t = BLOCK_VARS (block); t; t = TREE_CHAIN (t)) { - dump_generic_node (buffer, t, 0, flags, false); - pp_space (buffer); + dump_generic_node (pp, t, 0, flags, false); + pp_space (pp); } - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block)) > 0) @@ -774,51 +774,51 @@ dump_block_node (pretty_printer *buffer, tree block, int spc, int flags) unsigned i; vec *nlv = BLOCK_NONLOCALIZED_VARS (block); - pp_string (buffer, "NONLOCALIZED_VARS: "); + pp_string (pp, "NONLOCALIZED_VARS: "); FOR_EACH_VEC_ELT (*nlv, i, t) { - dump_generic_node (buffer, t, 0, flags, false); - pp_space (buffer); + dump_generic_node (pp, t, 0, flags, false); + pp_space (pp); } - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } if (BLOCK_ABSTRACT_ORIGIN (block)) { - pp_string (buffer, "ABSTRACT_ORIGIN: "); - dump_generic_node (buffer, BLOCK_ABSTRACT_ORIGIN (block), 0, + pp_string (pp, "ABSTRACT_ORIGIN: "); + dump_generic_node (pp, BLOCK_ABSTRACT_ORIGIN (block), 0, flags | TDF_SLIM, false); - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } if (BLOCK_FRAGMENT_ORIGIN (block)) { - pp_string (buffer, "FRAGMENT_ORIGIN: "); - dump_generic_node (buffer, BLOCK_FRAGMENT_ORIGIN (block), 0, + pp_string (pp, "FRAGMENT_ORIGIN: "); + dump_generic_node (pp, BLOCK_FRAGMENT_ORIGIN (block), 0, flags | TDF_SLIM, false); - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } if (BLOCK_FRAGMENT_CHAIN (block)) { - pp_string (buffer, "FRAGMENT_CHAIN: "); + pp_string (pp, "FRAGMENT_CHAIN: "); for (t = BLOCK_FRAGMENT_CHAIN (block); t; t = BLOCK_FRAGMENT_CHAIN (t)) { - dump_generic_node (buffer, t, 0, flags | TDF_SLIM, false); - pp_space (buffer); + dump_generic_node (pp, t, 0, flags | TDF_SLIM, false); + pp_space (pp); } - newline_and_indent (buffer, spc + 2); + newline_and_indent (pp, spc + 2); } } -/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of +/* Dump the node NODE on the pretty_printer PP, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h). If IS_STMT is true, the object printed is considered to be a statement and it is terminated by ';' if appropriate. */ int -dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, +dump_generic_node (pretty_printer *pp, tree node, int spc, int flags, bool is_stmt) { tree type; @@ -833,20 +833,20 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, is_expr = EXPR_P (node); if (is_stmt && (flags & TDF_STMTADDR)) - pp_printf (buffer, "<&%p> ", (void *)node); + pp_printf (pp, "<&%p> ", (void *)node); if ((flags & TDF_LINENO) && EXPR_HAS_LOCATION (node)) - dump_location (buffer, EXPR_LOCATION (node)); + dump_location (pp, EXPR_LOCATION (node)); code = TREE_CODE (node); switch (code) { case ERROR_MARK: - pp_string (buffer, "<<< error >>>"); + pp_string (pp, "<<< error >>>"); break; case IDENTIFIER_NODE: - pp_tree_identifier (buffer, node); + pp_tree_identifier (pp, node); break; case TREE_LIST: @@ -854,21 +854,21 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, { if (TREE_PURPOSE (node)) { - dump_generic_node (buffer, TREE_PURPOSE (node), spc, flags, false); - pp_space (buffer); + dump_generic_node (pp, TREE_PURPOSE (node), spc, flags, false); + pp_space (pp); } - dump_generic_node (buffer, TREE_VALUE (node), spc, flags, false); + dump_generic_node (pp, TREE_VALUE (node), spc, flags, false); node = TREE_CHAIN (node); if (node && TREE_CODE (node) == TREE_LIST) { - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } } break; case TREE_BINFO: - dump_generic_node (buffer, BINFO_TYPE (node), spc, flags, false); + dump_generic_node (pp, BINFO_TYPE (node), spc, flags, false); break; case TREE_VEC: @@ -879,12 +879,12 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, size_t len = TREE_VEC_LENGTH (node); for (i = 0; i < len - 1; i++) { - dump_generic_node (buffer, TREE_VEC_ELT (node, i), spc, flags, + dump_generic_node (pp, TREE_VEC_ELT (node, i), spc, flags, false); - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } - dump_generic_node (buffer, TREE_VEC_ELT (node, len - 1), spc, + dump_generic_node (pp, TREE_VEC_ELT (node, len - 1), spc, flags, false); } } @@ -904,19 +904,19 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, enum tree_code_class tclass; if (quals & TYPE_QUAL_ATOMIC) - pp_string (buffer, "atomic "); + pp_string (pp, "atomic "); if (quals & TYPE_QUAL_CONST) - pp_string (buffer, "const "); + pp_string (pp, "const "); else if (quals & TYPE_QUAL_VOLATILE) - pp_string (buffer, "volatile "); + pp_string (pp, "volatile "); else if (quals & TYPE_QUAL_RESTRICT) - pp_string (buffer, "restrict "); + pp_string (pp, "restrict "); if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node))) { - pp_string (buffer, " "); + pp_string (pp, " "); } tclass = TREE_CODE_CLASS (TREE_CODE (node)); @@ -924,90 +924,90 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (tclass == tcc_declaration) { if (DECL_NAME (node)) - dump_decl_name (buffer, node, flags); + dump_decl_name (pp, node, flags); else - pp_string (buffer, ""); + pp_string (pp, ""); } else if (tclass == tcc_type) { if (TYPE_NAME (node)) { if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE) - pp_tree_identifier (buffer, TYPE_NAME (node)); + pp_tree_identifier (pp, TYPE_NAME (node)); else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL && DECL_NAME (TYPE_NAME (node))) - dump_decl_name (buffer, TYPE_NAME (node), flags); + dump_decl_name (pp, TYPE_NAME (node), flags); else - pp_string (buffer, ""); + pp_string (pp, ""); } else if (TREE_CODE (node) == VECTOR_TYPE) { - pp_string (buffer, "vector"); - pp_left_paren (buffer); - pp_wide_integer (buffer, TYPE_VECTOR_SUBPARTS (node)); - pp_string (buffer, ") "); - dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false); + pp_string (pp, "vector"); + pp_left_paren (pp); + pp_wide_integer (pp, TYPE_VECTOR_SUBPARTS (node)); + pp_string (pp, ") "); + dump_generic_node (pp, TREE_TYPE (node), spc, flags, false); } else if (TREE_CODE (node) == INTEGER_TYPE) { if (TYPE_PRECISION (node) == CHAR_TYPE_SIZE) - pp_string (buffer, (TYPE_UNSIGNED (node) + pp_string (pp, (TYPE_UNSIGNED (node) ? "unsigned char" : "signed char")); else if (TYPE_PRECISION (node) == SHORT_TYPE_SIZE) - pp_string (buffer, (TYPE_UNSIGNED (node) + pp_string (pp, (TYPE_UNSIGNED (node) ? "unsigned short" : "signed short")); else if (TYPE_PRECISION (node) == INT_TYPE_SIZE) - pp_string (buffer, (TYPE_UNSIGNED (node) + pp_string (pp, (TYPE_UNSIGNED (node) ? "unsigned int" : "signed int")); else if (TYPE_PRECISION (node) == LONG_TYPE_SIZE) - pp_string (buffer, (TYPE_UNSIGNED (node) + pp_string (pp, (TYPE_UNSIGNED (node) ? "unsigned long" : "signed long")); else if (TYPE_PRECISION (node) == LONG_LONG_TYPE_SIZE) - pp_string (buffer, (TYPE_UNSIGNED (node) + pp_string (pp, (TYPE_UNSIGNED (node) ? "unsigned long long" : "signed long long")); else if (TYPE_PRECISION (node) >= CHAR_TYPE_SIZE && exact_log2 (TYPE_PRECISION (node)) != -1) { - pp_string (buffer, (TYPE_UNSIGNED (node) ? "uint" : "int")); - pp_decimal_int (buffer, TYPE_PRECISION (node)); - pp_string (buffer, "_t"); + pp_string (pp, (TYPE_UNSIGNED (node) ? "uint" : "int")); + pp_decimal_int (pp, TYPE_PRECISION (node)); + pp_string (pp, "_t"); } else { - pp_string (buffer, (TYPE_UNSIGNED (node) + pp_string (pp, (TYPE_UNSIGNED (node) ? ""); + pp_string (pp, ""); } break; } @@ -1018,51 +1018,51 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (TREE_TYPE (node) == NULL) { - pp_string (buffer, str); - pp_string (buffer, ""); + pp_string (pp, str); + pp_string (pp, ""); } else if (TREE_CODE (TREE_TYPE (node)) == FUNCTION_TYPE) { tree fnode = TREE_TYPE (node); - dump_generic_node (buffer, TREE_TYPE (fnode), spc, flags, false); - pp_space (buffer); - pp_left_paren (buffer); - pp_string (buffer, str); + dump_generic_node (pp, TREE_TYPE (fnode), spc, flags, false); + pp_space (pp); + pp_left_paren (pp); + pp_string (pp, str); if (TYPE_NAME (node) && DECL_NAME (TYPE_NAME (node))) - dump_decl_name (buffer, TYPE_NAME (node), flags); + dump_decl_name (pp, TYPE_NAME (node), flags); else if (flags & TDF_NOUID) - pp_printf (buffer, ""); + pp_printf (pp, ""); else - pp_printf (buffer, "", TYPE_UID (node)); + pp_printf (pp, "", TYPE_UID (node)); - pp_right_paren (buffer); - dump_function_declaration (buffer, fnode, spc, flags); + pp_right_paren (pp); + dump_function_declaration (pp, fnode, spc, flags); } else { unsigned int quals = TYPE_QUALS (node); - dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false); - pp_space (buffer); - pp_string (buffer, str); + dump_generic_node (pp, TREE_TYPE (node), spc, flags, false); + pp_space (pp); + pp_string (pp, str); if (quals & TYPE_QUAL_CONST) - pp_string (buffer, " const"); + pp_string (pp, " const"); if (quals & TYPE_QUAL_VOLATILE) - pp_string (buffer, " volatile"); + pp_string (pp, " volatile"); if (quals & TYPE_QUAL_RESTRICT) - pp_string (buffer, " restrict"); + pp_string (pp, " restrict"); if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node))) { - pp_string (buffer, " digit_buffer); - pp_string (buffer, pp_buffer (buffer)->digit_buffer); + print_hex (val, pp_buffer (pp)->digit_buffer); + pp_string (pp, pp_buffer (pp)->digit_buffer); } if (TREE_OVERFLOW (node)) - pp_string (buffer, "(OVF)"); + pp_string (pp, "(OVF)"); break; case REAL_CST: @@ -1296,27 +1296,27 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, { REAL_VALUE_TYPE d; if (TREE_OVERFLOW (node)) - pp_string (buffer, " overflow"); + pp_string (pp, " overflow"); #if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC) d = TREE_REAL_CST (node); if (REAL_VALUE_ISINF (d)) - pp_string (buffer, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf"); + pp_string (pp, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf"); else if (REAL_VALUE_ISNAN (d)) - pp_string (buffer, " Nan"); + pp_string (pp, " Nan"); else { char string[100]; real_to_decimal (string, &d, sizeof (string), 0, 1); - pp_string (buffer, string); + pp_string (pp, string); } #else { HOST_WIDE_INT i; unsigned char *p = (unsigned char *) &TREE_REAL_CST (node); - pp_string (buffer, "0x"); + pp_string (pp, "0x"); for (i = 0; i < sizeof TREE_REAL_CST (node); i++) - output_formatted_integer (buffer, "%02x", *p++); + output_formatted_integer (pp, "%02x", *p++); } #endif break; @@ -1326,77 +1326,77 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, { char string[100]; fixed_to_decimal (string, TREE_FIXED_CST_PTR (node), sizeof (string)); - pp_string (buffer, string); + pp_string (pp, string); break; } case COMPLEX_CST: - pp_string (buffer, "__complex__ ("); - dump_generic_node (buffer, TREE_REALPART (node), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_IMAGPART (node), spc, flags, false); - pp_right_paren (buffer); + pp_string (pp, "__complex__ ("); + dump_generic_node (pp, TREE_REALPART (node), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_IMAGPART (node), spc, flags, false); + pp_right_paren (pp); break; case STRING_CST: - pp_string (buffer, "\""); - pretty_print_string (buffer, TREE_STRING_POINTER (node)); - pp_string (buffer, "\""); + pp_string (pp, "\""); + pretty_print_string (pp, TREE_STRING_POINTER (node)); + pp_string (pp, "\""); break; case VECTOR_CST: { unsigned i; - pp_string (buffer, "{ "); + pp_string (pp, "{ "); for (i = 0; i < VECTOR_CST_NELTS (node); ++i) { if (i != 0) - pp_string (buffer, ", "); - dump_generic_node (buffer, VECTOR_CST_ELT (node, i), + pp_string (pp, ", "); + dump_generic_node (pp, VECTOR_CST_ELT (node, i), spc, flags, false); } - pp_string (buffer, " }"); + pp_string (pp, " }"); } break; case FUNCTION_TYPE: case METHOD_TYPE: - dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false); - pp_space (buffer); + dump_generic_node (pp, TREE_TYPE (node), spc, flags, false); + pp_space (pp); if (TREE_CODE (node) == METHOD_TYPE) { if (TYPE_METHOD_BASETYPE (node)) - dump_decl_name (buffer, TYPE_NAME (TYPE_METHOD_BASETYPE (node)), + dump_decl_name (pp, TYPE_NAME (TYPE_METHOD_BASETYPE (node)), flags); else - pp_string (buffer, ""); - pp_colon_colon (buffer); + pp_string (pp, ""); + pp_colon_colon (pp); } if (TYPE_NAME (node) && DECL_NAME (TYPE_NAME (node))) - dump_decl_name (buffer, TYPE_NAME (node), flags); + dump_decl_name (pp, TYPE_NAME (node), flags); else if (flags & TDF_NOUID) - pp_printf (buffer, ""); + pp_printf (pp, ""); else - pp_printf (buffer, "", TYPE_UID (node)); - dump_function_declaration (buffer, node, spc, flags); + pp_printf (pp, "", TYPE_UID (node)); + dump_function_declaration (pp, node, spc, flags); break; case FUNCTION_DECL: case CONST_DECL: - dump_decl_name (buffer, node, flags); + dump_decl_name (pp, node, flags); break; case LABEL_DECL: if (DECL_NAME (node)) - dump_decl_name (buffer, node, flags); + dump_decl_name (pp, node, flags); else if (LABEL_DECL_UID (node) != -1) - pp_printf (buffer, "", (int) LABEL_DECL_UID (node)); + pp_printf (pp, "", (int) LABEL_DECL_UID (node)); else { if (flags & TDF_NOUID) - pp_string (buffer, ""); + pp_string (pp, ""); else - pp_printf (buffer, "", DECL_UID (node)); + pp_printf (pp, "", DECL_UID (node)); } break; @@ -1407,7 +1407,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, break; } if (DECL_NAME (node)) - dump_decl_name (buffer, node, flags); + dump_decl_name (pp, node, flags); else if (TYPE_NAME (TREE_TYPE (node)) != node) { if ((TREE_CODE (TREE_TYPE (node)) == RECORD_TYPE @@ -1416,19 +1416,19 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, { /* The type is a c++ class: all structures have at least 4 methods. */ - pp_string (buffer, "class "); - dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false); + pp_string (pp, "class "); + dump_generic_node (pp, TREE_TYPE (node), spc, flags, false); } else { - pp_string (buffer, + pp_string (pp, (TREE_CODE (TREE_TYPE (node)) == UNION_TYPE ? "union" : "struct ")); - dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false); + dump_generic_node (pp, TREE_TYPE (node), spc, flags, false); } } else - pp_string (buffer, ""); + pp_string (pp, ""); break; case VAR_DECL: @@ -1437,11 +1437,11 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, case DEBUG_EXPR_DECL: case NAMESPACE_DECL: case NAMELIST_DECL: - dump_decl_name (buffer, node, flags); + dump_decl_name (pp, node, flags); break; case RESULT_DECL: - pp_string (buffer, ""); + pp_string (pp, ""); break; case COMPONENT_REF: @@ -1476,44 +1476,44 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, str = "->"; } if (op_prio (op0) < op_prio (node)) - pp_left_paren (buffer); - dump_generic_node (buffer, op0, spc, flags, false); + pp_left_paren (pp); + dump_generic_node (pp, op0, spc, flags, false); if (op_prio (op0) < op_prio (node)) - pp_right_paren (buffer); - pp_string (buffer, str); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); + pp_right_paren (pp); + pp_string (pp, str); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); op0 = component_ref_field_offset (node); if (op0 && TREE_CODE (op0) != INTEGER_CST) { - pp_string (buffer, "{off: "); - dump_generic_node (buffer, op0, spc, flags, false); - pp_right_brace (buffer); + pp_string (pp, "{off: "); + dump_generic_node (pp, op0, spc, flags, false); + pp_right_brace (pp); } break; case BIT_FIELD_REF: - pp_string (buffer, "BIT_FIELD_REF <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "BIT_FIELD_REF <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_greater (pp); break; case ARRAY_REF: case ARRAY_RANGE_REF: op0 = TREE_OPERAND (node, 0); if (op_prio (op0) < op_prio (node)) - pp_left_paren (buffer); - dump_generic_node (buffer, op0, spc, flags, false); + pp_left_paren (pp); + dump_generic_node (pp, op0, spc, flags, false); if (op_prio (op0) < op_prio (node)) - pp_right_paren (buffer); - pp_left_bracket (buffer); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); + pp_right_paren (pp); + pp_left_bracket (pp); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); if (TREE_CODE (node) == ARRAY_RANGE_REF) - pp_string (buffer, " ..."); - pp_right_bracket (buffer); + pp_string (pp, " ..."); + pp_right_bracket (pp); op0 = array_ref_low_bound (node); op1 = array_ref_element_size (node); @@ -1522,11 +1522,11 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, || TREE_OPERAND (node, 2) || TREE_OPERAND (node, 3)) { - pp_string (buffer, "{lb: "); - dump_generic_node (buffer, op0, spc, flags, false); - pp_string (buffer, " sz: "); - dump_generic_node (buffer, op1, spc, flags, false); - pp_right_brace (buffer); + pp_string (pp, "{lb: "); + dump_generic_node (pp, op0, spc, flags, false); + pp_string (pp, " sz: "); + dump_generic_node (pp, op1, spc, flags, false); + pp_right_brace (pp); } break; @@ -1537,9 +1537,9 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, bool is_struct_init = false; bool is_array_init = false; widest_int curidx; - pp_left_brace (buffer); + pp_left_brace (pp); if (TREE_CLOBBER_P (node)) - pp_string (buffer, "CLOBBER"); + pp_string (pp, "CLOBBER"); else if (TREE_CODE (TREE_TYPE (node)) == RECORD_TYPE || TREE_CODE (TREE_TYPE (node)) == UNION_TYPE) is_struct_init = true; @@ -1559,30 +1559,30 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, { if (is_struct_init) { - pp_dot (buffer); - dump_generic_node (buffer, field, spc, flags, false); - pp_equal (buffer); + pp_dot (pp); + dump_generic_node (pp, field, spc, flags, false); + pp_equal (pp); } else if (is_array_init && (TREE_CODE (field) != INTEGER_CST || curidx != wi::to_widest (field))) { - pp_left_bracket (buffer); + pp_left_bracket (pp); if (TREE_CODE (field) == RANGE_EXPR) { - dump_generic_node (buffer, TREE_OPERAND (field, 0), spc, + dump_generic_node (pp, TREE_OPERAND (field, 0), spc, flags, false); - pp_string (buffer, " ... "); - dump_generic_node (buffer, TREE_OPERAND (field, 1), spc, + pp_string (pp, " ... "); + dump_generic_node (pp, TREE_OPERAND (field, 1), spc, flags, false); if (TREE_CODE (TREE_OPERAND (field, 1)) == INTEGER_CST) curidx = wi::to_widest (TREE_OPERAND (field, 1)); } else - dump_generic_node (buffer, field, spc, flags, false); + dump_generic_node (pp, field, spc, flags, false); if (TREE_CODE (field) == INTEGER_CST) curidx = wi::to_widest (field); - pp_string (buffer, "]="); + pp_string (pp, "]="); } } if (is_array_init) @@ -1591,16 +1591,16 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (TREE_CODE (TREE_OPERAND (val, 0)) == FUNCTION_DECL) val = TREE_OPERAND (val, 0); if (val && TREE_CODE (val) == FUNCTION_DECL) - dump_decl_name (buffer, val, flags); + dump_decl_name (pp, val, flags); else - dump_generic_node (buffer, val, spc, flags, false); + dump_generic_node (pp, val, spc, flags, false); if (ix != vec_safe_length (CONSTRUCTOR_ELTS (node)) - 1) { - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } } - pp_right_brace (buffer); + pp_right_brace (pp); } break; @@ -1609,36 +1609,36 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, tree *tp; if (flags & TDF_SLIM) { - pp_string (buffer, ""); + pp_string (pp, ""); break; } - dump_generic_node (buffer, TREE_OPERAND (node, 0), + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, !(flags & TDF_SLIM)); if (flags & TDF_SLIM) - newline_and_indent (buffer, spc); + newline_and_indent (pp, spc); else { - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } for (tp = &TREE_OPERAND (node, 1); TREE_CODE (*tp) == COMPOUND_EXPR; tp = &TREE_OPERAND (*tp, 1)) { - dump_generic_node (buffer, TREE_OPERAND (*tp, 0), + dump_generic_node (pp, TREE_OPERAND (*tp, 0), spc, flags, !(flags & TDF_SLIM)); if (flags & TDF_SLIM) - newline_and_indent (buffer, spc); + newline_and_indent (pp, spc); else { - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } } - dump_generic_node (buffer, *tp, spc, flags, !(flags & TDF_SLIM)); + dump_generic_node (pp, *tp, spc, flags, !(flags & TDF_SLIM)); } break; @@ -1649,52 +1649,52 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (flags & TDF_SLIM) { - pp_string (buffer, ""); + pp_string (pp, ""); break; } for (si = tsi_start (node); !tsi_end_p (si); tsi_next (&si)) { if (!first) - newline_and_indent (buffer, spc); + newline_and_indent (pp, spc); else first = false; - dump_generic_node (buffer, tsi_stmt (si), spc, flags, true); + dump_generic_node (pp, tsi_stmt (si), spc, flags, true); } } break; case MODIFY_EXPR: case INIT_EXPR: - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); - pp_space (buffer); - pp_equal (buffer); - pp_space (buffer); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, + pp_space (pp); + pp_equal (pp); + pp_space (pp); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); break; case TARGET_EXPR: - pp_string (buffer, "TARGET_EXPR <"); - dump_generic_node (buffer, TARGET_EXPR_SLOT (node), spc, flags, false); - pp_comma (buffer); - pp_space (buffer); - dump_generic_node (buffer, TARGET_EXPR_INITIAL (node), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "TARGET_EXPR <"); + dump_generic_node (pp, TARGET_EXPR_SLOT (node), spc, flags, false); + pp_comma (pp); + pp_space (pp); + dump_generic_node (pp, TARGET_EXPR_INITIAL (node), spc, flags, false); + pp_greater (pp); break; case DECL_EXPR: - print_declaration (buffer, DECL_EXPR_DECL (node), spc, flags); + print_declaration (pp, DECL_EXPR_DECL (node), spc, flags); is_stmt = false; break; case COND_EXPR: if (TREE_TYPE (node) == NULL || TREE_TYPE (node) == void_type_node) { - pp_string (buffer, "if ("); - dump_generic_node (buffer, COND_EXPR_COND (node), spc, flags, false); - pp_right_paren (buffer); + pp_string (pp, "if ("); + dump_generic_node (pp, COND_EXPR_COND (node), spc, flags, false); + pp_right_paren (pp); /* The lowered cond_exprs should always be printed in full. */ if (COND_EXPR_THEN (node) && (IS_EMPTY_STMT (COND_EXPR_THEN (node)) @@ -1703,13 +1703,13 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, && (IS_EMPTY_STMT (COND_EXPR_ELSE (node)) || TREE_CODE (COND_EXPR_ELSE (node)) == GOTO_EXPR)) { - pp_space (buffer); - dump_generic_node (buffer, COND_EXPR_THEN (node), + pp_space (pp); + dump_generic_node (pp, COND_EXPR_THEN (node), 0, flags, true); if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node))) { - pp_string (buffer, " else "); - dump_generic_node (buffer, COND_EXPR_ELSE (node), + pp_string (pp, " else "); + dump_generic_node (pp, COND_EXPR_ELSE (node), 0, flags, true); } } @@ -1718,88 +1718,88 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, /* Output COND_EXPR_THEN. */ if (COND_EXPR_THEN (node)) { - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, COND_EXPR_THEN (node), spc+4, + newline_and_indent (pp, spc+2); + pp_left_brace (pp); + newline_and_indent (pp, spc+4); + dump_generic_node (pp, COND_EXPR_THEN (node), spc+4, flags, true); - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); } /* Output COND_EXPR_ELSE. */ if (COND_EXPR_ELSE (node) && !IS_EMPTY_STMT (COND_EXPR_ELSE (node))) { - newline_and_indent (buffer, spc); - pp_string (buffer, "else"); - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, COND_EXPR_ELSE (node), spc+4, + newline_and_indent (pp, spc); + pp_string (pp, "else"); + newline_and_indent (pp, spc+2); + pp_left_brace (pp); + newline_and_indent (pp, spc+4); + dump_generic_node (pp, COND_EXPR_ELSE (node), spc+4, flags, true); - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); } } is_expr = false; } else { - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_space (buffer); - pp_question (buffer); - pp_space (buffer); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_space (buffer); - pp_colon (buffer); - pp_space (buffer); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_space (pp); + pp_question (pp); + pp_space (pp); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_space (pp); + pp_colon (pp); + pp_space (pp); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); } break; case BIND_EXPR: - pp_left_brace (buffer); + pp_left_brace (pp); if (!(flags & TDF_SLIM)) { if (BIND_EXPR_VARS (node)) { - pp_newline (buffer); + pp_newline (pp); for (op0 = BIND_EXPR_VARS (node); op0; op0 = DECL_CHAIN (op0)) { - print_declaration (buffer, op0, spc+2, flags); - pp_newline (buffer); + print_declaration (pp, op0, spc+2, flags); + pp_newline (pp); } } - newline_and_indent (buffer, spc+2); - dump_generic_node (buffer, BIND_EXPR_BODY (node), spc+2, flags, true); - newline_and_indent (buffer, spc); - pp_right_brace (buffer); + newline_and_indent (pp, spc+2); + dump_generic_node (pp, BIND_EXPR_BODY (node), spc+2, flags, true); + newline_and_indent (pp, spc); + pp_right_brace (pp); } is_expr = false; break; case CALL_EXPR: if (CALL_EXPR_FN (node) != NULL_TREE) - print_call_name (buffer, CALL_EXPR_FN (node), flags); + print_call_name (pp, CALL_EXPR_FN (node), flags); else - pp_string (buffer, internal_fn_name (CALL_EXPR_IFN (node))); + pp_string (pp, internal_fn_name (CALL_EXPR_IFN (node))); /* Print parameters. */ - pp_space (buffer); - pp_left_paren (buffer); + pp_space (pp); + pp_left_paren (pp); { tree arg; call_expr_arg_iterator iter; FOR_EACH_CALL_EXPR_ARG (arg, iter, node) { - dump_generic_node (buffer, arg, spc, flags, false); + dump_generic_node (pp, arg, spc, flags, false); if (more_call_expr_args_p (&iter)) { - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } } } @@ -1807,25 +1807,25 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, { if (call_expr_nargs (node) > 0) { - pp_comma (buffer); - pp_space (buffer); + pp_comma (pp); + pp_space (pp); } - pp_string (buffer, "__builtin_va_arg_pack ()"); + pp_string (pp, "__builtin_va_arg_pack ()"); } - pp_right_paren (buffer); + pp_right_paren (pp); op1 = CALL_EXPR_STATIC_CHAIN (node); if (op1) { - pp_string (buffer, " [static-chain: "); - dump_generic_node (buffer, op1, spc, flags, false); - pp_right_bracket (buffer); + pp_string (pp, " [static-chain: "); + dump_generic_node (pp, op1, spc, flags, false); + pp_right_bracket (pp); } if (CALL_EXPR_RETURN_SLOT_OPT (node)) - pp_string (buffer, " [return slot optimization]"); + pp_string (pp, " [return slot optimization]"); if (CALL_EXPR_TAILCALL (node)) - pp_string (buffer, " [tail call]"); + pp_string (pp, " [tail call]"); break; case WITH_CLEANUP_EXPR: @@ -1833,15 +1833,15 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, break; case CLEANUP_POINT_EXPR: - pp_string (buffer, "<>"); + pp_string (pp, "<>"); break; case PLACEHOLDER_EXPR: - pp_string (buffer, "("); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_right_paren (buffer); + pp_string (pp, "VIEW_CONVERT_EXPR<"); + dump_generic_node (pp, TREE_TYPE (node), spc, flags, false); + pp_string (pp, ">("); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_right_paren (pp); break; case PAREN_EXPR: - pp_string (buffer, "(("); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, "))"); + pp_string (pp, "(("); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, "))"); break; case NON_LVALUE_EXPR: - pp_string (buffer, "NON_LVALUE_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "NON_LVALUE_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); break; case SAVE_EXPR: - pp_string (buffer, "SAVE_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "SAVE_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); break; case COMPLEX_EXPR: - pp_string (buffer, "COMPLEX_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "COMPLEX_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_greater (pp); break; case CONJ_EXPR: - pp_string (buffer, "CONJ_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "CONJ_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); break; case REALPART_EXPR: - pp_string (buffer, "REALPART_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "REALPART_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); break; case IMAGPART_EXPR: - pp_string (buffer, "IMAGPART_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "IMAGPART_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); break; case VA_ARG_EXPR: - pp_string (buffer, "VA_ARG_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "VA_ARG_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_greater (pp); break; case TRY_FINALLY_EXPR: case TRY_CATCH_EXPR: - pp_string (buffer, "try"); - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc+4, flags, true); - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); - newline_and_indent (buffer, spc); - pp_string (buffer, + pp_string (pp, "try"); + newline_and_indent (pp, spc+2); + pp_left_brace (pp); + newline_and_indent (pp, spc+4); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc+4, flags, true); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); + newline_and_indent (pp, spc); + pp_string (pp, (TREE_CODE (node) == TRY_CATCH_EXPR) ? "catch" : "finally"); - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc+4, flags, true); - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); + newline_and_indent (pp, spc+2); + pp_left_brace (pp); + newline_and_indent (pp, spc+4); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc+4, flags, true); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); is_expr = false; break; case CATCH_EXPR: - pp_string (buffer, "catch ("); - dump_generic_node (buffer, CATCH_TYPES (node), spc+2, flags, false); - pp_right_paren (buffer); - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, CATCH_BODY (node), spc+4, flags, true); - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); + pp_string (pp, "catch ("); + dump_generic_node (pp, CATCH_TYPES (node), spc+2, flags, false); + pp_right_paren (pp); + newline_and_indent (pp, spc+2); + pp_left_brace (pp); + newline_and_indent (pp, spc+4); + dump_generic_node (pp, CATCH_BODY (node), spc+4, flags, true); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); is_expr = false; break; case EH_FILTER_EXPR: - pp_string (buffer, "<<>>"); - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, EH_FILTER_FAILURE (node), spc+4, flags, true); - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); + pp_string (pp, "<<>>"); + newline_and_indent (pp, spc+2); + pp_left_brace (pp); + newline_and_indent (pp, spc+4); + dump_generic_node (pp, EH_FILTER_FAILURE (node), spc+4, flags, true); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); is_expr = false; break; @@ -2121,88 +2121,88 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, || strcmp (name, "continue") == 0) break; } - dump_generic_node (buffer, op0, spc, flags, false); - pp_colon (buffer); + dump_generic_node (pp, op0, spc, flags, false); + pp_colon (pp); if (DECL_NONLOCAL (op0)) - pp_string (buffer, " [non-local]"); + pp_string (pp, " [non-local]"); break; case LOOP_EXPR: - pp_string (buffer, "while (1)"); + pp_string (pp, "while (1)"); if (!(flags & TDF_SLIM)) { - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, LOOP_EXPR_BODY (node), spc+4, flags, true); - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); + newline_and_indent (pp, spc+2); + pp_left_brace (pp); + newline_and_indent (pp, spc+4); + dump_generic_node (pp, LOOP_EXPR_BODY (node), spc+4, flags, true); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); } is_expr = false; break; case PREDICT_EXPR: - pp_string (buffer, "// predicted "); + pp_string (pp, "// predicted "); if (PREDICT_EXPR_OUTCOME (node)) - pp_string (buffer, "likely by "); + pp_string (pp, "likely by "); else - pp_string (buffer, "unlikely by "); - pp_string (buffer, predictor_name (PREDICT_EXPR_PREDICTOR (node))); - pp_string (buffer, " predictor."); + pp_string (pp, "unlikely by "); + pp_string (pp, predictor_name (PREDICT_EXPR_PREDICTOR (node))); + pp_string (pp, " predictor."); break; case ANNOTATE_EXPR: - pp_string (buffer, "ANNOTATE_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, "ANNOTATE_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); switch ((enum annot_expr_kind) TREE_INT_CST_LOW (TREE_OPERAND (node, 1))) { case annot_expr_ivdep_kind: - pp_string (buffer, ", ivdep"); + pp_string (pp, ", ivdep"); break; case annot_expr_no_vector_kind: - pp_string (buffer, ", no-vector"); + pp_string (pp, ", no-vector"); break; case annot_expr_vector_kind: - pp_string (buffer, ", vector"); + pp_string (pp, ", vector"); break; default: gcc_unreachable (); } - pp_greater (buffer); + pp_greater (pp); break; case RETURN_EXPR: - pp_string (buffer, "return"); + pp_string (pp, "return"); op0 = TREE_OPERAND (node, 0); if (op0) { - pp_space (buffer); + pp_space (pp); if (TREE_CODE (op0) == MODIFY_EXPR) - dump_generic_node (buffer, TREE_OPERAND (op0, 1), + dump_generic_node (pp, TREE_OPERAND (op0, 1), spc, flags, false); else - dump_generic_node (buffer, op0, spc, flags, false); + dump_generic_node (pp, op0, spc, flags, false); } break; case EXIT_EXPR: - pp_string (buffer, "if ("); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ") break"); + pp_string (pp, "if ("); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ") break"); break; case SWITCH_EXPR: - pp_string (buffer, "switch ("); - dump_generic_node (buffer, SWITCH_COND (node), spc, flags, false); - pp_right_paren (buffer); + pp_string (pp, "switch ("); + dump_generic_node (pp, SWITCH_COND (node), spc, flags, false); + pp_right_paren (pp); if (!(flags & TDF_SLIM)) { - newline_and_indent (buffer, spc+2); - pp_left_brace (buffer); + newline_and_indent (pp, spc+2); + pp_left_brace (pp); if (SWITCH_BODY (node)) { - newline_and_indent (buffer, spc+4); - dump_generic_node (buffer, SWITCH_BODY (node), spc+4, flags, + newline_and_indent (pp, spc+4); + dump_generic_node (pp, SWITCH_BODY (node), spc+4, flags, true); } else @@ -2212,21 +2212,21 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, for (i = 0; i < n; ++i) { tree elt = TREE_VEC_ELT (vec, i); - newline_and_indent (buffer, spc+4); + newline_and_indent (pp, spc+4); if (elt) { - dump_generic_node (buffer, elt, spc+4, flags, false); - pp_string (buffer, " goto "); - dump_generic_node (buffer, CASE_LABEL (elt), spc+4, + dump_generic_node (pp, elt, spc+4, flags, false); + pp_string (pp, " goto "); + dump_generic_node (pp, CASE_LABEL (elt), spc+4, flags, true); - pp_semicolon (buffer); + pp_semicolon (pp); } else - pp_string (buffer, "case ???: goto ???;"); + pp_string (pp, "case ???: goto ???;"); } } - newline_and_indent (buffer, spc+2); - pp_right_brace (buffer); + newline_and_indent (pp, spc+2); + pp_right_brace (pp); } is_expr = false; break; @@ -2239,214 +2239,214 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (strcmp (name, "break") == 0 || strcmp (name, "continue") == 0) { - pp_string (buffer, name); + pp_string (pp, name); break; } } - pp_string (buffer, "goto "); - dump_generic_node (buffer, op0, spc, flags, false); + pp_string (pp, "goto "); + dump_generic_node (pp, op0, spc, flags, false); break; case ASM_EXPR: - pp_string (buffer, "__asm__"); + pp_string (pp, "__asm__"); if (ASM_VOLATILE_P (node)) - pp_string (buffer, " __volatile__"); - pp_left_paren (buffer); - dump_generic_node (buffer, ASM_STRING (node), spc, flags, false); - pp_colon (buffer); - dump_generic_node (buffer, ASM_OUTPUTS (node), spc, flags, false); - pp_colon (buffer); - dump_generic_node (buffer, ASM_INPUTS (node), spc, flags, false); + pp_string (pp, " __volatile__"); + pp_left_paren (pp); + dump_generic_node (pp, ASM_STRING (node), spc, flags, false); + pp_colon (pp); + dump_generic_node (pp, ASM_OUTPUTS (node), spc, flags, false); + pp_colon (pp); + dump_generic_node (pp, ASM_INPUTS (node), spc, flags, false); if (ASM_CLOBBERS (node)) { - pp_colon (buffer); - dump_generic_node (buffer, ASM_CLOBBERS (node), spc, flags, false); + pp_colon (pp); + dump_generic_node (pp, ASM_CLOBBERS (node), spc, flags, false); } - pp_right_paren (buffer); + pp_right_paren (pp); break; case CASE_LABEL_EXPR: if (CASE_LOW (node) && CASE_HIGH (node)) { - pp_string (buffer, "case "); - dump_generic_node (buffer, CASE_LOW (node), spc, flags, false); - pp_string (buffer, " ... "); - dump_generic_node (buffer, CASE_HIGH (node), spc, flags, false); + pp_string (pp, "case "); + dump_generic_node (pp, CASE_LOW (node), spc, flags, false); + pp_string (pp, " ... "); + dump_generic_node (pp, CASE_HIGH (node), spc, flags, false); } else if (CASE_LOW (node)) { - pp_string (buffer, "case "); - dump_generic_node (buffer, CASE_LOW (node), spc, flags, false); + pp_string (pp, "case "); + dump_generic_node (pp, CASE_LOW (node), spc, flags, false); } else - pp_string (buffer, "default"); - pp_colon (buffer); + pp_string (pp, "default"); + pp_colon (pp); break; case OBJ_TYPE_REF: - pp_string (buffer, "OBJ_TYPE_REF("); - dump_generic_node (buffer, OBJ_TYPE_REF_EXPR (node), spc, flags, false); - pp_semicolon (buffer); + pp_string (pp, "OBJ_TYPE_REF("); + dump_generic_node (pp, OBJ_TYPE_REF_EXPR (node), spc, flags, false); + pp_semicolon (pp); if (!(flags & TDF_SLIM) && virtual_method_call_p (node)) { - pp_string (buffer, "("); - dump_generic_node (buffer, obj_type_ref_class (node), spc, flags, false); - pp_string (buffer, ")"); + pp_string (pp, "("); + dump_generic_node (pp, obj_type_ref_class (node), spc, flags, false); + pp_string (pp, ")"); } - dump_generic_node (buffer, OBJ_TYPE_REF_OBJECT (node), spc, flags, false); - pp_arrow (buffer); - dump_generic_node (buffer, OBJ_TYPE_REF_TOKEN (node), spc, flags, false); - pp_right_paren (buffer); + dump_generic_node (pp, OBJ_TYPE_REF_OBJECT (node), spc, flags, false); + pp_arrow (pp); + dump_generic_node (pp, OBJ_TYPE_REF_TOKEN (node), spc, flags, false); + pp_right_paren (pp); break; case SSA_NAME: if (SSA_NAME_IDENTIFIER (node)) - dump_generic_node (buffer, SSA_NAME_IDENTIFIER (node), + dump_generic_node (pp, SSA_NAME_IDENTIFIER (node), spc, flags, false); - pp_underscore (buffer); - pp_decimal_int (buffer, SSA_NAME_VERSION (node)); + pp_underscore (pp); + pp_decimal_int (pp, SSA_NAME_VERSION (node)); if (SSA_NAME_IS_DEFAULT_DEF (node)) - pp_string (buffer, "(D)"); + pp_string (pp, "(D)"); if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node)) - pp_string (buffer, "(ab)"); + pp_string (pp, "(ab)"); break; case WITH_SIZE_EXPR: - pp_string (buffer, "WITH_SIZE_EXPR <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "WITH_SIZE_EXPR <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_greater (pp); break; case ASSERT_EXPR: - pp_string (buffer, "ASSERT_EXPR <"); - dump_generic_node (buffer, ASSERT_EXPR_VAR (node), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, ASSERT_EXPR_COND (node), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "ASSERT_EXPR <"); + dump_generic_node (pp, ASSERT_EXPR_VAR (node), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, ASSERT_EXPR_COND (node), spc, flags, false); + pp_greater (pp); break; case SCEV_KNOWN: - pp_string (buffer, "scev_known"); + pp_string (pp, "scev_known"); break; case SCEV_NOT_KNOWN: - pp_string (buffer, "scev_not_known"); + pp_string (pp, "scev_not_known"); break; case POLYNOMIAL_CHREC: - pp_left_brace (buffer); - dump_generic_node (buffer, CHREC_LEFT (node), spc, flags, false); - pp_string (buffer, ", +, "); - dump_generic_node (buffer, CHREC_RIGHT (node), spc, flags, false); - pp_string (buffer, "}_"); - dump_generic_node (buffer, CHREC_VAR (node), spc, flags, false); + pp_left_brace (pp); + dump_generic_node (pp, CHREC_LEFT (node), spc, flags, false); + pp_string (pp, ", +, "); + dump_generic_node (pp, CHREC_RIGHT (node), spc, flags, false); + pp_string (pp, "}_"); + dump_generic_node (pp, CHREC_VAR (node), spc, flags, false); is_stmt = false; break; case REALIGN_LOAD_EXPR: - pp_string (buffer, "REALIGN_LOAD <"); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_greater (buffer); + pp_string (pp, "REALIGN_LOAD <"); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_greater (pp); break; case VEC_COND_EXPR: - pp_string (buffer, " VEC_COND_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " , "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, " , "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_COND_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " , "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " , "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_string (pp, " > "); break; case VEC_PERM_EXPR: - pp_string (buffer, " VEC_PERM_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " , "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, " , "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_PERM_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " , "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " , "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_string (pp, " > "); break; case DOT_PROD_EXPR: - pp_string (buffer, " DOT_PROD_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " DOT_PROD_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_string (pp, " > "); break; case WIDEN_MULT_PLUS_EXPR: - pp_string (buffer, " WIDEN_MULT_PLUS_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " WIDEN_MULT_PLUS_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_string (pp, " > "); break; case WIDEN_MULT_MINUS_EXPR: - pp_string (buffer, " WIDEN_MULT_MINUS_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " WIDEN_MULT_MINUS_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_string (pp, " > "); break; case FMA_EXPR: - pp_string (buffer, " FMA_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " FMA_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 2), spc, flags, false); + pp_string (pp, " > "); break; case OMP_PARALLEL: - pp_string (buffer, "#pragma omp parallel"); - dump_omp_clauses (buffer, OMP_PARALLEL_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp parallel"); + dump_omp_clauses (pp, OMP_PARALLEL_CLAUSES (node), spc, flags); dump_omp_body: if (!(flags & TDF_SLIM) && OMP_BODY (node)) { - newline_and_indent (buffer, spc + 2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc + 4); - dump_generic_node (buffer, OMP_BODY (node), spc + 4, flags, false); - newline_and_indent (buffer, spc + 2); - pp_right_brace (buffer); + newline_and_indent (pp, spc + 2); + pp_left_brace (pp); + newline_and_indent (pp, spc + 4); + dump_generic_node (pp, OMP_BODY (node), spc + 4, flags, false); + newline_and_indent (pp, spc + 2); + pp_right_brace (pp); } is_expr = false; break; case OMP_TASK: - pp_string (buffer, "#pragma omp task"); - dump_omp_clauses (buffer, OMP_TASK_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp task"); + dump_omp_clauses (pp, OMP_TASK_CLAUSES (node), spc, flags); goto dump_omp_body; case OMP_FOR: - pp_string (buffer, "#pragma omp for"); + pp_string (pp, "#pragma omp for"); goto dump_omp_loop; case OMP_SIMD: - pp_string (buffer, "#pragma omp simd"); + pp_string (pp, "#pragma omp simd"); goto dump_omp_loop; case CILK_SIMD: - pp_string (buffer, "#pragma simd"); + pp_string (pp, "#pragma simd"); goto dump_omp_loop; case CILK_FOR: @@ -2456,32 +2456,32 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, goto dump_omp_loop_cilk_for; case OMP_DISTRIBUTE: - pp_string (buffer, "#pragma omp distribute"); + pp_string (pp, "#pragma omp distribute"); goto dump_omp_loop; case OMP_TEAMS: - pp_string (buffer, "#pragma omp teams"); - dump_omp_clauses (buffer, OMP_TEAMS_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp teams"); + dump_omp_clauses (pp, OMP_TEAMS_CLAUSES (node), spc, flags); goto dump_omp_body; case OMP_TARGET_DATA: - pp_string (buffer, "#pragma omp target data"); - dump_omp_clauses (buffer, OMP_TARGET_DATA_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp target data"); + dump_omp_clauses (pp, OMP_TARGET_DATA_CLAUSES (node), spc, flags); goto dump_omp_body; case OMP_TARGET: - pp_string (buffer, "#pragma omp target"); - dump_omp_clauses (buffer, OMP_TARGET_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp target"); + dump_omp_clauses (pp, OMP_TARGET_CLAUSES (node), spc, flags); goto dump_omp_body; case OMP_TARGET_UPDATE: - pp_string (buffer, "#pragma omp target update"); - dump_omp_clauses (buffer, OMP_TARGET_UPDATE_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp target update"); + dump_omp_clauses (pp, OMP_TARGET_UPDATE_CLAUSES (node), spc, flags); is_expr = false; break; dump_omp_loop: - dump_omp_clauses (buffer, OMP_FOR_CLAUSES (node), spc, flags); + dump_omp_clauses (pp, OMP_FOR_CLAUSES (node), spc, flags); dump_omp_loop_cilk_for: if (!(flags & TDF_SLIM)) @@ -2491,13 +2491,13 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (OMP_FOR_PRE_BODY (node)) { if (TREE_CODE (node) == CILK_FOR) - pp_string (buffer, " "); + pp_string (pp, " "); else - newline_and_indent (buffer, spc + 2); - pp_left_brace (buffer); + newline_and_indent (pp, spc + 2); + pp_left_brace (pp); spc += 4; - newline_and_indent (buffer, spc); - dump_generic_node (buffer, OMP_FOR_PRE_BODY (node), + newline_and_indent (pp, spc); + dump_generic_node (pp, OMP_FOR_PRE_BODY (node), spc, flags, false); } if (OMP_FOR_INIT (node)) @@ -2507,162 +2507,162 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, { spc += 2; if (TREE_CODE (node) != CILK_FOR || OMP_FOR_PRE_BODY (node)) - newline_and_indent (buffer, spc); + newline_and_indent (pp, spc); if (TREE_CODE (node) == CILK_FOR) - pp_string (buffer, "_Cilk_for ("); + pp_string (pp, "_Cilk_for ("); else - pp_string (buffer, "for ("); - dump_generic_node (buffer, + pp_string (pp, "for ("); + dump_generic_node (pp, TREE_VEC_ELT (OMP_FOR_INIT (node), i), spc, flags, false); - pp_string (buffer, "; "); - dump_generic_node (buffer, + pp_string (pp, "; "); + dump_generic_node (pp, TREE_VEC_ELT (OMP_FOR_COND (node), i), spc, flags, false); - pp_string (buffer, "; "); - dump_generic_node (buffer, + pp_string (pp, "; "); + dump_generic_node (pp, TREE_VEC_ELT (OMP_FOR_INCR (node), i), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); } if (TREE_CODE (node) == CILK_FOR) - dump_omp_clauses (buffer, OMP_FOR_CLAUSES (node), spc, flags); + dump_omp_clauses (pp, OMP_FOR_CLAUSES (node), spc, flags); } if (OMP_FOR_BODY (node)) { - newline_and_indent (buffer, spc + 2); - pp_left_brace (buffer); - newline_and_indent (buffer, spc + 4); - dump_generic_node (buffer, OMP_FOR_BODY (node), spc + 4, flags, + newline_and_indent (pp, spc + 2); + pp_left_brace (pp); + newline_and_indent (pp, spc + 4); + dump_generic_node (pp, OMP_FOR_BODY (node), spc + 4, flags, false); - newline_and_indent (buffer, spc + 2); - pp_right_brace (buffer); + newline_and_indent (pp, spc + 2); + pp_right_brace (pp); } if (OMP_FOR_INIT (node)) spc -= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node)) - 2; if (OMP_FOR_PRE_BODY (node)) { spc -= 4; - newline_and_indent (buffer, spc + 2); - pp_right_brace (buffer); + newline_and_indent (pp, spc + 2); + pp_right_brace (pp); } } is_expr = false; break; case OMP_SECTIONS: - pp_string (buffer, "#pragma omp sections"); - dump_omp_clauses (buffer, OMP_SECTIONS_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp sections"); + dump_omp_clauses (pp, OMP_SECTIONS_CLAUSES (node), spc, flags); goto dump_omp_body; case OMP_SECTION: - pp_string (buffer, "#pragma omp section"); + pp_string (pp, "#pragma omp section"); goto dump_omp_body; case OMP_MASTER: - pp_string (buffer, "#pragma omp master"); + pp_string (pp, "#pragma omp master"); goto dump_omp_body; case OMP_TASKGROUP: - pp_string (buffer, "#pragma omp taskgroup"); + pp_string (pp, "#pragma omp taskgroup"); goto dump_omp_body; case OMP_ORDERED: - pp_string (buffer, "#pragma omp ordered"); + pp_string (pp, "#pragma omp ordered"); goto dump_omp_body; case OMP_CRITICAL: - pp_string (buffer, "#pragma omp critical"); + pp_string (pp, "#pragma omp critical"); if (OMP_CRITICAL_NAME (node)) { - pp_space (buffer); - pp_left_paren (buffer); - dump_generic_node (buffer, OMP_CRITICAL_NAME (node), spc, + pp_space (pp); + pp_left_paren (pp); + dump_generic_node (pp, OMP_CRITICAL_NAME (node), spc, flags, false); - pp_right_paren (buffer); + pp_right_paren (pp); } goto dump_omp_body; case OMP_ATOMIC: - pp_string (buffer, "#pragma omp atomic"); + pp_string (pp, "#pragma omp atomic"); if (OMP_ATOMIC_SEQ_CST (node)) - pp_string (buffer, " seq_cst"); - newline_and_indent (buffer, spc + 2); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_space (buffer); - pp_equal (buffer); - pp_space (buffer); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " seq_cst"); + newline_and_indent (pp, spc + 2); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_space (pp); + pp_equal (pp); + pp_space (pp); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); break; case OMP_ATOMIC_READ: - pp_string (buffer, "#pragma omp atomic read"); + pp_string (pp, "#pragma omp atomic read"); if (OMP_ATOMIC_SEQ_CST (node)) - pp_string (buffer, " seq_cst"); - newline_and_indent (buffer, spc + 2); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_space (buffer); + pp_string (pp, " seq_cst"); + newline_and_indent (pp, spc + 2); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_space (pp); break; case OMP_ATOMIC_CAPTURE_OLD: case OMP_ATOMIC_CAPTURE_NEW: - pp_string (buffer, "#pragma omp atomic capture"); + pp_string (pp, "#pragma omp atomic capture"); if (OMP_ATOMIC_SEQ_CST (node)) - pp_string (buffer, " seq_cst"); - newline_and_indent (buffer, spc + 2); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_space (buffer); - pp_equal (buffer); - pp_space (buffer); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " seq_cst"); + newline_and_indent (pp, spc + 2); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_space (pp); + pp_equal (pp); + pp_space (pp); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); break; case OMP_SINGLE: - pp_string (buffer, "#pragma omp single"); - dump_omp_clauses (buffer, OMP_SINGLE_CLAUSES (node), spc, flags); + pp_string (pp, "#pragma omp single"); + dump_omp_clauses (pp, OMP_SINGLE_CLAUSES (node), spc, flags); goto dump_omp_body; case OMP_CLAUSE: - dump_omp_clause (buffer, node, spc, flags); + dump_omp_clause (pp, node, spc, flags); is_expr = false; break; case TRANSACTION_EXPR: if (TRANSACTION_EXPR_OUTER (node)) - pp_string (buffer, "__transaction_atomic [[outer]]"); + pp_string (pp, "__transaction_atomic [[outer]]"); else if (TRANSACTION_EXPR_RELAXED (node)) - pp_string (buffer, "__transaction_relaxed"); + pp_string (pp, "__transaction_relaxed"); else - pp_string (buffer, "__transaction_atomic"); + pp_string (pp, "__transaction_atomic"); if (!(flags & TDF_SLIM) && TRANSACTION_EXPR_BODY (node)) { - newline_and_indent (buffer, spc); - pp_left_brace (buffer); - newline_and_indent (buffer, spc + 2); - dump_generic_node (buffer, TRANSACTION_EXPR_BODY (node), + newline_and_indent (pp, spc); + pp_left_brace (pp); + newline_and_indent (pp, spc + 2); + dump_generic_node (pp, TRANSACTION_EXPR_BODY (node), spc + 2, flags, false); - newline_and_indent (buffer, spc); - pp_right_brace (buffer); + newline_and_indent (pp, spc); + pp_right_brace (pp); } is_expr = false; break; case REDUC_MAX_EXPR: - pp_string (buffer, " REDUC_MAX_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " REDUC_MAX_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " > "); break; case REDUC_MIN_EXPR: - pp_string (buffer, " REDUC_MIN_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " REDUC_MIN_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " > "); break; case REDUC_PLUS_EXPR: - pp_string (buffer, " REDUC_PLUS_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " REDUC_PLUS_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " > "); break; case VEC_WIDEN_MULT_HI_EXPR: @@ -2671,75 +2671,75 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, case VEC_WIDEN_MULT_ODD_EXPR: case VEC_WIDEN_LSHIFT_HI_EXPR: case VEC_WIDEN_LSHIFT_LO_EXPR: - pp_space (buffer); + pp_space (pp); for (str = get_tree_code_name (code); *str; str++) - pp_character (buffer, TOUPPER (*str)); - pp_string (buffer, " < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, " > "); + pp_character (pp, TOUPPER (*str)); + pp_string (pp, " < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " > "); break; case VEC_UNPACK_HI_EXPR: - pp_string (buffer, " VEC_UNPACK_HI_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_UNPACK_HI_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " > "); break; case VEC_UNPACK_LO_EXPR: - pp_string (buffer, " VEC_UNPACK_LO_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_UNPACK_LO_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " > "); break; case VEC_UNPACK_FLOAT_HI_EXPR: - pp_string (buffer, " VEC_UNPACK_FLOAT_HI_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_UNPACK_FLOAT_HI_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " > "); break; case VEC_UNPACK_FLOAT_LO_EXPR: - pp_string (buffer, " VEC_UNPACK_FLOAT_LO_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_UNPACK_FLOAT_LO_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, " > "); break; case VEC_PACK_TRUNC_EXPR: - pp_string (buffer, " VEC_PACK_TRUNC_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_PACK_TRUNC_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " > "); break; case VEC_PACK_SAT_EXPR: - pp_string (buffer, " VEC_PACK_SAT_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_PACK_SAT_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " > "); break; case VEC_PACK_FIX_TRUNC_EXPR: - pp_string (buffer, " VEC_PACK_FIX_TRUNC_EXPR < "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); - pp_string (buffer, ", "); - dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - pp_string (buffer, " > "); + pp_string (pp, " VEC_PACK_FIX_TRUNC_EXPR < "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, ", "); + dump_generic_node (pp, TREE_OPERAND (node, 1), spc, flags, false); + pp_string (pp, " > "); break; case BLOCK: - dump_block_node (buffer, node, spc, flags); + dump_block_node (pp, node, spc, flags); break; case CILK_SPAWN_STMT: - pp_string (buffer, "_Cilk_spawn "); - dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false); + pp_string (pp, "_Cilk_spawn "); + dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false); break; case CILK_SYNC_STMT: - pp_string (buffer, "_Cilk_sync"); + pp_string (pp, "_Cilk_sync"); break; default: @@ -2747,7 +2747,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, } if (is_stmt && is_expr) - pp_semicolon (buffer); + pp_semicolon (pp); return spc; } @@ -2755,28 +2755,28 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, /* Print the declaration of a variable. */ void -print_declaration (pretty_printer *buffer, tree t, int spc, int flags) +print_declaration (pretty_printer *pp, tree t, int spc, int flags) { INDENT (spc); if (TREE_CODE(t) == NAMELIST_DECL) { - pp_string(buffer, "namelist "); - dump_decl_name (buffer, t, flags); - pp_semicolon (buffer); + pp_string(pp, "namelist "); + dump_decl_name (pp, t, flags); + pp_semicolon (pp); return; } if (TREE_CODE (t) == TYPE_DECL) - pp_string (buffer, "typedef "); + pp_string (pp, "typedef "); if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL) && DECL_REGISTER (t)) - pp_string (buffer, "register "); + pp_string (pp, "register "); if (TREE_PUBLIC (t) && DECL_EXTERNAL (t)) - pp_string (buffer, "extern "); + pp_string (pp, "extern "); else if (TREE_STATIC (t)) - pp_string (buffer, "static "); + pp_string (pp, "static "); /* Print the type and name. */ if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) @@ -2787,43 +2787,43 @@ print_declaration (pretty_printer *buffer, tree t, int spc, int flags) tmp = TREE_TYPE (t); while (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE) tmp = TREE_TYPE (tmp); - dump_generic_node (buffer, TREE_TYPE (tmp), spc, flags, false); + dump_generic_node (pp, TREE_TYPE (tmp), spc, flags, false); /* Print variable's name. */ - pp_space (buffer); - dump_generic_node (buffer, t, spc, flags, false); + pp_space (pp); + dump_generic_node (pp, t, spc, flags, false); /* Print the dimensions. */ tmp = TREE_TYPE (t); while (TREE_CODE (tmp) == ARRAY_TYPE) { - dump_array_domain (buffer, TYPE_DOMAIN (tmp), spc, flags); + dump_array_domain (pp, TYPE_DOMAIN (tmp), spc, flags); tmp = TREE_TYPE (tmp); } } else if (TREE_CODE (t) == FUNCTION_DECL) { - dump_generic_node (buffer, TREE_TYPE (TREE_TYPE (t)), spc, flags, false); - pp_space (buffer); - dump_decl_name (buffer, t, flags); - dump_function_declaration (buffer, TREE_TYPE (t), spc, flags); + dump_generic_node (pp, TREE_TYPE (TREE_TYPE (t)), spc, flags, false); + pp_space (pp); + dump_decl_name (pp, t, flags); + dump_function_declaration (pp, TREE_TYPE (t), spc, flags); } else { /* Print type declaration. */ - dump_generic_node (buffer, TREE_TYPE (t), spc, flags, false); + dump_generic_node (pp, TREE_TYPE (t), spc, flags, false); /* Print variable's name. */ - pp_space (buffer); - dump_generic_node (buffer, t, spc, flags, false); + pp_space (pp); + dump_generic_node (pp, t, spc, flags, false); } if (TREE_CODE (t) == VAR_DECL && DECL_HARD_REGISTER (t)) { - pp_string (buffer, " __asm__ "); - pp_left_paren (buffer); - dump_generic_node (buffer, DECL_ASSEMBLER_NAME (t), spc, flags, false); - pp_right_paren (buffer); + pp_string (pp, " __asm__ "); + pp_left_paren (pp); + dump_generic_node (pp, DECL_ASSEMBLER_NAME (t), spc, flags, false); + pp_right_paren (pp); } /* The initial value of a function serves to determine whether the function @@ -2834,21 +2834,21 @@ print_declaration (pretty_printer *buffer, tree t, int spc, int flags) /* Print the initial value. */ if (DECL_INITIAL (t)) { - pp_space (buffer); - pp_equal (buffer); - pp_space (buffer); - dump_generic_node (buffer, DECL_INITIAL (t), spc, flags, false); + pp_space (pp); + pp_equal (pp); + pp_space (pp); + dump_generic_node (pp, DECL_INITIAL (t), spc, flags, false); } } if (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t)) { - pp_string (buffer, " [value-expr: "); - dump_generic_node (buffer, DECL_VALUE_EXPR (t), spc, flags, false); - pp_right_bracket (buffer); + pp_string (pp, " [value-expr: "); + dump_generic_node (pp, DECL_VALUE_EXPR (t), spc, flags, false); + pp_right_bracket (pp); } - pp_semicolon (buffer); + pp_semicolon (pp); } @@ -2856,26 +2856,26 @@ print_declaration (pretty_printer *buffer, tree t, int spc, int flags) FIXME: Still incomplete. */ static void -print_struct_decl (pretty_printer *buffer, const_tree node, int spc, int flags) +print_struct_decl (pretty_printer *pp, const_tree node, int spc, int flags) { /* Print the name of the structure. */ if (TYPE_NAME (node)) { INDENT (spc); if (TREE_CODE (node) == RECORD_TYPE) - pp_string (buffer, "struct "); + pp_string (pp, "struct "); else if ((TREE_CODE (node) == UNION_TYPE || TREE_CODE (node) == QUAL_UNION_TYPE)) - pp_string (buffer, "union "); + pp_string (pp, "union "); - dump_generic_node (buffer, TYPE_NAME (node), spc, 0, false); + dump_generic_node (pp, TYPE_NAME (node), spc, 0, false); } /* Print the contents of the structure. */ - pp_newline (buffer); + pp_newline (pp); INDENT (spc); - pp_left_brace (buffer); - pp_newline (buffer); + pp_left_brace (pp); + pp_newline (pp); /* Print the fields of the structure. */ { @@ -2892,14 +2892,14 @@ print_struct_decl (pretty_printer *buffer, const_tree node, int spc, int flags) && (TREE_CODE (TREE_TYPE (tmp)) != POINTER_TYPE || TREE_TYPE (TREE_TYPE (tmp)) != node)) { - print_declaration (buffer, tmp, spc+2, flags); - pp_newline (buffer); + print_declaration (pp, tmp, spc+2, flags); + pp_newline (pp); } tmp = DECL_CHAIN (tmp); } } INDENT (spc); - pp_right_brace (buffer); + pp_right_brace (pp); } /* Return the priority of the operator CODE. @@ -3252,7 +3252,7 @@ op_symbol (const_tree op) the gimple_call_fn of a GIMPLE_CALL. */ void -print_call_name (pretty_printer *buffer, tree node, int flags) +print_call_name (pretty_printer *pp, tree node, int flags) { tree op0 = node; @@ -3265,7 +3265,7 @@ print_call_name (pretty_printer *buffer, tree node, int flags) case VAR_DECL: case PARM_DECL: case FUNCTION_DECL: - dump_function_name (buffer, op0, flags); + dump_function_name (pp, op0, flags); break; case ADDR_EXPR: @@ -3275,19 +3275,19 @@ print_call_name (pretty_printer *buffer, tree node, int flags) goto again; case COND_EXPR: - pp_left_paren (buffer); - dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, flags, false); - pp_string (buffer, ") ? "); - dump_generic_node (buffer, TREE_OPERAND (op0, 1), 0, flags, false); - pp_string (buffer, " : "); - dump_generic_node (buffer, TREE_OPERAND (op0, 2), 0, flags, false); + pp_left_paren (pp); + dump_generic_node (pp, TREE_OPERAND (op0, 0), 0, flags, false); + pp_string (pp, ") ? "); + dump_generic_node (pp, TREE_OPERAND (op0, 1), 0, flags, false); + pp_string (pp, " : "); + dump_generic_node (pp, TREE_OPERAND (op0, 2), 0, flags, false); break; case ARRAY_REF: if (TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL) - dump_function_name (buffer, TREE_OPERAND (op0, 0), flags); + dump_function_name (pp, TREE_OPERAND (op0, 0), flags); else - dump_generic_node (buffer, op0, 0, flags, false); + dump_generic_node (pp, op0, 0, flags, false); break; case MEM_REF: @@ -3300,7 +3300,7 @@ print_call_name (pretty_printer *buffer, tree node, int flags) case COMPONENT_REF: case SSA_NAME: case OBJ_TYPE_REF: - dump_generic_node (buffer, op0, 0, flags, false); + dump_generic_node (pp, op0, 0, flags, false); break; default: @@ -3311,7 +3311,7 @@ print_call_name (pretty_printer *buffer, tree node, int flags) /* Parses the string STR and replaces new-lines by '\n', tabs by '\t', ... */ static void -pretty_print_string (pretty_printer *buffer, const char *str) +pretty_print_string (pretty_printer *pp, const char *str) { if (str == NULL) return; @@ -3321,73 +3321,73 @@ pretty_print_string (pretty_printer *buffer, const char *str) switch (str[0]) { case '\b': - pp_string (buffer, "\\b"); + pp_string (pp, "\\b"); break; case '\f': - pp_string (buffer, "\\f"); + pp_string (pp, "\\f"); break; case '\n': - pp_string (buffer, "\\n"); + pp_string (pp, "\\n"); break; case '\r': - pp_string (buffer, "\\r"); + pp_string (pp, "\\r"); break; case '\t': - pp_string (buffer, "\\t"); + pp_string (pp, "\\t"); break; case '\v': - pp_string (buffer, "\\v"); + pp_string (pp, "\\v"); break; case '\\': - pp_string (buffer, "\\\\"); + pp_string (pp, "\\\\"); break; case '\"': - pp_string (buffer, "\\\""); + pp_string (pp, "\\\""); break; case '\'': - pp_string (buffer, "\\'"); + pp_string (pp, "\\'"); break; /* No need to handle \0; the loop terminates on \0. */ case '\1': - pp_string (buffer, "\\1"); + pp_string (pp, "\\1"); break; case '\2': - pp_string (buffer, "\\2"); + pp_string (pp, "\\2"); break; case '\3': - pp_string (buffer, "\\3"); + pp_string (pp, "\\3"); break; case '\4': - pp_string (buffer, "\\4"); + pp_string (pp, "\\4"); break; case '\5': - pp_string (buffer, "\\5"); + pp_string (pp, "\\5"); break; case '\6': - pp_string (buffer, "\\6"); + pp_string (pp, "\\6"); break; case '\7': - pp_string (buffer, "\\7"); + pp_string (pp, "\\7"); break; default: - pp_character (buffer, str[0]); + pp_character (pp, str[0]); break; } str++; @@ -3397,20 +3397,20 @@ pretty_print_string (pretty_printer *buffer, const char *str) static void maybe_init_pretty_print (FILE *file) { - if (!buffer) + if (!tree_pp) { - buffer = new pretty_printer (); - pp_needs_newline (buffer) = true; - pp_translate_identifiers (buffer) = false; + tree_pp = new pretty_printer (); + pp_needs_newline (tree_pp) = true; + pp_translate_identifiers (tree_pp) = false; } - buffer->buffer->stream = file; + tree_pp->buffer->stream = file; } static void -newline_and_indent (pretty_printer *buffer, int spc) +newline_and_indent (pretty_printer *pp, int spc) { - pp_newline (buffer); + pp_newline (pp); INDENT (spc); }