It's nice to have this present in your default cases so you can see what
instruction is triggering an abort.
v2: Just pass a NULL state, now that it won't crash when you do.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
void nir_index_blocks(nir_function_impl *impl);
void nir_print_shader(nir_shader *shader, FILE *fp);
+void nir_print_instr(nir_instr *instr, FILE *fp);
#ifdef DEBUG
void nir_validate_shader(nir_shader *shader);
unreachable("Invalid instruction type");
break;
}
-
- fprintf(fp, "\n");
}
static int
nir_foreach_instr(block, instr) {
print_instr(instr, state, tabs, fp);
+ fprintf(fp, "\n");
}
print_tabs(tabs, fp);
destroy_print_state(&state);
}
+
+void
+nir_print_instr(nir_instr *instr, FILE *fp)
+{
+ print_instr(instr, NULL, 0, fp);
+}