GCC Middle and Back End API Reference
symbolic-nodes.h
Go to the documentation of this file.
1/* Base class for svalues and regions.
2 Copyright (C) 2023-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_SYMBOLIC_NODES_H
22#define GCC_ANALYZER_SYMBOLIC_NODES_H
23
24#include "pretty-print-markup.h"
25
27#include "analyzer/complexity.h"
28#include "analyzer/units.h"
30
32#include "text-art/dump.h"
33
34namespace ana {
35namespace symbolic {
36
37/* A central hub for managing symbolic::node instances
38 - Provides a central authority for handing out IDs for new nodes.
39 - Owns the various managers of symbolic::node subclasses and provides
40 a central place for them to find each other.
41
42 We use pointers to the managers to minimize compile-time dependencies.
43
44 This is effectively a singleton during analysis (but each unit test
45 gets its own instance). */
46
48{
49public:
52
53 node_manager (const node_manager &) = delete;
54
55 unsigned get_num_nodes () const { return m_next_node_id; }
56 unsigned alloc_node_id () { return m_next_node_id++; }
57
59 get_region_model_manager () const { return *m_rmm; }
60
62 get_svalue_manager () const { return *m_rmm; }
63
66
69
71 get_scalars () const { return *m_scalar_managers; }
72
73 void log_stats (logger *logger, bool show_objs) const;
74
75private:
77
78 std::unique_ptr<symbolic::scalar_managers> m_scalar_managers;
79 std::unique_ptr<region_model_manager> m_rmm;
80 std::unique_ptr<symbolic::bit_contents_manager> m_bit_contents_manager;
81 std::unique_ptr<symbolic::bit_vector_manager> m_bit_vector_manager;
82};
83
84/* A bundle of information for use by symbolic::node's
85 make_markup_node vfunc. */
86
88{
90 bool user_facing)
91 : m_model (model),
92 m_user_facing (user_facing)
93 {
94 }
95
98};
99
100/* Abstract base class for the various tree-like purely-functional
101 data structures we use during symbolic execution.
102
103 Instances are owned by a manager and reused, with memoization/caching
104 (compare to "hash consing" and value numbering).
105
106 Instances have a complexity and a numeric ID.
107
108 Has hierarchical dumping for debugging how nodes are built from other
109 nodes.
110
111 Has a node_visitor class for walking the object hierarchy.
112
113 Can convert itself to json for debugging/SARIF. */
114
115class node
116{
117 public:
118 using id_t = unsigned;
119
120 virtual ~node () = default;
121
122 /* Instances are managed via one of the managers within node_manager
123 and thus shouldn't be copied/assigned. */
124 node (const node &) = delete;
125 node (node &&) = delete;
126 node &operator= (const node &) = delete;
127 node &operator= (node &&) = delete;
128
129 const complexity &get_complexity () const { return m_complexity; }
130
131 id_t get_id () const { return m_id; }
132 static int cmp_ids (const symbolic::node *s1, const symbolic::node *s2);
133 static int cmp (const symbolic::node &s1, const symbolic::node &s2)
134 {
135 return (int)s1.get_id () - (int)s2.get_id ();
136 }
137 static int cmp_ptr_ptr (const void *, const void *);
138
140 bool show_ids = true,
141 bool elide_repeated_nodes = true) const;
142 void dump_to_logger (logger &) const;
143 void dump () const;
144
145 std::unique_ptr<text_art::tree_widget>
147 const char *prefix = nullptr) const;
148
149 virtual const char *
150 get_any_dump_color () const { return nullptr; }
151
152 virtual void
154
155 virtual std::unique_ptr<json::object>
156 to_json () const = 0;
157
158 virtual std::unique_ptr<diagnostics::markup::node>
159 make_markup_node (markup_context &markup_ctxt) const = 0;
160
161 bool involves_p (const symbolic::node &other) const;
162
163 void
165
166 void
168
171
172 protected:
173 node (complexity c, unsigned id)
174 : m_complexity (c),
175 m_id (id)
176 {}
177
178 std::unique_ptr<json::object>
179 make_json_obj (const char *type_name) const;
180
181 private:
182 virtual void
184 virtual void
186 node_dump_state &nds) const = 0;
187
189 id_t m_id; // for deterministic sorting at this stage, for dumps
190};
191
193{
194 bool operator()(const node *lhs, const node *rhs) const
195 {
196 return node::cmp_ids (lhs, rhs) < 0;
197 }
198};
199
200/* A pp_element subclass for printing a symbolic::node in pp_printf via %e.
201 This uses node::make_markup_node, lowers that, and prints the result
202 to the pretty_printer. */
203
205{
206public:
207 pp_element_for_node (const node &n, bool user_facing = true)
208 : m_node (n),
209 m_user_facing (user_facing)
210 {
211 }
212
213 void add_to_phase_2 (pp_markup::context &ctxt) final override;
214
215private:
216 const node &m_node;
218};
219
220/* A set of symbolic::node instances. */
221
222template <typename NodeClass>
223class node_set : public std::set<const NodeClass *, CompareNodeIds>
224{
225public:
226 void add (const NodeClass *n)
227 {
228 gcc_assert (n);
229 this->insert (n);
230 }
231 bool contains (const NodeClass *n) const;
232
234 union_ (const node_set<NodeClass> &other) const;
235
236 std::unique_ptr<text_art::tree_widget>
238 const char *prefix = nullptr) const;
239
241 bool show_ids = true,
242 bool elide_repeated_nodes = true) const;
243 void dump () const;
244
245 bool operator< (const node_set<NodeClass> &other) const;
246};
247
248template <typename NodeClass>
251{
252 node_set<NodeClass> result (*this);
253 for (auto iter : other)
254 result.add (iter);
255 return result;
256}
257
258template <typename NodeClass>
259inline bool
261{
262 if (this->size () != other.size ())
263 return this->size () < other.size ();
264 auto this_iter = this->begin ();
265 auto other_iter = other.begin ();
266 for (; this_iter != this->end (); ++this_iter, ++other_iter)
267 if (*this_iter != *other_iter)
268 return (*this_iter)->get_id () < (*other_iter)->get_id ();
269 return false;
270}
271
272/* A bundle of state for generating a hierarchical dump of one
273 of more symbolic::node instances. */
274
276{
278 const text_art::theme &theme,
279 text_art::style::id_t tree_style_id,
280 bool show_ids,
281 bool elide_repeated_nodes)
282 : dump_widget_info (sm, theme, tree_style_id),
283 m_show_ids (show_ids),
284 m_elide_repeated_nodes (elide_repeated_nodes)
285 {
286 }
287
288 /* Whether to show node IDs in dumps.
289 - True is useful for debugging
290 - false is useful for repeatable unit tests of dumping. */
292
293 /* If true, then if a node appears more than once in a dump,
294 only show its descendents the first time, showing a summary of its
295 children for repeated occurrences. */
297
298 /* State for implementing m_elide_repeated_nodes. */
300};
301
302/* Dump a tree-like representation of OBJ and its constituent symbolic::nodes
303 to PP.
304
305 For example:
306 . (gdb) call index_sval->dump()
307 . (27): ‘int’: initial_svalue
308 . ╰─ m_reg: (26): ‘int’: decl_region(‘x_10(D)’)
309 . ╰─ parent: (9): frame_region(‘test_bitmask_2’, index: 0, depth: 1)
310 . ╰─ parent: (1): stack region
311 . ╰─ parent: (0): root region
312
313 Note that OBJ is not necessarily itself a symbolic::node, it just needs
314 to implement make_dump_widget.
315
316 Set show_ids to false for generating repeatable output (e.g. for unit
317 testing of dump output). */
318
319template <typename T>
320void dump_node_tree_to_pp (const T &obj,
321 const text_art::theme *theme,
322 pretty_printer *pp,
323 bool show_ids,
324 bool elide_repeated_nodes)
325{
326 if (!theme)
327 return;
328
329 using namespace text_art;
330
331 style_manager sm;
332 style tree_style (get_style_from_color_cap_name ("note"));
333
334 style::id_t tree_style_id (sm.get_or_create_id (tree_style));
335
336 node_dump_state nds (sm, *theme, tree_style_id,
337 show_ids, elide_repeated_nodes);
338 if (std::unique_ptr<widget> w = obj.make_dump_widget (nds))
339 {
340 text_art::canvas c (w->to_canvas (nds.m_sm));
341 c.print_to_pp (pp);
342 }
343}
344
345/* Dump OBJ to OUTF, using OBJ's make_dump_widget member function,
346 global_dc's color/theme options, with symbol IDs shown,
347 and eliding repeated occurrences of nodes. */
348
349template <typename T>
350void dump_node_tree_to_file (const T &obj, FILE *outf)
351{
354 dump_node_tree_to_pp<T> (obj, theme, &pp, true, true);
355}
356
357/* Dump a tree-like representation of OBJ and its constituent symbolic::nodes
358 to stderr, using global_dc's colorization and theming options, with
359 symbolic::node IDs shown.
360
361 For example:
362 . (gdb) call reg->dump()
363 . (26): ‘int’: decl_region(‘x_10(D)’)
364 . ╰─ parent: (9): frame_region(‘test_bitmask_2’, index: 0, depth: 1)
365 . ╰─ parent: (1): stack region
366 . ╰─ parent: (0): root region
367
368 Note that OBJ is not necessarily itself a symbolic::node, it just needs
369 to implement make_dump_widget. */
370
371template <typename T>
372void dump_node_tree_to_stderr (const T &obj)
373{
374 dump_node_tree_to_file<T> (obj, stderr);
375}
376
377/* As dump_node_tree_to_pp, but write to LOG, indenting the whole output
378 according to the current nesting level of the log. */
379
380template <typename T>
381void dump_node_tree_to_logger (const T &obj,
382 logger &log,
383 const text_art::theme *theme,
384 bool show_ids,
385 bool elide_repeated_nodes)
386{
387 if (!theme)
388 return;
389
390 using namespace text_art;
391
392 style_manager sm;
393 style tree_style (get_style_from_color_cap_name ("note"));
394
395 style::id_t tree_style_id (sm.get_or_create_id (tree_style));
396
397 node_dump_state nds (sm, *theme, tree_style_id,
398 show_ids, elide_repeated_nodes);
399 if (std::unique_ptr<widget> w = obj.make_dump_widget (nds))
400 {
401 text_art::canvas c (w->to_canvas (nds.m_sm));
402 log.log_canvas (c);
403 }
404}
405
406/* As above, but pass LABEL to OBJ's make_dump_widget call. */
407
408template <typename T>
409void dump_node_tree_to_logger (const T &obj,
410 logger &log,
411 const text_art::theme *theme,
412 const char *label,
413 bool show_ids,
414 bool elide_repeated_nodes)
415{
416 if (!theme)
417 return;
418
419 using namespace text_art;
420
421 style_manager sm;
422 style tree_style (get_style_from_color_cap_name ("note"));
423
424 style::id_t tree_style_id (sm.get_or_create_id (tree_style));
425
426 node_dump_state nds (sm, *theme, tree_style_id,
427 show_ids, elide_repeated_nodes);
428 if (std::unique_ptr<widget> w = obj.make_dump_widget (nds, label))
429 {
430 text_art::canvas c (w->to_canvas (nds.m_sm));
431 log.log_canvas (c);
432 }
433}
434
435/* Dump a tree-like representation of OBJ and its constituent symbolic::nodes
436 to LOG with symbol IDs shown. */
437
438template <typename T>
439void dump_node_tree_to_logger (const T &obj,
440 logger &log)
441{
442 dump_node_tree_to_logger<T> (obj, log, log.get_text_art_theme (),
443 true, true);
444}
445
446/* As above, but pass LABEL to OBJ's make_dump_widget call. */
447
448template <typename T>
449void dump_node_tree_to_logger (const T &obj,
450 logger &log,
451 const char *label)
452{
453 dump_node_tree_to_logger<T> (obj, log, log.get_text_art_theme (),
454 label, true, true);
455}
456
457class value_node;
458
459} // namespace symbolic
460
462
463namespace symbolic {
464
465/* Intermediate base class for values that can be live or dead. */
466
467class value_node : public node
468{
469public:
470 virtual bool implicitly_live_p (liveness_context &liveness_ctxt) const;
471
472 virtual const svalue *
473 dyn_cast_svalue () const { return nullptr; }
474
475 virtual const bit_vector *
476 dyn_cast_bit_vector () const { return nullptr; }
477
478 virtual iter_result
479 for_each_svalue (iter_result (*cb) (const svalue &sval,
480 void *user_data),
481 void *user_data) const = 0;
482
483protected:
484 value_node (complexity c, unsigned id)
485 : node (c, id)
486 {}
487
488 std::unique_ptr<json::object>
489 make_json_obj (const char *type_name) const
490 {
491 return node::make_json_obj (type_name);
492 }
493};
494
495/* Base class for traversing the nodes in a node hierarchy
496 Subclasses should chain up the method calls. so that visit_node
497 is called for all of them.
498 visit_* methods should return true iff the traversal should continue
499 into child nodes. */
500
502{
503public:
504 virtual ~node_visitor () = default;
505
506 virtual bool
507 visit_node (const node &)
508 {
509 // No-op
510 return true;
511 }
512
513 virtual bool
515
516 virtual bool
518
519 virtual bool
521
522 virtual bool
524
525 virtual bool
527
528 virtual bool
530
531 virtual bool
533};
534
535/* A node_visitor subclass that calls a callback on any value_node
536 instances. */
537
539{
540public:
541 value_node_visitor (bool (*cb) (const value_node &val,
542 void *user_data),
543 void *user_data)
544 : m_cb (cb),
545 m_user_data (user_data)
546 {
547 }
548
549 bool visit_bit_vector (const bit_vector &bv) final override;
550 bool visit_svalue (const svalue &sval) final override;
551
552private:
553 bool (*m_cb) (const value_node &val, void *user_data);
555};
556
557/* A (base region, baseline_state) pair for identifying a
558 baseline bit_contents or baseline bit_vector. */
559
561{
564
565 bool
566 operator< (const baseline_key &other) const;
567
568 bool
570
571 std::unique_ptr<json::object>
572 to_json () const;
573};
574
575} // namespace ana::symbolic
576
577/* A bundle of state for purging information from a program_state about
578 a conjured_bit_vector or conjured_bit_contents. We pass this whenever
579 we could need to create one of these, so that if the program_state already
580 has information about this conjured value_node on an execution path, we
581 can purge that information, to avoid the analyzer confusing the two
582 interpretations of the value as being the same. */
583
585{
586public:
588 : m_model (model), m_ctxt (ctxt)
589 {
590 }
591 void purge (const symbolic::conjured_bit_vector &bv) const;
593
594private:
597};
598
599#if CHECKING_P
600
601namespace selftest {
602
603/* Implementation detail of ASSERT_SYMBOLIC_NODE_DUMP_EQ. */
604
605void
606assert_symbolic_node_dump_eq (const ::selftest::location &loc,
607 const symbolic::node &node,
608 const char *expected_str);
609
610/* Assert that dumping NODE results in EXPECTED_STR. */
611
612#define ASSERT_SYMBOLIC_NODE_DUMP_EQ(NODE, EXPECTED_STR) \
613 SELFTEST_BEGIN_STMT \
614 assert_symbolic_node_dump_eq (SELFTEST_LOCATION, NODE, \
615 EXPECTED_STR); \
616 SELFTEST_END_STMT
617
618/* Implementation details of ASSERT_SAME_SYMBOLIC_NODE. */
619
620void
621assert_same_symbolic_node (const ::selftest::location &loc,
622 const char *desc_lhs,
623 const char *desc_rhs,
624 const symbolic::node *lhs,
625 const symbolic::node *rhs);
626
627inline void
628assert_same_symbolic_node (const ::selftest::location &loc,
629 const char *desc_lhs,
630 const char *desc_rhs,
631 const symbolic::node &lhs,
632 const symbolic::node &rhs)
633{
634 assert_same_symbolic_node (loc,
635 desc_lhs,
636 desc_rhs,
637 &lhs,
638 &rhs);
639}
640
641/* Assert that LHS and RHS are the same symbolic::node instance. */
642
643#define ASSERT_SAME_SYMBOLIC_NODE(LHS, RHS) \
644 SELFTEST_BEGIN_STMT \
645 assert_same_symbolic_node (SELFTEST_LOCATION, (#LHS), (#RHS), (LHS), (RHS)); \
646 SELFTEST_END_STMT
647
648#define ASSERT_SAME_SYMBOLIC_NODE_AT(LOC, LHS, RHS) \
649 SELFTEST_BEGIN_STMT \
650 assert_same_symbolic_node ((LOC), (#LHS), (#RHS), (LHS), (RHS)); \
651 SELFTEST_END_STMT
652
653/* Implementation details of ASSERT_DIFFERENT_SYMBOLIC_NODE. */
654
655void
656assert_different_symbolic_node (const ::selftest::location &loc,
657 const char *desc_lhs,
658 const char *desc_rhs,
659 const symbolic::node *lhs,
660 const symbolic::node *rhs);
661
662inline void
663assert_different_symbolic_node (const ::selftest::location &loc,
664 const char *desc_lhs,
665 const char *desc_rhs,
666 const symbolic::node &lhs,
667 const symbolic::node &rhs)
668{
669 assert_different_symbolic_node (loc,
670 desc_lhs,
671 desc_rhs,
672 &lhs,
673 &rhs);
674}
675
676/* Assert that LHS and RHS are different symbolic::node instances. */
677
678#define ASSERT_DIFFERENT_SYMBOLIC_NODE(LHS, RHS) \
679 SELFTEST_BEGIN_STMT \
680 assert_different_symbolic_node (SELFTEST_LOCATION, (#LHS), (#RHS), (LHS), (RHS)); \
681 SELFTEST_END_STMT
682
683/* Implementation detail of ASSERT_SYMBOLIC_NODE_MARKUP_TEXT_EQ. */
684
685void
686assert_symbolic_node_markup_text_eq (const ::selftest::location &loc,
687 const symbolic::node &node,
688 const diagnostics::markup::lowering_options &,
689 const char *expected_str);
690
691/* Assert that NODE's make_markup_node's result when lowered to plain
692 text is EXPECTED_STR. */
693
694#define ASSERT_SYMBOLIC_NODE_MARKUP_TEXT_EQ(NODE, LOWERING_OPTS, EXPECTED_STR) \
695 SELFTEST_BEGIN_STMT \
696 assert_symbolic_node_markup_text_eq (SELFTEST_LOCATION, (NODE), \
697 (LOWERING_OPTS), (EXPECTED_STR)); \
698 SELFTEST_END_STMT
699
700} // namespace ana::selftest
701
702#endif /* CHECKING_P */
703
704} // namespace ana
705
706#endif /* GCC_ANALYZER_SYMBOLIC_NODES_H */
conjured_purge(region_model *model, region_model_context *ctxt)
Definition symbolic-nodes.h:587
region_model_context * m_ctxt
Definition symbolic-nodes.h:596
void purge(const symbolic::conjured_bit_vector &bv) const
void purge(const symbolic::conjured_bit_contents &bc) const
region_model * m_model
Definition symbolic-nodes.h:595
Definition integer-with-unit.h:33
Definition analyzer-logging.h:36
Definition region-model.h:840
Definition region-model-manager.h:36
Definition region-model.h:289
Definition region.h:130
Definition svalue.h:82
Definition symbolic-bit-contents.h:1072
Definition symbolic-bit-contents.h:68
Definition symbolic-bit-vectors.h:1128
Definition symbolic-bit-vectors.h:107
Definition symbolic-bit-contents.h:579
Definition symbolic-bit-vectors.h:405
Definition liveness-context.h:33
Definition symbolic-nodes.h:48
void log_stats(logger *logger, bool show_objs) const
symbolic::bit_contents_manager & get_bit_contents_manager() const
Definition symbolic-nodes.h:65
symbolic::scalar_managers & get_scalars() const
Definition symbolic-nodes.h:71
unsigned get_num_nodes() const
Definition symbolic-nodes.h:55
symbolic::bit_vector_manager & get_bit_vector_manager() const
Definition symbolic-nodes.h:68
std::unique_ptr< symbolic::scalar_managers > m_scalar_managers
Definition symbolic-nodes.h:78
unsigned alloc_node_id()
Definition symbolic-nodes.h:56
region_model_manager & get_svalue_manager() const
Definition symbolic-nodes.h:62
std::unique_ptr< region_model_manager > m_rmm
Definition symbolic-nodes.h:79
unsigned m_next_node_id
Definition symbolic-nodes.h:76
region_model_manager & get_region_model_manager() const
Definition symbolic-nodes.h:59
std::unique_ptr< symbolic::bit_vector_manager > m_bit_vector_manager
Definition symbolic-nodes.h:81
std::unique_ptr< symbolic::bit_contents_manager > m_bit_contents_manager
Definition symbolic-nodes.h:80
node_manager(const node_manager &)=delete
Definition symbolic-nodes.h:224
bool contains(const NodeClass *n) const
node_set< NodeClass > union_(const node_set< NodeClass > &other) const
Definition symbolic-nodes.h:250
std::unique_ptr< text_art::tree_widget > make_dump_widget(node_dump_state &nds, const char *prefix=nullptr) const
void add(const NodeClass *n)
Definition symbolic-nodes.h:226
bool operator<(const node_set< NodeClass > &other) const
Definition symbolic-nodes.h:260
void dump_to_pp(pretty_printer *pp, bool show_ids=true, bool elide_repeated_nodes=true) const
Definition symbolic-nodes.h:502
virtual bool visit_region(const region &)
virtual bool visit_bit_contents(const bit_contents &n)
virtual bool visit_node(const node &)
Definition symbolic-nodes.h:507
virtual bool visit_scalar_bit(const scalar< integer_with_unit< units::bit > > &)
virtual bool visit_bit_vector(const bit_vector &)
virtual bool visit_scalar_byte(const scalar< integer_with_unit< units::byte > > &n)
virtual ~node_visitor()=default
virtual bool visit_scalar_unitless(const scalar< integer > &)
virtual bool visit_svalue(const svalue &n)
Definition symbolic-nodes.h:116
virtual void add_dump_widget_children(text_art::tree_widget &, node_dump_state &nds) const =0
complexity m_complexity
Definition symbolic-nodes.h:188
static int cmp_ids(const symbolic::node *s1, const symbolic::node *s2)
bool involves_p(const symbolic::node &other) const
std::unique_ptr< text_art::tree_widget > make_dump_widget(node_dump_state &nds, const char *prefix=nullptr) const
std::unique_ptr< json::object > make_json_obj(const char *type_name) const
static int cmp(const symbolic::node &s1, const symbolic::node &s2)
Definition symbolic-nodes.h:133
node(const node &)=delete
virtual std::unique_ptr< json::object > to_json() const =0
text_art::style get_text_art_tree_style() const
void dump_to_logger(logger &) const
virtual ~node()=default
virtual void print_dump_widget_label(pretty_printer *pp) const =0
node(node &&)=delete
void end_any_dump_color(pretty_printer *pp) const
const complexity & get_complexity() const
Definition symbolic-nodes.h:129
id_t get_id() const
Definition symbolic-nodes.h:131
virtual std::unique_ptr< diagnostics::markup::node > make_markup_node(markup_context &markup_ctxt) const =0
void dump() const
virtual const char * get_any_dump_color() const
Definition symbolic-nodes.h:150
void start_any_dump_color(pretty_printer *pp) const
virtual void accept_node_visitor(node_visitor &v) const =0
node & operator=(const node &)=delete
unsigned id_t
Definition symbolic-nodes.h:118
id_t m_id
Definition symbolic-nodes.h:189
static int cmp_ptr_ptr(const void *, const void *)
void dump_to_pp(pretty_printer *pp, bool show_ids=true, bool elide_repeated_nodes=true) const
node(complexity c, unsigned id)
Definition symbolic-nodes.h:173
bool m_user_facing
Definition symbolic-nodes.h:217
const node & m_node
Definition symbolic-nodes.h:216
void add_to_phase_2(pp_markup::context &ctxt) final override
pp_element_for_node(const node &n, bool user_facing=true)
Definition symbolic-nodes.h:207
Definition symbolic-scalars.h:759
Definition symbolic-scalars.h:67
value_node_visitor(bool(*cb)(const value_node &val, void *user_data), void *user_data)
Definition symbolic-nodes.h:541
void * m_user_data
Definition symbolic-nodes.h:554
bool visit_svalue(const svalue &sval) final override
bool visit_bit_vector(const bit_vector &bv) final override
bool(*) m_cb(const value_node &val, void *user_data)
Definition symbolic-nodes.h:553
Definition symbolic-nodes.h:468
value_node(complexity c, unsigned id)
Definition symbolic-nodes.h:484
std::unique_ptr< json::object > make_json_obj(const char *type_name) const
Definition symbolic-nodes.h:489
virtual const svalue * dyn_cast_svalue() const
Definition symbolic-nodes.h:473
virtual bool implicitly_live_p(liveness_context &liveness_ctxt) const
virtual const bit_vector * dyn_cast_bit_vector() const
Definition symbolic-nodes.h:476
virtual iter_result for_each_svalue(iter_result(*cb)(const svalue &sval, void *user_data), void *user_data) const =0
text_art::theme * get_diagram_theme() const
Definition diagnostics/context.h:466
Definition pretty-print-markup.h:30
Definition pretty-print.h:241
Definition canvas.h:38
Definition types.h:348
style::id_t get_or_create_id(const style &style)
Definition style.cc:284
Definition theme.h:30
Definition tree-widget.h:32
Definition tree-diagnostic.h:63
pp_markup::element pp_element
Definition coretypes.h:180
diagnostics::context * global_dc
Definition diagnostic-global-context.cc:36
double log(double)
Definition common.h:74
void dump_node_tree_to_logger(const T &obj, logger &log, const text_art::theme *theme, bool show_ids, bool elide_repeated_nodes)
Definition symbolic-nodes.h:381
void dump_node_tree_to_stderr(const T &obj)
Definition symbolic-nodes.h:372
void dump_node_tree_to_file(const T &obj, FILE *outf)
Definition symbolic-nodes.h:350
void dump_node_tree_to_pp(const T &obj, const text_art::theme *theme, pretty_printer *pp, bool show_ids, bool elide_repeated_nodes)
Definition symbolic-nodes.h:320
Definition access-diagram.h:30
@ other
Definition common.h:535
iter_result
Definition common.h:563
baseline_state
Definition common.h:546
symbolic::node_set< symbolic::value_node > value_set
Definition symbolic-nodes.h:461
Definition custom-sarif-properties/state-graphs.h:33
Definition dump-context.h:31
Definition analyzer-logging.h:28
style get_style_from_color_cap_name(const char *name)
Definition style.cc:263
Definition complexity.h:31
Definition symbolic-nodes.h:193
bool operator()(const node *lhs, const node *rhs) const
Definition symbolic-nodes.h:194
Definition symbolic-nodes.h:561
baseline_state m_baseline_state
Definition symbolic-nodes.h:563
const region * m_base_reg
Definition symbolic-nodes.h:562
bool region_has_meaningful_size_p(symbolic::node_manager &node_mgr) const
std::unique_ptr< json::object > to_json() const
bool operator<(const baseline_key &other) const
Definition symbolic-nodes.h:88
const region_model * m_model
Definition symbolic-nodes.h:96
markup_context(const region_model *model, bool user_facing)
Definition symbolic-nodes.h:89
bool m_user_facing
Definition symbolic-nodes.h:97
Definition symbolic-nodes.h:276
bool m_elide_repeated_nodes
Definition symbolic-nodes.h:296
node_set< symbolic::node > m_nodes_seen
Definition symbolic-nodes.h:299
bool m_show_ids
Definition symbolic-nodes.h:291
node_dump_state(text_art::style_manager &sm, const text_art::theme &theme, text_art::style::id_t tree_style_id, bool show_ids, bool elide_repeated_nodes)
Definition symbolic-nodes.h:277
Definition collect2.cc:168
Definition gengtype.h:377
Definition dump-widget-info.h:31
dump_widget_info(text_art::style_manager &sm, const text_art::theme &theme, text_art::style::id_t tree_style_id)
Definition dump-widget-info.h:32
text_art::style_manager & m_sm
Definition dump-widget-info.h:46
Definition types.h:49
Definition types.h:228
unsigned char id_t
Definition types.h:229
#define gcc_assert(EXPR)
Definition system.h:772
#define bool
Definition system.h:844
T * end(vec< T, A, L > *v)
Definition vec.h:457
T * begin(vec< T, A, L > *v)
Definition vec.h:455