mesa/src/microsoft/compiler
Alyssa Rosenzweig b824ef83ab util/dynarray: infer type in append
Most of the time, we can infer the type to append in
util_dynarray_append using __typeof__, which is standardized in C23 and
support in Jesse's MSMSVCV. This patch drops the type argument most of
the time, making util_dynarray a little more ergonomic to use.

This is done in four steps.

First, rename util_dynarray_append -> util_dynarray_append_typed

    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_append(/util_dynarray_append_typed(/g' \{} \;"

Then, add a new append that infers the type. This is much more ergonomic
for what you want most of the time.

Next, use type-inferred append as much as possible, via Coccinelle
patch (plus manual fixup):

    @@
    expression dynarray, element;
    type type;
    @@

    -util_dynarray_append_typed(dynarray, type, element);
    +util_dynarray_append(dynarray, element);

Finally, hand fixup cases that Coccinelle missed or incorrectly
translated, of which there were several because we can't used the
untyped append with a literal (since the sizeof won't do what you want).

All four steps are squashed to produce a single patch changing every
util_dynarray_append call site in tree to either drop a type parameter
(if possible) or insert a _typed suffix (if we can't infer). As such,
the final patch is best reviewed by hand even though it was
tool-assisted.

No Long Linguine Meals were involved in the making of this patch.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38038>
2025-10-24 18:32:07 +00:00
..
dxcapi.h microsoft/compiler: Fixes dxcapi.h compiling warning with mingw64-clang 2025-08-13 11:32:27 +00:00
dxil_buffer.c
dxil_buffer.h
dxil_buffer_test.c
dxil_container.c microsoft/compiler: Fix PSV0 for validator 1.8 2025-06-18 16:49:36 +00:00
dxil_container.h microsoft/compiler: Fix PSV0 for validator 1.8 2025-06-18 16:49:36 +00:00
dxil_dump.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
dxil_dump.h
dxil_dump_decls.h
dxil_enums.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
dxil_enums.h
dxil_function.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
dxil_function.h
dxil_internal.h
dxil_module.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
dxil_module.h microsoft/compiler: Put holes in driver_location based on I/O variable sizes 2024-12-02 22:40:39 +00:00
dxil_nir.c microsoft/compiler: Respect write masks when lowering unaligned loads and stores 2025-10-10 19:53:15 +00:00
dxil_nir.h microsoft/compiler: Use lower_mem_access_bit_sizes for scratch/shared 2025-10-10 19:53:15 +00:00
dxil_nir_algebraic.py
dxil_nir_lower_int_cubemaps.c treewide: use nir_def_as_* 2025-08-01 15:34:24 +00:00
dxil_nir_lower_int_cubemaps.h
dxil_nir_lower_int_samplers.c treewide: use nir_def_as_* 2025-08-01 15:34:24 +00:00
dxil_nir_lower_int_samplers.h
dxil_nir_lower_vs_vertex_conversion.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
dxil_nir_tess.c microsoft/compiler: Use NIR_PASS instead of NIR_PASS_V 2025-07-25 08:55:14 -07:00
dxil_signature.c all: rename gl_shader_stage to mesa_shader_stage 2025-08-06 10:28:40 +08:00
dxil_signature.h microsoft/compiler: Fix PSV0 for validator 1.8 2025-06-18 16:49:36 +00:00
dxil_validator.cpp
dxil_validator.h
dxil_versions.h
meson.build
nir_to_dxil.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
nir_to_dxil.h microsoft/compiler: Separate 'advanced texture ops' from SM6.7 2025-06-23 23:10:15 +00:00