cprover
|
The symbol table. More...
#include <symbol_table.h>
Public Member Functions | |
symbol_tablet () | |
symbol_tablet (const symbol_tablet &other) | |
symbol_tablet & | operator= (const symbol_tablet &other) |
symbol_tablet (symbol_tablet &&other) | |
symbol_tablet & | operator= (symbol_tablet &&other) |
void | swap (symbol_tablet &other) |
virtual const symbol_tablet & | get_symbol_table () const override |
virtual symbolt * | get_writeable (const irep_idt &name) override |
Find a symbol in the symbol table for read-write access. More... | |
virtual std::pair< symbolt &, bool > | insert (symbolt symbol) override |
Author: Diffblue Ltd. More... | |
virtual bool | move (symbolt &symbol, symbolt *&new_symbol) override |
Move a symbol into the symbol table. More... | |
virtual void | erase (const 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 |
![]() | |
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... | |
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... | |
Private Attributes | |
symbolst | internal_symbols |
symbol_base_mapt | internal_symbol_base_map |
symbol_module_mapt | internal_symbol_module_map |
Additional Inherited Members | |
![]() | |
typedef std::unordered_map< irep_idt, symbolt > | symbolst |
![]() | |
const symbolst & | symbols |
const symbol_base_mapt & | symbol_base_map |
const symbol_module_mapt & | symbol_module_map |
The symbol table.
Definition at line 19 of file symbol_table.h.
|
inline |
Definition at line 27 of file symbol_table.h.
Referenced by operator=().
|
inline |
Definition at line 35 of file symbol_table.h.
|
inline |
Definition at line 52 of file symbol_table.h.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 104 of file symbol_table.h.
References internal_symbols.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 97 of file symbol_table.h.
References internal_symbol_base_map, internal_symbol_module_map, and internal_symbols.
Referenced by goto_modelt::clear(), and compilet::compile().
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 108 of file symbol_table.h.
References internal_symbols.
|
overridevirtual |
Remove a symbol from the symbol table.
entry | an iterator pointing at the symbol to remove |
Implements symbol_table_baset.
Definition at line 84 of file symbol_table.cpp.
References symbolt::base_name, id2string(), internal_symbol_base_map, internal_symbol_module_map, internal_symbols, INVARIANT, symbolt::module, symbolt::name, symbol_table_baset::symbol_base_map, and symbol_table_baset::symbol_module_map.
Referenced by cpp_typecheckt::clean_up(), remove_internal_symbols(), and c_typecheck_baset::typecheck_redefinition_non_type().
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 79 of file symbol_table.h.
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 87 of file symbol_table.h.
References internal_symbols.
Referenced by string_abstractiont::add_str_arguments(), cpp_declarator_convertert::convert(), cpp_typecheckt::convert_anon_struct_union_member(), cpp_typecheckt::convert_anonymous_union(), linkingt::copy_symbols(), cpp_typecheckt::do_not_typechecked(), languaget::generate_opaque_method_stubs(), cpp_typecheckt::instantiate_template(), dump_ct::operator()(), linker_script_merget::pointerize_linker_defined_symbols(), remove_complex(), goto_program2codet::remove_const(), remove_vector(), linkingt::rename_symbols(), static_lifetime_init(), jsil_typecheckt::typecheck(), cpp_typecheckt::typecheck_class_template(), cpp_typecheckt::typecheck_class_template_member(), cpp_typecheckt::typecheck_compound_type(), c_typecheck_baset::typecheck_declaration(), c_typecheck_baset::typecheck_symbol(), and jsil_typecheckt::update_expr_type().
Author: Diffblue Ltd.
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 15 of file symbol_table.cpp.
References symbolt::base_name, internal_symbol_base_map, internal_symbol_module_map, internal_symbols, symbolt::module, and symbolt::name.
Referenced by string_abstractiont::add_argument(), uninitializedt::add_assertions(), string_abstractiont::add_dummy_symbol_and_value(), add_stack_depth_symbol(), string_abstractiont::build_new_symbol(), string_abstractiont::build_symbol_constant(), string_abstractiont::build_unknown(), goto_program2codet::cleanup_expr(), cpp_typecheckt::convert(), string_instrumentationt::do_strerror(), cpp_typecheckt::do_virtual_table(), function_to_call(), generate_ansi_c_start_function(), string_instrumentationt::invalidate_buffer(), jsil_entry_point(), move(), goto_symext::parameter_assignments(), cpp_typecheckt::static_and_dynamic_initialization(), cpp_typecheckt::typecheck_compound_declarator(), and c_typecheck_baset::typecheck_expr_builtin_va_arg().
Move a symbol into the symbol table.
If there is already a symbol with the same name then symbol is unchanged, new_symbol points to the symbol with the same name and true is returned. Otherwise, the symbol is moved into the symbol table, symbol is destroyed, new_symbol points to its new location in the symbol table and false is returned
symbol | The symbol to be added to the symbol table |
new_symbol | Pointer which the function will set to either point to the symbol in the symbol table with the same name or to the symbol that has been successfully moved into the symbol table |
Implements symbol_table_baset.
Definition at line 61 of file symbol_table.cpp.
References symbolt::base_name, insert(), symbolt::module, and symbolt::name.
Referenced by shared_bufferst::add(), java_string_library_preprocesst::add_string_type(), c_nondet_symbol_factory(), cpp_typecheckt::class_template_symbol(), cpp_declarator_convertert::convert_new_symbol(), cpp_typecheckt::convert_parameter(), w_guardst::get_guard_symbol(), symex_dereference_statet::has_failed_symbol(), introduce_temporaries(), c_typecheck_baset::move_symbol(), cpp_typecheckt::typecheck_class_template(), cpp_typecheckt::typecheck_compound_declarator(), cpp_typecheckt::typecheck_compound_type(), cpp_typecheckt::typecheck_enum_body(), cpp_typecheckt::typecheck_enum_type(), cpp_typecheckt::typecheck_function_template(), and cpp_typecheckt::typecheck_member_function().
|
inline |
Definition at line 46 of file symbol_table.h.
References symbol_tablet().
|
inline |
Definition at line 63 of file symbol_table.h.
References internal_symbol_base_map, internal_symbol_module_map, and internal_symbols.
|
inline |
Definition at line 71 of file symbol_table.h.
References internal_symbol_base_map, internal_symbol_module_map, and internal_symbols.
Referenced by ci_lazy_methodst::operator()(), and read_object_and_link().
|
private |
Definition at line 23 of file symbol_table.h.
Referenced by clear(), erase(), insert(), operator=(), and swap().
|
private |
Definition at line 24 of file symbol_table.h.
Referenced by clear(), erase(), insert(), operator=(), and swap().
|
private |
Definition at line 22 of file symbol_table.h.
Referenced by begin(), clear(), end(), erase(), get_writeable(), insert(), operator=(), and swap().