@@ -131,6 +131,75 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
131
131
if(cmdline.isset("error-label"))
132
132
options.set_option("error-label", cmdline.get_values("error-label"));
133
133
#endif
134
+
135
+ // Select a specific analysis
136
+ if (cmdline.isset (" taint" ))
137
+ {
138
+ options.set_option (" taint" , true );
139
+ options.set_option (" specific-analysis" , true );
140
+ }
141
+ if (cmdline.isset (" unreachable-instructions" ))
142
+ {
143
+ options.set_option (" unreachable-instructions" , true );
144
+ options.set_option (" specific-analysis" , true );
145
+ }
146
+ if (cmdline.isset (" unreachable-functions" ))
147
+ {
148
+ options.set_option (" unreachable-functions" , true );
149
+ options.set_option (" specific-analysis" , true );
150
+ }
151
+ if (cmdline.isset (" reachable-functions" ))
152
+ {
153
+ options.set_option (" reachable-functions" , true );
154
+ options.set_option (" specific-analysis" , true );
155
+ }
156
+ if (cmdline.isset (" intervals" ))
157
+ {
158
+ options.set_option (" intervals" , true );
159
+ options.set_option (" specific-analysis" , true );
160
+ }
161
+ if (cmdline.isset (" show-intervals" ))
162
+ {
163
+ options.set_option (" show-intervals" , true );
164
+ options.set_option (" specific-analysis" , true );
165
+ }
166
+ if (cmdline.isset (" non-null" ))
167
+ {
168
+ options.set_option (" non-null" , true );
169
+ options.set_option (" specific-analysis" , true );
170
+ }
171
+ if (cmdline.isset (" show-local-may-alias" ))
172
+ {
173
+ options.set_option (" show-local-may-alias" , true );
174
+ options.set_option (" specific-analysis" , true );
175
+ }
176
+
177
+ // Output format choice
178
+ if (cmdline.isset (" text" ))
179
+ {
180
+ options.set_option (" text" , true );
181
+ options.set_option (" outfile" , cmdline.get_value (" text" ));
182
+ }
183
+ else if (cmdline.isset (" json" ))
184
+ {
185
+ options.set_option (" json" , true );
186
+ options.set_option (" outfile" , cmdline.get_value (" json" ));
187
+ }
188
+ else if (cmdline.isset (" xml" ))
189
+ {
190
+ options.set_option (" xml" , true );
191
+ options.set_option (" outfile" , cmdline.get_value (" xml" ));
192
+ }
193
+ else if (cmdline.isset (" dot" ))
194
+ {
195
+ options.set_option (" dot" , true );
196
+ options.set_option (" outfile" , cmdline.get_value (" dot" ));
197
+ }
198
+ else
199
+ {
200
+ options.set_option (" text" , true );
201
+ options.set_option (" outfile" , " -" );
202
+ }
134
203
}
135
204
136
205
// / invoke main modules
@@ -199,7 +268,7 @@ int goto_analyzer_parse_optionst::doit()
199
268
return 6 ;
200
269
}
201
270
202
- if (cmdline. isset (" taint" ))
271
+ if (options. get_bool_option (" taint" ))
203
272
{
204
273
std::string taint_file=cmdline.get_value (" taint" );
205
274
@@ -218,7 +287,7 @@ int goto_analyzer_parse_optionst::doit()
218
287
}
219
288
}
220
289
221
- if (cmdline. isset (" unreachable-instructions" ))
290
+ if (options. get_bool_option (" unreachable-instructions" ))
222
291
{
223
292
const std::string json_file=cmdline.get_value (" json" );
224
293
@@ -242,7 +311,7 @@ int goto_analyzer_parse_optionst::doit()
242
311
return 0 ;
243
312
}
244
313
245
- if (cmdline. isset (" unreachable-functions" ))
314
+ if (options. get_bool_option (" unreachable-functions" ))
246
315
{
247
316
const std::string json_file=cmdline.get_value (" json" );
248
317
@@ -266,7 +335,7 @@ int goto_analyzer_parse_optionst::doit()
266
335
return 0 ;
267
336
}
268
337
269
- if (cmdline. isset (" reachable-functions" ))
338
+ if (options. get_bool_option (" reachable-functions" ))
270
339
{
271
340
const std::string json_file=cmdline.get_value (" json" );
272
341
@@ -290,7 +359,7 @@ int goto_analyzer_parse_optionst::doit()
290
359
return 0 ;
291
360
}
292
361
293
- if (cmdline. isset (" show-local-may-alias" ))
362
+ if (options. get_bool_option (" show-local-may-alias" ))
294
363
{
295
364
namespacet ns (goto_model.symbol_table );
296
365
@@ -318,14 +387,14 @@ int goto_analyzer_parse_optionst::doit()
318
387
if (set_properties ())
319
388
return 7 ;
320
389
321
- if (cmdline. isset (" show-intervals" ))
390
+ if (options. get_bool_option (" show-intervals" ))
322
391
{
323
392
show_intervals (goto_model, std::cout);
324
393
return 0 ;
325
394
}
326
395
327
- if (cmdline. isset (" non-null" ) ||
328
- cmdline. isset (" intervals" ))
396
+ if (options. get_bool_option (" non-null" ) ||
397
+ options. get_bool_option (" intervals" ))
329
398
{
330
399
optionst options;
331
400
options.set_option (" json" , cmdline.get_value (" json" ));
0 commit comments