@@ -39,7 +39,7 @@ class taint_analysist
3939 const symbol_tablet &,
4040 goto_functionst &,
4141 bool show_full,
42- const std::string &json_file_name);
42+ const optionalt< std::string> &json_file_name);
4343
4444protected:
4545 messaget log;
@@ -224,12 +224,12 @@ bool taint_analysist::operator()(
224224 const symbol_tablet &symbol_table,
225225 goto_functionst &goto_functions,
226226 bool show_full,
227- const std::string &json_file_name)
227+ const optionalt< std::string> &json_file_name)
228228{
229229 try
230230 {
231231 json_arrayt json_result;
232- bool use_json=! json_file_name.empty ();
232+ bool use_json = json_file_name.has_value ();
233233
234234 log.status () << " Reading taint file `" << taint_file_name << " '"
235235 << messaget::eom;
@@ -378,17 +378,17 @@ bool taint_analysist::operator()(
378378
379379 if (use_json)
380380 {
381- std::ofstream json_out (json_file_name);
381+ std::ofstream json_out (json_file_name. value () );
382382
383383 if (!json_out)
384384 {
385- log.error () << " Failed to open json output `" << json_file_name << " ' "
386- << messaget::eom;
385+ log.error () << " Failed to open json output `" << json_file_name. value ()
386+ << " ' " << messaget::eom;
387387 return true ;
388388 }
389389
390- log.status () << " Analysis result is written to `" << json_file_name << " ' "
391- << messaget::eom;
390+ log.status () << " Analysis result is written to `"
391+ << json_file_name. value () << " ' " << messaget::eom;
392392
393393 json_out << json_result << ' \n ' ;
394394 }
@@ -418,7 +418,7 @@ bool taint_analysis(
418418 const std::string &taint_file_name,
419419 message_handlert &message_handler,
420420 bool show_full,
421- const std::string &json_file_name)
421+ const optionalt< std::string> &json_file_name)
422422{
423423 taint_analysist taint_analysis (message_handler);
424424 return taint_analysis (
0 commit comments