GCC Middle and Back End API Reference
symbolic-memory-ranges.h
Go to the documentation of this file.
1/* A (base_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 (base_region, symbolic bit range) pair.
31 Note that the range has a granularity of *bits*. */
32
34{
35public:
36 memory_range (const region &base_reg,
38 : m_base_reg (base_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_base_reg == &other.m_base_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 const region &
62 get_base_region () const { return m_base_reg; }
63
65 get_bit_range () const { return m_bit_range; }
66
69
72
73 const symbolic_bit_size &
74 get_size () const { return m_bit_range.get_size (); }
75
76private:
79};
80
81} // namespace ana::symbolic
82
83} // namespace ana
84
85#endif /* GCC_ANALYZER_SYMBOLIC_MEMORY_RANGES_H */
Definition region.h:130
const symbolic_bit_offset & get_next_offset() const
Definition symbolic-memory-ranges.h:71
const region & get_base_region() const
Definition symbolic-memory-ranges.h:62
symbolic_bit_range get_bit_range() const
Definition symbolic-memory-ranges.h:65
const symbolic_bit_offset & get_start_offset() const
Definition symbolic-memory-ranges.h:68
symbolic_bit_range m_bit_range
Definition symbolic-memory-ranges.h:78
memory_range(const region &base_reg, symbolic_bit_range bit_range)
Definition symbolic-memory-ranges.h:36
std::unique_ptr< text_art::tree_widget > make_dump_widget(node_dump_state &nds) const
const region & m_base_reg
Definition symbolic-memory-ranges.h:77
const symbolic_bit_size & get_size() const
Definition symbolic-memory-ranges.h:74
bool operator==(const memory_range &other) const
Definition symbolic-memory-ranges.h:49
memory_range(pointer sym_ptr, const symbolic_byte_size &num_bytes)
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:535
symbolic::scalar< integer_with_unit< units::bit > > symbolic_bit_offset
Definition symbolic-scalars.h:193
Definition store.h:398
Definition symbolic-nodes.h:276