GCC Middle and Back End API Reference
ana-state-to-diagnostic-state.h
Go to the documentation of this file.
1/* Creating diagnostic state graphs from ana::program_state.
2 Copyright (C) 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_ANA_STATE_TO_DIAGNOSTIC_STATE_H
22#define GCC_ANALYZER_ANA_STATE_TO_DIAGNOSTIC_STATE_H
23
26
27namespace ana {
28
30{
31public:
36
37private:
43
46
47 std::unique_ptr<diagnostics::digraphs::node>
49 std::string id);
50
51 std::unique_ptr<diagnostics::digraphs::node>
54
55 std::unique_ptr<diagnostics::digraphs::node>
57
58 /* Spatially sorted concrete bindings. */
59 typedef std::map<bit_range, const svalue *> concrete_bindings_t;
60
61 void
63 bool create_all);
64
65 std::unique_ptr<diagnostics::digraphs::node>
67
68 // Try to get the bit_range of REG within its base region
69 bool
71 bit_range &out);
72
73 void
75 const region &reg,
76 const concrete_bindings_t &conc_bindings,
77 bool create_all);
78
79 void
82
83 bool
85 const concrete_bindings_t &conc_bindings,
86 bool create_all);
87
88 std::unique_ptr<diagnostics::digraphs::node>
90
91 std::string make_node_id (const region &reg);
92 std::string make_node_id (const char *prefix);
93
98 std::map<const region *, diagnostics::digraphs::node *> m_region_to_state_node_map;
99 std::map<const region *, tree> m_types_for_untyped_regions;
100 unsigned m_next_id;
101 std::vector<pending_edge> m_pending_edges;
102};
103
104} // namespace ana
105
106#endif /* GCC_ANALYZER_ANA_STATE_TO_DIAGNOSTIC_STATE_H */
const extrinsic_state & m_ext_state
Definition ana-state-to-diagnostic-state.h:96
std::string make_node_id(const char *prefix)
void set_attr_for_dynamic_extents(const region &reg, diagnostics::state_graphs::state_node_ref)
std::map< bit_range, const svalue * > concrete_bindings_t
Definition ana-state-to-diagnostic-state.h:59
unsigned m_next_id
Definition ana-state-to-diagnostic-state.h:100
std::map< const region *, tree > m_types_for_untyped_regions
Definition ana-state-to-diagnostic-state.h:99
void populate_state_node_for_typed_region(diagnostics::state_graphs::state_node_ref, const region &reg, const concrete_bindings_t &conc_bindings, bool create_all)
std::unique_ptr< diagnostics::digraphs::node > create_state_node(const region &reg)
std::unique_ptr< diagnostics::digraphs::node > make_state_node(diagnostics::state_graphs::node_kind kind, std::string id)
void create_state_nodes_for_binding_cluster(const binding_cluster &cluster, bool create_all)
std::unique_ptr< diagnostics::digraphs::node > make_memspace_state_node(const region &reg, enum diagnostics::state_graphs::node_kind kind)
bool show_child_state_node_for_child_region_p(const region &reg, const concrete_bindings_t &conc_bindings, bool create_all)
analyzer_state_graph(const program_state &state, const extrinsic_state &ext_state)
std::unique_ptr< diagnostics::digraphs::node > create_state_node_for_svalue(const svalue *sval)
std::vector< pending_edge > m_pending_edges
Definition ana-state-to-diagnostic-state.h:101
bool get_bit_range_within_base_region(const region &reg, bit_range &out)
diagnostics::state_graphs::state_node_ref create_and_add_state_node(const region &reg)
std::unique_ptr< diagnostics::digraphs::node > create_state_node_for_conc_bindings(const concrete_bindings_t &conc_bindings)
region_model_manager & m_mgr
Definition ana-state-to-diagnostic-state.h:97
std::string make_node_id(const region &reg)
diagnostics::state_graphs::state_node_ref get_or_create_state_node(const region &reg)
std::map< const region *, diagnostics::digraphs::node * > m_region_to_state_node_map
Definition ana-state-to-diagnostic-state.h:98
tree_logical_location_manager m_logical_loc_mgr
Definition ana-state-to-diagnostic-state.h:94
const program_state & m_state
Definition ana-state-to-diagnostic-state.h:95
Definition store.h:600
Definition program-state.h:34
Definition program-state.h:224
Definition region-model-manager.h:32
Definition region.h:126
Definition svalue.h:92
Definition digraph.h:127
Definition digraphs.h:88
Definition ree.cc:583
Definition tree-logical-location.h:32
Definition access-diagram.h:30
node_kind
Definition state-graphs.h:44
Definition ana-state-to-diagnostic-state.h:39
diagnostics::state_graphs::state_node_ref m_src_node
Definition ana-state-to-diagnostic-state.h:40
const region & m_dst_reg
Definition ana-state-to-diagnostic-state.h:41
Definition store.h:233
Definition state-graphs.h:88
Definition genautomata.cc:669