cprover
cpp_typecheck_resolvet Class Reference

#include <cpp_typecheck_resolve.h>

Collaboration diagram for cpp_typecheck_resolvet:
[legend]

Classes

struct  matcht
 

Public Types

enum  wantt { wantt::VAR, wantt::TYPE, wantt::BOTH }
 

Public Member Functions

 cpp_typecheck_resolvet (class cpp_typecheckt &_cpp_typecheck)
 
exprt resolve (const cpp_namet &cpp_name, const wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
 
cpp_scopetresolve_scope (const cpp_namet &cpp_name, irep_idt &base_name, cpp_template_args_non_tct &template_args)
 
cpp_scopetresolve_namespace (const cpp_namet &cpp_name)
 

Protected Types

typedef std::vector< exprtresolve_identifierst
 

Protected Member Functions

void convert_identifiers (const cpp_scopest::id_sett &id_set, const cpp_typecheck_fargst &fargs, resolve_identifierst &identifiers)
 
exprt convert_template_parameter (const cpp_idt &id)
 
exprt convert_identifier (const cpp_idt &id, const cpp_typecheck_fargst &fargs)
 
void disambiguate_functions (resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
 
void exact_match_functions (resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
 
void filter (resolve_identifierst &identifiers, const wantt want)
 
symbol_typet disambiguate_template_classes (const irep_idt &base_name, const cpp_scopest::id_sett &id_set, const cpp_template_args_non_tct &template_args)
 disambiguate partial specialization More...
 
void make_constructors (resolve_identifierst &identifiers)
 
void apply_template_args (resolve_identifierst &identifiers, const cpp_template_args_non_tct &template_args, const cpp_typecheck_fargst &fargs)
 
void apply_template_args (exprt &expr, const cpp_template_args_non_tct &template_args, const cpp_typecheck_fargst &fargs)
 
void guess_function_template_args (resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
 guess arguments of function templates More...
 
void remove_templates (resolve_identifierst &identifiers)
 
void remove_duplicates (resolve_identifierst &identifiers)
 
exprt guess_function_template_args (const exprt &expr, const cpp_typecheck_fargst &fargs)
 Guess template arguments for function templates. More...
 
void guess_template_args (const typet &template_parameter, const typet &desired_type)
 
void guess_template_args (const exprt &template_parameter, const exprt &desired_expr)
 
bool disambiguate_functions (const exprt &expr, unsigned &args_distance, const cpp_typecheck_fargst &fargs)
 
void resolve_argument (exprt &argument, const cpp_typecheck_fargst &fargs)
 
exprt do_builtin (const irep_idt &base_name, const cpp_typecheck_fargst &fargs, const cpp_template_args_non_tct &template_args)
 
void show_identifiers (const irep_idt &base_name, const resolve_identifierst &identifiers, std::ostream &out)
 
void resolve_with_arguments (cpp_scopest::id_sett &id_set, const irep_idt &base_name, const cpp_typecheck_fargst &fargs)
 
void filter_for_named_scopes (cpp_scopest::id_sett &id_set)
 
void filter_for_namespaces (cpp_scopest::id_sett &id_set)
 

Protected Attributes

cpp_typechecktcpp_typecheck
 
source_locationt source_location
 
cpp_scopetoriginal_scope
 

Detailed Description

Definition at line 20 of file cpp_typecheck_resolve.h.

Member Typedef Documentation

◆ resolve_identifierst

typedef std::vector<exprt> cpp_typecheck_resolvet::resolve_identifierst
protected

Definition at line 48 of file cpp_typecheck_resolve.h.

Member Enumeration Documentation

◆ wantt

Enumerator
VAR 
TYPE 
BOTH 

Definition at line 26 of file cpp_typecheck_resolve.h.

Constructor & Destructor Documentation

◆ cpp_typecheck_resolvet()

cpp_typecheck_resolvet::cpp_typecheck_resolvet ( class cpp_typecheckt _cpp_typecheck)

Definition at line 36 of file cpp_typecheck_resolve.cpp.

Member Function Documentation

◆ apply_template_args() [1/2]

void cpp_typecheck_resolvet::apply_template_args ( resolve_identifierst identifiers,
const cpp_template_args_non_tct template_args,
const cpp_typecheck_fargst fargs 
)
protected

Definition at line 65 of file cpp_typecheck_resolve.cpp.

References irept::id(), irept::is_not_nil(), and exprt::type().

Referenced by resolve().

◆ apply_template_args() [2/2]

◆ convert_identifier()

◆ convert_identifiers()

void cpp_typecheck_resolvet::convert_identifiers ( const cpp_scopest::id_sett id_set,
const cpp_typecheck_fargst fargs,
resolve_identifierst identifiers 
)
protected

Definition at line 42 of file cpp_typecheck_resolve.cpp.

References convert_identifier(), irept::id(), id_set, irept::is_not_nil(), and exprt::type().

Referenced by resolve().

◆ convert_template_parameter()

◆ disambiguate_functions() [1/2]

◆ disambiguate_functions() [2/2]

◆ disambiguate_template_classes()

◆ do_builtin()

◆ exact_match_functions()

void cpp_typecheck_resolvet::exact_match_functions ( resolve_identifierst identifiers,
const cpp_typecheck_fargst fargs 
)
protected

Definition at line 428 of file cpp_typecheck_resolve.cpp.

References disambiguate_functions(), and cpp_typecheck_fargst::in_use.

Referenced by resolve().

◆ filter()

void cpp_typecheck_resolvet::filter ( resolve_identifierst identifiers,
const wantt  want 
)
protected

Definition at line 391 of file cpp_typecheck_resolve.cpp.

References BOTH, TYPE, UNREACHABLE, and VAR.

Referenced by resolve().

◆ filter_for_named_scopes()

◆ filter_for_namespaces()

void cpp_typecheck_resolvet::filter_for_namespaces ( cpp_scopest::id_sett id_set)
protected

Definition at line 2390 of file cpp_typecheck_resolve.cpp.

References id_set.

Referenced by resolve_namespace().

◆ guess_function_template_args() [1/2]

void cpp_typecheck_resolvet::guess_function_template_args ( resolve_identifierst identifiers,
const cpp_typecheck_fargst fargs 
)
protected

◆ guess_function_template_args() [2/2]

◆ guess_template_args() [1/2]

◆ guess_template_args() [2/2]

◆ make_constructors()

◆ remove_duplicates()

void cpp_typecheck_resolvet::remove_duplicates ( resolve_identifierst identifiers)
protected

Definition at line 159 of file cpp_typecheck_resolve.cpp.

References symbol_exprt::get_identifier(), to_symbol_expr(), and to_symbol_type().

Referenced by resolve().

◆ remove_templates()

void cpp_typecheck_resolvet::remove_templates ( resolve_identifierst identifiers)
protected

Definition at line 143 of file cpp_typecheck_resolve.cpp.

References cpp_typecheck, and namespace_baset::follow().

Referenced by resolve().

◆ resolve()

exprt cpp_typecheck_resolvet::resolve ( const cpp_namet cpp_name,
const wantt  want,
const cpp_typecheck_fargst fargs,
bool  fail_with_exception = true 
)

Definition at line 1396 of file cpp_typecheck_resolve.cpp.

References exprt::add_source_location(), apply_template_args(), BOTH, cpp_typecheckt::builtin_factory(), dstringt::c_str(), convert_identifiers(), cpp_typecheckt::cpp_is_pod(), cpp_typecheckt::cpp_scopes, cpp_typecheck, cpp_scopest::current_scope(), disambiguate_functions(), disambiguate_template_classes(), do_builtin(), cpp_typecheckt::elaborate_class_template(), messaget::eom(), messaget::error(), exact_match_functions(), filter(), irept::get(), irept::get_bool(), source_locationt::get_function(), cpp_scopest::get_root_scope(), guess_function_template_args(), cpp_typecheck_fargst::has_object, irept::id(), cpp_idt::id_class, id_set, cpp_idt::identifier, cpp_typecheck_fargst::in_use, cpp_scopet::insert(), cpp_typecheckt::instantiation_stack, cpp_declarationt::is_class_template(), irept::is_nil(), irept::is_not_nil(), cpp_namet::is_qualified(), cpp_scopet::is_root_scope(), cpp_scopet::lookup(), namespacet::lookup(), make_constructors(), irept::make_nil(), cpp_typecheck_fargst::operands, original_scope, cpp_idt::prefix, irept::pretty(), cpp_scopet::QUALIFIED, cpp_scopet::RECURSIVE, remove_duplicates(), remove_templates(), resolve_scope(), resolve_with_arguments(), string_constantt::set_value(), show_identifiers(), cpp_typecheckt::show_instantiation_stack(), dstringt::size(), source_location, cpp_namet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, cpp_idt::SYMBOL, cpp_idt::TEMPLATE, to_cpp_declaration(), cpp_typecheckt::to_string(), TYPE, symbolt::type, exprt::type(), and VAR.

Referenced by cpp_typecheckt::resolve(), and resolve_argument().

◆ resolve_argument()

void cpp_typecheck_resolvet::resolve_argument ( exprt argument,
const cpp_typecheck_fargst fargs 
)
protected

◆ resolve_namespace()

◆ resolve_scope()

◆ resolve_with_arguments()

void cpp_typecheck_resolvet::resolve_with_arguments ( cpp_scopest::id_sett id_set,
const irep_idt base_name,
const cpp_typecheck_fargst fargs 
)
protected

◆ show_identifiers()

void cpp_typecheck_resolvet::show_identifiers ( const irep_idt base_name,
const resolve_identifierst identifiers,
std::ostream &  out 
)
protected

Member Data Documentation

◆ cpp_typecheck

◆ original_scope

cpp_scopet* cpp_typecheck_resolvet::original_scope
protected

◆ source_location


The documentation for this class was generated from the following files: