21#ifndef GCC_SELFTEST_DIAGNOSTIC_PATH_H
22#define GCC_SELFTEST_DIAGNOSTIC_PATH_H
41class test_diagnostic_event :
public diagnostic_event
44 test_diagnostic_event (location_t loc,
const char *funcname,
int depth,
47 ~test_diagnostic_event ();
50 int get_stack_depth () const
final override {
return m_depth; }
51 void print_desc (pretty_printer &pp)
const final override
55 const logical_location *get_logical_location () const
final override
57 if (m_logical_loc.get_name ())
58 return &m_logical_loc;
62 meaning get_meaning () const
final override
66 bool connect_to_next_event_p () const
final override
68 return m_connected_to_next_event;
75 void connect_to_next_event ()
77 m_connected_to_next_event =
true;
82 return m_logical_loc.get_name ();
87 test_logical_location m_logical_loc;
90 bool m_connected_to_next_event;
96class test_diagnostic_thread :
public diagnostic_thread
99 test_diagnostic_thread (
const char *name) : m_name (name) {}
100 label_text
get_name (
bool)
const final override
102 return label_text::borrow (m_name);
115class test_diagnostic_path :
public diagnostic_path
118 test_diagnostic_path (pretty_printer *event_pp);
120 unsigned num_events () const
final override;
121 const diagnostic_event & get_event (
int idx) const
final override;
122 unsigned num_threads () const
final override;
123 const diagnostic_thread &
126 same_function_p (
int event_idx_a,
127 int event_idx_b) const
final override;
131 diagnostic_event_id_t add_event (location_t loc, const
char *funcname,
int depth,
132 const
char *fmt, ...)
134 diagnostic_event_id_t
136 location_t loc, const
char *funcname,
int depth,
137 const
char *fmt, ...)
140 void connect_to_next_event ();
142 void add_entry (const
char *callee_name,
int stack_depth,
144 void add_return (const
char *caller_name,
int stack_depth,
146 void add_call (const
char *caller_name,
147 int caller_stack_depth,
148 const
char *callee_name,
152 auto_delete_vec<test_diagnostic_thread> m_threads;
153 auto_delete_vec<test_diagnostic_event> m_events;
156 pretty_printer *m_event_pp;
#define ATTRIBUTE_GCC_DIAG(m, n)
Definition diagnostic-core.h:103
int diagnostic_thread_id_t
Definition diagnostic-event-id.h:70
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2008
static location_t get_location(const gimple *stmt)
Definition gimple-ssa-warn-access.cc:78
Definition dump-context.h:31
void pp_string(pretty_printer *pp, const char *str)
Definition pretty-print.cc:2653
static const char * get_function_name(struct function *fn)
Definition statistics.cc:124
const char * get_name(tree t)
Definition tree.cc:11909