GCC Middle and Back End API Reference
checker-event.h
Go to the documentation of this file.
1/* Subclasses of diagnostic_event for analyzer diagnostics.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it
8under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_ANALYZER_CHECKER_EVENT_H
22#define GCC_ANALYZER_CHECKER_EVENT_H
23
27
28namespace ana {
29
30/* An enum for discriminating between the concrete subclasses of
31 checker_event. */
32
56
57extern const char *event_kind_to_string (enum event_kind ek);
58
59/* Event subclasses.
60
61 The class hierarchy looks like this (using indentation to show
62 inheritance, and with event_kinds shown for the concrete subclasses):
63
64 diagnostic_event
65 checker_event
66 debug_event (event_kind::debug)
67 custom_event (event_kind::custom)
68 precanned_custom_event
69 statement_event (event_kind::stmt)
70 region_creation_event (event_kind::region_creation)
71 function_entry_event (event_kind::function_entry)
72 state_change_event (event_kind::state_change)
73 superedge_event
74 cfg_edge_event
75 start_cfg_edge_event (event_kind::start_cfg_edge)
76 end_cfg_edge_event (event_kind::end_cfg_edge)
77 catch_cfg_edge_event (event_kind::catch_cfg_edge)
78 call_event (event_kind::call_edge)
79 return_edge (event_kind::return_edge)
80 start_consolidated_cfg_edges_event (event_kind::start_consolidated_cfg_edges)
81 end_consolidated_cfg_edges_event (event_kind::end_consolidated_cfg_edges)
82 inlined_call_event (event_kind::inlined_call)
83 setjmp_event (event_kind::setjmp_)
84 rewind_event
85 rewind_from_longjmp_event (event_kind::rewind_from_longjmp)
86 rewind_to_setjmp_event (event_kind::rewind_to_setjmp)
87 throw_event (event_kind:throw_)
88 explicit_throw_event
89 throw_from_call_to_external_fn_event
90 unwind_event (event_kind::unwind)
91 warning_event (event_kind::warning). */
92
93/* Abstract subclass of diagnostic_event; the base class for use in
94 checker_path (the analyzer's diagnostic_path subclass). */
95
97{
98public:
99 /* Implementation of diagnostic_event. */
100
101 location_t get_location () const final override { return m_loc; }
102 int get_stack_depth () const final override { return m_effective_depth; }
104 {
105 return m_logical_loc;
106 }
107 meaning get_meaning () const override;
108 bool connect_to_next_event_p () const override { return false; }
110 {
111 return 0;
112 }
113
114 void
116 sarif_object &thread_flow_loc_obj) const override;
117
118 /* Additional functionality. */
119 enum event_kind get_kind () const { return m_kind; }
120 tree get_fndecl () const { return m_effective_fndecl; }
121
123
126 diagnostic_event_id_t emission_id);
127 virtual bool is_call_p () const { return false; }
128 virtual bool is_function_entry_p () const { return false; }
129 virtual bool is_return_p () const { return false; }
130
131 /* For use with %@. */
133 {
134 return &m_emission_id;
135 }
136
137 void dump (pretty_printer *pp) const;
138 void debug () const;
139
140 void set_location (location_t loc) { m_loc = loc; }
141
142protected:
144 const event_loc_info &loc_info);
145
146 private:
147 const enum event_kind m_kind;
148 protected:
149 location_t m_loc;
155 diagnostic_event_id_t m_emission_id; // only set once all pruning has occurred
157};
158
159/* A concrete event subclass for a purely textual event, for use in
160 debugging path creation and filtering. */
161
163{
164public:
165
166 debug_event (const event_loc_info &loc_info,
167 const char *desc)
168 : checker_event (event_kind::debug, loc_info),
169 m_desc (xstrdup (desc))
170 {
171 }
173 {
174 free (m_desc);
175 }
176
177 void print_desc (pretty_printer &) const final override;
178
179private:
180 char *m_desc;
181};
182
183/* An abstract event subclass for custom events. These are not filtered,
184 as they are likely to be pertinent to the diagnostic. */
185
187{
188protected:
189 custom_event (const event_loc_info &loc_info)
190 : checker_event (event_kind::custom, loc_info)
191 {
192 }
193};
194
195/* A concrete custom_event subclass with a precanned message. */
196
198{
199public:
201 const char *desc)
202 : custom_event (loc_info),
203 m_desc (xstrdup (desc))
204 {
205 }
207 {
208 free (m_desc);
209 }
210
211 void print_desc (pretty_printer &) const final override;
212
213private:
214 char *m_desc;
215};
216
217/* A concrete event subclass describing the execution of a gimple statement,
218 for use at high verbosity levels when debugging paths. */
219
221{
222public:
223 statement_event (const gimple *stmt, tree fndecl, int depth,
224 const program_state &dst_state);
225
226 void print_desc (pretty_printer &) const final override;
227
228 const gimple * const m_stmt;
230};
231
232/* An abstract event subclass describing the creation of a region that
233 is significant for a diagnostic.
234
235 There are too many combinations to express region creation in one message,
236 so we emit multiple region_creation_event instances when each pertinent
237 region is created.
238
239 The events are created by pending_diagnostic's add_region_creation_events
240 vfunc, which by default creates a region_creation_event_memory_space, and
241 if a capacity is known, a region_creation_event_capacity, giving e.g.:
242 (1) region created on stack here
243 (2) capacity: 100 bytes
244 but this vfunc can be overridden to create other events if other wordings
245 are more appropriate foa a given pending_diagnostic. */
246
248{
249protected:
251};
252
253/* Concrete subclass of region_creation_event.
254 Generates a message based on the memory space of the region
255 e.g. "region created on stack here". */
256
258{
259public:
261 const event_loc_info &loc_info)
262 : region_creation_event (loc_info),
263 m_mem_space (mem_space)
264 {
265 }
266
267 void print_desc (pretty_printer &pp) const final override;
268
269private:
271};
272
273/* Concrete subclass of region_creation_event.
274 Generates a message based on the capacity of the region
275 e.g. "capacity: 100 bytes". */
276
278{
279public:
281 const event_loc_info &loc_info)
282 : region_creation_event (loc_info),
283 m_capacity (capacity)
284 {
286 }
287
288 void print_desc (pretty_printer &pp) const final override;
289
290private:
292};
293
294/* Concrete subclass of region_creation_event.
295 Generates a message based on the capacity of the region
296 e.g. "allocated 100 bytes here". */
297
299{
300public:
302 const event_loc_info &loc_info)
303 : region_creation_event (loc_info),
304 m_capacity (capacity)
305 {}
306
307 void print_desc (pretty_printer &pp) const final override;
308
309private:
311};
312
313/* Concrete subclass of region_creation_event.
314 Generates a debug message intended for analyzer developers. */
315
317{
318public:
320 const event_loc_info &loc_info)
321 : region_creation_event (loc_info),
322 m_reg (reg), m_capacity (capacity)
323 {
324 }
325
326 void print_desc (pretty_printer &pp) const final override;
327
328private:
329 const region *m_reg;
331};
332
333/* An event subclass describing the entry to a function. */
334
336{
337public:
340 {
341 }
342
344
345 void print_desc (pretty_printer &pp) const override;
346 meaning get_meaning () const override;
347
348 bool is_function_entry_p () const final override { return true; }
349};
350
351/* Subclass of checker_event describing a state change. */
352
354{
355public:
357 int stack_depth,
358 const state_machine &sm,
359 const svalue *sval,
362 const svalue *origin,
363 const program_state &dst_state,
364 const exploded_node *enode);
365
366 void print_desc (pretty_printer &pp) const final override;
367 meaning get_meaning () const override;
368
370 {
371 return m_dst_state.get_current_function ();
372 }
373
374 const exploded_node *get_exploded_node () const { return m_enode; }
375
385};
386
387/* Subclass of checker_event; parent class for subclasses that relate to
388 a superedge. */
389
391{
392public:
394 sarif_object &thread_flow_loc_obj)
395 const override;
396
397 /* Mark this edge event as being either an interprocedural call or
398 return in which VAR is in STATE, and that this is critical to the
399 diagnostic (so that print_desc can attempt to get a better description
400 from any pending_diagnostic). */
406
408
409 bool should_filter_p (int verbosity) const;
410
411 protected:
412 superedge_event (enum event_kind kind, const exploded_edge &eedge,
413 const event_loc_info &loc_info);
414
415 public:
420};
421
422/* An abstract event subclass for when a CFG edge is followed; it has two
423 subclasses, representing the start of the edge and the end of the
424 edge, which come in pairs. */
425
427{
428public:
429 meaning get_meaning () const override;
430
432
433 protected:
434 cfg_edge_event (enum event_kind kind, const exploded_edge &eedge,
435 const event_loc_info &loc_info);
436};
437
438/* A concrete event subclass for the start of a CFG edge
439 e.g. "following 'false' branch...'. */
440
442{
443public:
445 const event_loc_info &loc_info)
446 : cfg_edge_event (event_kind::start_cfg_edge, eedge, loc_info)
447 {
448 }
449
450 void print_desc (pretty_printer &pp) const override;
451 bool connect_to_next_event_p () const final override { return true; }
452
453protected:
454 label_text maybe_describe_condition (bool can_colorize) const;
455
456private:
457 static label_text maybe_describe_condition (bool can_colorize,
458 tree lhs,
459 enum tree_code op,
460 tree rhs);
462};
463
464/* A concrete event subclass for the end of a CFG edge
465 e.g. "...to here'. */
466
468{
469public:
471 const event_loc_info &loc_info)
472 : cfg_edge_event (event_kind::end_cfg_edge, eedge, loc_info)
473 {
474 }
475
476 void print_desc (pretty_printer &pp) const final override
477 {
478 pp_string (&pp, "...to here");
479 }
480};
481
482/* A concrete event subclass for catching an exception
483 e.g. "...catching 'struct io_error' here". */
484
486{
487public:
489 const event_loc_info &loc_info,
490 tree type)
491 : cfg_edge_event (event_kind::catch_, eedge, loc_info),
492 m_type (type)
493 {
494 }
495
496 void print_desc (pretty_printer &pp) const final override
497 {
498 if (m_type)
499 pp_printf (&pp, "...catching exception of type %qT here", m_type);
500 else
501 pp_string (&pp, "...catching exception here");
502 }
503
504private:
506};
507
508/* A concrete event subclass for an interprocedural call. */
509
511{
512public:
514 const event_loc_info &loc_info);
515
516 void print_desc (pretty_printer &pp) const override;
517 meaning get_meaning () const override;
518
519 bool is_call_p () const final override;
520
521protected:
524
527};
528
529/* A concrete event subclass for an interprocedural return. */
530
532{
533public:
535 const event_loc_info &loc_info);
536
537 void print_desc (pretty_printer &pp) const final override;
538 meaning get_meaning () const override;
539
540 bool is_return_p () const final override;
541
544};
545
546/* A concrete event subclass for the start of a consolidated run of CFG
547 edges all either TRUE or FALSE e.g. "following 'false' branch...'. */
548
550{
551public:
553 bool edge_sense)
555 m_edge_sense (edge_sense)
556 {
557 }
558
559 void print_desc (pretty_printer &pp) const final override;
560 meaning get_meaning () const override;
561 bool connect_to_next_event_p () const final override { return true; }
562
563 private:
565};
566
567/* A concrete event subclass for the end of a consolidated run of
568 CFG edges e.g. "...to here'. */
569
571{
572public:
577
578 void print_desc (pretty_printer &pp) const final override
579 {
580 pp_string (&pp, "...to here");
581 }
582};
583
584/* A concrete event subclass for describing an inlined call event
585 e.g. "inlined call to 'callee' from 'caller'". */
586
588{
589public:
590 inlined_call_event (location_t loc,
591 tree apparent_callee_fndecl,
592 tree apparent_caller_fndecl,
593 int actual_depth,
594 int stack_depth_adjustment)
596 event_loc_info (loc,
597 apparent_caller_fndecl,
598 actual_depth + stack_depth_adjustment)),
599 m_apparent_callee_fndecl (apparent_callee_fndecl),
600 m_apparent_caller_fndecl (apparent_caller_fndecl)
601 {
602 gcc_assert (LOCATION_BLOCK (loc) == NULL);
603 }
604
605 void print_desc (pretty_printer &) const final override;
606 meaning get_meaning () const override;
607
608private:
611};
612
613/* A concrete event subclass for a setjmp or sigsetjmp call. */
614
616{
617public:
618 setjmp_event (const event_loc_info &loc_info,
619 const exploded_node *enode,
620 const gcall &setjmp_call)
621 : checker_event (event_kind::setjmp_, loc_info),
622 m_enode (enode), m_setjmp_call (setjmp_call)
623 {
624 }
625
626 void print_desc (pretty_printer &pp) const final override;
627
630 diagnostic_event_id_t emission_id) final override;
631
632private:
635};
636
637/* An abstract event subclass for rewinding from a longjmp to a setjmp
638 (or siglongjmp to sigsetjmp).
639
640 Base class for two from/to subclasses, showing the two halves of the
641 rewind. */
642
644{
645public:
648 const exploded_edge *get_eedge () const { return m_eedge; }
649
650 protected:
652 enum event_kind kind,
653 const event_loc_info &loc_info,
654 const rewind_info_t *rewind_info);
656
657 private:
659};
660
661/* A concrete event subclass for rewinding from a longjmp to a setjmp,
662 showing the longjmp (or siglongjmp). */
663
665{
666public:
668 const event_loc_info &loc_info,
669 const rewind_info_t *rewind_info)
670 : rewind_event (eedge, event_kind::rewind_from_longjmp, loc_info,
671 rewind_info)
672 {
673 }
674
675 void print_desc (pretty_printer &pp) const final override;
676};
677
678/* A concrete event subclass for rewinding from a longjmp to a setjmp,
679 showing the setjmp (or sigsetjmp). */
680
682{
683public:
685 const event_loc_info &loc_info,
686 const rewind_info_t *rewind_info)
687 : rewind_event (eedge, event_kind::rewind_to_setjmp, loc_info,
688 rewind_info)
689 {
690 }
691
692 void print_desc (pretty_printer &pp) const final override;
693
696 diagnostic_event_id_t emission_id) final override;
697
698private:
700};
701
702/* An abstract subclass for throwing/rethrowing an exception. */
703
705{
706public:
707 throw_event (const event_loc_info &loc_info,
708 const exploded_node *enode,
709 const gcall &throw_call)
710 : checker_event (event_kind::throw_, loc_info),
711 m_enode (enode),
712 m_throw_call (throw_call)
713 {
714 }
715
716protected:
719};
720
721/* A concrete event subclass for an explicit "throw EXC;"
722 or "throw;" (actually, a call to __cxa_throw or __cxa_rethrow). */
723
725{
726public:
728 const exploded_node *enode,
729 const gcall &throw_call,
730 tree type,
731 bool is_rethrow)
732 : throw_event (loc_info, enode, throw_call),
733 m_type (type),
734 m_is_rethrow (is_rethrow)
735 {
736 }
737
738 void print_desc (pretty_printer &pp) const final override;
739
740private:
743};
744
745/* A concrete event subclass for an exception being thrown
746 from within a call to a function we don't have the body of,
747 or where we don't know what function was called. */
748
750{
751public:
753 const exploded_node *enode,
754 const gcall &throw_call,
755 tree fndecl)
756 : throw_event (loc_info, enode, throw_call),
757 m_fndecl (fndecl)
758 {
759 }
760
761 void print_desc (pretty_printer &pp) const final override;
762
763private:
765};
766
767/* A concrete event subclass for unwinding a stack frame when
768 processing an exception. */
769
771{
772public:
773 unwind_event (const event_loc_info &loc_info)
774 : checker_event (event_kind::unwind, loc_info),
775 m_num_frames (1)
776 {
777 }
778
779 void print_desc (pretty_printer &pp) const final override;
780
782};
783
784/* Concrete subclass of checker_event for use at the end of a path:
785 a repeat of the warning message at the end of the path (perhaps with
786 references to pertinent events that occurred on the way), at the point
787 where the problem occurs. */
788
790{
791public:
793 const exploded_node *enode,
794 const state_machine *sm,
796 : checker_event (event_kind::warning, loc_info),
797 m_enode (enode),
798 m_sm (sm), m_var (var), m_state (state)
799 {
800 }
801
802 void print_desc (pretty_printer &pp) const final override;
803 meaning get_meaning () const override;
804
805 const exploded_node *get_exploded_node () const { return m_enode; }
806
807private:
812};
813
814} // namespace ana
815
816#endif /* GCC_ANALYZER_CHECKER_EVENT_H */
void print_desc(pretty_printer &pp) const override
meaning get_meaning() const override
call_event(const exploded_edge &eedge, const event_loc_info &loc_info)
bool is_call_p() const final override
tree get_callee_fndecl() const
const supernode * m_dest_snode
Definition checker-event.h:526
tree get_caller_fndecl() const
const supernode * m_src_snode
Definition checker-event.h:525
Definition supergraph.h:400
tree m_type
Definition checker-event.h:505
catch_cfg_edge_event(const exploded_edge &eedge, const event_loc_info &loc_info, tree type)
Definition checker-event.h:488
void print_desc(pretty_printer &pp) const final override
Definition checker-event.h:496
meaning get_meaning() const override
cfg_edge_event(enum event_kind kind, const exploded_edge &eedge, const event_loc_info &loc_info)
const cfg_superedge & get_cfg_superedge() const
Definition supergraph.h:522
virtual void prepare_for_emission(checker_path *, pending_diagnostic *pd, diagnostic_event_id_t emission_id)
checker_event(enum event_kind kind, const event_loc_info &loc_info)
void debug() const
virtual bool is_return_p() const
Definition checker-event.h:129
tree m_effective_fndecl
Definition checker-event.h:151
diagnostic_event_id_t m_emission_id
Definition checker-event.h:155
enum event_kind get_kind() const
Definition checker-event.h:119
int get_stack_depth() const final override
Definition checker-event.h:102
location_t m_loc
Definition checker-event.h:149
const diagnostic_event_id_t * get_id_ptr() const
Definition checker-event.h:132
enum event_kind m_kind
Definition checker-event.h:147
tree m_original_fndecl
Definition checker-event.h:150
virtual bool is_function_entry_p() const
Definition checker-event.h:128
logical_location m_logical_loc
Definition checker-event.h:156
void set_location(location_t loc)
Definition checker-event.h:140
pending_diagnostic * m_pending_diagnostic
Definition checker-event.h:154
bool connect_to_next_event_p() const override
Definition checker-event.h:108
int get_original_stack_depth() const
Definition checker-event.h:122
location_t get_location() const final override
Definition checker-event.h:101
virtual bool is_call_p() const
Definition checker-event.h:127
tree get_fndecl() const
Definition checker-event.h:120
void maybe_add_sarif_properties(sarif_builder &, sarif_object &thread_flow_loc_obj) const override
int m_effective_depth
Definition checker-event.h:153
int m_original_depth
Definition checker-event.h:152
diagnostic_thread_id_t get_thread_id() const final override
Definition checker-event.h:109
meaning get_meaning() const override
logical_location get_logical_location() const final override
Definition checker-event.h:103
void dump(pretty_printer *pp) const
Definition checker-path.h:32
custom_event(const event_loc_info &loc_info)
Definition checker-event.h:189
char * m_desc
Definition checker-event.h:180
~debug_event()
Definition checker-event.h:172
debug_event(const event_loc_info &loc_info, const char *desc)
Definition checker-event.h:166
void print_desc(pretty_printer &) const final override
end_cfg_edge_event(const exploded_edge &eedge, const event_loc_info &loc_info)
Definition checker-event.h:470
void print_desc(pretty_printer &pp) const final override
Definition checker-event.h:476
end_consolidated_cfg_edges_event(const event_loc_info &loc_info)
Definition checker-event.h:573
void print_desc(pretty_printer &pp) const final override
Definition checker-event.h:578
tree m_type
Definition checker-event.h:741
void print_desc(pretty_printer &pp) const final override
bool m_is_rethrow
Definition checker-event.h:742
explicit_throw_event(const event_loc_info &loc_info, const exploded_node *enode, const gcall &throw_call, tree type, bool is_rethrow)
Definition checker-event.h:727
Definition exploded-graph.h:394
Definition exploded-graph.h:203
function_entry_event(const program_point &dst_point)
meaning get_meaning() const override
bool is_function_entry_p() const final override
Definition checker-event.h:348
void print_desc(pretty_printer &pp) const override
function_entry_event(const event_loc_info &loc_info)
Definition checker-event.h:338
meaning get_meaning() const override
void print_desc(pretty_printer &) const final override
inlined_call_event(location_t loc, tree apparent_callee_fndecl, tree apparent_caller_fndecl, int actual_depth, int stack_depth_adjustment)
Definition checker-event.h:590
tree m_apparent_callee_fndecl
Definition checker-event.h:609
tree m_apparent_caller_fndecl
Definition checker-event.h:610
Definition pending-diagnostic.h:190
~precanned_custom_event()
Definition checker-event.h:206
char * m_desc
Definition checker-event.h:214
void print_desc(pretty_printer &) const final override
precanned_custom_event(const event_loc_info &loc_info, const char *desc)
Definition checker-event.h:200
Definition program-point.h:175
Definition program-state.h:221
tree m_capacity
Definition checker-event.h:310
void print_desc(pretty_printer &pp) const final override
region_creation_event_allocation_size(tree capacity, const event_loc_info &loc_info)
Definition checker-event.h:301
void print_desc(pretty_printer &pp) const final override
region_creation_event_capacity(tree capacity, const event_loc_info &loc_info)
Definition checker-event.h:280
tree m_capacity
Definition checker-event.h:291
region_creation_event_debug(const region *reg, tree capacity, const event_loc_info &loc_info)
Definition checker-event.h:319
tree m_capacity
Definition checker-event.h:330
const region * m_reg
Definition checker-event.h:329
void print_desc(pretty_printer &pp) const final override
enum memory_space m_mem_space
Definition checker-event.h:270
void print_desc(pretty_printer &pp) const final override
region_creation_event_memory_space(enum memory_space mem_space, const event_loc_info &loc_info)
Definition checker-event.h:260
region_creation_event(const event_loc_info &loc_info)
Definition region.h:126
const supernode * m_dest_snode
Definition checker-event.h:543
return_event(const exploded_edge &eedge, const event_loc_info &loc_info)
void print_desc(pretty_printer &pp) const final override
bool is_return_p() const final override
const supernode * m_src_snode
Definition checker-event.h:542
meaning get_meaning() const override
tree get_longjmp_caller() const
rewind_event(const exploded_edge *eedge, enum event_kind kind, const event_loc_info &loc_info, const rewind_info_t *rewind_info)
tree get_setjmp_caller() const
const exploded_edge * m_eedge
Definition checker-event.h:658
const rewind_info_t * m_rewind_info
Definition checker-event.h:655
const exploded_edge * get_eedge() const
Definition checker-event.h:648
rewind_from_longjmp_event(const exploded_edge *eedge, const event_loc_info &loc_info, const rewind_info_t *rewind_info)
Definition checker-event.h:667
void print_desc(pretty_printer &pp) const final override
Definition exploded-graph.h:470
void prepare_for_emission(checker_path *path, pending_diagnostic *pd, diagnostic_event_id_t emission_id) final override
rewind_to_setjmp_event(const exploded_edge *eedge, const event_loc_info &loc_info, const rewind_info_t *rewind_info)
Definition checker-event.h:684
void print_desc(pretty_printer &pp) const final override
diagnostic_event_id_t m_original_setjmp_event_id
Definition checker-event.h:699
const gcall & m_setjmp_call
Definition checker-event.h:634
void print_desc(pretty_printer &pp) const final override
void prepare_for_emission(checker_path *path, pending_diagnostic *pd, diagnostic_event_id_t emission_id) final override
const exploded_node * m_enode
Definition checker-event.h:633
setjmp_event(const event_loc_info &loc_info, const exploded_node *enode, const gcall &setjmp_call)
Definition checker-event.h:618
bool connect_to_next_event_p() const final override
Definition checker-event.h:451
void print_desc(pretty_printer &pp) const override
static label_text maybe_describe_condition(bool can_colorize, tree lhs, enum tree_code op, tree rhs)
start_cfg_edge_event(const exploded_edge &eedge, const event_loc_info &loc_info)
Definition checker-event.h:444
label_text maybe_describe_condition(bool can_colorize) const
static bool should_print_expr_p(tree)
bool connect_to_next_event_p() const final override
Definition checker-event.h:561
meaning get_meaning() const override
start_consolidated_cfg_edges_event(const event_loc_info &loc_info, bool edge_sense)
Definition checker-event.h:552
bool m_edge_sense
Definition checker-event.h:564
void print_desc(pretty_printer &pp) const final override
state_machine::state_t m_to
Definition checker-event.h:381
state_machine::state_t m_from
Definition checker-event.h:380
void print_desc(pretty_printer &pp) const final override
const svalue * m_origin
Definition checker-event.h:382
state_change_event(const supernode *node, const gimple *stmt, int stack_depth, const state_machine &sm, const svalue *sval, state_machine::state_t from, state_machine::state_t to, const svalue *origin, const program_state &dst_state, const exploded_node *enode)
const exploded_node * get_exploded_node() const
Definition checker-event.h:374
meaning get_meaning() const override
const supernode * m_node
Definition checker-event.h:376
program_state m_dst_state
Definition checker-event.h:383
const state_machine & m_sm
Definition checker-event.h:378
const svalue * m_sval
Definition checker-event.h:379
const exploded_node * m_enode
Definition checker-event.h:384
const gimple * m_stmt
Definition checker-event.h:377
const function * get_dest_function() const
Definition checker-event.h:369
Definition sm.h:40
const state_machine::state * state_t
Definition sm.h:60
statement_event(const gimple *stmt, tree fndecl, int depth, const program_state &dst_state)
void print_desc(pretty_printer &) const final override
const gimple *const m_stmt
Definition checker-event.h:228
const program_state m_dst_state
Definition checker-event.h:229
state_machine::state_t m_critical_state
Definition checker-event.h:419
superedge_event(enum event_kind kind, const exploded_edge &eedge, const event_loc_info &loc_info)
const callgraph_superedge & get_callgraph_superedge() const
void maybe_add_sarif_properties(sarif_builder &, sarif_object &thread_flow_loc_obj) const override
tree m_var
Definition checker-event.h:418
const exploded_edge & m_eedge
Definition checker-event.h:416
bool should_filter_p(int verbosity) const
void record_critical_state(tree var, state_machine::state_t state)
Definition checker-event.h:401
const superedge * m_sedge
Definition checker-event.h:417
Definition supergraph.h:318
Definition supergraph.h:239
Definition svalue.h:92
const gcall & m_throw_call
Definition checker-event.h:718
throw_event(const event_loc_info &loc_info, const exploded_node *enode, const gcall &throw_call)
Definition checker-event.h:707
const exploded_node * m_enode
Definition checker-event.h:717
void print_desc(pretty_printer &pp) const final override
throw_from_call_to_external_fn_event(const event_loc_info &loc_info, const exploded_node *enode, const gcall &throw_call, tree fndecl)
Definition checker-event.h:752
tree m_fndecl
Definition checker-event.h:764
unwind_event(const event_loc_info &loc_info)
Definition checker-event.h:773
void print_desc(pretty_printer &pp) const final override
int m_num_frames
Definition checker-event.h:781
tree m_var
Definition checker-event.h:810
const exploded_node * get_exploded_node() const
Definition checker-event.h:805
const state_machine * m_sm
Definition checker-event.h:809
meaning get_meaning() const override
const exploded_node * m_enode
Definition checker-event.h:808
void print_desc(pretty_printer &pp) const final override
state_machine::state_t m_state
Definition checker-event.h:811
warning_event(const event_loc_info &loc_info, const exploded_node *enode, const state_machine *sm, tree var, state_machine::state_t state)
Definition checker-event.h:792
Definition diagnostic-event-id.h:37
Definition diagnostic-path.h:72
Definition pretty-print.h:241
Definition diagnostic-format-sarif.cc:747
Definition diagnostic-format-sarif.h:133
static struct path_prefix cpath path
Definition collect2.cc:514
union tree_node * tree
Definition coretypes.h:97
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
free(str)
tree_code
Definition genmatch.cc:1002
#define LOCATION_BLOCK(LOC)
Definition input.h:196
logical_location_manager::key logical_location
Definition logical-location.h:173
Definition access-diagram.h:30
event_kind
Definition checker-event.h:34
@ function_entry
Definition checker-event.h:39
@ throw_
Definition checker-event.h:52
@ unwind
Definition checker-event.h:53
@ stmt
Definition checker-event.h:37
@ setjmp_
Definition checker-event.h:49
@ rewind_to_setjmp
Definition checker-event.h:51
@ start_consolidated_cfg_edges
Definition checker-event.h:46
@ start_cfg_edge
Definition checker-event.h:41
@ region_creation
Definition checker-event.h:38
@ inlined_call
Definition checker-event.h:48
@ warning
Definition checker-event.h:54
@ state_change
Definition checker-event.h:40
@ rewind_from_longjmp
Definition checker-event.h:50
@ catch_
Definition checker-event.h:43
@ custom
Definition checker-event.h:36
@ return_edge
Definition checker-event.h:45
@ end_cfg_edge
Definition checker-event.h:42
@ debug
Definition checker-event.h:35
@ call_edge
Definition checker-event.h:44
@ end_consolidated_cfg_edges
Definition checker-event.h:47
const char * event_kind_to_string(enum event_kind ek)
memory_space
Definition region.h:32
void pp_printf(pretty_printer *pp, const char *msg,...)
Definition pretty-print.cc:2569
void pp_string(pretty_printer *pp, const char *str)
Definition pretty-print.cc:2650
Definition event-loc-info.h:29
Definition diagnostic-path.h:116
Definition function.h:249
Definition gimple.h:352
Definition gimple.h:221
Definition genautomata.cc:669
Definition gengtype.h:252
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:814