intel/compiler: Refactor dump_instruction(s)

Delete unnecessary virtual functions, we need just two.  Refactor code
so the 'default behavior' logic (stderr and/or creating file) is not
duplicated.

Rename the virtuals so overrides don't hide the common convenience
functions.  Finally, provide a variant of dump_instructions() with
a `FILE *` parameter.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23457>
This commit is contained in:
Caio Oliveira
2023-06-05 23:31:17 -07:00
committed by Marge Bot
parent 4f9a23e339
commit 2bb26cc01d
6 changed files with 24 additions and 52 deletions
+1 -7
View File
@@ -1309,13 +1309,7 @@ vec4_visitor::split_virtual_grfs()
}
void
vec4_visitor::dump_instruction(const backend_instruction *be_inst) const
{
dump_instruction(be_inst, stderr);
}
void
vec4_visitor::dump_instruction(const backend_instruction *be_inst, FILE *file) const
vec4_visitor::dump_instruction_to_file(const backend_instruction *be_inst, FILE *file) const
{
const vec4_instruction *inst = (const vec4_instruction *)be_inst;