43
43
#include < analyses/local_may_alias.h>
44
44
#include < analyses/constant_propagator.h>
45
45
#include < analyses/dependence_graph.h>
46
+ #include < analyses/interval_domain.h>
46
47
47
48
#include < langapi/mode.h>
48
49
57
58
58
59
#include " taint_analysis.h"
59
60
#include " unreachable_instructions.h"
60
- #include " static_analyzer.h"
61
61
#include " static_show_domain.h"
62
62
#include " static_simplifier.h"
63
63
#include " static_verifier.h"
@@ -161,21 +161,6 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
161
161
options.set_option (" reachable-functions" , true );
162
162
options.set_option (" specific-analysis" , true );
163
163
}
164
- if (cmdline.isset (" intervals" ))
165
- {
166
- options.set_option (" intervals" , true );
167
- options.set_option (" specific-analysis" , true );
168
- }
169
- if (cmdline.isset (" show-intervals" ))
170
- {
171
- options.set_option (" show-intervals" , true );
172
- options.set_option (" specific-analysis" , true );
173
- }
174
- if (cmdline.isset (" non-null" ))
175
- {
176
- options.set_option (" non-null" , true );
177
- options.set_option (" specific-analysis" , true );
178
- }
179
164
if (cmdline.isset (" show-local-may-alias" ))
180
165
{
181
166
options.set_option (" show-local-may-alias" , true );
@@ -236,7 +221,28 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
236
221
" simplify-slicing" ,
237
222
!(cmdline.isset (" no-simplify-slicing" )));
238
223
}
239
-
224
+ else if (cmdline.isset (" show-intervals" ))
225
+ {
226
+ // For backwards compatibility
227
+ options.set_option (" show" , true );
228
+ options.set_option (" general-analysis" , true );
229
+ options.set_option (" intervals" , true );
230
+ options.set_option (" domain set" , true );
231
+ }
232
+ else if (cmdline.isset (" (show-non-null)" ))
233
+ {
234
+ // For backwards compatibility
235
+ options.set_option (" show" , true );
236
+ options.set_option (" general-analysis" , true );
237
+ options.set_option (" non-null" , true );
238
+ options.set_option (" domain set" , true );
239
+ }
240
+ else if (cmdline.isset (" intervals" ) || cmdline.isset (" non-null" ))
241
+ {
242
+ // For backwards compatibility either of these on their own means show
243
+ options.set_option (" show" , true );
244
+ options.set_option (" general-analysis" , true );
245
+ }
240
246
241
247
if (options.get_bool_option (" general-analysis" ))
242
248
{
@@ -263,6 +269,17 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
263
269
options.set_option (" dependence-graph" , true );
264
270
options.set_option (" domain set" , true );
265
271
}
272
+ else if (cmdline.isset (" intervals" ))
273
+ {
274
+ options.set_option (" intervals" , true );
275
+ options.set_option (" domain set" , true );
276
+ }
277
+ else if (cmdline.isset (" non-null" ))
278
+ {
279
+ options.set_option (" non-null" , true );
280
+ options.set_option (" domain set" , true );
281
+ }
282
+
266
283
267
284
if (!options.get_bool_option (" domain set" ))
268
285
{
@@ -291,6 +308,17 @@ ai_baset *goto_analyzer_parse_optionst::build_analyzer(const optionst &options)
291
308
{
292
309
domain=new dependence_grapht (namespacet (goto_model.symbol_table ));
293
310
}
311
+ else if (options.get_bool_option (" intervals" ))
312
+ {
313
+ domain=new ait<interval_domaint>();
314
+ }
315
+ #if 0
316
+ // Not actually implemented, despite the option...
317
+ else if(options.get_bool_option("non-null"))
318
+ {
319
+ domain=new ait<non_null_domaint>();
320
+ }
321
+ #endif
294
322
}
295
323
else if (options.get_bool_option (" concurrent" ))
296
324
{
@@ -304,6 +332,17 @@ ai_baset *goto_analyzer_parse_optionst::build_analyzer(const optionst &options)
304
332
{
305
333
domain=new dependence_grapht(namespacet(goto_model.symbol_table));
306
334
}
335
+ else if(options.get_bool_option("intervals"))
336
+ {
337
+ domain=new concurrency_aware_ait<interval_domaint>();
338
+ }
339
+ #if 0
340
+ // Not actually implemented, despite the option...
341
+ else if(options.get_bool_option("non-null"))
342
+ {
343
+ domain=new concurrency_aware_ait<non_null_domaint>();
344
+ }
345
+ #endif
307
346
#endif
308
347
}
309
348
@@ -529,23 +568,6 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
529
568
if (set_properties ())
530
569
return 7 ;
531
570
532
- if (options.get_bool_option (" show-intervals" ))
533
- {
534
- show_intervals (goto_model, std::cout);
535
- return 0 ;
536
- }
537
-
538
- if (options.get_bool_option (" non-null" ) ||
539
- options.get_bool_option (" intervals" ))
540
- {
541
- optionst options;
542
- options.set_option (" json" , cmdline.get_value (" json" ));
543
- options.set_option (" xml" , cmdline.get_value (" xml" ));
544
- bool result=
545
- static_analyzer (goto_model, options, get_message_handler ());
546
- return result?10 :0 ;
547
- }
548
-
549
571
if (options.get_bool_option (" general-analysis" ))
550
572
{
551
573
@@ -760,6 +782,8 @@ void goto_analyzer_parse_optionst::help()
760
782
" \n "
761
783
" Domain options:\n "
762
784
" --constants constant domain\n "
785
+ " --intervals interval domain\n "
786
+ " --non-null non-null domain\n "
763
787
" --dependence-graph data and control dependencies between instructions\n " // NOLINT(*)
764
788
" \n "
765
789
" Output options:\n "
@@ -777,8 +801,6 @@ void goto_analyzer_parse_optionst::help()
777
801
" --unreachable-functions list functions unreachable from the entry point\n "
778
802
// NOLINTNEXTLINE(whitespace/line_length)
779
803
" --reachable-functions list functions reachable from the entry point\n "
780
- " --intervals interval analysis\n "
781
- " --non-null non-null analysis\n "
782
804
" \n "
783
805
" C/C++ frontend options:\n "
784
806
" -I path set include path (C/C++)\n "
0 commit comments