diff options
author | Tom Tromey <tromey@adacore.com> | 2023-04-28 08:01:54 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-05-23 13:57:53 -0600 |
commit | 562db568441ed0f7e258b843916c34572170cc6d (patch) | |
tree | 911c015433a041e3d121c62de69c8097842821f6 /gdb/parser-defs.h | |
parent | 98d630e910c73d163a071753bfc3b9c106cd3715 (diff) | |
download | gdb-562db568441ed0f7e258b843916c34572170cc6d.zip gdb-562db568441ed0f7e258b843916c34572170cc6d.tar.gz gdb-562db568441ed0f7e258b843916c34572170cc6d.tar.bz2 |
Move innermost_block_tracker to expression.h
I think parser-defs.h should hold declarations that can be used by
parser implementations, whereas expression.h should hold declarations
that are used by code that wants to call a parser. Following this
logic, this patch moves innermost_block_tracker to expression.h.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r-- | gdb/parser-defs.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index 62829a8..5c6bc22 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -316,49 +316,6 @@ private: std::vector<expr::operation_up> m_operations; }; -/* When parsing expressions we track the innermost block that was - referenced. */ - -class innermost_block_tracker -{ -public: - innermost_block_tracker (innermost_block_tracker_types types - = INNERMOST_BLOCK_FOR_SYMBOLS) - : m_types (types), - m_innermost_block (NULL) - { /* Nothing. */ } - - /* Update the stored innermost block if the new block B is more inner - than the currently stored block, or if no block is stored yet. The - type T tells us whether the block B was for a symbol or for a - register. The stored innermost block is only updated if the type T is - a type we are interested in, the types we are interested in are held - in M_TYPES and set during RESET. */ - void update (const struct block *b, innermost_block_tracker_types t); - - /* Overload of main UPDATE method which extracts the block from BS. */ - void update (const struct block_symbol &bs) - { - update (bs.block, INNERMOST_BLOCK_FOR_SYMBOLS); - } - - /* Return the stored innermost block. Can be nullptr if no symbols or - registers were found during an expression parse, and so no innermost - block was defined. */ - const struct block *block () const - { - return m_innermost_block; - } - -private: - /* The type of innermost block being looked for. */ - innermost_block_tracker_types m_types; - - /* The currently stored innermost block found while parsing an - expression. */ - const struct block *m_innermost_block; -}; - /* A string token, either a char-string or bit-string. Char-strings are used, for example, for the names of symbols. */ |