GCC Middle and Back End API Reference
quoting_info Class Reference
Collaboration diagram for quoting_info:

Data Structures

struct  location
struct  run

Public Member Functions

void on_begin_quote (const output_buffer &buf, unsigned chunk_idx)
void on_end_quote (pretty_printer *pp, output_buffer &buf, unsigned chunk_idx, const urlifier &urlifier)
bool has_phase_3_quotes_p () const
void handle_phase_3 (pretty_printer *pp, const urlifier &urlifier)

Private Attributes

location m_loc_last_open_quote
std::vector< runm_phase_3_quotes

Detailed Description

A class for tracking quoted text within a buffer for
use by a urlifier.   

Member Function Documentation

◆ handle_phase_3()

void quoting_info::handle_phase_3 ( pretty_printer * pp,
const urlifier & urlifier )
Subroutine of pp_output_formatted_text for the awkward case where
quoted text straddles multiple chunks.

Flush PP's buffer's chunks to PP's output buffer, whilst inserting
URLs for any quoted text that should be URLified.

For example, given:
|  pp_format (pp,
|            "unrecognized option %qs; did you mean %<-%s%>",
|            "foo", "foption");
we would have these chunks:
|  chunk 0: "unrecognized option "
|  chunk 1: "`foo'" (already checked for urlification)
|  chunk 2: "; did you mean `-"
|                           ^*
|  chunk 3: "foption"
|            *******
|  chunk 4: "'"
|            ^
and this quoting_info would have recorded the open quote near the end
of chunk 2 and close quote at the start of chunk 4; this function would
check the combination of the end of chunk 2 and all of chunk 3 ("-foption")
for urlification.   

References output_buffer::cur_chunk_array, gcc_assert, ggc_alloc(), m_phase_3_quotes, chunk_info::m_quotes, pp_buffer, pp_maybe_wrap_text(), and urlify_quoted_string().

Referenced by pp_output_formatted_text().

◆ has_phase_3_quotes_p()

bool quoting_info::has_phase_3_quotes_p ( ) const

◆ on_begin_quote()

void quoting_info::on_begin_quote ( const output_buffer & buf,
unsigned chunk_idx )

◆ on_end_quote()

void quoting_info::on_end_quote ( pretty_printer * pp,
output_buffer & buf,
unsigned chunk_idx,
const urlifier & urlifier )

Field Documentation

◆ m_loc_last_open_quote

location quoting_info::m_loc_last_open_quote

◆ m_phase_3_quotes

std::vector<run> quoting_info::m_phase_3_quotes

Referenced by handle_phase_3().

The documentation for this class was generated from the following file: