GCC Middle and Back End API Reference
simple_diagnostic_path Class Reference

#include <diagnostic-path.h>

Inheritance diagram for simple_diagnostic_path:
Collaboration diagram for simple_diagnostic_path:

Public Member Functions

 simple_diagnostic_path (pretty_printer *event_pp)
unsigned num_events () const final override
const diagnostic_eventget_event (int idx) const final override
unsigned num_threads () const final override
const diagnostic_threadget_thread (diagnostic_thread_id_t) const final override
diagnostic_thread_id_t add_thread (const char *name)
diagnostic_event_id_t add_event (location_t loc, tree fndecl, int depth, const char *fmt,...) ATTRIBUTE_GCC_DIAG(5
diagnostic_event_id_t diagnostic_event_id_t add_thread_event (diagnostic_thread_id_t thread_id, location_t loc, tree fndecl, int depth, const char *fmt,...) ATTRIBUTE_GCC_DIAG(6
diagnostic_event_id_t diagnostic_event_id_t void connect_to_next_event ()
void disable_event_localization ()
bool interprocedural_p () const
bool multithreaded_p () const

Private Member Functions

bool get_first_event_in_a_function (unsigned *out_idx) const

Private Attributes

auto_delete_vec< simple_diagnostic_threadm_threads
auto_delete_vec< simple_diagnostic_eventm_events
bool m_localize_events

Detailed Description

A simple implementation of diagnostic_path, as a vector of
simple_diagnostic_event instances.   

Constructor & Destructor Documentation

◆ simple_diagnostic_path()

simple_diagnostic_path::simple_diagnostic_path ( pretty_printer * event_pp)
class simple_diagnostic_path : public diagnostic_path.   

References add_thread().

Member Function Documentation

◆ add_event()

diagnostic_event_id_t simple_diagnostic_path::add_event ( location_t loc,
tree fndecl,
int depth,
const char * fmt,
... )
Add an event to this path at LOC within function FNDECL at
stack depth DEPTH.

Use m_context's printer to format FMT, as the text of the new
event.  Localize FMT iff m_localize_events is set.

Return the id of the new event.   

References _, ap, line_table, m_event_pp, m_events, m_localize_events, pp_clear_output_area(), pp_format(), pp_formatted_text(), pp_output_formatted_text(), and UNKNOWN_LOCATION.

◆ add_thread()

diagnostic_thread_id_t simple_diagnostic_path::add_thread ( const char * name)

References m_threads.

Referenced by simple_diagnostic_path().

◆ add_thread_event()

diagnostic_event_id_t simple_diagnostic_path::add_thread_event ( diagnostic_thread_id_t thread_id,
location_t loc,
tree fndecl,
int depth,
const char * fmt,
... )

◆ connect_to_next_event()

void simple_diagnostic_path::connect_to_next_event ( )
Mark the most recent event on this path (which must exist) as being
connected to the next one to be added.   

References gcc_assert, and m_events.

◆ disable_event_localization()

void simple_diagnostic_path::disable_event_localization ( )

References m_localize_events.

◆ get_event()

const diagnostic_event & simple_diagnostic_path::get_event ( int idx) const
Implementation of diagnostic_path::get_event vfunc for
simple_diagnostic_path: simply return the event in the vec.   

Implements diagnostic_path.

References m_events.

◆ get_first_event_in_a_function()

bool diagnostic_path::get_first_event_in_a_function ( unsigned * out_idx) const
class diagnostic_path.   
Subroutint of diagnostic_path::interprocedural_p.
Look for the first event in this path that is within a function
i.e. has a non-NULL fndecl, and a non-zero stack depth.
If found, write its index to *OUT_IDX and return true.
Otherwise return false.   

References diagnostic_event::get_fndecl(), diagnostic_event::get_stack_depth(), i, and NULL.

◆ get_thread()

const diagnostic_thread & simple_diagnostic_path::get_thread ( diagnostic_thread_id_t idx) const

Implements diagnostic_path.

References m_threads.

◆ interprocedural_p()

bool diagnostic_path::interprocedural_p ( ) const
Return true if the events in this path involve more than one
function, or false if it is purely intraprocedural.   

References diagnostic_event::get_fndecl(), diagnostic_event::get_stack_depth(), and i.

◆ multithreaded_p()

bool diagnostic_path::multithreaded_p ( ) const

◆ num_events()

unsigned simple_diagnostic_path::num_events ( ) const
Implementation of diagnostic_path::num_events vfunc for
simple_diagnostic_path: simply get the number of events in the vec.   

Implements diagnostic_path.

References m_events.

◆ num_threads()

unsigned simple_diagnostic_path::num_threads ( ) const

Implements diagnostic_path.

References m_threads.

Field Documentation

◆ m_event_pp

pretty_printer* simple_diagnostic_path::m_event_pp

Referenced by add_event(), and add_thread_event().

◆ m_events

◆ m_localize_events

bool simple_diagnostic_path::m_localize_events

◆ m_threads

auto_delete_vec<simple_diagnostic_thread> simple_diagnostic_path::m_threads

Referenced by add_thread(), get_thread(), and num_threads().

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