@@ -11,21 +11,46 @@ Date: September 2021
11
11
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_UTILS_H
12
12
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_UTILS_H
13
13
14
- // clang-format off
15
- #include < vector>
14
+ #include < goto-programs/goto_convert_class.h>
15
+
16
+ #include < util/byte_operators.h>
17
+ #include < util/expr_cast.h>
18
+ #include < util/message.h>
19
+
20
+ #include < goto-programs/goto_model.h>
16
21
17
22
#include < analyses/dirty.h>
18
23
#include < analyses/locals.h>
19
-
20
24
#include < goto-instrument/havoc_utils.h>
21
25
22
- #include < goto-programs/goto_convert_class.h>
23
- #include < goto-programs/goto_model.h>
26
+ #include < vector>
24
27
25
- #include < util/expr_cast.h>
26
- #include < util/byte_operators.h>
27
- #include < util/message.h>
28
- // clang-format on
28
+ // / Class that allows to clean expressions of side effects and to generate
29
+ // / havoc_slice expressions.
30
+ class cleanert : public goto_convertt
31
+ {
32
+ public:
33
+ cleanert (
34
+ symbol_table_baset &_symbol_table,
35
+ message_handlert &_message_handler)
36
+ : goto_convertt(_symbol_table, _message_handler)
37
+ {
38
+ }
39
+
40
+ void clean (exprt &guard, goto_programt &dest, const irep_idt &mode)
41
+ {
42
+ goto_convertt::clean_expr (guard, dest, mode, true );
43
+ }
44
+
45
+ void do_havoc_slice (
46
+ const symbol_exprt &function,
47
+ const exprt::operandst &arguments,
48
+ goto_programt &dest,
49
+ const irep_idt &mode)
50
+ {
51
+ goto_convertt::do_havoc_slice (nil_exprt{}, function, arguments, dest, mode);
52
+ }
53
+ };
29
54
30
55
// / \brief A class that overrides the low-level havocing functions in the base
31
56
// / utility class, to havoc only when expressions point to valid memory,
0 commit comments