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);
}
Esempio n. 2
0
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);
	}
}