Skip to content

Commit 69c5c8f

Browse files
ViacheslavRbigcbot
authored andcommitted
Enabling LLVM FatalErrorHandler
Enabling LLVM FatalErrorHandler, in Release mode the handler throws runtime_error exception.
1 parent f922573 commit 69c5c8f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

IGC/AdaptorOCL/dllInterfaceCompute.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ bool TranslateBuildSPMD(
11791179
llvm::Module* pKernelModule = nullptr;
11801180
LLVMContextWrapper* llvmContext = new LLVMContextWrapper;
11811181
RegisterComputeErrHandlers(*llvmContext);
1182+
RegisterErrHandlers();
11821183

11831184
if (IGC_IS_FLAG_ENABLED(ShaderDumpEnable))
11841185
{

IGC/common/debug/Debug.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ namespace {
253253
exit(1);
254254
}
255255
#endif
256+
// Throw exception to return control to an application,
257+
// it can try to gracefully process the error
258+
throw std::runtime_error("LLVM Error: " + reasonStrWrapper);
256259
}
257260

258261
void ComputeFatalErrorHandler(const DiagnosticInfo &DI, void * /*Context*/) {

0 commit comments

Comments
 (0)