12 #ifndef CPROVER_CPP_CPP_TYPECHECK_H 13 #define CPROVER_CPP_CPP_TYPECHECK_H 36 const std::string &module,
50 const std::string &_module,
64 const std::string &_module,
91 bool fail_with_exception=
true)
94 return cpp_typecheck_resolve.
resolve(
95 cpp_name, want, fargs, fail_with_exception);
166 const typet &function_type);
170 const symbolt &template_symbol,
208 const symbolt &template_symbol,
267 const irept &initializers);
275 irept &initializers);
310 std::set<irep_idt> &bases,
311 std::set<irep_idt> &vbases,
315 const typet &t2)
const;
365 bool tag_only_declaration);
398 const irep_idt &compound_identifier,
401 const typet &method_qualifier,
405 const irep_idt &compound_identifier,
407 const typet &method_qualifier);
433 const exprt &
object);
528 const exprt &expr,
const typet &type,
exprt &new_expr,
unsigned &rank);
531 const exprt &expr,
const typet &type,
exprt &new_expr,
unsigned &rank);
537 const exprt &expr,
const typet &type,
unsigned &rank)
const;
543 const exprt &expr,
const typet &type,
exprt &new_expr,
unsigned &rank);
546 const exprt &expr,
const typet &type,
unsigned &rank);
556 std::set<irep_idt> &set_bases)
const;
559 std::list<irep_idt> &vbases)
const;
567 const typet &dest_type);
585 bool check_constantness=
true);
591 bool check_constantness=
true);
599 #endif // CPROVER_CPP_CPP_TYPECHECK_H void typecheck_function_expr(exprt &expr, const cpp_typecheck_fargst &fargs)
The type of an expression.
void convert_function(symbolt &symbol)
void add_anonymous_members_to_scope(const symbolt &struct_union_symbol)
void typecheck_expr_dereference(exprt &expr)
bool find_cpctor(const symbolt &symbol) const
void check_fixed_size_array(typet &type)
check that an array has fixed size
void typecheck_side_effect_function_call(side_effect_expr_function_callt &expr)
C++ Language Type Checking.
bool reference_binding(exprt expr, const typet &type, exprt &new_expr, unsigned &rank)
Reference binding.
codet dtor(const symbolt &symb)
produces destructor code for a class object
void typecheck_type(typet &type)
C++ Language Type Checking.
A generic base class for relations, i.e., binary predicates.
template_mapt template_map
void new_temporary(const source_locationt &source_location, const typet &, const exprt::operandst &ops, exprt &temporary)
void typecheck_expr_member(exprt &expr)
static bool has_const(const typet &type)
bool standard_conversion_floating_point_conversion(const exprt &expr, const typet &type, exprt &new_expr) const
Floating-point conversion.
void convert_non_template_declaration(cpp_declarationt &declaration)
void typecheck_expr_rel(binary_relation_exprt &expr)
virtual void typecheck_switch(code_switcht &code)
void add_implicit_dereference(exprt &expr)
exprt resolve(const cpp_namet &cpp_name, const wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
bool static_typecast(const exprt &expr, const typet &type, exprt &new_expr, bool check_constantness=true)
bool find_parent(const symbolt &symb, const irep_idt &base_name, irep_idt &identifier)
bool standard_conversion_integral_conversion(const exprt &expr, const typet &type, exprt &new_expr) const
Integral conversion.
instantiation_stackt instantiation_stack
const symbolt & instantiate_template(const source_locationt &source_location, const symbolt &symbol, const cpp_template_args_tct &specialization_template_args, const cpp_template_args_tct &full_template_args, const typet &specialization=typet(ID_nil))
void get_bases(const struct_typet &type, std::set< irep_idt > &set_bases) const
cpp_template_args_tct typecheck_template_args(const source_locationt &source_location, const symbolt &template_symbol, const cpp_template_args_non_tct &template_args)
instantiation_stackt & instantiation_stack
void full_member_initialization(const struct_union_typet &struct_union_type, irept &initializers)
Build the full initialization list of the constructor.
bool user_defined_conversion_sequence(const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank)
User-defined conversion sequence.
bool check_component_access(const struct_union_typet::componentt &component, const struct_union_typet &struct_union_type)
void convert_template_function_or_member_specialization(cpp_declarationt &declaration)
std::vector< componentt > componentst
bool standard_conversion_qualification(const exprt &expr, const typet &, exprt &new_expr) const
Qualification conversion.
bool standard_conversion_floating_point_promotion(const exprt &expr, exprt &new_expr) const
Floating-point-promotion conversion.
void typecheck_expr_function_identifier(exprt &expr)
bool overloadable(const exprt &expr)
void show_instantiation_stack(std::ostream &)
virtual void typecheck_code(codet &code)
template_mapt template_map
void convert_parameter(const irep_idt &mode, code_typet::parametert ¶meter)
void static_and_dynamic_initialization()
Initialization of static objects:
The trinary if-then-else operator.
void typecheck_enum_body(symbolt &symbol)
void explicit_typecast_ambiguity(exprt &expr)
void default_dtor(const symbolt &symb, cpp_declarationt &dtor)
Note:
void move_member_initializers(irept &initializers, const typet &type, exprt &value)
void typecheck_assign(codet &code)
void add_this_to_method_type(const irep_idt &compound_identifier, typet &method_type, const typet &method_qualifier)
void typecheck_method_application(side_effect_expr_function_callt &expr)
void typecheck_expr_delete(exprt &expr)
void typecheck_expr_this(exprt &expr)
virtual void implicit_typecast(exprt &expr, const typet &type)
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
void typecheck_expr_reference_to(exprt &expr)
void check_member_initializers(const irept &bases, const struct_typet::componentst &components, const irept &initializers)
Check a constructor initialization-list.
bool standard_conversion_function_to_pointer(const exprt &expr, exprt &new_expr) const
Function-to-pointer conversion.
virtual void typecheck_block(codet &code)
std::string class_template_identifier(const irep_idt &base_name, const template_typet &template_type, const cpp_template_args_non_tct &partial_specialization_args)
bool cast_away_constness(const typet &t1, const typet &t2) const
void typecheck_class_template(cpp_declarationt &declaration)
void typecheck_expr_typecast(exprt &expr)
cpp_scopet & typecheck_template_parameters(template_typet &type)
bool standard_conversion_integral_promotion(const exprt &expr, exprt &new_expr) const
Integral-promotion conversion.
void typecheck_expr_binary_arithmetic(exprt &expr)
virtual void typecheck_expr(exprt &expr)
void convert(cpp_linkage_spect &)
void typecheck_compound_declarator(const symbolt &symbol, const cpp_declarationt &declaration, cpp_declaratort &declarator, struct_typet::componentst &components, const irep_idt &access, bool is_static, bool is_typedef, bool is_mutable)
bool reference_compatible(const exprt &expr, const typet &type, unsigned &rank) const
Reference-compatible.
void typecheck_enum_type(typet &type)
void typecheck_expr_explicit_typecast(exprt &expr)
bool dynamic_typecast(const exprt &expr, const typet &type, exprt &new_expr)
bool standard_conversion_floating_integral_conversion(const exprt &expr, const typet &type, exprt &new_expr) const
Floating-integral conversion.
void default_assignop_value(const symbolt &symbol, cpp_declaratort &declarator)
Generate code for the implicit default assignment operator.
instantiation_stackt instantiation_stack
bool reference_related(const exprt &expr, const typet &type) const
Reference-related.
void add_method_body(symbolt *_method_symbol)
void typecheck_expr_ptrmember(exprt &expr)
virtual void typecheck_try_catch(codet &code)
void typecheck_function_call_arguments(side_effect_expr_function_callt &expr)
void elaborate_class_template(const typet &type)
elaborate class template instances
virtual ~cpp_typecheckt()
void typecheck_expr_explicit_constructor_call(exprt &expr)
void salvage_default_arguments(const template_typet &old_type, template_typet &new_type)
A reference into the symbol table.
ANSI-C Language Type Checking.
std::list< instantiationt > instantiation_stackt
method_bodyt(symbolt *_method_symbol, const template_mapt &_template_map, const instantiation_stackt &_instantiation_stack)
void typecheck_cast_expr(exprt &expr)
virtual void typecheck()
typechecking main method
cpp_typecheckt(cpp_parse_treet &_cpp_parse_tree, symbol_tablet &_symbol_table1, const symbol_tablet &_symbol_table2, const std::string &_module, message_handlert &message_handler)
bool cpp_is_pod(const typet &type) const
std::string function_template_identifier(const irep_idt &base_name, const template_typet &template_type, const typet &function_type)
bool reinterpret_typecast(const exprt &expr, const typet &type, exprt &new_expr, bool check_constantness=true)
cpp_parse_treet & cpp_parse_tree
void typecheck_friend_declaration(symbolt &symbol, cpp_declarationt &cpp_declaration)
void convert_parameters(const irep_idt &mode, code_typet &function_type)
void typecheck_compound_body(struct_union_typet &type)
source_locationt source_location
codet cpp_destructor(const source_locationt &source_location, const typet &type, const exprt &object)
void typecheck_member_function(const irep_idt &compound_identifier, struct_typet::componentt &component, irept &initializers, const typet &method_qualifier, exprt &value)
void do_virtual_table(const symbolt &symbol)
void convert_initializer(symbolt &symbol)
Initialize an object with a value.
Base class for tree-like data structures with sharing.
bool standard_conversion_pointer_to_member(const exprt &expr, const typet &type, exprt &new_expr)
Pointer-to-member conversion.
void convert_template_declaration(cpp_declarationt &declaration)
void typecheck_function_template(cpp_declarationt &declaration)
typecheck function templates
void typecheck_expr_throw(exprt &expr)
void typecheck_side_effect_assignment(side_effect_exprt &expr)
void convert_pmop(exprt &expr)
void zero_initializer(const exprt &object, const typet &type, const source_locationt &source_location, exprt::operandst &ops)
exprt resolve(const cpp_namet &cpp_name, const cpp_typecheck_resolvet::wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
void default_assignop(const symbolt &symbol, cpp_declarationt &cpctor)
Generate declaration of the implicit default assignment operator.
void default_cpctor(const symbolt &, cpp_declarationt &cpctor) const
Generate code for implicit default copy constructor.
void make_ptr_typecast(exprt &expr, const typet &dest_type)
void typecheck_expr_trinary(if_exprt &expr)
std::string template_suffix(const cpp_template_args_tct &template_args)
std::list< irep_idt > dynamic_initializationst
bool find_dtor(const symbolt &symbol) const
std::vector< exprt > operandst
A function call side effect.
void typecheck_method_bodies(method_bodiest &)
bool const_typecast(const exprt &expr, const typet &type, exprt &new_expr)
bool get_component(const source_locationt &source_location, const exprt &object, const irep_idt &component_name, exprt &member)
void typecheck_expr_address_of(exprt &expr)
irep_idt function_identifier(const typet &type)
for function overloading
virtual void typecheck_decl(codet &code)
method_bodiest method_bodies
cpp_template_args_tct full_template_args
bool subtype_typecast(const struct_typet &from, const struct_typet &to) const
bool operator_is_overloaded(exprt &expr)
void typecheck_compound_bases(struct_typet &type)
bool standard_conversion_lvalue_to_rvalue(const exprt &expr, exprt &new_expr) const
Lvalue-to-rvalue conversion.
Base type of C structs and unions, and C++ classes.
void default_ctor(const source_locationt &source_location, const irep_idt &base_name, cpp_declarationt &ctor) const
Generate code for implicit default constructors.
void do_not_typechecked()
irep_idt current_linkage_spec
bool standard_conversion_sequence(const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank)
Standard Conversion Sequence.
void convert_anonymous_union(cpp_declarationt &declaration, codet &new_code)
void typecheck_expr_comma(exprt &expr)
bool find_assignop(const symbolt &symbol) const
const symbolt & class_template_symbol(const source_locationt &source_location, const symbolt &template_symbol, const cpp_template_args_tct &specialization_template_args, const cpp_template_args_tct &full_template_args)
Base class for all expressions.
void get_virtual_bases(const struct_typet &type, std::list< irep_idt > &vbases) const
void convert_class_template_specialization(cpp_declarationt &declaration)
unsigned template_counter
void add_base_components(const struct_typet &from, const irep_idt &access, struct_typet &to, std::set< irep_idt > &bases, std::set< irep_idt > &vbases, bool is_virtual)
virtual void typecheck_while(code_whilet &code)
virtual std::string to_string(const typet &type)
C++ Language Type Checking.
void typecheck_compound_type(struct_union_typet &type)
const struct_typet & this_struct_type()
dynamic_initializationst dynamic_initializations
bool disable_access_control
void typecheck_expr_side_effect(side_effect_exprt &expr)
void typecheck_expr_main(exprt &expr)
Called after the operands are done.
void typecheck_compound_body(symbolt &symbol)
bool standard_conversion_array_to_pointer(const exprt &expr, exprt &new_expr) const
Array-to-pointer conversion.
virtual void typecheck_ifthenelse(code_ifthenelset &code)
bool standard_conversion_pointer(const exprt &expr, const typet &type, exprt &new_expr)
Pointer conversion.
void put_compound_into_scope(const struct_union_typet::componentt &component)
A statement in a programming language.
void typecheck_expr_cpp_name(exprt &expr, const cpp_typecheck_fargst &fargs)
void typecheck_side_effect_inc_dec(side_effect_exprt &expr)
std::list< method_bodyt > method_bodiest
An expression containing a side effect.
void typecheck_expr_sizeof(exprt &expr)
bool implicit_conversion_sequence(const exprt &expr, const typet &type, exprt &new_expr, unsigned &rank)
implicit conversion sequence
static bool has_volatile(const typet &type)
void typecheck_class_template_member(cpp_declarationt &declaration)
typecheck class template members; these can be methods or static members
void typecheck_expr_index(exprt &expr)
message_handlert * message_handler
void convert_anon_struct_union_member(const cpp_declarationt &declaration, const irep_idt &access, struct_typet::componentst &components)
virtual void typecheck_member_initializer(codet &code)
cpp_typecheckt(cpp_parse_treet &_cpp_parse_tree, symbol_tablet &_symbol_table, const std::string &_module, message_handlert &message_handler)
cpp_scopet & tag_scope(const irep_idt &_base_name, bool has_body, bool tag_only_declaration)
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_tablet &symbol_table, const std::string &module, message_handlert &message_handler)
codet cpp_constructor(const source_locationt &source_location, const exprt &object, const exprt::operandst &operands)
instantiation_levelt(instantiation_stackt &_instantiation_stack)
void typecheck_expr_new(exprt &expr)
void reference_initializer(exprt &expr, const typet &type)
A reference to type "cv1 T1" is initialized by an expression of type "cv2 T2" as follows: ...
bool standard_conversion_boolean(const exprt &expr, exprt &new_expr) const
Boolean conversion.