GCC Middle and Back End API Reference
checker-event.h
Go to the documentation of this file.
1/* Subclasses of diagnostics::paths::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
28
29namespace ana {
30
31/* An enum for discriminating between the concrete subclasses of
32 checker_event. */
33
57
58extern const char *event_kind_to_string (enum event_kind ek);
59
60/* Event subclasses.
61
62 The class hierarchy looks like this (using indentation to show
63 inheritance, and with event_kinds shown for the concrete subclasses):
64
65 diagnostics::paths::event
66 checker_event
67 debug_event (event_kind::debug)
68 custom_event (event_kind::custom)
69 precanned_custom_event
70 statement_event (event_kind::stmt)
71 region_creation_event (event_kind::region_creation)
72 function_entry_event (event_kind::function_entry)
73 state_change_event (event_kind::state_change)
74 superedge_event
75 cfg_edge_event
76 start_cfg_edge_event (event_kind::start_cfg_edge)
77 end_cfg_edge_event (event_kind::end_cfg_edge)
78 catch_cfg_edge_event (event_kind::catch_cfg_edge)
79 call_event (event_kind::call_edge)
80 return_edge (event_kind::return_edge)
81 start_consolidated_cfg_edges_event (event_kind::start_consolidated_cfg_edges)
82 end_consolidated_cfg_edges_event (event_kind::end_consolidated_cfg_edges)
83 inlined_call_event (event_kind::inlined_call)
84 setjmp_event (event_kind::setjmp_)
85 rewind_event
86 rewind_from_longjmp_event (event_kind::rewind_from_longjmp)
87 rewind_to_setjmp_event (event_kind::rewind_to_setjmp)
88 throw_event (event_kind:throw_)
89 explicit_throw_event
90 throw_from_call_to_external_fn_event
91 unwind_event (event_kind::unwind)
92 warning_event (event_kind::warning). */
93
94/* Abstract subclass of diagnostics::paths::event; the base class for use in
95 checker_path (the analyzer's diagnostics::paths::path subclass). */
96
98{
99public:
100 /* Implementation of diagnostics::paths::event. */
101
102 location_t get_location () const final override { return m_loc; }
103 int get_stack_depth () const final override { return m_effective_depth; }
105 get_logical_location () const final override
106 {
107 return m_logical_loc;
108 }
109 meaning get_meaning () const override;
110 bool connect_to_next_event_p () const override { return false; }
112 {
113 return 0;
114 }
115
116 void
118 diagnostics::sarif_object &thread_flow_loc_obj)
119 const override;
120
121 /* Additional functionality. */
122 enum event_kind get_kind () const { return m_kind; }
123 tree get_fndecl () const { return m_effective_fndecl; }
124
126
130 virtual bool is_call_p () const { return false; }
131 virtual bool is_function_entry_p () const { return false; }
132 virtual bool is_return_p () const { return false; }
133
134 std::unique_ptr<diagnostics::digraphs::digraph>
135 maybe_make_diagnostic_state_graph (bool debug) const final override;
136
137 virtual const program_state *
138 get_program_state () const { return nullptr; }
139
140 /* For use with %@. */
142 {
143 return &m_emission_id;
144 }
145
146 void dump (pretty_printer *pp) const;
147 void debug () const;
148
149 void set_location (location_t loc) { m_loc = loc; }
150
151protected:
153 const event_loc_info &loc_info);
154
155 private:
157 const enum event_kind m_kind;
158 protected:
159 location_t m_loc;
165 diagnostics::paths::event_id_t m_emission_id; // only set once all pruning has occurred
167};
168
169/* A concrete event subclass for a purely textual event, for use in
170 debugging path creation and filtering. */
171
173{
174public:
175
176 debug_event (const event_loc_info &loc_info,
177 const char *desc)
178 : checker_event (event_kind::debug, loc_info),
179 m_desc (xstrdup (desc))
180 {
181 }
183 {
184 free (m_desc);
185 }
186
187 void print_desc (pretty_printer &) const final override;
188
189private:
190 char *m_desc;
191};
192
193/* An abstract event subclass for custom events. These are not filtered,
194 as they are likely to be pertinent to the diagnostic. */
195
197{
198protected:
199 custom_event (const event_loc_info &loc_info)
200 : checker_event (event_kind::custom, loc_info)
201 {
202 }
203};
204
205/* A concrete custom_event subclass with a precanned message. */
206
208{
209public:
211 const char *desc)
212 : custom_event (loc_info),
213 m_desc (xstrdup (desc))
214 {
215 }
217 {
218 free (m_desc);
219 }
220
221 void print_desc (pretty_printer &) const final override;
222
223private:
224 char *m_desc;
225};
226
227/* A concrete event subclass describing the execution of a gimple statement,
228 for use at high verbosity levels when debugging paths. */
229
231{
232public:
233 statement_event (const gimple *stmt, tree fndecl, int depth,
234 const program_state &dst_state);
235
236 void print_desc (pretty_printer &) const final override;
237
238 const program_state *
239 get_program_state () const final override
240 {
241 return &m_dst_state;
242 }
243
244 const gimple * const m_stmt;
246};
247
248/* An abstract event subclass describing the creation of a region that
249 is significant for a diagnostic.
250
251 There are too many combinations to express region creation in one message,
252 so we emit multiple region_creation_event instances when each pertinent
253 region is created.
254
255 The events are created by pending_diagnostic's add_region_creation_events
256 vfunc, which by default creates a region_creation_event_memory_space, and
257 if a capacity is known, a region_creation_event_capacity, giving e.g.:
258 (1) region created on stack here
259 (2) capacity: 100 bytes
260 but this vfunc can be overridden to create other events if other wordings
261 are more appropriate foa a given pending_diagnostic. */
262
264{
265protected:
267};
268
269/* Concrete subclass of region_creation_event.
270 Generates a message based on the memory space of the region
271 e.g. "region created on stack here". */
272
274{
275public:
277 const event_loc_info &loc_info)
278 : region_creation_event (loc_info),
279 m_mem_space (mem_space)
280 {
281 }
282
283 void print_desc (pretty_printer &pp) const final override;
284
285private:
287};
288
289/* Concrete subclass of region_creation_event.
290 Generates a message based on the capacity of the region
291 e.g. "capacity: 100 bytes". */
292
294{
295public:
297 const event_loc_info &loc_info)
298 : region_creation_event (loc_info),
299 m_capacity (capacity)
300 {
302 }
303
304 void print_desc (pretty_printer &pp) const final override;
305
306private:
308};
309
310/* Concrete subclass of region_creation_event.
311 Generates a message based on the capacity of the region
312 e.g. "allocated 100 bytes here". */
313
315{
316public:
318 const event_loc_info &loc_info)
319 : region_creation_event (loc_info),
320 m_capacity (capacity)
321 {}
322
323 void print_desc (pretty_printer &pp) const final override;
324
325private:
327};
328
329/* Concrete subclass of region_creation_event.
330 Generates a debug message intended for analyzer developers. */
331
333{
334public:
336 const event_loc_info &loc_info)
337 : region_creation_event (loc_info),
338 m_reg (reg), m_capacity (capacity)
339 {
340 }
341
342 void print_desc (pretty_printer &pp) const final override;
343
344private:
345 const region *m_reg;
347};
348
349/* An event subclass describing the entry to a function. */
350
352{
353public:
355 const program_state &state)
357 m_state (state)
358 {
359 }
360
362 const program_state &state);
363
364 void print_desc (pretty_printer &pp) const override;
365 meaning get_meaning () const override;
366
367 bool is_function_entry_p () const final override { return true; }
368
369 const program_state *
370 get_program_state () const final override
371 {
372 return &m_state;
373 }
374
375private:
377};
378
379/* Subclass of checker_event describing a state change. */
380
382{
383public:
385 int stack_depth,
386 const state_machine &sm,
387 const svalue *sval,
390 const svalue *origin,
391 const program_state &dst_state,
392 const exploded_node *enode);
393
394 void print_desc (pretty_printer &pp) const final override;
395 meaning get_meaning () const override;
396
397 const program_state *
398 get_program_state () const final override
399 {
400 return &m_dst_state;
401 }
402
404 {
405 return m_dst_state.get_current_function ();
406 }
407
408 const exploded_node *get_exploded_node () const { return m_enode; }
409
419};
420
421/* Subclass of checker_event; parent class for subclasses that relate to
422 a superedge. */
423
425{
426public:
427 void
429 diagnostics::sarif_object &thread_flow_loc_obj)
430 const override;
431
432 /* Mark this edge event as being either an interprocedural call or
433 return in which VAR is in STATE, and that this is critical to the
434 diagnostic (so that print_desc can attempt to get a better description
435 from any pending_diagnostic). */
441
443
444 bool should_filter_p (int verbosity) const;
445
446 const program_state *
447 get_program_state () const override;
448
449 protected:
450 superedge_event (enum event_kind kind, const exploded_edge &eedge,
451 const event_loc_info &loc_info);
452
453 public:
458};
459
460/* An abstract event subclass for when a CFG edge is followed; it has two
461 subclasses, representing the start of the edge and the end of the
462 edge, which come in pairs. */
463
465{
466public:
467 meaning get_meaning () const override;
468
470
471 protected:
472 cfg_edge_event (enum event_kind kind, const exploded_edge &eedge,
473 const event_loc_info &loc_info);
474};
475
476/* A concrete event subclass for the start of a CFG edge
477 e.g. "following 'false' branch...'. */
478
480{
481public:
483 const event_loc_info &loc_info)
484 : cfg_edge_event (event_kind::start_cfg_edge, eedge, loc_info)
485 {
486 }
487
488 void print_desc (pretty_printer &pp) const override;
489 bool connect_to_next_event_p () const final override { return true; }
490
491protected:
492 label_text maybe_describe_condition (bool can_colorize) const;
493
494private:
495 static label_text maybe_describe_condition (bool can_colorize,
496 tree lhs,
497 enum tree_code op,
498 tree rhs);
500};
501
502/* A concrete event subclass for the end of a CFG edge
503 e.g. "...to here'. */
504
506{
507public:
509 const event_loc_info &loc_info)
510 : cfg_edge_event (event_kind::end_cfg_edge, eedge, loc_info)
511 {
512 }
513
514 void print_desc (pretty_printer &pp) const final override
515 {
516 pp_string (&pp, "...to here");
517 }
518};
519
520/* A concrete event subclass for catching an exception
521 e.g. "...catching 'struct io_error' here". */
522
524{
525public:
527 const event_loc_info &loc_info,
528 tree type)
529 : cfg_edge_event (event_kind::catch_, eedge, loc_info),
530 m_type (type)
531 {
532 }
533
534 void print_desc (pretty_printer &pp) const final override
535 {
536 if (m_type)
537 pp_printf (&pp, "...catching exception of type %qT here", m_type);
538 else
539 pp_string (&pp, "...catching exception here");
540 }
541
542 meaning get_meaning () const override;
543
544private:
546};
547
548/* A concrete event subclass for an interprocedural call. */
549
551{
552public:
554 const event_loc_info &loc_info);
555
556 void print_desc (pretty_printer &pp) const override;
557 meaning get_meaning () const override;
558
559 bool is_call_p () const final override;
560
561 const program_state *
562 get_program_state () const final override;
563
564protected:
567
570};
571
572/* A concrete event subclass for an interprocedural return. */
573
575{
576public:
578 const event_loc_info &loc_info);
579
580 void print_desc (pretty_printer &pp) const final override;
581 meaning get_meaning () const override;
582
583 bool is_return_p () const final override;
584
587};
588
589/* A concrete event subclass for the start of a consolidated run of CFG
590 edges all either TRUE or FALSE e.g. "following 'false' branch...'. */
591
593{
594public:
596 bool edge_sense)
598 m_edge_sense (edge_sense)
599 {
600 }
601
602 void print_desc (pretty_printer &pp) const final override;
603 meaning get_meaning () const override;
604 bool connect_to_next_event_p () const final override { return true; }
605
606 private:
608};
609
610/* A concrete event subclass for the end of a consolidated run of
611 CFG edges e.g. "...to here'. */
612
614{
615public:
620
621 void print_desc (pretty_printer &pp) const final override
622 {
623 pp_string (&pp, "...to here");
624 }
625};
626
627/* A concrete event subclass for describing an inlined call event
628 e.g. "inlined call to 'callee' from 'caller'". */
629
631{
632public:
633 inlined_call_event (location_t loc,
634 tree apparent_callee_fndecl,
635 tree apparent_caller_fndecl,
636 int actual_depth,
637 int stack_depth_adjustment)
639 event_loc_info (loc,
640 apparent_caller_fndecl,
641 actual_depth + stack_depth_adjustment)),
642 m_apparent_callee_fndecl (apparent_callee_fndecl),
643 m_apparent_caller_fndecl (apparent_caller_fndecl)
644 {
645 gcc_assert (LOCATION_BLOCK (loc) == NULL);
646 }
647
648 void print_desc (pretty_printer &) const final override;
649 meaning get_meaning () const override;
650
651private:
654};
655
656/* A concrete event subclass for a setjmp or sigsetjmp call. */
657
659{
660public:
661 setjmp_event (const event_loc_info &loc_info,
662 const exploded_node *enode,
663 const gcall &setjmp_call)
664 : checker_event (event_kind::setjmp_, loc_info),
665 m_enode (enode), m_setjmp_call (setjmp_call)
666 {
667 }
668
669 void print_desc (pretty_printer &pp) const final override;
670
671 meaning get_meaning () const override;
672
675 diagnostics::paths::event_id_t emission_id) final override;
676
677private:
680};
681
682/* An abstract event subclass for rewinding from a longjmp to a setjmp
683 (or siglongjmp to sigsetjmp).
684
685 Base class for two from/to subclasses, showing the two halves of the
686 rewind. */
687
689{
690public:
693 const exploded_edge *get_eedge () const { return m_eedge; }
694
695 meaning get_meaning () const override;
696
697 protected:
699 enum event_kind kind,
700 const event_loc_info &loc_info,
701 const rewind_info_t *rewind_info);
703
704 private:
706};
707
708/* A concrete event subclass for rewinding from a longjmp to a setjmp,
709 showing the longjmp (or siglongjmp). */
710
712{
713public:
715 const event_loc_info &loc_info,
716 const rewind_info_t *rewind_info)
717 : rewind_event (eedge, event_kind::rewind_from_longjmp, loc_info,
718 rewind_info)
719 {
720 }
721
722 void print_desc (pretty_printer &pp) const final override;
723};
724
725/* A concrete event subclass for rewinding from a longjmp to a setjmp,
726 showing the setjmp (or sigsetjmp). */
727
729{
730public:
732 const event_loc_info &loc_info,
733 const rewind_info_t *rewind_info)
734 : rewind_event (eedge, event_kind::rewind_to_setjmp, loc_info,
735 rewind_info)
736 {
737 }
738
739 void print_desc (pretty_printer &pp) const final override;
740
743 diagnostics::paths::event_id_t emission_id) final override;
744
745private:
747};
748
749/* An abstract subclass for throwing/rethrowing an exception. */
750
752{
753public:
754 throw_event (const event_loc_info &loc_info,
755 const exploded_node *enode,
756 const gcall &throw_call)
757 : checker_event (event_kind::throw_, loc_info),
758 m_enode (enode),
759 m_throw_call (throw_call)
760 {
761 }
762
763 meaning get_meaning () const override;
764
765protected:
768};
769
770/* A concrete event subclass for an explicit "throw EXC;"
771 or "throw;" (actually, a call to __cxa_throw or __cxa_rethrow). */
772
774{
775public:
777 const exploded_node *enode,
778 const gcall &throw_call,
779 tree type,
780 bool is_rethrow)
781 : throw_event (loc_info, enode, throw_call),
782 m_type (type),
783 m_is_rethrow (is_rethrow)
784 {
785 }
786
787 void print_desc (pretty_printer &pp) const final override;
788
789private:
792};
793
794/* A concrete event subclass for an exception being thrown
795 from within a call to a function we don't have the body of,
796 or where we don't know what function was called. */
797
799{
800public:
802 const exploded_node *enode,
803 const gcall &throw_call,
804 tree fndecl)
805 : throw_event (loc_info, enode, throw_call),
806 m_fndecl (fndecl)
807 {
808 }
809
810 void print_desc (pretty_printer &pp) const final override;
811
812private:
814};
815
816/* A concrete event subclass for unwinding a stack frame when
817 processing an exception. */
818
820{
821public:
822 unwind_event (const event_loc_info &loc_info)
823 : checker_event (event_kind::unwind, loc_info),
824 m_num_frames (1)
825 {
826 }
827
828 meaning get_meaning () const override;
829
830 void print_desc (pretty_printer &pp) const final override;
831
833};
834
835/* Concrete subclass of checker_event for use at the end of a path:
836 a repeat of the warning message at the end of the path (perhaps with
837 references to pertinent events that occurred on the way), at the point
838 where the problem occurs. */
839
841{
842public:
844 const exploded_node *enode,
845 const state_machine *sm,
847 const program_state *program_state_ = nullptr)
848 : checker_event (event_kind::warning, loc_info),
849 m_enode (enode),
850 m_sm (sm), m_var (var), m_state (state)
851 {
852 if (program_state_)
853 m_program_state = std::make_unique<program_state> (*program_state_);
854 }
855
856 void print_desc (pretty_printer &pp) const final override;
857 meaning get_meaning () const override;
858
859 const program_state *
860 get_program_state () const final override;
861
862 const exploded_node *get_exploded_node () const { return m_enode; }
863
864private:
869 /* Optional copy of program state, for when this is different from
870 m_enode's state: */
871 std::unique_ptr<program_state> m_program_state;
872};
873
874} // namespace ana
875
876#endif /* GCC_ANALYZER_CHECKER_EVENT_H */
void print_desc(pretty_printer &pp) const override
const program_state * get_program_state() const final 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:569
tree get_caller_fndecl() const
const supernode * m_src_snode
Definition checker-event.h:568
Definition supergraph.h:400
tree m_type
Definition checker-event.h:545
catch_cfg_edge_event(const exploded_edge &eedge, const event_loc_info &loc_info, tree type)
Definition checker-event.h:526
meaning get_meaning() const override
void print_desc(pretty_printer &pp) const final override
Definition checker-event.h:534
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
diagnostics::paths::event_id_t m_emission_id
Definition checker-event.h:165
virtual const program_state * get_program_state() const
Definition checker-event.h:138
diagnostics::logical_locations::key get_logical_location() const final override
Definition checker-event.h:105
checker_event(enum event_kind kind, const event_loc_info &loc_info)
const diagnostics::paths::event_id_t * get_id_ptr() const
Definition checker-event.h:141
void debug() const
virtual bool is_return_p() const
Definition checker-event.h:132
virtual void prepare_for_emission(checker_path *, pending_diagnostic *pd, diagnostics::paths::event_id_t emission_id)
tree m_effective_fndecl
Definition checker-event.h:161
enum event_kind get_kind() const
Definition checker-event.h:122
int get_stack_depth() const final override
Definition checker-event.h:103
location_t m_loc
Definition checker-event.h:159
enum event_kind m_kind
Definition checker-event.h:157
tree m_original_fndecl
Definition checker-event.h:160
virtual bool is_function_entry_p() const
Definition checker-event.h:131
diagnostics::logical_locations::key m_logical_loc
Definition checker-event.h:166
diagnostics::paths::thread_id_t get_thread_id() const final override
Definition checker-event.h:111
void maybe_add_sarif_properties(diagnostics::sarif_builder &, diagnostics::sarif_object &thread_flow_loc_obj) const override
void set_location(location_t loc)
Definition checker-event.h:149
pending_diagnostic * m_pending_diagnostic
Definition checker-event.h:164
bool connect_to_next_event_p() const override
Definition checker-event.h:110
int get_original_stack_depth() const
Definition checker-event.h:125
location_t get_location() const final override
Definition checker-event.h:102
virtual bool is_call_p() const
Definition checker-event.h:130
std::unique_ptr< diagnostics::digraphs::digraph > maybe_make_diagnostic_state_graph(bool debug) const final override
tree get_fndecl() const
Definition checker-event.h:123
const checker_path * m_path
Definition checker-event.h:156
int m_effective_depth
Definition checker-event.h:163
int m_original_depth
Definition checker-event.h:162
meaning get_meaning() const override
void dump(pretty_printer *pp) const
Definition checker-path.h:32
custom_event(const event_loc_info &loc_info)
Definition checker-event.h:199
char * m_desc
Definition checker-event.h:190
~debug_event()
Definition checker-event.h:182
debug_event(const event_loc_info &loc_info, const char *desc)
Definition checker-event.h:176
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:508
void print_desc(pretty_printer &pp) const final override
Definition checker-event.h:514
end_consolidated_cfg_edges_event(const event_loc_info &loc_info)
Definition checker-event.h:616
void print_desc(pretty_printer &pp) const final override
Definition checker-event.h:621
tree m_type
Definition checker-event.h:790
void print_desc(pretty_printer &pp) const final override
bool m_is_rethrow
Definition checker-event.h:791
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:776
Definition exploded-graph.h:396
Definition exploded-graph.h:205
function_entry_event(const program_point &dst_point, const program_state &state)
const program_state * get_program_state() const final override
Definition checker-event.h:370
meaning get_meaning() const override
function_entry_event(const event_loc_info &loc_info, const program_state &state)
Definition checker-event.h:354
bool is_function_entry_p() const final override
Definition checker-event.h:367
void print_desc(pretty_printer &pp) const override
const program_state & m_state
Definition checker-event.h:376
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:633
tree m_apparent_callee_fndecl
Definition checker-event.h:652
tree m_apparent_caller_fndecl
Definition checker-event.h:653
Definition pending-diagnostic.h:189
~precanned_custom_event()
Definition checker-event.h:216
char * m_desc
Definition checker-event.h:224
void print_desc(pretty_printer &) const final override
precanned_custom_event(const event_loc_info &loc_info, const char *desc)
Definition checker-event.h:210
Definition program-point.h:175
Definition program-state.h:224
tree m_capacity
Definition checker-event.h:326
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:317
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:296
tree m_capacity
Definition checker-event.h:307
region_creation_event_debug(const region *reg, tree capacity, const event_loc_info &loc_info)
Definition checker-event.h:335
tree m_capacity
Definition checker-event.h:346
const region * m_reg
Definition checker-event.h:345
void print_desc(pretty_printer &pp) const final override
enum memory_space m_mem_space
Definition checker-event.h:286
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:276
region_creation_event(const event_loc_info &loc_info)
Definition region.h:126
const supernode * m_dest_snode
Definition checker-event.h:586
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:585
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)
meaning get_meaning() const override
tree get_setjmp_caller() const
const exploded_edge * m_eedge
Definition checker-event.h:705
const rewind_info_t * m_rewind_info
Definition checker-event.h:702
const exploded_edge * get_eedge() const
Definition checker-event.h:693
rewind_from_longjmp_event(const exploded_edge *eedge, const event_loc_info &loc_info, const rewind_info_t *rewind_info)
Definition checker-event.h:714
void print_desc(pretty_printer &pp) const final override
Definition exploded-graph.h:472
void prepare_for_emission(checker_path *path, pending_diagnostic *pd, diagnostics::paths::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:731
void print_desc(pretty_printer &pp) const final override
diagnostics::paths::event_id_t m_original_setjmp_event_id
Definition checker-event.h:746
meaning get_meaning() const override
const gcall & m_setjmp_call
Definition checker-event.h:679
void print_desc(pretty_printer &pp) const final override
void prepare_for_emission(checker_path *path, pending_diagnostic *pd, diagnostics::paths::event_id_t emission_id) final override
const exploded_node * m_enode
Definition checker-event.h:678
setjmp_event(const event_loc_info &loc_info, const exploded_node *enode, const gcall &setjmp_call)
Definition checker-event.h:661
bool connect_to_next_event_p() const final override
Definition checker-event.h:489
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:482
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:604
meaning get_meaning() const override
start_consolidated_cfg_edges_event(const event_loc_info &loc_info, bool edge_sense)
Definition checker-event.h:595
bool m_edge_sense
Definition checker-event.h:607
void print_desc(pretty_printer &pp) const final override
state_machine::state_t m_to
Definition checker-event.h:415
state_machine::state_t m_from
Definition checker-event.h:414
void print_desc(pretty_printer &pp) const final override
const svalue * m_origin
Definition checker-event.h:416
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:408
meaning get_meaning() const override
const supernode * m_node
Definition checker-event.h:410
program_state m_dst_state
Definition checker-event.h:417
const state_machine & m_sm
Definition checker-event.h:412
const svalue * m_sval
Definition checker-event.h:413
const program_state * get_program_state() const final override
Definition checker-event.h:398
const exploded_node * m_enode
Definition checker-event.h:418
const gimple * m_stmt
Definition checker-event.h:411
const function * get_dest_function() const
Definition checker-event.h:403
Definition sm.h:41
const state_machine::state * state_t
Definition sm.h:61
statement_event(const gimple *stmt, tree fndecl, int depth, const program_state &dst_state)
void print_desc(pretty_printer &) const final override
const program_state * get_program_state() const final override
Definition checker-event.h:239
const gimple *const m_stmt
Definition checker-event.h:244
const program_state m_dst_state
Definition checker-event.h:245
void maybe_add_sarif_properties(diagnostics::sarif_builder &, diagnostics::sarif_object &thread_flow_loc_obj) const override
const program_state * get_program_state() const override
state_machine::state_t m_critical_state
Definition checker-event.h:457
superedge_event(enum event_kind kind, const exploded_edge &eedge, const event_loc_info &loc_info)
const callgraph_superedge & get_callgraph_superedge() const
tree m_var
Definition checker-event.h:456
const exploded_edge & m_eedge
Definition checker-event.h:454
bool should_filter_p(int verbosity) const
void record_critical_state(tree var, state_machine::state_t state)
Definition checker-event.h:436
const superedge * m_sedge
Definition checker-event.h:455
Definition supergraph.h:318
Definition supergraph.h:239
Definition svalue.h:92
const gcall & m_throw_call
Definition checker-event.h:767
meaning get_meaning() const override
throw_event(const event_loc_info &loc_info, const exploded_node *enode, const gcall &throw_call)
Definition checker-event.h:754
const exploded_node * m_enode
Definition checker-event.h:766
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:801
tree m_fndecl
Definition checker-event.h:813
unwind_event(const event_loc_info &loc_info)
Definition checker-event.h:822
meaning get_meaning() const override
void print_desc(pretty_printer &pp) const final override
int m_num_frames
Definition checker-event.h:832
const program_state * get_program_state() const final override
std::unique_ptr< program_state > m_program_state
Definition checker-event.h:871
tree m_var
Definition checker-event.h:867
const exploded_node * get_exploded_node() const
Definition checker-event.h:862
const state_machine * m_sm
Definition checker-event.h:866
meaning get_meaning() const override
const exploded_node * m_enode
Definition checker-event.h:865
void print_desc(pretty_printer &pp) const final override
state_machine::state_t m_state
Definition checker-event.h:868
warning_event(const event_loc_info &loc_info, const exploded_node *enode, const state_machine *sm, tree var, state_machine::state_t state, const program_state *program_state_=nullptr)
Definition checker-event.h:843
Definition logical-locations.h:101
Definition paths.h:83
Definition sarif-sink.cc:769
Definition sarif-sink.h:151
Definition pretty-print.h:241
bool debug
Definition collect-utils.cc:34
static struct path_prefix cpath path
Definition collect2.cc:514
union tree_node * tree
Definition coretypes.h:97
bool warning(diagnostics::option_id, const char *,...) ATTRIBUTE_GCC_DIAG(2
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2009
free(str)
tree_code
Definition genmatch.cc:1002
#define LOCATION_BLOCK(LOC)
Definition input.h:98
Definition access-diagram.h:30
event_kind
Definition checker-event.h:35
@ function_entry
Definition checker-event.h:40
@ throw_
Definition checker-event.h:53
@ unwind
Definition checker-event.h:54
@ stmt
Definition checker-event.h:38
@ setjmp_
Definition checker-event.h:50
@ rewind_to_setjmp
Definition checker-event.h:52
@ start_consolidated_cfg_edges
Definition checker-event.h:47
@ start_cfg_edge
Definition checker-event.h:42
@ region_creation
Definition checker-event.h:39
@ inlined_call
Definition checker-event.h:49
@ state_change
Definition checker-event.h:41
@ rewind_from_longjmp
Definition checker-event.h:51
@ catch_
Definition checker-event.h:44
@ custom
Definition checker-event.h:37
@ return_edge
Definition checker-event.h:46
@ end_cfg_edge
Definition checker-event.h:43
@ call_edge
Definition checker-event.h:45
@ end_consolidated_cfg_edges
Definition checker-event.h:48
const char * event_kind_to_string(enum event_kind ek)
memory_space
Definition region.h:32
Definition custom-sarif-properties/state-graphs.h:33
int thread_id_t
Definition event-id.h:71
diagnostic_event_id_t event_id_t
Definition event-id.h:66
void pp_printf(pretty_printer *pp, const char *msg,...)
Definition pretty-print.cc:2683
void pp_string(pretty_printer *pp, const char *str)
Definition pretty-print.cc:2764
Definition event-loc-info.h:29
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