static void radeonDiagnosticHandler(LLVMDiagnosticInfoRef di, void *context) { struct radeon_llvm_diagnostics *diag = (struct radeon_llvm_diagnostics *)context; LLVMDiagnosticSeverity severity = LLVMGetDiagInfoSeverity(di); char *description = LLVMGetDiagInfoDescription(di); const char *severity_str = NULL; switch (severity) { case LLVMDSError: severity_str = "error"; break; case LLVMDSWarning: severity_str = "warning"; break; case LLVMDSRemark: severity_str = "remark"; break; case LLVMDSNote: severity_str = "note"; break; default: severity_str = "unknown"; } pipe_debug_message(diag->debug, SHADER_INFO, "LLVM diagnostic (%s): %s", severity_str, description); if (severity == LLVMDSError) { diag->retval = 1; fprintf(stderr,"LLVM triggered Diagnostic Handler: %s\n", description); } LLVMDisposeMessage(description); }
static void radeonDiagnosticHandler(LLVMDiagnosticInfoRef di, void *context) { if (LLVMGetDiagInfoSeverity(di) == LLVMDSError) { unsigned int *diagnosticflag = (unsigned int *)context; char *diaginfo_message = LLVMGetDiagInfoDescription(di); *diagnosticflag = 1; fprintf(stderr,"LLVM triggered Diagnostic Handler: %s\n", diaginfo_message); LLVMDisposeMessage(diaginfo_message); } }
static void diagnosticHandler(LLVMDiagnosticInfoRef DI, void *C) { char *CErr = LLVMGetDiagInfoDescription(DI); fprintf(stderr, "Error with new bitcode parser: %s\n", CErr); LLVMDisposeMessage(CErr); exit(1); }