qir_dump_inst(inst);
fprintf(stderr, "\n");
}
- remove_from_list(&inst->link);
+ qir_remove_instruction(inst);
progress = true;
continue;
} else {
qir_dump_inst(inst);
fprintf(stderr, "\n");
}
- remove_from_list(&inst->link);
- free(inst);
+ qir_remove_instruction(inst);
progress = true;
continue;
}
return c;
}
+void
+qir_remove_instruction(struct qinst *qinst)
+{
+ remove_from_list(&qinst->link);
+ free(qinst->src);
+ free(qinst);
+}
+
void
qir_compile_destroy(struct vc4_compile *c)
{
+ while (!is_empty_list(&c->instructions)) {
+ struct qinst *qinst =
+ (struct qinst *)first_elem(&c->instructions);
+ qir_remove_instruction(qinst);
+ }
+
ralloc_free(c);
}
struct qreg b,
struct qreg c,
struct qreg d);
+void qir_remove_instruction(struct qinst *qinst);
void qir_emit(struct vc4_compile *c, struct qinst *inst);
struct qreg qir_get_temp(struct vc4_compile *c);
int qir_get_op_nsrc(enum qop qop);