Skip to content

Commit 2db3a82

Browse files
fixup! Make parse_options_baset the owner of message_handler
1 parent 13825ca commit 2db3a82

File tree

10 files changed

+14
-31
lines changed

10 files changed

+14
-31
lines changed

jbmc/src/janalyzer/janalyzer_parse_options.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ janalyzer_parse_optionst::janalyzer_parse_optionst(int argc, const char **argv)
6262
JANALYZER_OPTIONS,
6363
argc,
6464
argv,
65-
util_make_unique<ui_message_handlert>(
66-
cmdline,
67-
std::string("JANALYZER ") + CBMC_VERSION))
65+
std::string("JANALYZER ") + CBMC_VERSION)
6866
{
6967
}
7068

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ jbmc_parse_optionst::jbmc_parse_optionst(int argc, const char **argv)
8181
JBMC_OPTIONS,
8282
argc,
8383
argv,
84-
util_make_unique<ui_message_handlert>(
85-
cmdline,
86-
std::string("JBMC ") + CBMC_VERSION))
84+
std::string("JBMC ") + CBMC_VERSION)
8785
{
8886
}
8987

@@ -95,9 +93,7 @@ ::jbmc_parse_optionst::jbmc_parse_optionst(
9593
JBMC_OPTIONS + extra_options,
9694
argc,
9795
argv,
98-
util_make_unique<ui_message_handlert>(
99-
cmdline,
100-
std::string("JBMC ") + CBMC_VERSION))
96+
std::string("JBMC ") + CBMC_VERSION)
10197
{
10298
}
10399

jbmc/src/jdiff/jdiff_parse_options.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ jdiff_parse_optionst::jdiff_parse_optionst(int argc, const char **argv)
6666
JDIFF_OPTIONS,
6767
argc,
6868
argv,
69-
util_make_unique<ui_message_handlert>(
70-
cmdline,
71-
std::string("JDIFF ") + CBMC_VERSION))
69+
std::string("JDIFF ") + CBMC_VERSION)
7270
{
7371
}
7472

src/cbmc/cbmc_parse_options.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ cbmc_parse_optionst::cbmc_parse_optionst(int argc, const char **argv)
8787
CBMC_OPTIONS,
8888
argc,
8989
argv,
90-
util_make_unique<ui_message_handlert>(
91-
cmdline,
92-
std::string("CBMC ") + CBMC_VERSION)),
90+
std::string("CBMC ") + CBMC_VERSION),
9391
xml_interfacet(cmdline)
9492
{
9593
}
@@ -102,9 +100,7 @@ ::cbmc_parse_optionst::cbmc_parse_optionst(
102100
CBMC_OPTIONS + extra_options,
103101
argc,
104102
argv,
105-
util_make_unique<ui_message_handlert>(
106-
cmdline,
107-
std::string("CBMC ") + CBMC_VERSION)),
103+
std::string("CBMC ") + CBMC_VERSION),
108104
xml_interfacet(cmdline)
109105
{
110106
}

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ goto_analyzer_parse_optionst::goto_analyzer_parse_optionst(
7373
GOTO_ANALYSER_OPTIONS,
7474
argc,
7575
argv,
76-
util_make_unique<ui_message_handlert>(
77-
cmdline,
78-
std::string("GOTO-ANALYZER ") + CBMC_VERSION))
76+
std::string("GOTO-ANALYZER "))
7977
{
8078
}
8179

src/goto-diff/goto_diff_parse_options.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ goto_diff_parse_optionst::goto_diff_parse_optionst(int argc, const char **argv)
6868
GOTO_DIFF_OPTIONS,
6969
argc,
7070
argv,
71-
util_make_unique<ui_message_handlert>(
72-
cmdline,
73-
std::string("GOTO-DIFF ") + CBMC_VERSION))
71+
std::string("GOTO-DIFF ") + CBMC_VERSION)
7472
{
7573
}
7674

src/goto-harness/goto_harness_parse_options.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ goto_harness_parse_optionst::goto_harness_parse_optionst(
129129
: parse_options_baset{GOTO_HARNESS_OPTIONS,
130130
argc,
131131
argv,
132-
util_make_unique<ui_message_handlert>(
133-
cmdline,
134-
std::string("GOTO-HARNESS ") + CBMC_VERSION)}
132+
std::string("GOTO-HARNESS ") + CBMC_VERSION}
135133
{
136134
}
137135

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class goto_instrument_parse_optionst : public parse_options_baset
122122
GOTO_INSTRUMENT_OPTIONS,
123123
argc,
124124
argv,
125-
util_make_unique<ui_message_handlert>(cmdline, "goto-instrument")),
125+
"goto-instrument"),
126126
function_pointer_removal_done(false),
127127
partial_inlining_done(false),
128128
remove_returns_done(false)

src/util/parse_options.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ parse_options_baset::parse_options_baset(
2828
const std::string &_optstring,
2929
int argc,
3030
const char **argv,
31-
std::unique_ptr<ui_message_handlert> mh)
32-
: message_handler(std::move(mh)), log(*message_handler)
31+
const std::string &program)
3332
{
3433
std::string optstring=std::string("?h(help)")+_optstring;
3534
parse_result=cmdline.parse(argc, argv, optstring.c_str());
35+
message_handler = util_make_unique<ui_message_handlert>(cmdline, program);
36+
log = messaget{*message_handler};
3637
}
3738

3839
void parse_options_baset::help()

src/util/parse_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class parse_options_baset
2424
const std::string &optstring,
2525
int argc,
2626
const char **argv,
27-
std::unique_ptr<ui_message_handlert> mh);
27+
const std::string &program);
2828

2929
cmdlinet cmdline;
3030

0 commit comments

Comments
 (0)