spirv: Add a prepass to set types on vtn_values

This autogenerated pass will automatically find and set the type field
on all vtn_values.  This way we always have the type and can use it for
validation and other checks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Jason Ekstrand
2017-12-05 22:31:02 -08:00
parent 2c84b49ddf
commit bb1e6ff161
6 changed files with 149 additions and 3 deletions

View File

@@ -72,6 +72,14 @@ spirv_info_c = custom_target(
command : [prog_python2, '@INPUT0@', '@INPUT1@', '@OUTPUT@'],
)
vtn_gather_types_c = custom_target(
'vtn_gather_types.c',
input : files('../spirv/vtn_gather_types_c.py',
'../spirv/spirv.core.grammar.json'),
output : 'vtn_gather_types.c',
command : [prog_python2, '@INPUT0@', '@INPUT1@', '@OUTPUT@'],
)
files_libnir = files(
'nir.c',
'nir.h',
@@ -189,7 +197,8 @@ files_libnir = files(
libnir = static_library(
'nir',
[files_libnir, spirv_info_c, nir_opt_algebraic_c, nir_opcodes_c,
nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h],
nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h,
vtn_gather_types_c],
include_directories : [inc_common, inc_compiler, include_directories('../spirv')],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
link_with : libcompiler,