Skip to content

Commit 7ca5b57

Browse files
Remove unnecessary block scope
reduces indentation
1 parent 7cc920f commit 7ca5b57

File tree

1 file changed

+87
-91
lines changed

1 file changed

+87
-91
lines changed

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 87 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -541,122 +541,118 @@ int jbmc_parse_optionst::doit()
541541
if(get_goto_program_ret != -1)
542542
return get_goto_program_ret;
543543

544+
if(
545+
options.get_bool_option("program-only") ||
546+
options.get_bool_option("show-vcc") ||
547+
(options.get_bool_option("symex-driven-lazy-loading") &&
548+
(cmdline.isset("show-symbol-table") || cmdline.isset("list-symbols") ||
549+
cmdline.isset("show-goto-functions") ||
550+
cmdline.isset("list-goto-functions") ||
551+
cmdline.isset("show-properties") || cmdline.isset("show-loops"))))
544552
{
545-
if(
546-
options.get_bool_option("program-only") ||
547-
options.get_bool_option("show-vcc") ||
548-
(options.get_bool_option("symex-driven-lazy-loading") &&
549-
(cmdline.isset("show-symbol-table") || cmdline.isset("list-symbols") ||
550-
cmdline.isset("show-goto-functions") ||
551-
cmdline.isset("list-goto-functions") ||
552-
cmdline.isset("show-properties") || cmdline.isset("show-loops"))))
553+
if(options.get_bool_option("paths"))
553554
{
554-
if(options.get_bool_option("paths"))
555-
{
556-
all_properties_verifiert<java_single_path_symex_only_checkert> verifier(
557-
options, ui_message_handler, *goto_model_ptr);
558-
(void)verifier();
559-
}
560-
else
561-
{
562-
all_properties_verifiert<java_multi_path_symex_only_checkert> verifier(
563-
options, ui_message_handler, *goto_model_ptr);
564-
(void)verifier();
565-
}
566-
567-
if(options.get_bool_option("symex-driven-lazy-loading"))
568-
{
569-
// We can only output these after goto-symex has run.
570-
(void)show_loaded_symbols(*goto_model_ptr);
571-
(void)show_loaded_functions(*goto_model_ptr);
572-
}
573-
574-
return CPROVER_EXIT_SUCCESS;
555+
all_properties_verifiert<java_single_path_symex_only_checkert> verifier(
556+
options, ui_message_handler, *goto_model_ptr);
557+
(void)verifier();
575558
}
576-
577-
if(
578-
options.get_bool_option("dimacs") ||
579-
!options.get_option("outfile").empty())
559+
else
580560
{
581-
if(options.get_bool_option("paths"))
582-
{
583-
stop_on_fail_verifiert<java_single_path_symex_checkert> verifier(
584-
options, ui_message_handler, *goto_model_ptr);
585-
(void)verifier();
586-
}
587-
else
588-
{
589-
stop_on_fail_verifiert<java_multi_path_symex_checkert> verifier(
590-
options, ui_message_handler, *goto_model_ptr);
591-
(void)verifier();
592-
}
561+
all_properties_verifiert<java_multi_path_symex_only_checkert> verifier(
562+
options, ui_message_handler, *goto_model_ptr);
563+
(void)verifier();
564+
}
593565

594-
return CPROVER_EXIT_SUCCESS;
566+
if(options.get_bool_option("symex-driven-lazy-loading"))
567+
{
568+
// We can only output these after goto-symex has run.
569+
(void)show_loaded_symbols(*goto_model_ptr);
570+
(void)show_loaded_functions(*goto_model_ptr);
595571
}
596572

597-
std::unique_ptr<goto_verifiert> verifier = nullptr;
573+
return CPROVER_EXIT_SUCCESS;
574+
}
598575

