amd/llvm: Fix warning due to asserted-only variable.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 8 Oct 2019 01:41:50 +0000 (03:41 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 8 Oct 2019 08:22:56 +0000 (10:22 +0200)
[212/893] Compiling C object 'src/amd/llvm/ce8261c@@amd_common_llvm@sta/ac_nir_to_llvm.c.o'.
../mesa/src/amd/llvm/ac_nir_to_llvm.c: In function ‘visit_image_atomic’:
../mesa/src/amd/llvm/ac_nir_to_llvm.c:2636:17: warning: unused variable ‘format’ [-Wunused-variable]
 2636 |    const GLenum format = nir_intrinsic_format(instr);
      |                 ^~~~~~

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/llvm/ac_nir_to_llvm.c

index bb99c736f78e7f9ee909fda34ae40f480681d98b..41b71cd63a5433852d4777037847a885954dcbda 100644 (file)
@@ -2633,7 +2633,7 @@ static LLVMValueRef visit_image_atomic(struct ac_nir_context *ctx,
                    instr->intrinsic == nir_intrinsic_bindless_image_atomic_umin ||
                    instr->intrinsic == nir_intrinsic_bindless_image_atomic_imax ||
                    instr->intrinsic == nir_intrinsic_bindless_image_atomic_umax) {
-                       const GLenum format = nir_intrinsic_format(instr);
+                       ASSERTED const GLenum format = nir_intrinsic_format(instr);
                        assert(format == GL_R32UI || format == GL_R32I);
                }
                dim = nir_intrinsic_image_dim(instr);