GCC Middle and Back End API Reference
liveness-context.h
Go to the documentation of this file.
1/* A bundle of information for use when determining if a symbolic::value_node
2 is implicitly live.
3
4 Copyright (C) 2026 Free Software Foundation, Inc.
5 Contributed by David Malcolm <dmalcolm@redhat.com>.
6
7This file is part of GCC.
8
9GCC is free software; you can redistribute it and/or modify it
10under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 3, or (at your option)
12any later version.
13
14GCC is distributed in the hope that it will be useful, but
15WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GCC; see the file COPYING3. If not see
21<http://www.gnu.org/licenses/>. */
22
23#ifndef GCC_ANALYZER_LIVENESS_CONTEXT
24#define GCC_ANALYZER_LIVENESS_CONTEXT
25
26namespace ana {
27namespace symbolic {
28
29/* A bundle of information for use when determining if a symbolic::value_node
30 is implicitly live. */
31
33{
34public:
35 liveness_context (const value_set &known_live_values,
36 const region_model &model);
37
38 bool node_live_p (const value_node &n);
40
41 const region_model *get_model () const { return &m_model; }
42
43 std::unique_ptr<text_art::tree_widget>
45
46 void dump_to_pp (pretty_printer *pp) const;
47
48 DEBUG_FUNCTION void dump () const;
49
50 bool known_live_ptr_to_base_region_p (const region &base_reg) const;
51
52private:
53 void
55 bool is_live);
56
57 std::map<const symbolic::value_node *, bool> m_known_liveness;
58
59 /* A set of base regions for which m_known_liveness has a live
60 pointer_svalue pointing to that region, so that we can then treat
61 (T*)ptr as being implicitly live for all T. */
62 std::set<const region *> m_known_base_regions;
63
65};
66
67} // namespace ana::symbolic
68} // namespace ana
69
70#endif /* GCC_ANALYZER_LIVENESS_CONTEXT */
Definition region-model.h:289
Definition region.h:130
Definition symbolic-bit-vectors.h:990
std::unique_ptr< text_art::tree_widget > make_dump_widget(symbolic::node_dump_state &nds) const
bool known_live_ptr_to_base_region_p(const region &base_reg) const
std::map< const symbolic::value_node *, bool > m_known_liveness
Definition liveness-context.h:57
void set_known_liveness_for_node(const symbolic::value_node &n, bool is_live)
bool bits_live_p(const bit_vector_from_ubc &)
bool node_live_p(const value_node &n)
void dump_to_pp(pretty_printer *pp) const
liveness_context(const value_set &known_live_values, const region_model &model)
const region_model & m_model
Definition liveness-context.h:64
DEBUG_FUNCTION void dump() const
const region_model * get_model() const
Definition liveness-context.h:41
std::set< const region * > m_known_base_regions
Definition liveness-context.h:62
Definition symbolic-nodes.h:468
Definition pretty-print.h:241
Definition common.h:74
Definition access-diagram.h:30
symbolic::node_set< symbolic::value_node > value_set
Definition symbolic-nodes.h:461
Definition symbolic-nodes.h:276
#define DEBUG_FUNCTION
Definition system.h:1145