599-
if(
600-
options.get_bool_option("stop-on-fail") &&
601-
options.get_bool_option("paths"))
576+
if(
577+
options.get_bool_option("dimacs") || !options.get_option("outfile").empty())
578+
{
579+
if(options.get_bool_option("paths"))
602580
{
603-
verifier = util_make_unique<
604-
stop_on_fail_verifiert<java_single_path_symex_checkert>>(
581+
stop_on_fail_verifiert<java_single_path_symex_checkert> verifier(
605582
options, ui_message_handler, *goto_model_ptr);
583+
(void)verifier();
606584
}
607-
else if(
608-
options.get_bool_option("stop-on-fail") &&
609-
!options.get_bool_option("paths"))
585+
else
610586
{
611-
if(options.get_bool_option("localize-faults"))
612-
{
613-
verifier =
614-
util_make_unique<stop_on_fail_verifier_with_fault_localizationt<
615-
java_multi_path_symex_checkert>>(
616-
options, ui_message_handler, *goto_model_ptr);
617-
}
618-
else
619-
{
620-
verifier = util_make_unique<
621-
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
587+
stop_on_fail_verifiert<java_multi_path_symex_checkert> verifier(
588+
options, ui_message_handler, *goto_model_ptr);
589+
(void)verifier();
590+
}
591+
592+
return CPROVER_EXIT_SUCCESS;
593+
}
594+
595+
std::unique_ptr<goto_verifiert> verifier = nullptr;
596+
597+
if(
598+
options.get_bool_option("stop-on-fail") && options.get_bool_option("paths"))
599+
{
600+
verifier =
601+
util_make_unique<stop_on_fail_verifiert<java_single_path_symex_checkert>>(
602+
options, ui_message_handler, *goto_model_ptr);
603+
}
604+
else if(
605+
options.get_bool_option("stop-on-fail") &&
606+
!options.get_bool_option("paths"))
607+
{
608+
if(options.get_bool_option("localize-faults"))
609+
{
610+
verifier =
611+
util_make_unique<stop_on_fail_verifier_with_fault_localizationt<
612+
java_multi_path_symex_checkert>>(
622613
options, ui_message_handler, *goto_model_ptr);
623-
}
624614
}
625-
else if(
626-
!options.get_bool_option("stop-on-fail") &&
627-
options.get_bool_option("paths"))
615+
else
628616
{
629-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
630-
java_single_path_symex_checkert>>(
617+
verifier = util_make_unique<
618+
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
631619
options, ui_message_handler, *goto_model_ptr);
632620
}
633-
else if(
634-
!options.get_bool_option("stop-on-fail") &&
635-
!options.get_bool_option("paths"))
621+
}
622+
else if(
623+
!options.get_bool_option("stop-on-fail") &&
624+
options.get_bool_option("paths"))
625+
{
626+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
627+
java_single_path_symex_checkert>>(
628+
options, ui_message_handler, *goto_model_ptr);
629+
}
630+
else if(
631+
!options.get_bool_option("stop-on-fail") &&
632+
!options.get_bool_option("paths"))
633+
{
634+
if(options.get_bool_option("localize-faults"))
636635
{
637-
if(options.get_bool_option("localize-faults"))
638-
{
639-
verifier =
640-
util_make_unique<all_properties_verifier_with_fault_localizationt<
641-
java_multi_path_symex_checkert>>(
642-
options, ui_message_handler, *goto_model_ptr);
643-
}
644-
else
645-
{
646-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
636+
verifier =
637+
util_make_unique<all_properties_verifier_with_fault_localizationt<
647638
java_multi_path_symex_checkert>>(
648639
options, ui_message_handler, *goto_model_ptr);
649-
}
650640
}
651641
else
652642
{
653-
UNREACHABLE;
643+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
644+
java_multi_path_symex_checkert>>(
645+
options, ui_message_handler, *goto_model_ptr);
654646
}
655-
656-
const resultt result = (*verifier)();
657-
verifier->report();
658-
return result_to_exit_code(result);
659647
}
648+
else
649+
{
650+
UNREACHABLE;
651+
}
652+
653+
const resultt result = (*verifier)();
654+
verifier->report();
655+
return result_to_exit_code(result);
660656
}
661657

662658
int jbmc_parse_optionst::get_goto_program(

0 commit comments

Comments
 (0)