Skip to content
Snippets Groups Projects
Commit 07e74798 authored by David Malcolm's avatar David Malcolm
Browse files

pretty-print: split up pretty_printer::format into subroutines


The body of pretty_printer::format is almost 500 lines long,
mostly comprising two distinct phases.

This patch splits it up so that there are explicit subroutines
for the two different phases, reducing the scope of various
locals, and making it easier to e.g. put a breakpoint on phase 2.

No functional change intended.

gcc/ChangeLog:
	* pretty-print-markup.h (pp_markup::context::context): Drop
	params "buf" and "chunk_idx", initializing m_buf from pp.
	(pp_markup::context::m_chunk_idx): Drop field.
	* pretty-print.cc (pretty_printer::format): Convert param
	from a text_info * to a text_info &.  Split out phase 1
	and phase 2 into subroutines...
	(format_phase_1): New, from pretty_printer::format.
	(format_phase_2): Likewise.
	* pretty-print.h (pretty_printer::format): Convert param
	from a text_info * to a text_info &.
	(pp_format): Update for above change.  Assert that text_info is
	non-null.

Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent d0891f3a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment