Commit c2bafae
authored
Treat version and operand_kinds as optional in generate_language_headers (KhronosGroup#6706)
Grammars such as NonSemantic.Graph.DebugInfo omit operand_kinds and
version. Match SPIRV-Headers optional-field handling so GN header
generation succeeds.
This should fix the CI error I'm seeing here:
KhronosGroup/glslang#4275
```
python3 ../../External/spirv-tools/utils/generate_language_headers.py --extinst-grammar ../../External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.nonsemantic.graph.debuginfo.grammar.json --extinst-output-path gen/External/spirv-tools/NonSemanticGraphDebugInfo.h
Traceback (most recent call last):
File "/tmpfs/src/github/glslang/out/Default-hlsl-false/../../External/spirv-tools/utils/generate_language_headers.py", line 185, in
main()
File "/tmpfs/src/github/glslang/out/Default-hlsl-false/../../External/spirv-tools/utils/generate_language_headers.py", line 176, in main
operand_kinds = grammar_json['operand_kinds'],
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'operand_kinds'
```
This change was mostly debugged/written using Cursor.1 parent 21c81e0 commit c2bafae
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
176 | | - | |
177 | | - | |
| 185 | + | |
| 186 | + | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
| |||
0 commit comments