@@ -24,13 +24,10 @@ Author: Peter Schrammel
24
24
#include < goto-programs/instrument_preconditions.h>
25
25
#include < goto-programs/loop_ids.h>
26
26
#include < goto-programs/mm_io.h>
27
- #include < goto-programs/remove_complex.h>
28
27
#include < goto-programs/remove_function_pointers.h>
29
28
#include < goto-programs/remove_returns.h>
30
29
#include < goto-programs/remove_skip.h>
31
- #include < goto-programs/remove_vector.h>
32
30
#include < goto-programs/remove_virtual_functions.h>
33
- #include < goto-programs/rewrite_union.h>
34
31
#include < goto-programs/set_properties.h>
35
32
#include < goto-programs/show_properties.h>
36
33
@@ -71,88 +68,9 @@ void jdiff_parse_optionst::get_command_line_options(optionst &options)
71
68
if (cmdline.isset (" cover" ))
72
69
parse_cover_options (cmdline, options);
73
70
74
- if (cmdline.isset (" mm" ))
75
- options.set_option (" mm" , cmdline.get_value (" mm" ));
76
-
77
71
// all checks supported by goto_check
78
72
PARSE_OPTIONS_GOTO_CHECK_JAVA (cmdline, options);
79
73
80
- if (cmdline.isset (" debug-level" ))
81
- options.set_option (" debug-level" , cmdline.get_value (" debug-level" ));
82
-
83
- if (cmdline.isset (" unwindset" ))
84
- options.set_option (" unwindset" , cmdline.get_value (" unwindset" ));
85
-
86
- // constant propagation
87
- if (cmdline.isset (" no-propagation" ))
88
- options.set_option (" propagation" , false );
89
- else
90
- options.set_option (" propagation" , true );
91
-
92
- // check array bounds
93
- if (cmdline.isset (" bounds-check" ))
94
- options.set_option (" bounds-check" , true );
95
- else
96
- options.set_option (" bounds-check" , false );
97
-
98
- // check division by zero
99
- if (cmdline.isset (" div-by-zero-check" ))
100
- options.set_option (" div-by-zero-check" , true );
101
- else
102
- options.set_option (" div-by-zero-check" , false );
103
-
104
- // check overflow/underflow
105
- if (cmdline.isset (" signed-overflow-check" ))
106
- options.set_option (" signed-overflow-check" , true );
107
- else
108
- options.set_option (" signed-overflow-check" , false );
109
-
110
- // check overflow/underflow
111
- if (cmdline.isset (" unsigned-overflow-check" ))
112
- options.set_option (" unsigned-overflow-check" , true );
113
- else
114
- options.set_option (" unsigned-overflow-check" , false );
115
-
116
- // check overflow/underflow
117
- if (cmdline.isset (" float-overflow-check" ))
118
- options.set_option (" float-overflow-check" , true );
119
- else
120
- options.set_option (" float-overflow-check" , false );
121
-
122
- // check for NaN (not a number)
123
- if (cmdline.isset (" nan-check" ))
124
- options.set_option (" nan-check" , true );
125
- else
126
- options.set_option (" nan-check" , false );
127
-
128
- // check pointers
129
- if (cmdline.isset (" pointer-check" ))
130
- options.set_option (" pointer-check" , true );
131
- else
132
- options.set_option (" pointer-check" , false );
133
-
134
- // check for memory leaks
135
- if (cmdline.isset (" memory-leak-check" ))
136
- options.set_option (" memory-leak-check" , true );
137
- else
138
- options.set_option (" memory-leak-check" , false );
139
-
140
- // check assertions
141
- if (cmdline.isset (" no-assertions" ))
142
- options.set_option (" assertions" , false );
143
- else
144
- options.set_option (" assertions" , true );
145
-
146
- // use assumptions
147
- if (cmdline.isset (" no-assumptions" ))
148
- options.set_option (" assumptions" , false );
149
- else
150
- options.set_option (" assumptions" , true );
151
-
152
- // magic error label
153
- if (cmdline.isset (" error-label" ))
154
- options.set_option (" error-label" , cmdline.get_values (" error-label" ));
155
-
156
74
options.set_option (" show-properties" , cmdline.isset (" show-properties" ));
157
75
}
158
76
@@ -247,73 +165,64 @@ bool jdiff_parse_optionst::process_goto_program(
247
165
const optionst &options,
248
166
goto_modelt &goto_model)
249
167
{
250
- {
251
- // remove function pointers
252
- log .status () << " Removing function pointers and virtual functions"
253
- << messaget::eom;
254
- remove_function_pointers (
255
- ui_message_handler, goto_model, cmdline.isset (" pointer-check" ));
168
+ // remove function pointers
169
+ log .status () << " Removing function pointers and virtual functions"
170
+ << messaget::eom;
171
+ remove_function_pointers (
172
+ ui_message_handler, goto_model, cmdline.isset (" pointer-check" ));
256
173
257
- // Java virtual functions -> explicit dispatch tables:
258
- remove_virtual_functions (goto_model);
174
+ // Java virtual functions -> explicit dispatch tables:
175
+ remove_virtual_functions (goto_model);
259
176
260
- // remove Java throw and catch
261
- // This introduces instanceof, so order is important:
262
- remove_exceptions_using_instanceof (goto_model, ui_message_handler);
177
+ // remove Java throw and catch
178
+ // This introduces instanceof, so order is important:
179
+ remove_exceptions_using_instanceof (goto_model, ui_message_handler);
263
180
264
- // Java instanceof -> clsid comparison:
265
- class_hierarchyt class_hierarchy (goto_model.symbol_table );
266
- remove_instanceof (goto_model, class_hierarchy, ui_message_handler);
181
+ // Java instanceof -> clsid comparison:
182
+ class_hierarchyt class_hierarchy (goto_model.symbol_table );
183
+ remove_instanceof (goto_model, class_hierarchy, ui_message_handler);
267
184
268
- mm_io (goto_model);
185
+ mm_io (goto_model);
269
186
270
- // instrument library preconditions
271
- instrument_preconditions (goto_model);
187
+ // instrument library preconditions
188
+ instrument_preconditions (goto_model);
272
189
273
- // remove returns, gcc vectors, complex
274
- remove_returns (goto_model);
275
- remove_vector (goto_model);
276
- remove_complex (goto_model);
277
- rewrite_union (goto_model);
190
+ // remove returns
191
+ remove_returns (goto_model);
278
192
279
- // add generic checks
280
- log .status () << " Generic Property Instrumentation" << messaget::eom;
281
- goto_check_java (options, goto_model, ui_message_handler);
193
+ // add generic checks
194
+ log .status () << " Generic Property Instrumentation" << messaget::eom;
195
+ goto_check_java (options, goto_model, ui_message_handler);
282
196
283
- // checks don't know about adjusted float expressions
284
- adjust_float_expressions (goto_model);
197
+ // checks don't know about adjusted float expressions
198
+ adjust_float_expressions (goto_model);
285
199
286
- // recalculate numbers, etc.
287
- goto_model.goto_functions .update ();
200
+ // recalculate numbers, etc.
201
+ goto_model.goto_functions .update ();
288
202
289
- // add loop ids
290
- goto_model. goto_functions . compute_loop_numbers ();
291
-
292
- // remove skips such that trivial GOTOs are deleted and not considered
293
- // for coverage annotation:
203
+ // instrument cover goals
204
+ if (cmdline. isset ( " cover " ))
205
+ {
206
+ // remove skips such that trivial GOTOs are deleted and not considered for
207
+ // coverage annotation:
294
208
remove_skip (goto_model);
295
209
296
- // instrument cover goals
297
- if (cmdline.isset (" cover" ))
298
- {
299
- const auto cover_config =
300
- get_cover_config (options, goto_model.symbol_table , ui_message_handler);
301
- if (instrument_cover_goals (cover_config, goto_model, ui_message_handler))
302
- return true ;
303
- }
304
-
305
- // label the assertions
306
- // This must be done after adding assertions and
307
- // before using the argument of the "property" option.
308
- // Do not re-label after using the property slicer because
309
- // this would cause the property identifiers to change.
310
- label_properties (goto_model);
311
-
312
- // remove any skips introduced since coverage instrumentation
313
- remove_skip (goto_model);
314
- goto_model.goto_functions .update ();
210
+ const auto cover_config =
211
+ get_cover_config (options, goto_model.symbol_table , ui_message_handler);
212
+ if (instrument_cover_goals (cover_config, goto_model, ui_message_handler))
213
+ return true ;
315
214
}
316
215
216
+ // label the assertions
217
+ // This must be done after adding assertions and
218
+ // before using the argument of the "property" option.
219
+ // Do not re-label after using the property slicer because
220
+ // this would cause the property identifiers to change.
221
+ label_properties (goto_model);
222
+
223
+ // remove any skips introduced since coverage instrumentation
224
+ remove_skip (goto_model);
225
+
317
226
return false ;
318
227
}
319
228
@@ -335,7 +244,7 @@ void jdiff_parse_optionst::help()
335
244
" Diff options:\n "
336
245
HELP_SHOW_GOTO_FUNCTIONS
337
246
HELP_SHOW_PROPERTIES
338
- " --syntactic do syntactic diff (default) \n "
247
+ " --show-loops show the loops in the programs \n "
339
248
" -u | --unified output unified diff\n "
340
249
" --change-impact | \n "
341
250
" --forward-impact |\n "
0 commit comments