@@ -19,7 +19,6 @@ Author: Peter Schrammel
19
19
#include < util/config.h>
20
20
#include < util/exit_codes.h>
21
21
#include < util/make_unique.h>
22
- #include < util/options.h>
23
22
#include < util/version.h>
24
23
25
24
#include < langapi/language.h>
@@ -79,7 +78,7 @@ ::goto_diff_parse_optionst::goto_diff_parse_optionst(
79
78
{
80
79
}
81
80
82
- void goto_diff_parse_optionst::get_command_line_options (optionst &options )
81
+ void goto_diff_parse_optionst::get_command_line_options ()
83
82
{
84
83
if (config.set (cmdline))
85
84
{
@@ -88,16 +87,16 @@ void goto_diff_parse_optionst::get_command_line_options(optionst &options)
88
87
}
89
88
90
89
if (cmdline.isset (" program-only" ))
91
- options. set_option (" program-only" , true );
90
+ options-> set_option (" program-only" , true );
92
91
93
92
if (cmdline.isset (" show-vcc" ))
94
- options. set_option (" show-vcc" , true );
93
+ options-> set_option (" show-vcc" , true );
95
94
96
95
if (cmdline.isset (" cover" ))
97
- parse_cover_options (cmdline, options);
96
+ parse_cover_options (cmdline, * options);
98
97
99
98
if (cmdline.isset (" mm" ))
100
- options. set_option (" mm" , cmdline.get_value (" mm" ));
99
+ options-> set_option (" mm" , cmdline.get_value (" mm" ));
101
100
102
101
if (cmdline.isset (" c89" ))
103
102
config.ansi_c .set_c89 ();
@@ -118,107 +117,107 @@ void goto_diff_parse_optionst::get_command_line_options(optionst &options)
118
117
config.cpp .set_cpp11 ();
119
118
120
119
// all checks supported by goto_check
121
- PARSE_OPTIONS_GOTO_CHECK (cmdline, options);
120
+ PARSE_OPTIONS_GOTO_CHECK (cmdline, (* options) );
122
121
123
122
if (cmdline.isset (" debug-level" ))
124
- options. set_option (" debug-level" , cmdline.get_value (" debug-level" ));
123
+ options-> set_option (" debug-level" , cmdline.get_value (" debug-level" ));
125
124
126
125
if (cmdline.isset (" slice-by-trace" ))
127
- options. set_option (" slice-by-trace" , cmdline.get_value (" slice-by-trace" ));
126
+ options-> set_option (" slice-by-trace" , cmdline.get_value (" slice-by-trace" ));
128
127
129
128
if (cmdline.isset (" unwindset" ))
130
- options. set_option (" unwindset" , cmdline.get_value (" unwindset" ));
129
+ options-> set_option (" unwindset" , cmdline.get_value (" unwindset" ));
131
130
132
131
// constant propagation
133
132
if (cmdline.isset (" no-propagation" ))
134
- options. set_option (" propagation" , false );
133
+ options-> set_option (" propagation" , false );
135
134
else
136
- options. set_option (" propagation" , true );
135
+ options-> set_option (" propagation" , true );
137
136
138
137
// check array bounds
139
138
if (cmdline.isset (" bounds-check" ))
140
- options. set_option (" bounds-check" , true );
139
+ options-> set_option (" bounds-check" , true );
141
140
else
142
- options. set_option (" bounds-check" , false );
141
+ options-> set_option (" bounds-check" , false );
143
142
144
143
// check division by zero
145
144
if (cmdline.isset (" div-by-zero-check" ))
146
- options. set_option (" div-by-zero-check" , true );
145
+ options-> set_option (" div-by-zero-check" , true );
147
146
else
148
- options. set_option (" div-by-zero-check" , false );
147
+ options-> set_option (" div-by-zero-check" , false );
149
148
150
149
// check overflow/underflow
151
150
if (cmdline.isset (" signed-overflow-check" ))
152
- options. set_option (" signed-overflow-check" , true );
151
+ options-> set_option (" signed-overflow-check" , true );
153
152
else
154
- options. set_option (" signed-overflow-check" , false );
153
+ options-> set_option (" signed-overflow-check" , false );
155
154
156
155
// check overflow/underflow
157
156
if (cmdline.isset (" unsigned-overflow-check" ))
158
- options. set_option (" unsigned-overflow-check" , true );
157
+ options-> set_option (" unsigned-overflow-check" , true );
159
158
else
160
- options. set_option (" unsigned-overflow-check" , false );
159
+ options-> set_option (" unsigned-overflow-check" , false );
161
160
162
161
// check overflow/underflow
163
162
if (cmdline.isset (" float-overflow-check" ))
164
- options. set_option (" float-overflow-check" , true );
163
+ options-> set_option (" float-overflow-check" , true );
165
164
else
166
- options. set_option (" float-overflow-check" , false );
165
+ options-> set_option (" float-overflow-check" , false );
167
166
168
167
// check for NaN (not a number)
169
168
if (cmdline.isset (" nan-check" ))
170
- options. set_option (" nan-check" , true );
169
+ options-> set_option (" nan-check" , true );
171
170
else
172
- options. set_option (" nan-check" , false );
171
+ options-> set_option (" nan-check" , false );
173
172
174
173
// check pointers
175
174
if (cmdline.isset (" pointer-check" ))
176
- options. set_option (" pointer-check" , true );
175
+ options-> set_option (" pointer-check" , true );
177
176
else
178
- options. set_option (" pointer-check" , false );
177
+ options-> set_option (" pointer-check" , false );
179
178
180
179
// check for memory leaks
181
180
if (cmdline.isset (" memory-leak-check" ))
182
- options. set_option (" memory-leak-check" , true );
181
+ options-> set_option (" memory-leak-check" , true );
183
182
else
184
- options. set_option (" memory-leak-check" , false );
183
+ options-> set_option (" memory-leak-check" , false );
185
184
186
185
// check assertions
187
186
if (cmdline.isset (" no-assertions" ))
188
- options. set_option (" assertions" , false );
187
+ options-> set_option (" assertions" , false );
189
188
else
190
- options. set_option (" assertions" , true );
189
+ options-> set_option (" assertions" , true );
191
190
192
191
// use assumptions
193
192
if (cmdline.isset (" no-assumptions" ))
194
- options. set_option (" assumptions" , false );
193
+ options-> set_option (" assumptions" , false );
195
194
else
196
- options. set_option (" assumptions" , true );
195
+ options-> set_option (" assumptions" , true );
197
196
198
197
// magic error label
199
198
if (cmdline.isset (" error-label" ))
200
- options. set_option (" error-label" , cmdline.get_values (" error-label" ));
199
+ options-> set_option (" error-label" , cmdline.get_values (" error-label" ));
201
200
202
201
// generate unwinding assertions
203
202
if (cmdline.isset (" cover" ))
204
- options. set_option (" unwinding-assertions" , false );
203
+ options-> set_option (" unwinding-assertions" , false );
205
204
else
206
- options.set_option (
207
- " unwinding-assertions" ,
208
- cmdline.isset (" unwinding-assertions" ));
205
+ options->set_option (
206
+ " unwinding-assertions" , cmdline.isset (" unwinding-assertions" ));
209
207
210
208
// generate unwinding assumptions otherwise
211
- options. set_option (" partial-loops" , cmdline.isset (" partial-loops" ));
209
+ options-> set_option (" partial-loops" , cmdline.isset (" partial-loops" ));
212
210
213
- if (options.get_bool_option (" partial-loops" ) &&
214
- options.get_bool_option (" unwinding-assertions" ))
211
+ if (
212
+ options->get_bool_option (" partial-loops" ) &&
213
+ options->get_bool_option (" unwinding-assertions" ))
215
214
{
216
215
error () << " --partial-loops and --unwinding-assertions"
217
216
<< " must not be given together" << eom;
218
217
exit (1 );
219
218
}
220
219
221
- options. set_option (" show-properties" , cmdline.isset (" show-properties" ));
220
+ options-> set_option (" show-properties" , cmdline.isset (" show-properties" ));
222
221
}
223
222
224
223
// / invoke main modules
@@ -234,8 +233,7 @@ int goto_diff_parse_optionst::doit()
234
233
// command line options
235
234
//
236
235
237
- optionst options;
238
- get_command_line_options (options);
236
+ get_command_line_options ();
239
237
eval_verbosity (
240
238
cmdline.get_value (" verbosity" ), messaget::M_STATISTICS, ui_message_handler);
241
239
@@ -254,12 +252,10 @@ int goto_diff_parse_optionst::doit()
254
252
255
253
goto_modelt goto_model1, goto_model2;
256
254
257
- int get_goto_program_ret=
258
- get_goto_program (options, *this , goto_model1);
255
+ int get_goto_program_ret = get_goto_program (*this , goto_model1);
259
256
if (get_goto_program_ret!=-1 )
260
257
return get_goto_program_ret;
261
- get_goto_program_ret=
262
- get_goto_program (options, languages2, goto_model2);
258
+ get_goto_program_ret = get_goto_program (languages2, goto_model2);
263
259
if (get_goto_program_ret!=-1 )
264
260
return get_goto_program_ret;
265
261
@@ -316,15 +312,14 @@ int goto_diff_parse_optionst::doit()
316
312
return CPROVER_EXIT_SUCCESS;
317
313
}
318
314
319
- syntactic_difft sd (goto_model1, goto_model2, options, ui_message_handler);
315
+ syntactic_difft sd (goto_model1, goto_model2, * options, ui_message_handler);
320
316
sd ();
321
317
sd.output_functions ();
322
318
323
319
return CPROVER_EXIT_SUCCESS;
324
320
}
325
321
326
322
int goto_diff_parse_optionst::get_goto_program (
327
- const optionst &options,
328
323
goto_diff_languagest &languages,
329
324
goto_modelt &goto_model)
330
325
{
@@ -371,7 +366,7 @@ int goto_diff_parse_optionst::get_goto_program(
371
366
goto_model.goto_functions ,
372
367
ui_message_handler);
373
368
374
- if (process_goto_program (options, goto_model))
369
+ if (process_goto_program (goto_model))
375
370
return CPROVER_EXIT_INTERNAL_ERROR;
376
371
377
372
// if we had a second argument then we will handle it next
@@ -382,9 +377,7 @@ int goto_diff_parse_optionst::get_goto_program(
382
377
return -1 ; // no error, continue
383
378
}
384
379
385
- bool goto_diff_parse_optionst::process_goto_program (
386
- const optionst &options,
387
- goto_modelt &goto_model)
380
+ bool goto_diff_parse_optionst::process_goto_program (goto_modelt &goto_model)
388
381
{
389
382
try
390
383
{
@@ -417,7 +410,7 @@ bool goto_diff_parse_optionst::process_goto_program(
417
410
418
411
// add generic checks
419
412
status () << " Generic Property Instrumentation" << eom;
420
- goto_check (options, goto_model);
413
+ goto_check (* options, goto_model);
421
414
422
415
// checks don't know about adjusted float expressions
423
416
adjust_float_expressions (goto_model);
@@ -435,7 +428,7 @@ bool goto_diff_parse_optionst::process_goto_program(
435
428
// for coverage annotation:
436
429
remove_skip (goto_model);
437
430
438
- if (instrument_cover_goals (options, goto_model, get_message_handler ()))
431
+ if (instrument_cover_goals (* options, goto_model, get_message_handler ()))
439
432
return true ;
440
433
}
441
434
0 commit comments