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
27
28namespace ana {
29
30namespace state_node_properties = custom_sarif_properties::state_graphs::node;
31
33{
34public:
39
40private:
41
47
50
51 std::unique_ptr<diagnostics::digraphs::node>
53 std::string id);
54
55 std::unique_ptr<diagnostics::digraphs::node>
58
59 std::unique_ptr<diagnostics::digraphs::node>
61
62 /* Spatially sorted concrete bindings. */
63 typedef std::map<bit_range, const svalue *> concrete_bindings_t;
64
65 void
67 bool create_all);
68
69 std::unique_ptr<diagnostics::digraphs::node>
71
72 // Try to get the bit_range of REG within its base region
73 bool
75 bit_range &out);
76
77 void
79 const region &reg,
80 const concrete_bindings_t &conc_bindings,
81 bool create_all);
82
83 void
86
87 bool
89 const concrete_bindings_t &conc_bindings,
90 bool create_all);
91
92 std::unique_ptr<diagnostics::digraphs::node>
94
95 std::string make_node_id (const region &reg);
96 std::string make_node_id (const char *prefix);
97
102 std::map<const region *,
104 std::map<const region *, tree> m_types_for_untyped_regions;
105 unsigned m_next_id;
106 std::vector<pending_edge> m_pending_edges;
107};
108
109} // namespace ana
110
111#endif /* GCC_ANALYZER_ANA_STATE_TO_DIAGNOSTIC_STATE_H */
const extrinsic_state & m_ext_state
Definition ana-state-to-diagnostic-state.h:100
std::string make_node_id(const char *prefix)
diagnostics::digraphs::node & create_and_add_state_node(const region &reg)
std::unique_ptr< diagnostics::digraphs::node > make_memspace_state_node(const region &reg, enum state_node_properties::kind_t kind)
void populate_state_node_for_typed_region(diagnostics::digraphs::node &, const region &reg, const concrete_bindings_t &conc_bindings, bool create_all)
void set_attr_for_dynamic_extents(const region &reg, diagnostics::digraphs::node &)
std::map< bit_range, const svalue * > concrete_bindings_t
Definition ana-state-to-diagnostic-state.h:63
unsigned m_next_id
Definition ana-state-to-diagnostic-state.h:105
std::map< const region *, tree > m_types_for_untyped_regions
Definition ana-state-to-diagnostic-state.h:104
std::unique_ptr< diagnostics::digraphs::node > create_state_node(const region &reg)
void create_state_nodes_for_binding_cluster(const binding_cluster &cluster, bool create_all)
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::unique_ptr< diagnostics::digraphs::node > make_state_node(enum state_node_properties::kind_t kind, std::string id)
std::vector< pending_edge > m_pending_edges
Definition ana-state-to-diagnostic-state.h:106
bool get_bit_range_within_base_region(const region &reg, bit_range &out)
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:101
std::string make_node_id(const region &reg)
std::map< const region *, diagnostics::digraphs::node * > m_region_to_state_node_map
Definition ana-state-to-diagnostic-state.h:103
tree_logical_location_manager m_logical_loc_mgr
Definition ana-state-to-diagnostic-state.h:98
diagnostics::digraphs::node & get_or_create_state_node(const region &reg)
const program_state & m_state
Definition ana-state-to-diagnostic-state.h:99
Definition store.h:680
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 diagnostics/digraphs.h:123
Definition diagnostics/digraphs.h:255
Definition ree.cc:583
Definition tree-logical-location.h:32
Definition access-diagram.h:30
Definition custom-sarif-properties/state-graphs.h:33
kind_t
Definition custom-sarif-properties/state-graphs.h:36
Definition ana-state-to-diagnostic-state.h:43
diagnostics::digraphs::node & m_src_node
Definition ana-state-to-diagnostic-state.h:44
const region & m_dst_reg
Definition ana-state-to-diagnostic-state.h:45
Definition store.h:233
Definition genautomata.cc:669