bld_base = &ctx.soa.bld_base;
ctx.load_system_value = declare_system_value;
- if (!si_compile_tgsi_main(&ctx, shader))
- goto out;
+ if (!si_compile_tgsi_main(&ctx, shader)) {
+ si_llvm_dispose(&ctx);
+ return -1;
+ }
mod = bld_base->base.gallivm->module;
/* Compile to bytecode. */
r = si_compile_llvm(sscreen, &shader->binary, &shader->config, tm,
mod, debug, ctx.type, "TGSI shader");
+ si_llvm_dispose(&ctx);
if (r) {
fprintf(stderr, "LLVM failed to compile shader\n");
- goto out;
+ return r;
}
- si_llvm_dispose(&ctx);
-
/* Validate SGPR and VGPR usage for compute to detect compiler bugs.
* LLVM 3.9svn has this bug.
*/
shader->gs_copy_shader = CALLOC_STRUCT(si_shader);
shader->gs_copy_shader->selector = shader->selector;
ctx.shader = shader->gs_copy_shader;
- if ((r = si_generate_gs_copy_shader(sscreen, &ctx,
- shader, debug))) {
+ r = si_generate_gs_copy_shader(sscreen, &ctx,
+ shader, debug);
+ if (r) {
free(shader->gs_copy_shader);
shader->gs_copy_shader = NULL;
- goto out;
+ return r;
}
}
- r = 0;
-out:
- return r;
+ return 0;
}
/**