cprover
|
#include <cpp_scopes.h>
Public Types | |
typedef std::set< cpp_scopet * > | scope_sett |
typedef std::set< cpp_idt * > | id_sett |
typedef std::unordered_map< irep_idt, cpp_idt * > | id_mapt |
Public Member Functions | |
cpp_scopest () | |
cpp_scopet & | current_scope () |
cpp_scopet & | new_scope (const irep_idt &new_scope_name, cpp_idt::id_classt id_class) |
cpp_scopet & | new_namespace (const irep_idt &new_scope_name) |
cpp_scopet & | new_block_scope () |
cpp_idt & | put_into_scope (const symbolt &symbol, cpp_scopet &scope, bool is_friend=false) |
cpp_idt & | put_into_scope (const symbolt &symbol, bool is_friend=false) |
cpp_idt & | get_id (const irep_idt &identifier) |
cpp_scopet & | get_scope (const irep_idt &identifier) |
cpp_scopet & | set_scope (const irep_idt &identifier) |
cpp_scopet & | get_root_scope () |
void | go_to_root_scope () |
void | go_to (cpp_idt &id) |
void | go_to_global_scope () |
cpp_scopet & | get_global_scope () |
void | print_current (std::ostream &out) const |
Public Attributes | |
id_mapt | id_map |
cpp_scopet * | current_scope_ptr |
Protected Attributes | |
cpp_root_scopet | root_scope |
Definition at line 22 of file cpp_scopes.h.
typedef std::unordered_map<irep_idt, cpp_idt *> cpp_scopest::id_mapt |
Definition at line 68 of file cpp_scopes.h.
typedef std::set<cpp_idt *> cpp_scopest::id_sett |
Definition at line 31 of file cpp_scopes.h.
typedef std::set<cpp_scopet *> cpp_scopest::scope_sett |
Definition at line 30 of file cpp_scopes.h.
|
inline |
Definition at line 25 of file cpp_scopes.h.
References current_scope_ptr, and root_scope.
|
inline |
Definition at line 33 of file cpp_scopes.h.
References current_scope_ptr.
Referenced by cpp_typecheckt::add_anonymous_members_to_scope(), cpp_typecheckt::check_component_access(), cpp_typecheckt::class_template_identifier(), cpp_declarator_convertert::convert(), cpp_typecheckt::convert(), cpp_typecheckt::convert_anon_struct_union_member(), cpp_typecheckt::convert_anonymous_union(), cpp_typecheckt::convert_class_template_specialization(), cpp_typecheck_resolvet::convert_identifier(), cpp_declarator_convertert::convert_new_symbol(), cpp_typecheckt::convert_parameter(), cpp_typecheckt::convert_template_function_or_member_specialization(), cpp_typecheck_resolvet::filter_for_named_scopes(), get_global_scope(), cpp_typecheck_resolvet::guess_template_args(), cpp_typecheckt::instantiate_template(), new_block_scope(), cpp_typecheckt::put_compound_into_scope(), put_into_scope(), cpp_typecheck_resolvet::resolve(), cpp_typecheck_resolvet::resolve_namespace(), cpp_typecheck_resolvet::resolve_scope(), set_scope(), cpp_typecheckt::tag_scope(), cpp_typecheckt::this_struct_type(), cpp_typecheckt::typecheck_class_template(), cpp_typecheckt::typecheck_class_template_member(), cpp_typecheckt::typecheck_compound_bases(), cpp_typecheckt::typecheck_compound_declarator(), cpp_typecheckt::typecheck_compound_type(), cpp_typecheckt::typecheck_enum_type(), cpp_typecheckt::typecheck_expr_cpp_name(), cpp_typecheckt::typecheck_expr_this(), cpp_typecheckt::typecheck_function_template(), cpp_typecheckt::typecheck_member_function(), cpp_typecheckt::typecheck_member_initializer(), and cpp_typecheckt::typecheck_template_parameters().
|
inline |
Definition at line 116 of file cpp_scopes.h.
References current_scope(), and cpp_scopet::get_global_scope().
Referenced by go_to_global_scope(), and cpp_typecheckt::tag_scope().
Definition at line 73 of file cpp_scopes.h.
References id2string(), and id_map.
Referenced by cpp_typecheck_resolvet::filter_for_named_scopes(), and get_scope().
|
inline |
Definition at line 94 of file cpp_scopes.h.
References root_scope.
Referenced by cpp_typecheck_resolvet::do_builtin(), and cpp_typecheck_resolvet::resolve().
|
inline |
Definition at line 81 of file cpp_scopes.h.
References get_id(), and cpp_idt::is_scope.
Referenced by cpp_typecheckt::check_component_access(), cpp_typecheckt::instantiate_template(), cpp_typecheck_resolvet::resolve_scope(), cpp_typecheck_resolvet::resolve_with_arguments(), and set_scope().
|
inline |
Definition at line 104 of file cpp_scopes.h.
References current_scope_ptr.
Referenced by cpp_typecheck_resolvet::apply_template_args(), cpp_typecheck_resolvet::disambiguate_template_classes(), cpp_typecheck_resolvet::guess_function_template_args(), cpp_typecheckt::instantiate_template(), put_into_scope(), cpp_typecheck_resolvet::resolve_scope(), cpp_typecheckt::typecheck_class_template_member(), cpp_typecheckt::typecheck_enum_type(), cpp_typecheckt::typecheck_member_initializer(), cpp_typecheckt::typecheck_template_args(), and cpp_typecheckt::typecheck_template_parameters().
|
inline |
Definition at line 111 of file cpp_scopes.h.
References current_scope_ptr, and get_global_scope().
Referenced by put_into_scope(), and cpp_typecheckt::typecheck_friend_declaration().
|
inline |
Definition at line 99 of file cpp_scopes.h.
References current_scope_ptr, and root_scope.
Referenced by cpp_typecheck_resolvet::resolve_scope().
cpp_scopet & cpp_scopest::new_block_scope | ( | ) |
Definition at line 16 of file cpp_scopes.cpp.
References cpp_idt::BLOCK_SCOPE, cpp_idt::compound_counter, current_scope(), new_scope(), and to_string().
Referenced by cpp_typecheckt::typecheck_block().
|
inline |
Definition at line 50 of file cpp_scopes.h.
References cpp_idt::NAMESPACE, and new_scope().
Referenced by cpp_typecheckt::convert().
|
inline |
Definition at line 38 of file cpp_scopes.h.
References current_scope_ptr, dstringt::empty(), cpp_idt::id_class, id_class, id_map, and cpp_scopet::new_scope().
Referenced by new_block_scope(), and new_namespace().
void cpp_scopest::print_current | ( | std::ostream & | out | ) | const |
Definition at line 72 of file cpp_scopes.cpp.
References current_scope_ptr, cpp_scopet::get_parent(), cpp_scopet::is_root_scope(), and cpp_idt::print_fields().
cpp_idt & cpp_scopest::put_into_scope | ( | const symbolt & | symbol, |
cpp_scopet & | scope, | ||
bool | is_friend = false |
||
) |
Definition at line 22 of file cpp_scopes.cpp.
References symbolt::base_name, cpp_idt::BLOCK_SCOPE, dstringt::c_str(), current_scope(), dstringt::empty(), go_to(), go_to_global_scope(), irept::id(), id2string(), cpp_idt::id_class, id_map, cpp_idt::identifier, cpp_scopet::insert(), symbolt::name, cpp_idt::prefix, cpp_idt::SYMBOL, and symbolt::type.
Referenced by cpp_typecheckt::class_template_symbol(), cpp_declarator_convertert::convert(), cpp_declarator_convertert::convert_new_symbol(), cpp_typecheckt::convert_parameter(), put_into_scope(), cpp_typecheckt::typecheck_class_template(), cpp_typecheckt::typecheck_compound_type(), cpp_typecheckt::typecheck_enum_body(), cpp_typecheckt::typecheck_enum_type(), and cpp_typecheckt::typecheck_function_template().
Definition at line 62 of file cpp_scopes.h.
References current_scope(), and put_into_scope().
|
inline |
Definition at line 88 of file cpp_scopes.h.
References current_scope(), current_scope_ptr, and get_scope().
Referenced by cpp_typecheckt::convert(), cpp_typecheckt::convert_function(), cpp_typecheckt::cpp_constructor(), cpp_typecheckt::cpp_destructor(), cpp_typecheckt::operator_is_overloaded(), cpp_typecheckt::typecheck_compound_body(), and cpp_typecheckt::typecheck_expr_member().
cpp_scopet* cpp_scopest::current_scope_ptr |
Definition at line 71 of file cpp_scopes.h.
Referenced by cpp_scopest(), current_scope(), go_to(), go_to_global_scope(), go_to_root_scope(), new_scope(), print_current(), cpp_save_scopet::restore(), and set_scope().
id_mapt cpp_scopest::id_map |
Definition at line 69 of file cpp_scopes.h.
Referenced by cpp_typecheckt::class_template_symbol(), cpp_typecheck_resolvet::disambiguate_template_classes(), get_id(), cpp_typecheck_resolvet::guess_function_template_args(), cpp_typecheckt::instantiate_template(), new_scope(), cpp_typecheckt::put_compound_into_scope(), put_into_scope(), cpp_typecheckt::typecheck_class_template(), cpp_typecheckt::typecheck_compound_bases(), cpp_typecheckt::typecheck_function_template(), cpp_typecheckt::typecheck_member_initializer(), and cpp_typecheckt::typecheck_template_args().
|
protected |
Definition at line 125 of file cpp_scopes.h.
Referenced by cpp_scopest(), get_root_scope(), and go_to_root_scope().