Skip to content

Commit eb05f49

Browse files
author
Irwin D'Souza
committed
Use failCompilation instead of explicit throw
Update the code to use TR::Compilation::failCompilation instead of explicitly throwing an exception since the failCompilation method provides a debugging message that helps determine where an exception was thrown from. Signed-off-by: Irwin D'Souza <dsouzai@ca.ibm.com>
1 parent fa08921 commit eb05f49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/compile/OMRCompilation.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1162,10 +1162,10 @@ int32_t OMR::Compilation::compile()
11621162
// If that happened we want to fail the compilation at this point.
11631163
//
11641164
if (_methodSymbol->unimplementedOpcode())
1165-
throw TR::UnimplementedOpCode();
1165+
self()->failCompilation<TR::UnimplementedOpCode>("Unimplemented Op Code");
11661166

11671167
if (!_ilGenSuccess)
1168-
throw TR::ILGenFailure();
1168+
self()->failCompilation<TR::ILGenFailure>("IL Gen Failure");
11691169

11701170
#ifdef J9_PROJECT_SPECIFIC
11711171
if (self()->getOption(TR_TraceCG))

compiler/infra/Assert.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void assumeDontCallMeDirectlyImpl( const char * file, int32_t line, const
9393
// Fatal assertions fire always, however, non fatal assertions
9494
// can be disabled via TR_SoftFailOnAssume.
9595
if (comp && comp->getOption(TR_SoftFailOnAssume) && !fatal)
96-
throw TR::AssertionFailure();
96+
comp->failCompilation<TR::AssertionFailure>("Assertion Failure");
9797

9898
// Default is to always print to screen
9999
bool printOnscreen = true;

0 commit comments

Comments
 (0)