Skip to content

Commit 733f7b2

Browse files
Added is_success and is_error helpers
1 parent 5e7f3f7 commit 733f7b2

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/java_bytecode/ci_lazy_methods.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bool ci_lazy_methodst::operator()(
6262

6363
main_function_resultt main_function=
6464
get_main_symbol(symbol_table, main_class, get_message_handler(), true);
65-
if(main_function.status!=main_function_resultt::Success)
65+
if(!main_function.is_success())
6666
{
6767
// Failed, mark all functions in the given main class(es)
6868
// reachable.

src/java_bytecode/java_bytecode_language.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ bool java_bytecode_languaget::generate_support_functions(
248248
{
249249
main_function_resultt res=
250250
get_main_symbol(symbol_table, main_class, get_message_handler());
251-
if(res.status!=main_function_resultt::Success)
252-
return res.status==main_function_resultt::Error;
251+
if(!res.is_success())
252+
return res.is_error();
253253

254254
// generate the test harness in __CPROVER__start and a call the entry point
255255
return

src/java_bytecode/java_entry_point.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ bool java_entry_point(
462462
messaget message(message_handler);
463463
main_function_resultt res=
464464
get_main_symbol(symbol_table, main_class, message_handler);
465-
if(res.status!=main_function_resultt::Success)
465+
if(!res.is_success())
466466
return true;
467467
symbolt symbol=res.main_function;
468468

src/java_bytecode/java_entry_point.h

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ struct main_function_resultt
4040
: status(Success), main_function(main_function)
4141
{
4242
}
43+
44+
bool is_success() const { return status==Success; }
45+
bool is_error() const { return status==Error; }
4346
};
4447

4548
/// Figures out the entry point of the code to verify

0 commit comments

Comments
 (0)