GCC Middle and Back End API Reference
common.h
Go to the documentation of this file.
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
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_COMMON_H
22#define GCC_ANALYZER_COMMON_H
23
24#include "config.h"
25#define INCLUDE_LIST
26#define INCLUDE_MAP
27#define INCLUDE_SET
28#define INCLUDE_STRING
29#define INCLUDE_VECTOR
30#include "system.h"
31#include "coretypes.h"
32#include "tree.h"
33#include "function.h"
34#include "basic-block.h"
35#include "gimple.h"
36#include "options.h"
37#include "bitmap.h"
38#include "diagnostic-core.h"
39#include "diagnostics/paths.h"
40#include "rich-location.h"
41#include "function.h"
42#include "json.h"
43#include "tristate.h"
44
45class graphviz_out;
46
47namespace ana {
48
49/* Forward decls of common types, with indentation to show inheritance. */
50
51class supergraph;
52class supernode;
53class superedge;
54
55class svalue;
56 class region_svalue;
57 class constant_svalue;
58 class unknown_svalue;
59 class poisoned_svalue;
60 class setjmp_svalue;
61 class initial_svalue;
62 class unaryop_svalue;
63 class binop_svalue;
64 class sub_svalue;
65 class repeated_svalue;
66 class bits_within_svalue;
67 class unmergeable_svalue;
68 class placeholder_svalue;
69 class widening_svalue;
70 class compound_svalue;
71 class conjured_svalue;
72 class asm_output_svalue;
73 class const_fn_result_svalue;
75class region;
76 class frame_region;
77 class function_region;
78 class label_region;
79 class decl_region;
80 class symbolic_region;
81 class element_region;
82 class offset_region;
83 class sized_region;
84 class cast_region;
85 class field_region;
86 class string_region;
87 class bit_range_region;
88 class var_arg_region;
90class conjured_purge;
91struct model_merger;
92class store_manager;
93class store;
94class region_model;
97class call_details;
100class equiv_class;
102class bounded_ranges;
104
105struct pending_location;
107class pending_note;
108class saved_diagnostic;
109struct event_loc_info;
110class checker_event;
111 class state_change_event;
112 class warning_event;
113class checker_path;
114class extrinsic_state;
115class sm_state_map;
116class program_point;
117class program_state;
118class exploded_graph;
119class exploded_node;
120class exploded_edge;
123class exploded_cluster;
124class exploded_path;
125class analysis_plan;
126class state_purge_map;
129class state_change;
130class rewind_info_t;
131
132class engine;
133class state_machine;
134class logger;
135class visitor;
137class call_summary;
139struct per_function_data;
140struct interesting_t;
141class uncertainty_t;
142
143class feasible_node;
144
145class known_function;
148
149class translation_unit;
150
151/* Forward decls of functions. */
152
153extern void dump_tree (pretty_printer *pp, tree t);
157extern int readability_comparator (const void *p1, const void *p2);
158extern int tree_cmp (const void *p1, const void *p2);
161
162inline bool
163useful_location_p (location_t loc)
164{
165 return get_pure_location (loc) != UNKNOWN_LOCATION;
166}
167
168/* A tree, extended with stack frame information for locals, so that
169 we can distinguish between different values of locals within a potentially
170 recursive callstack. */
171
173{
174public:
175 path_var (tree t, int stack_depth)
176 : m_tree (t), m_stack_depth (stack_depth)
177 {
178 // TODO: ignore stack depth for globals and constants
179 }
180
181 bool operator== (const path_var &other) const
182 {
183 return (m_tree == other.m_tree
184 && m_stack_depth == other.m_stack_depth);
185 }
186
187 operator bool () const
188 {
189 return m_tree != NULL_TREE;
190 }
191
192 void dump (pretty_printer *pp) const;
193
195 int m_stack_depth; // or -1 for globals?
196};
197
198typedef offset_int bit_offset_t;
199typedef offset_int bit_size_t;
200typedef offset_int byte_offset_t;
201typedef offset_int byte_size_t;
202
204
206
207/* The location of a region expressesd as an offset relative to a
208 base region. */
209
211{
212public:
214 : m_base_region (nullptr), m_offset (0), m_sym_offset (nullptr)
215 {
216 }
217
218 static region_offset make_concrete (const region *base_region,
219 bit_offset_t offset)
220 {
221 return region_offset (base_region, offset, nullptr);
222 }
223 static region_offset make_symbolic (const region *base_region,
224 const svalue *sym_offset)
225 {
226 return region_offset (base_region, 0, sym_offset);
227 }
228 static region_offset make_byte_offset (const region *base_region,
229 const svalue *num_bytes_sval);
230
231 const region *get_base_region () const { return m_base_region; }
232
233 bool concrete_p () const { return m_sym_offset == nullptr; }
234 bool symbolic_p () const { return m_sym_offset != nullptr; }
235
237 {
239 return m_offset;
240 }
241
243 {
245 if (m_offset % BITS_PER_UNIT == 0)
246 {
247 *out = m_offset / BITS_PER_UNIT;
248 return true;
249 }
250 return false;
251 }
252
254 {
256 return m_sym_offset;
257 }
258
261
262 bool operator== (const region_offset &other) const
263 {
264 return (m_base_region == other.m_base_region
265 && m_offset == other.m_offset
266 && m_sym_offset == other.m_sym_offset);
267 }
268
269 void dump_to_pp (pretty_printer *pp, bool) const;
270 void dump (bool) const;
271
272private:
273 region_offset (const region *base_region, bit_offset_t offset,
274 const svalue *sym_offset)
275 : m_base_region (base_region), m_offset (offset), m_sym_offset (sym_offset)
276 {}
277
281};
282
283extern bool operator< (const region_offset &, const region_offset &);
284extern bool operator<= (const region_offset &, const region_offset &);
285extern bool operator> (const region_offset &, const region_offset &);
286extern bool operator>= (const region_offset &, const region_offset &);
287
288extern location_t get_stmt_location (const gimple *stmt, function *fun);
289
290extern 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
297{
298public:
299 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
306 {
307 // no-op
308 }
309
310 virtual void impl_call_pre (const call_details &) const
311 {
312 return;
313 }
314 virtual void impl_call_post (const call_details &) const
315 {
316 return;
317 }
318
319 virtual const builtin_known_function *
320 dyn_cast_builtin_kf () const { return nullptr; }
321};
322
323/* Subclass of known_function for builtin functions. */
324
326{
327public:
328 virtual enum built_in_function builtin_code () const = 0;
331 return builtin_info[builtin_code ()].decl;
332 }
333
335 dyn_cast_builtin_kf () const final override { return this; }
336};
337
338/* Subclass of known_function for IFN_* functions. */
339
341{
342public:
343 bool matches_call_types_p (const call_details &) const final override
344 {
345 /* Types are assumed to be correct. */
346 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
355{
356public:
357 void impl_call_pre (const call_details &cd) const override;
358};
359
367
368/* An enum for describing the direction of an access to memory. */
369
371{
374};
375
376/* Abstract base class for associating custom data with an
377 exploded_edge, for handling non-standard edges such as
378 rewinding from a longjmp, signal handlers, etc.
379 Also used when "bifurcating" state: splitting the execution
380 path in non-standard ways (e.g. for simulating the various
381 outcomes of "realloc"). */
382
384{
385public:
386 virtual ~custom_edge_info () {}
387
388 /* Hook for making .dot label more readable. */
389 virtual void print (pretty_printer *pp) const = 0;
390
391 virtual void
392 get_dot_attrs (const char *&out_style,
393 const char *&out_color) const;
394
395 /* Hook for updating STATE when handling bifurcation. */
397 const exploded_edge *eedge,
398 region_model_context *ctxt) const;
399
400 /* Hook for updating MODEL within exploded_path::feasible_p
401 and when handling bifurcation. */
402 virtual bool update_model (region_model *model,
403 const exploded_edge *eedge,
404 region_model_context *ctxt) const = 0;
405
406 virtual void add_events_to_path (checker_path *emission_path,
407 const exploded_edge &eedge,
408 pending_diagnostic &pd) const = 0;
409
411 const program_point &point,
413 exploded_node *enode_for_diag,
414 region_model_context *ctxt) const;
415};
416
417/* Abstract base class for splitting state.
418
419 Most of the state-management code in the analyzer involves
420 modifying state objects in-place, which assumes a single outcome.
421
422 This class provides an escape hatch to allow for multiple outcomes
423 for such updates e.g. for modelling multiple outcomes from function
424 calls, such as the various outcomes of "realloc". */
425
427{
428public:
429 virtual ~path_context () {}
430
431 /* Hook for clients to split state with a non-standard path. */
432 virtual void bifurcate (std::unique_ptr<custom_edge_info> info) = 0;
433
434 /* Hook for clients to terminate the standard path. */
435 virtual void terminate_path () = 0;
436
437 /* Hook for clients to determine if the standard path has been
438 terminated. */
439 virtual bool terminate_path_p () const = 0;
440};
441
442extern tree get_stashed_constant_by_name (const char *name);
444
446
447extern std::unique_ptr<json::value>
449
450extern std::unique_ptr<json::value>
452
453extern std::unique_ptr<json::value>
455
456extern std::unique_ptr<json::value>
458
459extern tristate
460compare_constants (tree lhs_const, enum tree_code op, tree rhs_const);
461
462extern tree
464
465extern tree
467
468extern const svalue *
470
471extern region_offset
473
475
476} // namespace ana
477
478extern bool is_special_named_call_p (const gcall &call, const char *funcname,
479 unsigned int num_args,
480 bool look_in_std = false);
481extern bool is_named_call_p (const_tree fndecl, const char *funcname);
482extern bool is_named_call_p (const_tree fndecl, const char *funcname,
483 const gcall &call, unsigned int num_args);
484extern bool is_std_function_p (const_tree fndecl);
485extern bool is_std_named_call_p (const_tree fndecl, const char *funcname);
486extern bool is_std_named_call_p (const_tree fndecl, const char *funcname,
487 const gcall &call, unsigned int num_args);
488extern bool is_setjmp_call_p (const gcall &call);
489extern bool is_longjmp_call_p (const gcall &call);
490extern bool is_placement_new_p (const gcall &call);
491extern bool is_cxa_throw_p (const gcall &call);
492extern bool is_cxa_rethrow_p (const gcall &call);
493extern bool is_cxa_end_catch_p (const gcall &call);
494
495extern const char *get_user_facing_name (const gcall &call);
496
498
499extern label_text make_label_text (bool can_colorize, const char *fmt, ...);
500extern label_text make_label_text_n (bool can_colorize,
501 unsigned HOST_WIDE_INT n,
502 const char *singular_fmt,
503 const char *plural_fmt, ...);
504
505extern bool fndecl_has_gimple_body_p (tree fndecl);
506
507/* An RAII-style class for pushing/popping cfun within a scope.
508 Doing so ensures we get "In function " announcements
509 from the diagnostics subsystem. */
510
512{
513public:
514 auto_cfun (function *fun) { push_cfun (fun); }
516};
517
518/* A template for creating hash traits for a POD type. */
519
520template <typename Type>
522{
523 typedef Type value_type;
524 typedef Type compare_type;
525 static inline hashval_t hash (value_type);
526 static inline bool equal (const value_type &existing,
527 const value_type &candidate);
528 static inline void mark_deleted (Type &);
529 static inline void mark_empty (Type &);
530 static inline bool is_deleted (Type);
531 static inline bool is_empty (Type);
532};
533
534/* A hash traits class that uses member functions to implement
535 the various required ops. */
536
537template <typename Type>
539{
540 typedef Type value_type;
541 typedef Type compare_type;
542 static inline hashval_t hash (value_type v) { return v.hash (); }
543 static inline bool equal (const value_type &existing,
544 const value_type &candidate)
545 {
546 return existing == candidate;
547 }
548 static inline void mark_deleted (Type &t) { t.mark_deleted (); }
549 static inline void mark_empty (Type &t) { t.mark_empty (); }
550 static inline bool is_deleted (Type t) { return t.is_deleted (); }
551 static inline bool is_empty (Type t) { return t.is_empty (); }
552};
553
554/* A map from T::key_t to T* for use in consolidating instances of T.
555 Owns all instances of T.
556 T::key_t should have operator== and be hashable. */
557
558template <typename T>
560{
561public:
562 typedef typename T::key_t key_t;
563 typedef T instance_t;
565 typedef typename inner_map_t::iterator iterator;
566
567 /* Delete all instances of T. */
568
570 {
571 for (typename inner_map_t::iterator iter = m_inner_map.begin ();
572 iter != m_inner_map.end (); ++iter)
573 delete (*iter).second;
574 }
575
576 /* Get the instance of T for K if one exists, or nullptr. */
577
578 T *get (const key_t &k) const
579 {
580 if (instance_t **slot = const_cast<inner_map_t &> (m_inner_map).get (k))
581 return *slot;
582 return nullptr;
583 }
584
585 /* Take ownership of INSTANCE. */
586
587 void put (const key_t &k, T *instance)
588 {
589 m_inner_map.put (k, instance);
590 }
591
592 size_t elements () const { return m_inner_map.elements (); }
593
594 iterator begin () const { return m_inner_map.begin (); }
595 iterator end () const { return m_inner_map.end (); }
596
597private:
599};
600
601/* Disable -Wformat-diag; we want to be able to use pp_printf
602 for logging/dumping without complying with the rules for diagnostics. */
603#if __GNUC__ >= 10
604#pragma GCC diagnostic ignored "-Wformat-diag"
605#endif
606
607namespace gcc {
608namespace topics {
609
610/* A topic for messages relating to the analyzer. */
611
612namespace analyzer_events {
613
614/* A message published by the analyzer when the frontend finishes
615 parsing the TU, to allow it to look up pertinent items using the FE's
616 name-resolution logic. */
617
619{
621 const ana::translation_unit &m_tu;
622};
623
624/* A message published by the analyzer as it starts up, intended for
625 subsystems/plugins that want to register additional functionality
626 within the analyzer. */
627
629{
630 virtual void
631 register_state_machine (std::unique_ptr<ana::state_machine>) const = 0;
632
633 virtual void
634 register_known_function (const char *name,
635 std::unique_ptr<ana::known_function>) const = 0;
636
637 virtual ana::logger *
638 get_logger () const = 0;
639};
640
641/* A message published by the analyzer when it simulates popping a stack
642 frame. */
643
651
653
654 virtual ~subscriber () = default;
655
656 virtual void on_message (const on_tu_finished &) {}
657 virtual void on_message (const on_ana_init &) {}
658 virtual void on_message (const on_frame_popped &) {}
659};
660
661} // namespace gcc::topics::analyzer_events
662} // namespace gcc::topics
663} // namespace gcc
664
665#if !ENABLE_ANALYZER
666extern void sorry_no_analyzer ();
667#endif /* #if !ENABLE_ANALYZER */
668
669#endif /* GCC_ANALYZER_COMMON_H */
Definition analysis-plan.h:35
Definition region.h:1316
Definition constraint-manager.h:178
Definition common.h:326
virtual enum built_in_function builtin_code() const =0
const builtin_known_function * dyn_cast_builtin_kf() const final override
Definition common.h:335
tree builtin_decl() const
Definition common.h:329
Definition call-details.h:31
Definition call-summary.h:68
Definition call-summary.h:34
Definition region.h:1168
Definition checker-event.h:98
Definition checker-path.h:32
Definition svalue.h:1500
Definition constraint-manager.h:410
Definition common.h:384
virtual bool update_state(program_state *state, const exploded_edge *eedge, region_model_context *ctxt) const
virtual void get_dot_attrs(const char *&out_style, const char *&out_color) const
virtual void add_events_to_path(checker_path *emission_path, const exploded_edge &eedge, pending_diagnostic &pd) const =0
virtual bool update_model(region_model *model, const exploded_edge *eedge, region_model_context *ctxt) const =0
virtual exploded_node * create_enode(exploded_graph &eg, const program_point &point, program_state &&state, exploded_node *enode_for_diag, region_model_context *ctxt) const
virtual void print(pretty_printer *pp) const =0
virtual ~custom_edge_info()
Definition common.h:386
Definition region.h:742
Definition region.h:879
Definition region-model.h:1312
Definition constraint-manager.h:240
Definition exploded-graph.h:335
Definition exploded-graph.h:783
Definition exploded-graph.h:206
Definition exploded-graph.h:932
Definition program-state.h:34
Definition exploded-graph.h:960
Definition exploded-graph.h:980
Definition feasible-graph.h:84
Definition region.h:802
Definition region.h:319
Definition region.h:481
Definition exploded-graph.h:40
Definition common.h:341
bool matches_call_types_p(const call_details &) const final override
Definition common.h:343
Definition known-function-manager.h:41
Definition common.h:297
virtual void impl_call_post(const call_details &) const
Definition common.h:314
virtual void impl_call_pre(const call_details &) const
Definition common.h:310
virtual bool matches_call_types_p(const call_details &cd) const =0
virtual const builtin_known_function * dyn_cast_builtin_kf() const
Definition common.h:320
virtual ~known_function()
Definition common.h:299
virtual void check_any_preconditions(const call_details &) const
Definition common.h:305
Definition region.h:520
Definition analyzer-logging.h:34
Definition region.h:973
Definition common.h:427
virtual bool terminate_path_p() const =0
virtual void bifurcate(std::unique_ptr< custom_edge_info > info)=0
virtual void terminate_path()=0
virtual ~path_context()
Definition common.h:429
bool operator==(const path_var &other) const
Definition common.h:181
int m_stack_depth
Definition common.h:195
path_var(tree t, int stack_depth)
Definition common.h:175
void dump(pretty_printer *pp) const
tree m_tree
Definition common.h:194
Definition pending-diagnostic.h:189
Definition pending-diagnostic.h:435
Definition program-point.h:54
Definition program-state.h:224
void impl_call_pre(const call_details &cd) const override
Definition region-model-reachability.h:36
Definition region-model.h:746
Definition region-model-manager.h:32
Definition region-model.h:294
Definition common.h:211
bit_offset_t get_bit_offset() const
Definition common.h:236
bool symbolic_p() const
Definition common.h:234
const region * get_base_region() const
Definition common.h:231
bit_offset_t m_offset
Definition common.h:279
static region_offset make_byte_offset(const region *base_region, const svalue *num_bytes_sval)
const svalue * m_sym_offset
Definition common.h:280
static region_offset make_concrete(const region *base_region, bit_offset_t offset)
Definition common.h:218
void dump_to_pp(pretty_printer *pp, bool) const
region_offset()
Definition common.h:213
const svalue * calc_symbolic_byte_offset(region_model_manager *mgr) const
region_offset(const region *base_region, bit_offset_t offset, const svalue *sym_offset)
Definition common.h:273
void dump(bool) const
bool operator==(const region_offset &other) const
Definition common.h:262
const svalue & calc_symbolic_bit_offset(region_model_manager *mgr) const
const region * m_base_region
Definition common.h:278
bool get_concrete_byte_offset(byte_offset_t *out) const
Definition common.h:242
static region_offset make_symbolic(const region *base_region, const svalue *sym_offset)
Definition common.h:223
const svalue * get_symbolic_byte_offset() const
Definition common.h:253
bool concrete_p() const
Definition common.h:233
Definition region.h:126
Definition region-model.h:1252
Definition exploded-graph.h:447
Definition diagnostic-manager.h:79
Definition region.h:1067
Definition program-state.h:92
Definition checker-event.h:382
Definition sm.h:43
Definition state-purge.h:31
Definition state-purge.h:152
Definition state-purge.h:119
Definition store.h:949
Definition store.h:830
Definition region.h:1276
Definition svalue.h:92
Definition region.h:663
Definition store.h:161
Definition region.h:1406
Definition region-model.h:223
Definition checker-event.h:879
~auto_cfun()
Definition common.h:515
auto_cfun(function *fun)
Definition common.h:514
Definition common.h:560
inner_map_t::iterator iterator
Definition common.h:565
inner_map_t m_inner_map
Definition common.h:598
T * get(const key_t &k) const
Definition common.h:578
T::key_t key_t
Definition common.h:562
~consolidation_map()
Definition common.h:569
iterator begin() const
Definition common.h:594
T instance_t
Definition common.h:563
hash_map< key_t, instance_t * > inner_map_t
Definition common.h:564
void put(const key_t &k, T *instance)
Definition common.h:587
size_t elements() const
Definition common.h:592
iterator end() const
Definition common.h:595
Definition genmatch.cc:1506
Definition graphviz.h:388
Definition hash-map.h:40
Definition hash-set.h:37
Definition pretty-print.h:241
Definition lra-spills.cc:101
Definition tristate.h:26
bool is_named_call_p(const_tree fndecl, const char *funcname)
bool is_cxa_rethrow_p(const gcall &call)
bool is_std_function_p(const_tree fndecl)
bool is_placement_new_p(const gcall &call)
bool is_setjmp_call_p(const gcall &call)
void sorry_no_analyzer()
Definition analyzer-pass.cc:104
bool is_std_named_call_p(const_tree fndecl, const char *funcname)
label_text make_label_text_n(bool can_colorize, unsigned HOST_WIDE_INT n, const char *singular_fmt, const char *plural_fmt,...)
bool is_cxa_end_catch_p(const gcall &call)
bool is_cxa_throw_p(const gcall &call)
bool fndecl_has_gimple_body_p(tree fndecl)
label_text make_label_text(bool can_colorize, const char *fmt,...)
const char * get_user_facing_name(const gcall &call)
bool is_special_named_call_p(const gcall &call, const char *funcname, unsigned int num_args, bool look_in_std=false)
void register_analyzer_pass()
bool is_longjmp_call_p(const gcall &call)
const union tree_node * const_tree
Definition coretypes.h:98
union tree_node * tree
Definition coretypes.h:97
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2009
void push_cfun(struct function *new_cfun)
Definition function.cc:4756
void pop_cfun(void)
Definition function.cc:4782
static struct token T
Definition gengtype-parse.cc:45
static void record_type(type_p type)
Definition gengtype-state.cc:1426
built_in_function
Definition genmatch.cc:1009
tree_code
Definition genmatch.cc:1002
#define UNKNOWN_LOCATION
Definition input.h:32
location_t get_pure_location(location_t loc)
Definition input.h:183
Definition access-diagram.h:30
bool compat_types_p(tree src_type, tree dst_type)
void register_known_functions_lang_cp(known_function_manager &kfm)
void register_known_functions(known_function_manager &kfm, region_model_manager &rmm)
std::unique_ptr< json::value > byte_offset_to_json(const byte_offset_t &offset)
std::unique_ptr< json::value > bit_offset_to_json(const bit_offset_t &offset)
offset_int byte_size_t
Definition common.h:201
@ stmt
Definition checker-event.h:38
@ state_change
Definition checker-event.h:41
bool operator>(const region_offset &, const region_offset &)
offset_int bit_offset_t
Definition common.h:198
tree fixup_tree_for_diagnostic(tree)
void dump_tree(pretty_printer *pp, tree t)
bool operator>=(const region_offset &, const region_offset &)
tree get_string_cst_size(const_tree string_cst)
bool operator<(const region_offset &, const region_offset &)
void register_known_analyzer_functions(known_function_manager &kfm)
access_direction
Definition common.h:371
@ read
Definition common.h:372
@ write
Definition common.h:373
bool operator<=(const region_offset &, const region_offset &)
tree get_field_at_bit_offset(tree record_type, bit_offset_t bit_offset)
void print_expr_for_user(pretty_printer *pp, tree t)
tristate compare_constants(tree lhs_const, enum tree_code op, tree rhs_const)
tree get_stashed_constant_by_name(const char *name)
bool int_size_in_bits(const_tree type, bit_size_t *out)
std::unique_ptr< json::value > tree_to_json(tree node)
tree get_ssa_default_def(const function &fun, tree var)
std::unique_ptr< json::value > diagnostic_event_id_to_json(const diagnostics::paths::event_id_t &)
offset_int byte_offset_t
Definition common.h:200
location_t get_stmt_location(const gimple *stmt, function *fun)
const svalue * strip_types(const svalue *sval, region_model_manager &mgr)
FILE * get_or_create_any_logfile()
void dump_quoted_tree(pretty_printer *pp, tree t)
void log_stashed_constants(logger *logger)
offset_int bit_size_t
Definition common.h:199
int tree_cmp(const void *p1, const void *p2)
tree remove_ssa_names(tree expr)
tree get_diagnostic_tree_for_gassign(const gassign *)
hash_set< const svalue * > svalue_set
Definition common.h:74
void register_varargs_builtins(known_function_manager &kfm)
void register_known_fd_functions(known_function_manager &kfm)
int readability_comparator(const void *p1, const void *p2)
bool useful_location_p(location_t loc)
Definition common.h:163
void register_known_file_functions(known_function_manager &kfm)
void print_quoted_type(pretty_printer *pp, tree t)
Definition custom-sarif-properties/state-graphs.h:33
diagnostic_event_id_t event_id_t
Definition event-id.h:66
Definition channels.h:26
Definition constraint-manager.h:123
Definition event-loc-info.h:29
Definition pending-diagnostic.h:37
Definition region-model.h:1202
Definition diagnostic-manager.h:35
Definition exploded-graph.h:658
Definition tree-loop-distribution.cc:240
Definition function.h:249
Definition gimple.h:907
Definition gimple.h:352
virtual void register_state_machine(std::unique_ptr< ana::state_machine >) const =0
virtual void register_known_function(const char *name, std::unique_ptr< ana::known_function >) const =0
virtual ana::logger * get_logger() const =0
const ana::region_model * m_old_model
Definition common.h:647
const ana::svalue * m_retval
Definition common.h:648
const ana::region_model * m_new_model
Definition common.h:646
ana::region_model_context * m_ctxt
Definition common.h:649
ana::logger * m_logger
Definition common.h:620
const ana::translation_unit & m_tu
Definition common.h:621
virtual void on_message(const on_frame_popped &)
Definition common.h:658
virtual void on_message(const on_ana_init &)
Definition common.h:657
virtual void on_message(const on_tu_finished &)
Definition common.h:656
Definition gimple.h:221
Definition common.h:539
static void mark_empty(Type &t)
Definition common.h:549
static hashval_t hash(value_type v)
Definition common.h:542
Type compare_type
Definition common.h:541
Type value_type
Definition common.h:540
static bool equal(const value_type &existing, const value_type &candidate)
Definition common.h:543
static void mark_deleted(Type &t)
Definition common.h:548
static bool is_empty(Type t)
Definition common.h:551
static bool is_deleted(Type t)
Definition common.h:550
Definition common.h:522
static void mark_deleted(Type &)
Type compare_type
Definition common.h:524
static bool is_empty(Type)
static bool equal(const value_type &existing, const value_type &candidate)
static bool is_deleted(Type)
Type value_type
Definition common.h:523
static hashval_t hash(value_type)
static void mark_empty(Type &)
Definition genautomata.cc:669
Definition gengtype.h:252
Definition hash-traits.h:75
#define gcc_assert(EXPR)
Definition system.h:817
#define bool
Definition system.h:889
@ END_BUILTINS
Definition tree-core.h:3548
static tree candidate(unsigned uid)
Definition tree-sra.cc:326
static control_dependences * cd
Definition tree-ssa-dce.cc:104
#define NULL_TREE
Definition tree.h:318