microsoft/clc: Add unreachable() to fix 'may be unitialized' warning

In function ‘lower_load_kernel_input’,
      inlined from ‘clc_nir_lower_kernel_input_loads’ at ../src/microsoft/clc/clc_nir.c:205:28:
  ../src/microsoft/clc/clc_nir.c:169:7: warning: ‘base_type’ may be used uninitialized [-Wmaybe-uninitialized]
    169 |       glsl_vector_type(base_type, nir_dest_num_components(intr->dest));
        |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../src/microsoft/clc/clc_nir.c: In function ‘clc_nir_lower_kernel_input_loads’:
  ../src/microsoft/clc/clc_nir.c:151:24: note: ‘base_type’ was declared here
    151 |    enum glsl_base_type base_type;
        |                        ^~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23666>
This commit is contained in:
Caio Oliveira
2023-06-14 23:17:36 -07:00
committed by Marge Bot
parent 6007dcbb33
commit 44ed3e7341
+4 -2
View File
@@ -157,12 +157,14 @@ lower_load_kernel_input(nir_builder *b, nir_intrinsic_instr *intr,
case 32:
base_type = GLSL_TYPE_UINT;
break;
case 16:
case 16:
base_type = GLSL_TYPE_UINT16;
break;
case 8:
case 8:
base_type = GLSL_TYPE_UINT8;
break;
default:
unreachable("invalid bit size");
}
const struct glsl_type *type =