Skip to content

Commit 7371265

Browse files
committed
Call get_language_options from get_goto_model
This allows language frontends to consume command-line options, which were previously left uninitialised when using goto-analyzer or symex frontends.
1 parent fee04d6 commit 7371265

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int goto_analyzer_parse_optionst::doit()
216216

217217
goto_model.set_message_handler(get_message_handler());
218218

219-
if(goto_model(cmdline.args))
219+
if(goto_model(cmdline))
220220
return 6;
221221

222222
if(process_goto_program(options))

src/goto-programs/get_goto_model.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ Function: get_goto_modelt::operator()
3232
3333
\*******************************************************************/
3434

35-
bool get_goto_modelt::operator()(const std::vector<std::string> &files)
35+
bool get_goto_modelt::operator()(const cmdlinet &_cmdline)
3636
{
37+
const std::vector<std::string> &files=_cmdline.args;
3738
if(files.empty())
3839
{
3940
error() << "Please provide a program" << eom;
@@ -92,6 +93,7 @@ bool get_goto_modelt::operator()(const std::vector<std::string> &files)
9293

9394
languaget &language=*lf.language;
9495
language.set_message_handler(get_message_handler());
96+
language.get_language_options(_cmdline);
9597

9698
status() << "Parsing " << filename << eom;
9799

src/goto-programs/get_goto_model.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ Author: Daniel Kroening, [email protected]
1010
#define CPROVER_GOTO_PROGRAMS_GET_GOTO_MODEL_H
1111

1212
#include <util/message.h>
13+
#include <util/cmdline.h>
1314

1415
#include "goto_model.h"
1516

1617
class get_goto_modelt:public goto_modelt, public messaget
1718
{
1819
public:
19-
bool operator()(const std::vector<std::string> &);
20+
bool operator()(const cmdlinet &);
2021
};
2122

2223
#endif // CPROVER_GOTO_PROGRAMS_GET_GOTO_MODEL_H

src/symex/symex_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int symex_parse_optionst::doit()
178178

179179
goto_model.set_message_handler(get_message_handler());
180180

181-
if(goto_model(cmdline.args))
181+
if(goto_model(cmdline))
182182
return 6;
183183

184184
if(process_goto_program(options))

0 commit comments

Comments
 (0)