@@ -19,7 +19,6 @@ Author: Peter Schrammel
1919#include < util/config.h>
2020#include < util/exit_codes.h>
2121#include < util/make_unique.h>
22- #include < util/options.h>
2322#include < util/version.h>
2423
2524#include < langapi/language.h>
@@ -79,7 +78,7 @@ ::goto_diff_parse_optionst::goto_diff_parse_optionst(
7978{
8079}
8180
82- void goto_diff_parse_optionst::get_command_line_options (optionst &options )
81+ void goto_diff_parse_optionst::get_command_line_options ()
8382{
8483 if (config.set (cmdline))
8584 {
@@ -88,16 +87,16 @@ void goto_diff_parse_optionst::get_command_line_options(optionst &options)
8887 }
8988
9089 if (cmdline.isset (" program-only" ))
91- options. set_option (" program-only" , true );
90+ options-> set_option (" program-only" , true );
9291
9392 if (cmdline.isset (" show-vcc" ))
94- options. set_option (" show-vcc" , true );
93+ options-> set_option (" show-vcc" , true );
9594
9695 if (cmdline.isset (" cover" ))
97- parse_cover_options (cmdline, options);
96+ parse_cover_options (cmdline, * options);
9897
9998 if (cmdline.isset (" mm" ))
100- options. set_option (" mm" , cmdline.get_value (" mm" ));
99+ options-> set_option (" mm" , cmdline.get_value (" mm" ));
101100
102101 if (cmdline.isset (" c89" ))
103102 config.ansi_c .set_c89 ();
@@ -118,107 +117,107 @@ void goto_diff_parse_optionst::get_command_line_options(optionst &options)
118117 config.cpp .set_cpp11 ();
119118
120119 // all checks supported by goto_check
121- PARSE_OPTIONS_GOTO_CHECK (cmdline, options);
120+ PARSE_OPTIONS_GOTO_CHECK (cmdline, (* options) );
122121
123122 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" ));
125124
126125 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" ));
128127
129128 if (cmdline.isset (" unwindset" ))
130- options. set_option (" unwindset" , cmdline.get_value (" unwindset" ));
129+ options-> set_option (" unwindset" , cmdline.get_value (" unwindset" ));
131130
132131 // constant propagation
133132 if (cmdline.isset (" no-propagation" ))
134- options. set_option (" propagation" , false );
133+ options-> set_option (" propagation" , false );
135134 else
136- options. set_option (" propagation" , true );
135+ options-> set_option (" propagation" , true );
137136
138137 // check array bounds
139138 if (cmdline.isset (" bounds-check" ))
140- options. set_option (" bounds-check" , true );
139+ options-> set_option (" bounds-check" , true );
141140 else
142- options. set_option (" bounds-check" , false );
141+ options-> set_option (" bounds-check" , false );
143142
144143 // check division by zero
145144 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 );
147146 else
148- options. set_option (" div-by-zero-check" , false );
147+ options-> set_option (" div-by-zero-check" , false );
149148
150149 // check overflow/underflow
151150 if (cmdline.isset (" signed-overflow-check" ))
152- options. set_option (" signed-overflow-check" , true );
151+ options-> set_option (" signed-overflow-check" , true );
153152 else
154- options. set_option (" signed-overflow-check" , false );
153+ options-> set_option (" signed-overflow-check" , false );
155154
156155 // check overflow/underflow
157156 if (cmdline.isset (" unsigned-overflow-check" ))
158- options. set_option (" unsigned-overflow-check" , true );
157+ options-> set_option (" unsigned-overflow-check" , true );
159158 else
160- options. set_option (" unsigned-overflow-check" , false );
159+ options-> set_option (" unsigned-overflow-check" , false );
161160
162161 // check overflow/underflow
163162 if (cmdline.isset (" float-overflow-check" ))
164- options. set_option (" float-overflow-check" , true );
163+ options-> set_option (" float-overflow-check" , true );
165164 else
166- options. set_option (" float-overflow-check" , false );
165+ options-> set_option (" float-overflow-check" , false );
167166
168167 // check for NaN (not a number)
169168 if (cmdline.isset (" nan-check" ))
170- options. set_option (" nan-check" , true );
169+ options-> set_option (" nan-check" , true );
171170 else
172- options. set_option (" nan-check" , false );
171+ options-> set_option (" nan-check" , false );
173172
174173 // check pointers
175174 if (cmdline.isset (" pointer-check" ))
176- options. set_option (" pointer-check" , true );
175+ options-> set_option (" pointer-check" , true );
177176 else
178- options. set_option (" pointer-check" , false );
177+ options-> set_option (" pointer-check" , false );
179178
180179 // check for memory leaks
181180 if (cmdline.isset (" memory-leak-check" ))
182- options. set_option (" memory-leak-check" , true );
181+ options-> set_option (" memory-leak-check" , true );
183182 else
184- options. set_option (" memory-leak-check" , false );
183+ options-> set_option (" memory-leak-check" , false );
185184
186185 // check assertions
187186 if (cmdline.isset (" no-assertions" ))
188- options. set_option (" assertions" , false );
187+ options-> set_option (" assertions" , false );
189188 else
190- options. set_option (" assertions" , true );
189+ options-> set_option (" assertions" , true );
191190
192191 // use assumptions
193192 if (cmdline.isset (" no-assumptions" ))
194- options. set_option (" assumptions" , false );
193+ options-> set_option (" assumptions" , false );
195194 else
196- options. set_option (" assumptions" , true );
195+ options-> set_option (" assumptions" , true );
197196
198197 // magic error label
199198 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" ));
201200
202201 // generate unwinding assertions
203202 if (cmdline.isset (" cover" ))
204- options. set_option (" unwinding-assertions" , false );
203+ options-> set_option (" unwinding-assertions" , false );
205204 else
206- options.set_option (
207- " unwinding-assertions" ,
208- cmdline.isset (" unwinding-assertions" ));
205+ options->set_option (
206+ " unwinding-assertions" , cmdline.isset (" unwinding-assertions" ));
209207
210208 // generate unwinding assumptions otherwise
211- options. set_option (" partial-loops" , cmdline.isset (" partial-loops" ));
209+ options-> set_option (" partial-loops" , cmdline.isset (" partial-loops" ));
212210
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" ))
215214 {
216215 error () << " --partial-loops and --unwinding-assertions"
217216 << " must not be given together" << eom;
218217 exit (1 );
219218 }
220219
221- options. set_option (" show-properties" , cmdline.isset (" show-properties" ));
220+ options-> set_option (" show-properties" , cmdline.isset (" show-properties" ));
222221}
223222
224223// / invoke main modules
@@ -234,8 +233,7 @@ int goto_diff_parse_optionst::doit()
234233 // command line options
235234 //
236235
237- optionst options;
238- get_command_line_options (options);
236+ get_command_line_options ();
239237 eval_verbosity (
240238 cmdline.get_value (" verbosity" ), messaget::M_STATISTICS, ui_message_handler);
241239
@@ -254,12 +252,10 @@ int goto_diff_parse_optionst::doit()
254252
255253 goto_modelt goto_model1, goto_model2;
256254
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);
259256 if (get_goto_program_ret!=-1 )
260257 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);
263259 if (get_goto_program_ret!=-1 )
264260 return get_goto_program_ret;
265261
@@ -316,15 +312,14 @@ int goto_diff_parse_optionst::doit()
316312 return CPROVER_EXIT_SUCCESS;
317313 }
318314
319- syntactic_difft sd (goto_model1, goto_model2, options, ui_message_handler);
315+ syntactic_difft sd (goto_model1, goto_model2, * options, ui_message_handler);
320316 sd ();
321317 sd.output_functions ();
322318
323319 return CPROVER_EXIT_SUCCESS;
324320}
325321
326322int goto_diff_parse_optionst::get_goto_program (
327- const optionst &options,
328323 goto_diff_languagest &languages,
329324 goto_modelt &goto_model)
330325{
@@ -371,7 +366,7 @@ int goto_diff_parse_optionst::get_goto_program(
371366 goto_model.goto_functions ,
372367 ui_message_handler);
373368
374- if (process_goto_program (options, goto_model))
369+ if (process_goto_program (goto_model))
375370 return CPROVER_EXIT_INTERNAL_ERROR;
376371
377372 // if we had a second argument then we will handle it next
@@ -382,9 +377,7 @@ int goto_diff_parse_optionst::get_goto_program(
382377 return -1 ; // no error, continue
383378}
384379
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)
388381{
389382 try
390383 {
@@ -417,7 +410,7 @@ bool goto_diff_parse_optionst::process_goto_program(
417410
418411 // add generic checks
419412 status () << " Generic Property Instrumentation" << eom;
420- goto_check (options, goto_model);
413+ goto_check (* options, goto_model);
421414
422415 // checks don't know about adjusted float expressions
423416 adjust_float_expressions (goto_model);
@@ -435,7 +428,7 @@ bool goto_diff_parse_optionst::process_goto_program(
435428 // for coverage annotation:
436429 remove_skip (goto_model);
437430
438- if (instrument_cover_goals (options, goto_model, get_message_handler ()))
431+ if (instrument_cover_goals (* options, goto_model, get_message_handler ()))
439432 return true ;
440433 }
441434
0 commit comments