64 class symbol_record_rep
68 symbol_record_rep () =
delete;
70 symbol_record_rep (
const std::string& nm, symrec_t sc)
71 : m_frame_offset (0), m_data_offset (0), m_storage_class (sc),
75 OCTAVE_DEFAULT_COPY_MOVE_DELETE (symbol_record_rep)
78 bool is_valid ()
const {
return ! m_name.empty (); }
80 void set_frame_offset (std::size_t offset) { m_frame_offset = offset; }
82 std::size_t frame_offset ()
const {
return m_frame_offset; }
84 void set_data_offset (std::size_t offset) { m_data_offset = offset; }
86 std::size_t data_offset ()
const {
return m_data_offset; }
88 bool is_local ()
const
90 return m_storage_class & LOCAL;
93 bool is_formal ()
const
95 return m_storage_class & FORMAL;
98 bool is_added_static ()
const
100 return m_storage_class & ADDED_STATIC;
103 bool is_variable ()
const
105 return m_storage_class & VARIABLE;
110 m_storage_class =
static_cast<symrec_t
> (m_storage_class | LOCAL);
116 m_storage_class =
static_cast<symrec_t
> (m_storage_class
117 | FORMAL | VARIABLE);
120 void mark_added_static ()
122 m_storage_class =
static_cast<symrec_t
> (m_storage_class
126 void mark_variable ()
128 m_storage_class =
static_cast<symrec_t
> (m_storage_class | VARIABLE);
131 OCTAVE_DEPRECATED (10,
"symbol_record_rep::mark_as_variable is obsolete, use mark_variable")
132 void mark_as_variable ()
134 m_storage_class =
static_cast<symrec_t
> (m_storage_class | VARIABLE);
140 m_storage_class =
static_cast<symrec_t
> (m_storage_class & ~LOCAL);
143 void unmark_formal ()
145 m_storage_class =
static_cast<symrec_t
> (m_storage_class & ~FORMAL);
148 void unmark_added_static ()
150 m_storage_class =
static_cast<symrec_t
> (m_storage_class
154 void unmark_variable ()
156 m_storage_class =
static_cast<symrec_t
> (m_storage_class & ~VARIABLE);
159 OCTAVE_DEPRECATED (10,
"symbol_record_rep::unmark_as_variable is obsolete, use unmark_variable")
160 void unmark_as_variable ()
162 m_storage_class =
static_cast<symrec_t
> (m_storage_class & ~VARIABLE);
165 unsigned int storage_class ()
const {
return m_storage_class; }
167 std::shared_ptr<symbol_record_rep> dup ()
const;
171 std::string name ()
const {
return m_name; }
173 void rename (
const std::string& new_name) { m_name = new_name; }
177 std::size_t m_frame_offset;
178 std::size_t m_data_offset;
180 symrec_t m_storage_class;
188 : m_rep (new symbol_record_rep (nm, sc))
193 : m_rep (new symbol_record_rep (nm, sc))
202 bool is_valid ()
const {
return m_rep->is_valid (); }
204 explicit operator bool ()
const {
return is_valid (); }
207 { m_rep->set_frame_offset (offset); }
212 { m_rep->set_data_offset (offset); }
214 std::size_t
data_offset ()
const {
return m_rep->data_offset (); }
218 std::string
name ()
const {
return m_rep->name (); }
220 void rename (
const std::string& new_name) { m_rep->rename (new_name); }
222 bool is_local ()
const {
return m_rep->is_local (); }
231 OCTAVE_DEPRECATED (10,
"symbol_record::mark_as_variable is obsolete, use mark_variable")
232 void mark_as_variable () { m_rep->mark_variable (); }
238 OCTAVE_DEPRECATED (10,
"symbol_record::unmark_as_variable is obsolete, use unmark_variable")
239 void unmark_as_variable () { m_rep->unmark_variable (); }
247 std::shared_ptr<symbol_record_rep> m_rep;
250 symbol_record (
const std::shared_ptr<symbol_record_rep>& new_rep)