CBMC
cpp_typecast.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@cs.cmu.edu
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_CPP_CPP_TYPECAST_H
11 #define CPROVER_CPP_CPP_TYPECAST_H
12 
13 #include <ansi-c/c_typecast.h>
14 
15 class cpp_typecheckt;
16 
18 {
19 public:
21 
22  virtual void implicit_typecast(
23  exprt &expr,
24  const typet &type);
25 
26  virtual void implicit_typecast_arithmetic(
27  exprt &expr);
28 
29  virtual void implicit_typecast_arithmetic(
30  exprt &expr1,
31  exprt &expr2);
32 
33 protected:
34  virtual void implicit_typecast_followed(
35  exprt &expr,
36  const typet &src_type,
37  const typet &dest_type);
38 
39  void get_bases(
40  const irep_idt &identifier,
41  std::map<irep_idt, unsigned> &base_count);
42 
43 public:
44  void check_qualifiers(
45  const typet &from,
46  const typet &to);
47 
48  bool subtype_typecast(
49  const typet &from,
50  const typet &to,
51  std::string &err);
52 
54  const typet &src_type,
55  const typet &dest_type);
56 
58  const struct_typet &from,
59  const struct_typet &to);
60 
61  void make_ptr_typecast(
62  exprt &expr,
63  const typet &src_type,
64  const typet &dest_type);
65 
67 };
68 
69 #endif // CPROVER_CPP_CPP_TYPECAST_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
cpp_typecastt::make_ptr_typecast
void make_ptr_typecast(exprt &expr, const typet &src_type, const typet &dest_type)
cpp_typecastt::check_qualifiers
void check_qualifiers(const typet &from, const typet &to)
c_typecastt
Definition: c_typecast.h:43
typet
The type of an expression, extends irept.
Definition: type.h:28
exprt
Base class for all expressions.
Definition: expr.h:55
cpp_typecastt::get_bases
void get_bases(const irep_idt &identifier, std::map< irep_idt, unsigned > &base_count)
cpp_typecastt::subtype_offset
exprt subtype_offset(const struct_typet &from, const struct_typet &to)
cpp_typecastt::cpp_typecastt
cpp_typecastt(cpp_typecheckt &cpp_typecheck)
cpp_typecastt::implicit_typecast_followed
virtual void implicit_typecast_followed(exprt &expr, const typet &src_type, const typet &dest_type)
cpp_typecheckt
Definition: cpp_typecheck.h:39
struct_typet
Structure type, corresponds to C style structs.
Definition: std_types.h:230
c_typecast.h
cpp_typecastt::integral_conversion
bool integral_conversion(const typet &src_type, const typet &dest_type)
cpp_typecastt
Definition: cpp_typecast.h:17
cpp_typecastt::cpp_typecheck
cpp_typecheckt & cpp_typecheck
Definition: cpp_typecast.h:66
cpp_typecastt::subtype_typecast
bool subtype_typecast(const typet &from, const typet &to, std::string &err)
cpp_typecastt::implicit_typecast
virtual void implicit_typecast(exprt &expr, const typet &type)
cpp_typecastt::implicit_typecast_arithmetic
virtual void implicit_typecast_arithmetic(exprt &expr)