4
4
// / The module implements instrumentation of the passed GOTO program according
5
5
// / to propagation of tainted data through it.
6
6
7
+ #include < algorithm>
8
+ #include < fstream>
9
+ #include < summaries/summary_dump.h>
7
10
#include < taint-instrumenter/instrumentation_driver.h>
8
- #include < taint-instrumenter/search_for_rule_applications.h>
9
11
#include < taint-instrumenter/instrumentation_props.h>
10
- #include < taint-instrumenter/instrumenter.h>
11
12
#include < taint-instrumenter/instrumented_goto_binary_builder.h>
12
- #include < util/msgstream.h>
13
+ #include < taint-instrumenter/instrumenter.h>
14
+ #include < taint-instrumenter/search_for_rule_applications.h>
13
15
#include < util/file_util.h>
16
+ #include < util/msgstream.h>
14
17
#include < util/tmprof.h>
15
- #include < summaries/summary_dump.h>
16
- #include < algorithm>
17
- #include < fstream>
18
18
19
19
taint_instrumentation_drivert::taint_instrumentation_drivert (
20
20
const taint_programt &program,
@@ -49,12 +49,11 @@ void taint_instrumentation_drivert::run(
49
49
50
50
statistics.begin_search_for_rule_applications ();
51
51
52
- logger.status ()
53
- << " Starting instrumenter on the analysed program. " << messaget::eom;
52
+ logger.status () << " Starting instrumenter on the analysed program. "
53
+ << messaget::eom;
54
54
55
55
logger.status () << " Searching for rule applications." << messaget::eom;
56
- rule_application_sitest
57
- map_from_functions_to_rule_application_sites;
56
+ rule_application_sitest map_from_functions_to_rule_application_sites;
58
57
taint_search_for_rule_applications (
59
58
summaries, map_from_functions_to_rule_application_sites, program);
60
59
@@ -72,8 +71,8 @@ void taint_instrumentation_drivert::run(
72
71
statistics.end_search_for_rule_applications ();
73
72
statistics.begin_instrumentation_props ();
74
73
75
- logger.status ()
76
- << " Collecting the instrumentation properties. " << messaget::eom;
74
+ logger.status () << " Collecting the instrumentation properties. "
75
+ << messaget::eom;
77
76
78
77
taint_instrumentation_propst instrumentation_props (
79
78
map_from_functions_to_rule_application_sites,
@@ -83,8 +82,8 @@ void taint_instrumentation_drivert::run(
83
82
84
83
// Dump computed instrumentation props into JSON files.
85
84
{
86
- logger.status ()
87
- << " Saving instrumentation properties as JSON. " << messaget::eom;
85
+ logger.status () << " Saving instrumentation properties as JSON. "
86
+ << messaget::eom;
88
87
json_objectt jobj;
89
88
dump_as_json (instrumentation_props, jobj);
90
89
std::ofstream ostr ((results_dir / " instrumentation_props.json" ).native ());
@@ -109,11 +108,10 @@ void taint_instrumentation_drivert::run(
109
108
statistics.end_instrumenter ();
110
109
statistics.begin_instrumented_goto_binary_build ();
111
110
112
- logger.status ()
113
- << " Starting the builder of the instrumented GOTO binary."
114
- << messaget::eom;
111
+ logger.status () << " Starting the builder of the instrumented GOTO binary."
112
+ << messaget::eom;
115
113
116
- const std::pair<taint_instrumented_goto_binary_infot,std::string>
114
+ const std::pair<taint_instrumented_goto_binary_infot, std::string>
117
115
task_valid = build_instrumented_goto_binary (
118
116
instrumentation_props,
119
117
instrumenter,
@@ -126,13 +124,12 @@ void taint_instrumentation_drivert::run(
126
124
string_refinement_enabled);
127
125
if (task_valid.second .empty ())
128
126
{
129
- logger.status ()
130
- << " Saving info JSON file about the saved GOTO binary."
131
- << messaget::eom;
127
+ logger.status () << " Saving info JSON file about the saved GOTO binary."
128
+ << messaget::eom;
132
129
133
130
json_objectt jtask;
134
131
dump_as_json (task_valid.first , jtask);
135
- std::ofstream ostr (
132
+ std::ofstream ostr (
136
133
(results_dir / " instrumented_goto_program.json" ).native ());
137
134
ostr << jtask;
138
135
}
0 commit comments