CBMC
|
A symbol table wrapper that records which entries have been updated/removedA 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.
More...
#include <journalling_symbol_table.h>
Public Types | |
typedef std::unordered_set< irep_idt > | changesett |
Public Types inherited from symbol_table_baset | |
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_table_baset::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 |
void | validate (const validation_modet vm=validation_modet::INVARIANT) const 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 |
Public Member Functions inherited from symbol_table_baset | |
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... | |
std::list< symbolst::const_iterator > | match_name_or_base_name (const irep_idt &id) const |
Collect all symbols the name of which matches id or the base name of which matches id . 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 | |
Public Attributes inherited from symbol_table_baset | |
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 36 of file journalling_symbol_table.h.
typedef std::unordered_set<irep_idt> journalling_symbol_tablet::changesett |
Definition at line 39 of file journalling_symbol_table.h.
|
inlineexplicitprivate |
Definition at line 52 of file journalling_symbol_table.h.
|
delete |
|
inline |
Definition at line 64 of file journalling_symbol_table.h.
|
virtual |
Implements symbol_table_baset.
Definition at line 273 of file symbol_table_base.cpp.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 133 of file journalling_symbol_table.h.
|
virtual |
Implements symbol_table_baset.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 126 of file journalling_symbol_table.h.
|
virtual |
Implements symbol_table_baset.
Definition at line 274 of file symbol_table_base.cpp.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 138 of file journalling_symbol_table.h.
|
virtual |
Implements symbol_table_baset.
|
inlineoverridevirtual |
Remove a symbol from the symbol table.
entry | an iterator pointing at the symbol to remove |
Implements symbol_table_baset.
Definition at line 119 of file journalling_symbol_table.h.
|
inline |
Definition at line 153 of file journalling_symbol_table.h.
|
inline |
Definition at line 161 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 76 of file journalling_symbol_table.h.
|
inline |
Definition at line 157 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 96 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 109 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 86 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Reimplemented from symbol_table_baset.
Definition at line 104 of file journalling_symbol_table.h.
|
inlineprivate |
Definition at line 167 of file journalling_symbol_table.h.
|
inlineprivate |
Definition at line 179 of file journalling_symbol_table.h.
|
inlineprivate |
Definition at line 174 of file journalling_symbol_table.h.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 147 of file journalling_symbol_table.h.
|
inlinestatic |
Definition at line 81 of file journalling_symbol_table.h.
|
private |
Definition at line 42 of file journalling_symbol_table.h.
|
private |
Definition at line 44 of file journalling_symbol_table.h.
|
private |
Definition at line 49 of file journalling_symbol_table.h.
|
private |
Definition at line 47 of file journalling_symbol_table.h.