GCC Middle and Back End API Reference
|
#include <diagnostic-path.h>
Public Member Functions | |
simple_diagnostic_path (pretty_printer *event_pp) | |
unsigned | num_events () const final override |
const diagnostic_event & | get_event (int idx) const final override |
unsigned | num_threads () const final override |
const diagnostic_thread & | get_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 () |
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_thread > | m_threads |
auto_delete_vec< simple_diagnostic_event > | m_events |
pretty_printer * | m_event_pp |
A simple implementation of diagnostic_path, as a vector of simple_diagnostic_event instances.
simple_diagnostic_path::simple_diagnostic_path | ( | pretty_printer * | event_pp | ) |
class simple_diagnostic_path : public diagnostic_path.
References add_thread().
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. Return the id of the new event.
References _, ap, ggc_alloc(), line_table, m_event_pp, m_events, pp_clear_output_area(), pp_format(), pp_formatted_text(), pp_output_formatted_text(), and UNKNOWN_LOCATION.
diagnostic_thread_id_t simple_diagnostic_path::add_thread | ( | const char * | name | ) |
References m_threads.
Referenced by simple_diagnostic_path().
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, | ||
... ) |
References _, ap, ggc_alloc(), line_table, m_event_pp, m_events, pp_clear_output_area(), pp_format(), pp_formatted_text(), pp_output_formatted_text(), and UNKNOWN_LOCATION.
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.
|
finaloverridevirtual |
Implementation of diagnostic_path::get_event vfunc for simple_diagnostic_path: simply return the event in the vec.
Implements diagnostic_path.
References m_events.
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(), ggc_alloc(), i, and NULL.
|
finaloverridevirtual |
Implements diagnostic_path.
References m_threads.
|
inherited |
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(), ggc_alloc(), and i.
|
inherited |
|
finaloverridevirtual |
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.
|
finaloverridevirtual |
Implements diagnostic_path.
References m_threads.
|
private |
Referenced by add_event(), and add_thread_event().
|
private |
Referenced by add_event(), add_thread_event(), connect_to_next_event(), get_event(), and num_events().
|
private |
Referenced by add_thread(), get_thread(), and num_threads().