compiler: Generate files with newline at end

These generator scripts use the `write` function that, unlike `print`,
doesn't print a trailing newline. So let's add one to the template.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35697>
This commit is contained in:
Matt Turner 2025-06-23 18:38:33 -04:00 committed by Marge Bot
parent 2ce201707e
commit 6100dbc3d0
3 changed files with 6 additions and 3 deletions

View file

@ -21,7 +21,8 @@ template = """\
extern const struct glsl_type glsl_type_builtin_${t["name"]};
%endfor
#endif /* _BUILTIN_TYPES_ */"""
#endif /* _BUILTIN_TYPES_ */
"""
if len(sys.argv) < 2:
print('Missing output argument', file=sys.stderr)

View file

@ -45,7 +45,8 @@ typedef enum {
extern const char *nir_intrinsic_index_names[NIR_INTRINSIC_NUM_INDEX_FLAGS];
#endif /* _NIR_INTRINSICS_ */"""
#endif /* _NIR_INTRINSICS_ */
"""
from nir_intrinsics import INTR_OPCODES, INTR_INDICES
from mako.template import Template

View file

@ -69,7 +69,8 @@ nir_intrinsic_has_${name}(const nir_intrinsic_instr *instr)
}
% endfor
#endif /* _NIR_INTRINSICS_INDICES_ */"""
#endif /* _NIR_INTRINSICS_INDICES_ */
"""
from nir_intrinsics import INTR_INDICES
from mako.template import Template