CBMC
|
A symbol table wrapper that records which entries have been updated/removed. More...
#include <journalling_symbol_table.h>
Public Types | |
typedef std::unordered_set< irep_idt > | changesett |
![]() | |
typedef std::unordered_map< irep_idt, symbolt > | symbolst |
using | const_iteratort = symbolst::const_iterator |
Public Member Functions | |
journalling_symbol_tablet (const journalling_symbol_tablet &other)=delete | |
journalling_symbol_tablet (journalling_symbol_tablet &&other) | |
virtual const symbol_tablet & | get_symbol_table () const override |
virtual bool | move (symbolt &symbol, symbolt *&new_symbol) override |
virtual symbolt * | get_writeable (const irep_idt &identifier) override |
Find a symbol in the symbol table for read-write access. More... | |
std::size_t | next_unused_suffix (const std::string &prefix) const override |
virtual std::pair< symbolt &, bool > | insert (symbolt symbol) override |
Move or copy a new symbol to the symbol table. More... | |
virtual void | erase (const symbol_tablet::symbolst::const_iterator &entry) override |
Remove a symbol from the symbol table. More... | |
virtual void | clear () override |
virtual iteratort | begin () override |
virtual iteratort | end () override |
const changesett & | get_inserted () const |
const changesett & | get_updated () const |
const changesett & | get_removed () const |
virtual iteratort | begin ()=0 |
virtual const_iteratort | begin () const |
virtual iteratort | end ()=0 |
virtual const_iteratort | end () const |
![]() | |
symbol_table_baset (const symbolst &symbols, const symbol_base_mapt &symbol_base_map, const symbol_module_mapt &symbol_module_map) | |
symbol_table_baset (const symbol_table_baset &other)=delete | |
symbol_table_baset & | operator= (const symbol_table_baset &other)=delete |
virtual | ~symbol_table_baset () |
Author: Diffblue Ltd. More... | |
std::size_t | next_unused_suffix (const std::string &prefix, std::size_t start_number) const |
Find smallest unused integer i so that prefix + std::to_string(i) does not exist in the list symbols . More... | |
operator const symbol_tablet & () const | |
Permits implicit cast to const symbol_tablet &. More... | |
bool | has_symbol (const irep_idt &name) const |
Check whether a symbol exists in the symbol table. More... | |
const symbolt * | lookup (const irep_idt &name) const |
Find a symbol in the symbol table for read-only access. More... | |
const symbolt & | lookup_ref (const irep_idt &name) const |
Find a symbol in the symbol table for read-only access. More... | |
symbolt & | get_writeable_ref (const irep_idt &name) |
Find a symbol in the symbol table for read-write access. More... | |
bool | add (const symbolt &symbol) |
Add a new symbol to the symbol table. More... | |
bool | remove (const irep_idt &name) |
Remove a symbol from the symbol table. More... | |
void | show (std::ostream &out) const |
Print the contents of the symbol table. More... | |
std::vector< irep_idt > | sorted_symbol_names () const |
Build and return a lexicographically sorted vector of symbol names from all symbols stored in this symbol table. More... | |
virtual const_iteratort | begin () const |
virtual const_iteratort | end () const |
Static Public Member Functions | |
static journalling_symbol_tablet | wrap (symbol_table_baset &base_symbol_table) |
Private Member Functions | |
journalling_symbol_tablet (symbol_table_baset &base_symbol_table) | |
void | on_insert (const irep_idt &id) |
void | on_update (const irep_idt &id) |
void | on_remove (const irep_idt &id) |
Private Attributes | |
symbol_table_baset & | base_symbol_table |
changesett | inserted |
changesett | updated |
changesett | removed |
Additional Inherited Members | |
![]() | |
const symbolst & | symbols |
Read-only field, used to look up symbols given their names. More... | |
const symbol_base_mapt & | symbol_base_map |
Read-only field, used to look up symbol names given their base names. More... | |
const symbol_module_mapt & | symbol_module_map |
Read-only field, used to look up symbol names given their modules. More... | |
A symbol table wrapper that records which entries have been updated/removed.
A caller can pass a journalling_symbol_tablet
into a callee that is expected to mutate it somehow, then after it has run inspect the recording table's journal to determine what has changed more cheaply than examining every symbol.
Example of usage:
Definition at line 35 of file journalling_symbol_table.h.
typedef std::unordered_set<irep_idt> journalling_symbol_tablet::changesett |
Definition at line 38 of file journalling_symbol_table.h.
|
inlineexplicitprivate |
Definition at line 51 of file journalling_symbol_table.h.
|
delete |
|
inline |
Definition at line 63 of file journalling_symbol_table.h.
virtual const_iteratort symbol_table_baset::begin |
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 132 of file journalling_symbol_table.h.
symbol_table_baset::const_iteratort symbol_table_baset::begin |
Definition at line 68 of file symbol_table_base.cpp.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 125 of file journalling_symbol_table.h.
virtual const_iteratort symbol_table_baset::end |
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 137 of file journalling_symbol_table.h.
symbol_table_baset::const_iteratort symbol_table_baset::end |
Definition at line 63 of file symbol_table_base.cpp.
|
inlineoverridevirtual |
Remove a symbol from the symbol table.
entry | an iterator pointing at the symbol to remove |
Implements symbol_table_baset.
Definition at line 118 of file journalling_symbol_table.h.
|
inline |
Definition at line 146 of file journalling_symbol_table.h.
|
inline |
Definition at line 154 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 75 of file journalling_symbol_table.h.
|
inline |
Definition at line 150 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Find a symbol in the symbol table for read-write access.
name | The name of the symbol to look for |
Implements symbol_table_baset.
Definition at line 95 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Move or copy a new symbol to the symbol table.
symbol | The symbol to be added to the symbol table - can be moved or copied in. |
Implements symbol_table_baset.
Definition at line 108 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 85 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Reimplemented from symbol_table_baset.
Definition at line 103 of file journalling_symbol_table.h.
|
inlineprivate |
Definition at line 160 of file journalling_symbol_table.h.
|
inlineprivate |
Definition at line 172 of file journalling_symbol_table.h.
|
inlineprivate |
Definition at line 167 of file journalling_symbol_table.h.
|
inlinestatic |
Definition at line 80 of file journalling_symbol_table.h.
|
private |
Definition at line 41 of file journalling_symbol_table.h.
|
private |
Definition at line 43 of file journalling_symbol_table.h.
|
private |
Definition at line 48 of file journalling_symbol_table.h.
|
private |
Definition at line 46 of file journalling_symbol_table.h.