GCC Middle and Back End API Reference
simple_diagnostic_path Class Reference

#include <simple-diagnostic-path.h>

Inheritance diagram for simple_diagnostic_path:
Collaboration diagram for simple_diagnostic_path:

Public Types

using thread = diagnostics::paths::thread
using thread_id_t = diagnostics::paths::thread_id_t
using event = diagnostics::paths::event
using event_id_t = diagnostics::paths::event_id_t

Public Member Functions

 simple_diagnostic_path (const tree_logical_location_manager &logical_loc_mgr, pretty_printer *event_pp)
unsigned num_events () const final override
const eventget_event (int idx) const final override
unsigned num_threads () const final override
const threadget_thread (thread_id_t) const final override
bool same_function_p (int event_idx_a, int event_idx_b) const final override
thread_id_t add_thread (const char *name)
event_id_t add_event (location_t loc, tree fndecl, int depth, const char *fmt,...) ATTRIBUTE_GCC_DIAG(5
event_id_t event_id_t add_thread_event (thread_id_t thread_id, location_t loc, tree fndecl, int depth, const char *fmt,...) ATTRIBUTE_GCC_DIAG(6
event_id_t event_id_t void connect_to_next_event ()
void disable_event_localization ()
bool interprocedural_p () const
bool multithreaded_p () const
const logical_locations::manager & get_logical_location_manager () 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
pretty_printerm_event_pp
bool m_localize_events
const logical_locations::manager & m_logical_loc_mgr

Detailed Description

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

Member Typedef Documentation

◆ event

◆ event_id_t

◆ thread

◆ thread_id_t

Constructor & Destructor Documentation

◆ simple_diagnostic_path()

simple_diagnostic_path::simple_diagnostic_path ( const tree_logical_location_manager & logical_loc_mgr,
pretty_printer * event_pp )
class simple_diagnostic_path : public diagnostics::paths::path.   

References add_thread(), m_event_pp, m_localize_events, diagnostics::paths::path::path(), and true.

Member Function Documentation

◆ add_event()

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()

thread_id_t simple_diagnostic_path::add_thread ( const char * name)

References m_threads.

Referenced by simple_diagnostic_path().

◆ add_thread_event()

event_id_t simple_diagnostic_path::add_thread_event ( 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 ( )
inline

◆ get_event()

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

Implements diagnostics::paths::path.

References m_events.

◆ get_first_event_in_a_function()

bool path::get_first_event_in_a_function ( unsigned * out_idx) const
privateinherited
class diagnostics::paths::path.   
Subroutine of path::interprocedural_p.
Look for the first event in this path that is within a function
i.e. has a non-null logical location for which function_p is true.
If found, write its index to *OUT_IDX and return true.
Otherwise return false.   

References get_event(), diagnostics::paths::event::get_logical_location(), i, m_logical_loc_mgr, and num_events().

Referenced by interprocedural_p().

◆ get_logical_location_manager()

const logical_locations::manager & diagnostics::paths::path::get_logical_location_manager ( ) const
inlineinherited

◆ get_thread()

const thread & simple_diagnostic_path::get_thread ( thread_id_t idx) const
finaloverridevirtual

Implements diagnostics::paths::path.

References m_threads.

◆ interprocedural_p()

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

References get_event(), get_first_event_in_a_function(), diagnostics::paths::event::get_stack_depth(), i, num_events(), and same_function_p().

◆ multithreaded_p()

bool diagnostics::paths::path::multithreaded_p ( ) const
inherited

◆ num_events()

unsigned simple_diagnostic_path::num_events ( ) const
inlinefinaloverridevirtual

Implements diagnostics::paths::path.

References final(), and m_events.

◆ num_threads()

unsigned simple_diagnostic_path::num_threads ( ) const
inlinefinaloverridevirtual

Implements diagnostics::paths::path.

References final(), and m_threads.

◆ same_function_p()

bool simple_diagnostic_path::same_function_p ( int event_idx_a,
int event_idx_b ) const
finaloverridevirtual

Implements diagnostics::paths::path.

References m_events.

Field Documentation

◆ m_event_pp

pretty_printer* simple_diagnostic_path::m_event_pp
private

◆ m_events

◆ m_localize_events

bool simple_diagnostic_path::m_localize_events
private

◆ m_logical_loc_mgr

const logical_locations::manager& diagnostics::paths::path::m_logical_loc_mgr
privateinherited

◆ m_threads

auto_delete_vec<simple_diagnostic_thread> simple_diagnostic_path::m_threads
private

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


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