GCC Middle and Back End API Reference
symbolic-memory-ranges.h
Go to the documentation of this file.
1/* A (cluster_region, symbolic bit range) pair.
2 Copyright (C) 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_MEMORY_RANGES_H
22#define GCC_ANALYZER_SYMBOLIC_MEMORY_RANGES_H
23
26
27namespace ana {
28namespace symbolic {
29
30/* A (cluster_region, symbolic bit range) pair.
31 Note that the range has a granularity of *bits*. */
32
34{
35public:
36 memory_range (const cluster_region &cluster_reg,
38 : m_cluster_reg (cluster_reg),
40 {
41 }
42
44 const symbolic_byte_size &num_bytes);
45
46 void dump () const;
47
48 bool
49 operator== (const memory_range &other) const
50 {
51 return (&m_cluster_reg == &other.m_cluster_reg
52 && m_bit_range == other.m_bit_range);
53 }
54
55 std::unique_ptr<text_art::tree_widget>
57
58 std::unique_ptr<json::object>
59 to_json () const;
60
61 /* Deprecated (poor terminology); use get_cluster_region instead. */
62 const cluster_region &
63 get_base_region () const { return m_cluster_reg; }
64
65 const cluster_region &
66 get_cluster_region () const { return m_cluster_reg; }
67
69 get_bit_range () const { return m_bit_range; }
70
73
76
77 const symbolic_bit_size &
78 get_size () const { return m_bit_range.get_size (); }
79
80private:
83};
84
85} // namespace ana::symbolic
86
87} // namespace ana
88
89#endif /* GCC_ANALYZER_SYMBOLIC_MEMORY_RANGES_H */
Definition region.h:537
const symbolic_bit_offset & get_next_offset() const
Definition symbolic-memory-ranges.h:75
const cluster_region & m_cluster_reg
Definition symbolic-memory-ranges.h:81
const cluster_region & get_cluster_region() const
Definition symbolic-memory-ranges.h:66
symbolic_bit_range get_bit_range() const
Definition symbolic-memory-ranges.h:69
const symbolic_bit_offset & get_start_offset() const
Definition symbolic-memory-ranges.h:72
symbolic_bit_range m_bit_range
Definition symbolic-memory-ranges.h:82
std::unique_ptr< text_art::tree_widget > make_dump_widget(node_dump_state &nds) const
memory_range(const cluster_region &cluster_reg, symbolic_bit_range bit_range)
Definition symbolic-memory-ranges.h:36
const symbolic_bit_size & get_size() const
Definition symbolic-memory-ranges.h:78
bool operator==(const memory_range &other) const
Definition symbolic-memory-ranges.h:49
memory_range(pointer sym_ptr, const symbolic_byte_size &num_bytes)
const cluster_region & get_base_region() const
Definition symbolic-memory-ranges.h:63
std::unique_ptr< json::object > to_json() const
Definition symbolic-pointers.h:33
const scalar< ConcreteValueType > & get_size() const
Definition symbolic-ranges.h:74
const scalar< ConcreteValueType > & get_next_offset() const
Definition symbolic-ranges.h:85
const scalar< ConcreteValueType > & get_start_offset() const
Definition symbolic-ranges.h:71
Definition common.h:74
Definition access-diagram.h:30
symbolic::scalar< integer_with_unit< units::bit > > symbolic_bit_size
Definition symbolic-scalars.h:194
symbolic::range< integer_with_unit< units::bit > > symbolic_bit_range
Definition common.h:124
symbolic::scalar< integer_with_unit< units::byte > > symbolic_byte_size
Definition symbolic-scalars.h:197
@ other
Definition common.h:536
symbolic::scalar< integer_with_unit< units::bit > > symbolic_bit_offset
Definition symbolic-scalars.h:193
Definition store.h:398
Definition symbolic-nodes.h:276