File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ SRC = auto_objects.cpp \
15
15
precondition.cpp \
16
16
renaming_level.cpp \
17
17
shadow_memory.cpp \
18
+ shadow_memory_util.cpp \
18
19
show_program.cpp \
19
20
show_vcc.cpp \
20
21
slice.cpp \
Original file line number Diff line number Diff line change
1
+ /* ******************************************************************\
2
+
3
+ Module: Symex Shadow Memory Instrumentation
4
+
5
+ Author: Peter Schrammel
6
+
7
+ \*******************************************************************/
8
+
9
+ // / \file
10
+ // / Symex Shadow Memory Instrumentation Utilities
11
+
12
+ #include " shadow_memory_util.h"
13
+
14
+ #include < util/invariant.h>
15
+ #include < util/pointer_expr.h>
16
+ #include < util/std_expr.h>
17
+
18
+ irep_idt extract_field_name (const exprt &string_expr)
19
+ {
20
+ if (string_expr.id () == ID_typecast)
21
+ return extract_field_name (to_typecast_expr (string_expr).op ());
22
+ else if (string_expr.id () == ID_address_of)
23
+ return extract_field_name (to_address_of_expr (string_expr).object ());
24
+ else if (string_expr.id () == ID_index)
25
+ return extract_field_name (to_index_expr (string_expr).array ());
26
+ else if (string_expr.id () == ID_string_constant)
27
+ {
28
+ return string_expr.get (ID_value);
29
+ }
30
+ else
31
+ UNREACHABLE;
32
+ }
Original file line number Diff line number Diff line change
1
+ /* ******************************************************************\
2
+
3
+ Module: Symex Shadow Memory Instrumentation
4
+
5
+ Author: Peter Schrammel
6
+
7
+ \*******************************************************************/
8
+
9
+ // / \file
10
+ // / Symex Shadow Memory Instrumentation Utilities
11
+
12
+ #ifndef CPROVER_GOTO_SYMEX_SHADOW_MEMORY_UTIL_H
13
+ #define CPROVER_GOTO_SYMEX_SHADOW_MEMORY_UTIL_H
14
+
15
+ #include < util/irep.h>
16
+
17
+ class exprt ;
18
+
19
+ // / Extracts the field name identifier from a string expression,
20
+ // / e.g. as passed as argument to a __CPROVER_field_decl_local call.
21
+ // / \param string_expr The string argument expression
22
+ // / \return The identifier denoted by the string argument expression
23
+ irep_idt extract_field_name (const exprt &string_expr);
24
+
25
+ #endif // CPROVER_GOTO_SYMEX_SHADOW_MEMORY_STATE_H
You can’t perform that action at this time.
0 commit comments