cprover
c_sizeof.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_ANSI_C_C_SIZEOF_H
11 #define CPROVER_ANSI_C_C_SIZEOF_H
12 
13 #include <util/namespace.h>
14 #include <util/expr.h>
15 
16 class c_sizeoft
17 {
18 public:
19  explicit c_sizeoft(const namespacet &_ns):ns(_ns)
20  {
21  }
22 
23  virtual ~c_sizeoft()
24  {
25  }
26 
27  exprt operator()(const typet &type)
28  {
29  return sizeof_rec(type);
30  }
31 
33  const struct_typet &type,
34  const irep_idt &component_name);
35 
36 protected:
37  const namespacet &ns;
38 
39  virtual exprt sizeof_rec(const typet &type);
40 };
41 
43  const typet &src,
44  const namespacet &ns);
45 
47  const struct_typet &src,
48  const irep_idt &component_name,
49  const namespacet &ns);
50 
51 #endif // CPROVER_ANSI_C_C_SIZEOF_H
exprt c_sizeof(const typet &src, const namespacet &ns)
Definition: c_sizeof.cpp:303
The type of an expression.
Definition: type.h:20
exprt c_offsetof(const struct_typet &src, const irep_idt &component_name, const namespacet &ns)
Definition: c_sizeof.cpp:311
Structure type.
Definition: std_types.h:296
virtual exprt sizeof_rec(const typet &type)
Definition: c_sizeof.cpp:22
virtual ~c_sizeoft()
Definition: c_sizeof.h:23
TO_BE_DOCUMENTED.
Definition: namespace.h:62
c_sizeoft(const namespacet &_ns)
Definition: c_sizeof.h:19
exprt operator()(const typet &type)
Definition: c_sizeof.h:27
const namespacet & ns
Definition: c_sizeof.h:37
Base class for all expressions.
Definition: expr.h:46
exprt c_offsetof(const struct_typet &type, const irep_idt &component_name)
Definition: c_sizeof.cpp:253