@@ -148,32 +148,33 @@ end
148
148
cmd = ` $(cmd) --spirv-max-version=$(job. config. target. version. major) .$(job. config. target. version. minor) `
149
149
end
150
150
end
151
- proc = run (ignorestatus (cmd))
152
- if ! success (proc)
151
+ try
152
+ run (cmd)
153
+ catch e
153
154
error (""" Failed to translate LLVM code to SPIR-V.
154
155
If you think this is a bug, please file an issue and attach $(input) .""" )
155
156
end
156
157
157
158
# validate
158
159
if job. config. target. validate
159
- cmd = ` $(SPIRV_Tools_jll. spirv_val ()) $translated `
160
- proc = run (ignorestatus (cmd))
161
- if ! success (proc)
162
- run (` $(SPIRV_Tools_jll. spirv_dis ()) $translated -o -` )
160
+ try
161
+ run (` $(SPIRV_Tools_jll. spirv_val ()) $translated ` )
162
+ catch e
163
163
error (""" Failed to validate generated SPIR-V.
164
164
If you think this is a bug, please file an issue and attach $(input) and $(translated) .""" )
165
- end
165
+ end
166
166
end
167
167
168
168
# optimize
169
169
optimized = tempname (cleanup= false ) * " .spv"
170
170
if job. config. target. optimize
171
- cmd = ` $(SPIRV_Tools_jll. spirv_opt ()) -O --skip-validation $translated -o $optimized `
172
- proc = run (ignorestatus (cmd))
173
- if ! success (proc)
174
- error (""" Failed to optimize generated SPIR-V.
175
- If you think this is a bug, please file an issue and attach $(input) and $(translated) .""" )
176
- end
171
+ try
172
+ run (``` $(SPIRV_Tools_jll. spirv_opt ()) -O --skip-validation
173
+ $translated -o $optimized ``` )
174
+ catch
175
+ error (""" Failed to optimize generated SPIR-V.
176
+ If you think this is a bug, please file an issue and attach $(input) and $(translated) .""" )
177
+ end
177
178
else
178
179
cp (translated, optimized)
179
180
end
0 commit comments