File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 23
23
#include " goto_functions.h"
24
24
#include " goto_model.h"
25
25
26
+
27
+ optionalt<source_locationt> find_property (
28
+ const irep_idt &property,
29
+ const goto_functionst & goto_functions)
30
+ {
31
+ for (const auto &fct : goto_functions.function_map )
32
+ {
33
+ const goto_programt &goto_program = fct.second .body ;
34
+
35
+ for (const auto &ins : goto_program.instructions )
36
+ {
37
+ if (ins.is_assert ())
38
+ {
39
+ if (ins.source_location .get_property_id () == property)
40
+ {
41
+ return ins.source_location ;
42
+ }
43
+ }
44
+ }
45
+ }
46
+ return { };
47
+ }
48
+
49
+
26
50
void show_properties (
27
51
const namespacet &ns,
28
52
const irep_idt &identifier,
Original file line number Diff line number Diff line change 13
13
#define CPROVER_GOTO_PROGRAMS_SHOW_PROPERTIES_H
14
14
15
15
#include < util/ui_message.h>
16
+ #include < util/optional.h>
16
17
17
18
class namespacet ;
18
19
class goto_modelt ;
@@ -28,4 +29,15 @@ void show_properties(
28
29
ui_message_handlert::uit ui,
29
30
const goto_functionst &goto_functions);
30
31
32
+ // / \brief Returns a source_locationt that corresponds
33
+ // / to the property given by an irep_idt.
34
+ // / \param property irep_idt that identifies property
35
+ // / \param goto_functions program in which to search for
36
+ // / the property
37
+ // / \return optional<source_locationt> the location of the
38
+ // / property, if found.
39
+ optionalt<source_locationt> find_property (
40
+ const irep_idt &property,
41
+ const goto_functionst &goto_functions);
42
+
31
43
#endif // CPROVER_GOTO_PROGRAMS_SHOW_PROPERTIES_H
You can’t perform that action at this time.
0 commit comments