[Mesa-dev] [PATCH] radeon/llvm: Fix LLVM diagnostic error reporting

Aaron Watry awatry at gmail.com
Mon Jul 14 14:31:39 PDT 2014


Tested-by and Reviewed-by: Aaron Watry <awatry at gmail.com>

On Mon, Jul 14, 2014 at 3:51 PM, Tom Stellard <thomas.stellard at amd.com> wrote:
> We were trying to print the error message after disposing the
> message object.
> ---
>  src/gallium/drivers/radeon/radeon_llvm_emit.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c
> index 6a394b2..1b17dd4 100644
> --- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
> +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
> @@ -83,16 +83,13 @@ static LLVMTargetRef get_r600_target() {
>  #if HAVE_LLVM >= 0x0305
>
>  static void radeonDiagnosticHandler(LLVMDiagnosticInfoRef di, void *context) {
> -       unsigned int *diagnosticflag;
> -       char *diaginfo_message;
> -
> -       diaginfo_message = LLVMGetDiagInfoDescription(di);
> -       LLVMDisposeMessage(diaginfo_message);
> -
> -       diagnosticflag = (unsigned int *)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);
>         }
>  }
>
> --
> 1.8.1.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list