freedreno/ir3: use nir_shader_get_entrypoint() helper

Should also fix coverity warning: CID 1362454

Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
Rob Clark 2016-06-02 11:13:26 -04:00
parent df64cd6814
commit 374ad2e2bd

View file

@ -2188,16 +2188,7 @@ static void
emit_instructions(struct ir3_compile *ctx)
{
unsigned ninputs, noutputs;
nir_function_impl *fxn = NULL;
/* Find the main function: */
nir_foreach_function(function, ctx->s) {
compile_assert(ctx, strcmp(function->name, "main") == 0);
compile_assert(ctx, function->impl);
fxn = function->impl;
break;
}
nir_function_impl *fxn = nir_shader_get_entrypoint(ctx->s)->impl;
ninputs = (max_drvloc(&ctx->s->inputs) + 1) * 4;
noutputs = (max_drvloc(&ctx->s->outputs) + 1) * 4;