Line data Source code
1 : /* Base header for the analyzer, plus utility functions.
2 : Copyright (C) 2019-2026 Free Software Foundation, Inc.
3 : Contributed by David Malcolm <dmalcolm@redhat.com>.
4 :
5 : This file is part of GCC.
6 :
7 : GCC is free software; you can redistribute it and/or modify it
8 : under the terms of the GNU General Public License as published by
9 : the Free Software Foundation; either version 3, or (at your option)
10 : any later version.
11 :
12 : GCC is distributed in the hope that it will be useful, but
13 : WITHOUT ANY WARRANTY; without even the implied warranty of
14 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 : General Public License for more details.
16 :
17 : You should have received a copy of the GNU General Public License
18 : along with GCC; see the file COPYING3. If not see
19 : <http://www.gnu.org/licenses/>. */
20 :
21 : #ifndef GCC_ANALYZER_COMMON_H
22 : #define GCC_ANALYZER_COMMON_H
23 :
24 : #include "config.h"
25 : #define INCLUDE_ALGORITHM
26 : #define INCLUDE_LIST
27 : #define INCLUDE_MAP
28 : #define INCLUDE_SET
29 : #define INCLUDE_STRING
30 : #define INCLUDE_VECTOR
31 : #include "system.h"
32 : #include "coretypes.h"
33 : #include "tree.h"
34 : #include "function.h"
35 : #include "basic-block.h"
36 : #include "gimple.h"
37 : #include "options.h"
38 : #include "bitmap.h"
39 : #include "diagnostic-core.h"
40 : #include "diagnostics/paths.h"
41 : #include "rich-location.h"
42 : #include "function.h"
43 : #include "json.h"
44 : #include "tristate.h"
45 : #include "value-range.h"
46 :
47 : class graphviz_out;
48 :
49 : namespace diagnostics {
50 : namespace markup {
51 :
52 : class node;
53 : class lowering_options;
54 :
55 : } } // namespace diagnostics:markup
56 :
57 : namespace ana {
58 :
59 : /* Forward decls of common types, with indentation to show inheritance. */
60 :
61 : class supergraph;
62 : class supernode;
63 : class superedge;
64 :
65 : class integer;
66 : template<typename Unit> class integer_with_unit;
67 :
68 : namespace units {
69 : struct bit;
70 : struct byte;
71 : }
72 :
73 : namespace symbolic
74 : {
75 : template<typename ConcreteValueType>
76 : class range;
77 :
78 : class node_dump_state;
79 : template <typename NodeClass> class node_set;
80 :
81 : class node_visitor;
82 : class liveness_context;
83 : struct markup_context;
84 :
85 : class node;
86 : class bit_contents;
87 : class unfoldable_bit_contents;
88 : class baseline_bit_contents;
89 : class conjured_bit_contents;
90 : class offset_bit_contents;
91 : class uniform_bit_contents;
92 : class bit_overlay;
93 : class concrete_bit_overlay;
94 : class symbolic_bit_overlay;
95 :
96 : template <typename ConcreteValueType>
97 : class scalar;
98 :
99 : class value_node;
100 : class bit_vector;
101 : class concat_bit_vector;
102 : class conjured_bit_vector;
103 : class constant_bit_vector;
104 : class cropped_bit_vector;
105 : class repeated_bit_vector;
106 : class bit_vector_from_svalue;
107 : class bit_vector_from_ubc;
108 : class uniform_bit_vector;
109 : class empty_bit_vector;
110 : class poisoned_bit_vector;
111 : class tristate_bit_vector;
112 :
113 : /* Top-level manager class. */
114 : class node_manager;
115 :
116 : /* Managers for specific kinds of symbolic::node. */
117 : class bit_contents_manager;
118 : class bit_vector_manager;
119 : class scalar_managers;
120 : template<typename ConcreteValueType> class scalar_manager;
121 :
122 : } // namespace ana::symbolic
123 :
124 : using symbolic_bit_range = symbolic::range<integer_with_unit<units::bit>>;
125 : using symbolic_byte_range = symbolic::range<integer_with_unit<units::byte>>;
126 :
127 : class svalue;
128 : class pointer_svalue;
129 : class constant_svalue;
130 : class unknown_svalue;
131 : class poisoned_svalue;
132 : class setjmp_svalue;
133 : class initial_svalue;
134 : class unaryop_svalue;
135 : class binop_svalue;
136 : class svalue_from_bit_vector;
137 : class unmergeable_svalue;
138 : class placeholder_svalue;
139 : class widening_svalue;
140 : class asm_output_svalue;
141 : class const_fn_result_svalue;
142 : class region;
143 : class cluster_region;
144 : class frame_region;
145 : class function_region;
146 : class label_region;
147 : class decl_region;
148 : class symbolic_region;
149 : class element_region;
150 : class offset_region;
151 : class sized_region;
152 : class cast_region;
153 : class field_region;
154 : class string_region;
155 : class bit_range_region;
156 : class var_arg_region;
157 : class region_model_manager;
158 : class conjured_purge;
159 : struct model_merger;
160 : class store;
161 : class region_model;
162 : class region_model_context;
163 : class impl_region_model_context;
164 : class call_details;
165 : class rejected_constraint;
166 : class constraint_manager;
167 : class equiv_class;
168 : class reachable_regions;
169 : class bounded_ranges;
170 : class bounded_ranges_manager;
171 :
172 : class setjmp_record;
173 :
174 : struct pending_location;
175 : class pending_diagnostic;
176 : class pending_note;
177 : class saved_diagnostic;
178 : struct event_loc_info;
179 : class checker_event;
180 : class state_change_event;
181 : class warning_event;
182 : class checker_path;
183 : class extrinsic_state;
184 : class sm_state_map;
185 : class call_string;
186 : class program_point;
187 : class program_state;
188 : class exploded_graph;
189 : class exploded_node;
190 : class exploded_edge;
191 : class feasibility_problem;
192 : class feasibility_state;
193 : class exploded_cluster;
194 : class exploded_path;
195 : class analysis_plan;
196 : class state_purge_map;
197 : class state_purge_per_ssa_name;
198 : class state_purge_per_decl;
199 : class state_change;
200 : class rewind_info_t;
201 :
202 : class engine;
203 : class state_machine;
204 : class logger;
205 : class visitor;
206 : class known_function_manager;
207 : class call_summary;
208 : class call_summary_replay;
209 : struct per_function_data;
210 : struct interesting_t;
211 : class state_transition;
212 : class state_transition_at_call;
213 : class state_transition_at_return;
214 : class uncertainty_t;
215 :
216 : class feasible_node;
217 :
218 : class known_function;
219 : class builtin_known_function;
220 : class internal_known_function;
221 :
222 : class translation_unit;
223 :
224 : /* Forward decls of functions. */
225 :
226 : extern void dump_tree (pretty_printer *pp, tree t);
227 : extern void dump_quoted_tree (pretty_printer *pp, tree t);
228 : extern void print_quoted_type (pretty_printer *pp, tree t);
229 : extern void print_expr_for_user (pretty_printer *pp, tree t);
230 : extern bool printable_expr_p (const_tree expr);
231 : extern int readability_comparator (const void *p1, const void *p2);
232 : extern int tree_cmp (const void *p1, const void *p2);
233 : extern int cmp_types (const_tree a, const_tree b);
234 : extern tree fixup_tree_for_diagnostic (tree);
235 : extern tree get_diagnostic_tree_for_gassign (const gassign *);
236 :
237 : inline bool
238 170716 : useful_location_p (location_t loc)
239 : {
240 170716 : return get_pure_location (loc) != UNKNOWN_LOCATION;
241 : }
242 :
243 : /* A tree, extended with stack frame information for locals, so that
244 : we can distinguish between different values of locals within a potentially
245 : recursive callstack. */
246 :
247 : class path_var
248 : {
249 : public:
250 26461 : path_var (tree t, int stack_depth)
251 4236182 : : m_tree (t), m_stack_depth (stack_depth)
252 : {
253 : // TODO: ignore stack depth for globals and constants
254 : }
255 :
256 40 : bool operator== (const path_var &other) const
257 : {
258 40 : return (m_tree == other.m_tree
259 40 : && m_stack_depth == other.m_stack_depth);
260 : }
261 :
262 10799 : operator bool () const
263 : {
264 10799 : return m_tree != NULL_TREE;
265 : }
266 :
267 : void dump (pretty_printer *pp) const;
268 :
269 : tree m_tree;
270 : int m_stack_depth; // or -1 for globals?
271 : };
272 :
273 : typedef offset_int bit_offset_t;
274 : typedef offset_int bit_size_t;
275 : typedef offset_int byte_offset_t;
276 : typedef offset_int byte_size_t;
277 :
278 : extern bool int_size_in_bits (const_tree type, bit_size_t *out);
279 :
280 : extern bool
281 : compare_bit_offsets_p (bit_offset_t a,
282 : enum tree_code op,
283 : bit_offset_t b);
284 :
285 : extern int
286 : cmp_csts_and_types (const_tree cst1, const_tree cst2);
287 :
288 : extern location_t get_stmt_location (const gimple *stmt, function *fun);
289 :
290 : extern bool compat_types_p (tree src_type, tree dst_type);
291 :
292 : /* Abstract base class for simulating the behavior of known functions,
293 : supplied by the core of the analyzer, or by plugins.
294 : The former are typically implemented in the various kf*.cc */
295 :
296 215881 : class known_function
297 : {
298 : public:
299 482 : virtual ~known_function () {}
300 : virtual bool matches_call_types_p (const call_details &cd) const = 0;
301 :
302 : /* A hook for performing additional checks on the expected state
303 : at a call. */
304 : virtual void
305 33437 : check_any_preconditions (const call_details &) const
306 : {
307 : // no-op
308 33437 : }
309 :
310 16662 : virtual void impl_call_pre (const call_details &) const
311 : {
312 16662 : return;
313 : }
314 31799 : virtual void impl_call_post (const call_details &) const
315 : {
316 31799 : return;
317 : }
318 :
319 : virtual const builtin_known_function *
320 49117 : dyn_cast_builtin_kf () const { return nullptr; }
321 : };
322 :
323 : /* Subclass of known_function for builtin functions. */
324 :
325 186609 : class builtin_known_function : public known_function
326 : {
327 : public:
328 : virtual enum built_in_function builtin_code () const = 0;
329 63416 : tree builtin_decl () const {
330 63416 : gcc_assert (builtin_code () < END_BUILTINS);
331 63416 : return builtin_info[builtin_code ()].decl;
332 : }
333 :
334 : const builtin_known_function *
335 63416 : dyn_cast_builtin_kf () const final override { return this; }
336 : };
337 :
338 : /* Subclass of known_function for IFN_* functions. */
339 :
340 289061 : class internal_known_function : public known_function
341 : {
342 : public:
343 0 : bool matches_call_types_p (const call_details &) const final override
344 : {
345 : /* Types are assumed to be correct. */
346 0 : return true;
347 : }
348 : };
349 :
350 : /* Abstract subclass of known_function that merely sets the return
351 : value of the function (based on function attributes), and assumes
352 : it has no side-effects. */
353 :
354 113429 : class pure_known_function_with_default_return : public known_function
355 : {
356 : public:
357 : void impl_call_pre (const call_details &cd) const override;
358 : };
359 :
360 : extern void register_known_functions (known_function_manager &kfm,
361 : region_model_manager &rmm);
362 : extern void register_known_analyzer_functions (known_function_manager &kfm);
363 : extern void register_known_fd_functions (known_function_manager &kfm);
364 : extern void register_known_file_functions (known_function_manager &kfm);
365 : extern void register_known_functions_lang_cp (known_function_manager &kfm);
366 : extern void register_varargs_builtins (known_function_manager &kfm);
367 :
368 : /* An enum for describing the direction of an access to memory. */
369 :
370 : enum class access_direction
371 : {
372 : read,
373 : write
374 : };
375 :
376 : /* State tracked along an execution path that's pertinent to a specific
377 : diagnostic (e.g. for a divide-by-zero warning where the zero value
378 : comes from). */
379 :
380 468365 : struct diagnostic_state
381 : {
382 86550 : diagnostic_state ()
383 86550 : : m_region_holding_value (nullptr)
384 : {
385 : }
386 :
387 1194 : diagnostic_state (std::string debug_desc,
388 : const region *region_holding_value)
389 1194 : : m_debug_desc (std::move (debug_desc)),
390 1194 : m_region_holding_value (region_holding_value)
391 : {
392 : }
393 :
394 : void dump_to_pp (pretty_printer *) const;
395 : void dump () const;
396 :
397 : bool
398 : operator== (const diagnostic_state &other) const
399 : {
400 : return m_region_holding_value == other.m_region_holding_value;
401 : }
402 : bool
403 : operator!= (const diagnostic_state &other) const
404 : {
405 : return !(*this == other);
406 : }
407 :
408 : std::string m_debug_desc;
409 : const region *m_region_holding_value;
410 : };
411 :
412 : struct rewind_context;
413 :
414 : /* Abstract base class for associating custom data with an
415 : exploded_edge, for handling non-standard edges such as
416 : rewinding from a longjmp, signal handlers, etc.
417 : Also used when "bifurcating" state: splitting the execution
418 : path in non-standard ways (e.g. for simulating the various
419 : outcomes of "realloc"). */
420 :
421 33524 : class custom_edge_info
422 : {
423 : public:
424 25 : virtual ~custom_edge_info () {}
425 :
426 : /* Hook for making .dot label more readable. */
427 : virtual void print (pretty_printer *pp) const = 0;
428 :
429 : virtual void
430 : get_dot_attrs (const char *&out_style,
431 : const char *&out_color) const;
432 :
433 : /* Hook for updating STATE when handling bifurcation. */
434 : virtual bool update_state (program_state *state,
435 : const exploded_edge *eedge,
436 : region_model_context *ctxt) const;
437 :
438 : /* Hook for updating MODEL within exploded_path::feasible_p
439 : and when handling bifurcation. */
440 : virtual bool update_model (region_model *model,
441 : const exploded_edge *eedge,
442 : region_model_context *ctxt) const = 0;
443 :
444 : virtual void add_events_to_path (checker_path *emission_path,
445 : const exploded_edge &eedge,
446 : pending_diagnostic &pd,
447 : const state_transition *state_trans) const = 0;
448 :
449 : virtual exploded_node *create_enode (exploded_graph &eg,
450 : const program_point &point,
451 : program_state &&state,
452 : exploded_node *enode_for_diag,
453 : region_model_context *ctxt) const;
454 :
455 : virtual bool
456 524 : try_to_rewind_data_flow (rewind_context &) const
457 : {
458 524 : return false;
459 : }
460 : };
461 :
462 : /* Abstract base class for splitting state.
463 :
464 : Most of the state-management code in the analyzer involves
465 : modifying state objects in-place, which assumes a single outcome.
466 :
467 : This class provides an escape hatch to allow for multiple outcomes
468 : for such updates e.g. for modelling multiple outcomes from function
469 : calls, such as the various outcomes of "realloc". */
470 :
471 215749 : class path_context
472 : {
473 : public:
474 108094 : virtual ~path_context () {}
475 :
476 : /* Hook for clients to split state with a non-standard path. */
477 : virtual void bifurcate (std::unique_ptr<custom_edge_info> info) = 0;
478 :
479 : /* Hook for clients to terminate the standard path. */
480 : virtual void terminate_path () = 0;
481 :
482 : /* Hook for clients to determine if the standard path has been
483 : terminated. */
484 : virtual bool terminate_path_p () const = 0;
485 : };
486 :
487 : extern tree get_stashed_constant_by_name (const char *name);
488 : extern void log_stashed_constants (logger *logger);
489 :
490 : extern FILE *get_or_create_any_logfile ();
491 :
492 : extern std::unique_ptr<json::value>
493 : tree_to_json (tree node);
494 :
495 : extern std::unique_ptr<json::value>
496 : diagnostic_event_id_to_json (const diagnostics::paths::event_id_t &);
497 :
498 : extern std::unique_ptr<json::value>
499 : bit_offset_to_json (const bit_offset_t &offset);
500 :
501 : extern std::unique_ptr<json::value>
502 : byte_offset_to_json (const byte_offset_t &offset);
503 :
504 : extern tristate
505 : compare_constants (tree lhs_const, enum tree_code op, tree rhs_const);
506 :
507 : extern tree
508 : get_string_cst_size (const_tree string_cst);
509 :
510 : extern tree
511 : get_ssa_default_def (const function &fun, tree var);
512 :
513 : extern const svalue *
514 : strip_types (const svalue *sval, region_model_manager &mgr);
515 :
516 : extern tree remove_ssa_names (tree expr);
517 :
518 : /* An enum describing a particular kind of "poisoned" value. */
519 :
520 : enum class poison_kind
521 : {
522 : /* For use to describe uninitialized memory. */
523 : uninit,
524 :
525 : /* For use to describe freed memory. */
526 : freed,
527 :
528 : /* For use to describe deleted memory. */
529 : deleted,
530 :
531 : /* For use on pointers to regions within popped stack frames. */
532 : popped_stack,
533 :
534 : /* Placeholder value (e.g. for string_scan when we don't have
535 : a poison_kind). */
536 : other
537 : };
538 :
539 : extern const char *
540 : poison_kind_to_str (enum poison_kind);
541 :
542 : /* An enum for discriminating different baseline states,
543 : for determining the implicit contents of base regions
544 : that don't have their contents explicitly tracked. */
545 :
546 : enum class baseline_state
547 : {
548 : /* Analysis is on a direct path from entry to "main", so
549 : the implicit contents of a global variable is that of
550 : its initializer (or 0). */
551 : main,
552 :
553 : /* Analysis is on an entrypoint that isn't on "main", so
554 : the implicit contents of a global variable is its initial_svalue. */
555 : after_main
556 : };
557 :
558 : extern const char *
559 : baseline_state_to_str (baseline_state);
560 :
561 : /* An enum for tracking the state of an iteration. */
562 :
563 : enum class iter_result
564 : {
565 : keep_going,
566 : stop
567 : };
568 :
569 : extern void
570 : append_pathvar_with_type (path_var pv,
571 : tree type,
572 : auto_vec<path_var> *out_pvs);
573 :
574 : } // namespace ana
575 :
576 : extern bool is_special_named_call_p (const gcall &call, const char *funcname,
577 : unsigned int num_args,
578 : bool look_in_std = false);
579 : extern bool is_named_call_p (const_tree fndecl, const char *funcname);
580 : extern bool is_named_call_p (const_tree fndecl, const char *funcname,
581 : const gcall &call, unsigned int num_args);
582 : extern bool is_std_function_p (const_tree fndecl);
583 : extern bool is_cxxabi_function_p (const_tree fndecl);
584 : extern bool is_std_named_call_p (const_tree fndecl, const char *funcname);
585 : extern bool is_std_named_call_p (const_tree fndecl, const char *funcname,
586 : const gcall &call, unsigned int num_args);
587 : extern bool is_setjmp_call_p (const gcall &call);
588 : extern bool is_longjmp_call_p (const gcall &call);
589 : extern bool is_placement_new_p (const gcall &call);
590 : extern bool is_cxa_throw_p (const gcall &call);
591 : extern bool is_cxa_rethrow_p (const gcall &call);
592 : extern bool is_cxa_end_catch_p (const gcall &call);
593 :
594 : extern const char *get_user_facing_name (const gcall &call);
595 :
596 : extern void register_analyzer_pass ();
597 :
598 : extern label_text make_label_text (bool can_colorize, const char *fmt, ...);
599 : extern label_text make_label_text_n (bool can_colorize,
600 : unsigned HOST_WIDE_INT n,
601 : const char *singular_fmt,
602 : const char *plural_fmt, ...);
603 :
604 : extern bool fndecl_has_gimple_body_p (tree fndecl);
605 :
606 : /* An RAII-style class for pushing/popping cfun within a scope.
607 : Doing so ensures we get "In function " announcements
608 : from the diagnostics subsystem. */
609 :
610 : class auto_cfun
611 : {
612 : public:
613 777882 : auto_cfun (function *fun) { push_cfun (fun); }
614 777882 : ~auto_cfun () { pop_cfun (); }
615 : };
616 :
617 : /* A template for creating hash traits for a POD type. */
618 :
619 : template <typename Type>
620 : struct pod_hash_traits : typed_noop_remove<Type>
621 : {
622 : typedef Type value_type;
623 : typedef Type compare_type;
624 : static inline hashval_t hash (value_type);
625 : static inline bool equal (const value_type &existing,
626 : const value_type &candidate);
627 : static inline void mark_deleted (Type &);
628 : static inline void mark_empty (Type &);
629 : static inline bool is_deleted (Type);
630 : static inline bool is_empty (Type);
631 : };
632 :
633 : /* A hash traits class that uses member functions to implement
634 : the various required ops. */
635 :
636 : template <typename Type>
637 : struct member_function_hash_traits : public typed_noop_remove<Type>
638 : {
639 : typedef Type value_type;
640 : typedef Type compare_type;
641 2123789 : static inline hashval_t hash (value_type v) { return v.hash (); }
642 2026769 : static inline bool equal (const value_type &existing,
643 : const value_type &candidate)
644 : {
645 4372511 : return existing == candidate;
646 : }
647 : static inline void mark_deleted (Type &t) { t.mark_deleted (); }
648 0 : static inline void mark_empty (Type &t) { t.mark_empty (); }
649 80241 : static inline bool is_deleted (Type t) { return t.is_deleted (); }
650 8899245 : static inline bool is_empty (Type t) { return t.is_empty (); }
651 : };
652 :
653 : /* A map from T::key_t to T* for use in consolidating instances of T.
654 : Owns all instances of T.
655 : T::key_t should have operator== and be hashable. */
656 :
657 : template <typename T>
658 : class consolidation_map
659 : {
660 : public:
661 : typedef typename T::key_t key_t;
662 : typedef T instance_t;
663 : typedef hash_map<key_t, instance_t *> inner_map_t;
664 : typedef typename inner_map_t::iterator iterator;
665 :
666 : /* Delete all instances of T. */
667 :
668 40455 : ~consolidation_map ()
669 : {
670 113172 : for (typename inner_map_t::iterator iter = m_inner_map.begin ();
671 113172 : iter != m_inner_map.end (); ++iter)
672 72717 : delete (*iter).second;
673 40455 : }
674 :
675 : /* Get the instance of T for K if one exists, or nullptr. */
676 :
677 334266 : T *get (const key_t &k) const
678 : {
679 334266 : if (instance_t **slot = const_cast<inner_map_t &> (m_inner_map).get (k))
680 261549 : return *slot;
681 : return nullptr;
682 : }
683 :
684 : /* Take ownership of INSTANCE. */
685 :
686 72717 : void put (const key_t &k, T *instance)
687 : {
688 72717 : m_inner_map.put (k, instance);
689 : }
690 :
691 90 : size_t elements () const { return m_inner_map.elements (); }
692 :
693 68 : iterator begin () const { return m_inner_map.begin (); }
694 110 : iterator end () const { return m_inner_map.end (); }
695 :
696 : private:
697 : inner_map_t m_inner_map;
698 : };
699 :
700 : /* Disable -Wformat-diag; we want to be able to use pp_printf
701 : for logging/dumping without complying with the rules for diagnostics. */
702 : #if __GNUC__ >= 10
703 : #pragma GCC diagnostic ignored "-Wformat-diag"
704 : #endif
705 :
706 : namespace gcc {
707 : namespace topics {
708 :
709 : /* A topic for messages relating to the analyzer. */
710 :
711 : namespace analyzer_events {
712 :
713 : /* A message published by the analyzer when the frontend finishes
714 : parsing the TU, to allow it to look up pertinent items using the FE's
715 : name-resolution logic. */
716 :
717 : struct on_tu_finished
718 : {
719 : ana::logger *m_logger;
720 : const ana::translation_unit &m_tu;
721 : };
722 :
723 : /* A message published by the analyzer as it starts up, intended for
724 : subsystems/plugins that want to register additional functionality
725 : within the analyzer. */
726 :
727 38 : struct on_ana_init
728 : {
729 : virtual void
730 : register_state_machine (std::unique_ptr<ana::state_machine>) const = 0;
731 :
732 : virtual void
733 : register_known_function (const char *name,
734 : std::unique_ptr<ana::known_function>) const = 0;
735 :
736 : virtual ana::logger *
737 : get_logger () const = 0;
738 : };
739 :
740 : /* A message published by the analyzer when it simulates popping a stack
741 : frame. */
742 :
743 : struct on_frame_popped
744 : {
745 : const ana::region_model *m_new_model;
746 : const ana::region_model *m_old_model;
747 : const ana::svalue *m_retval;
748 : ana::region_model_context *m_ctxt;
749 : };
750 :
751 : /* A message published by the analyzer when it has finished and is about
752 : to clean up. */
753 :
754 : struct on_ana_done
755 : {
756 : const ana::engine &m_engine;
757 : const ana::exploded_graph &m_eg;
758 : };
759 :
760 1 : struct subscriber {
761 :
762 : virtual ~subscriber () = default;
763 :
764 38 : virtual void on_message (const on_tu_finished &) {}
765 1 : virtual void on_message (const on_ana_init &) {}
766 227 : virtual void on_message (const on_frame_popped &) {}
767 37 : virtual void on_message (const on_ana_done &) {}
768 : };
769 :
770 : } // namespace gcc::topics::analyzer_events
771 : } // namespace gcc::topics
772 : } // namespace gcc
773 :
774 : #if !ENABLE_ANALYZER
775 : extern void sorry_no_analyzer ();
776 : #endif /* #if !ENABLE_ANALYZER */
777 :
778 : #endif /* GCC_ANALYZER_COMMON_H */
|