IR print visitor: Move logic for printing the whole program to _mesa_print_ir
This commit is contained in:
@@ -789,14 +789,7 @@ main(int argc, char **argv)
|
||||
printf("\n\n");
|
||||
|
||||
if (!state.error) {
|
||||
printf("(\n");
|
||||
foreach_iter(exec_list_iterator, iter, instructions) {
|
||||
ir_print_visitor v;
|
||||
|
||||
((ir_instruction *)iter.get())->accept(& v);
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n)");
|
||||
_mesa_print_ir(&instructions, &state);
|
||||
}
|
||||
|
||||
delete state.symbols;
|
||||
|
||||
@@ -24,6 +24,22 @@
|
||||
#include "ir_print_visitor.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
void
|
||||
_mesa_print_ir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
(void) state;
|
||||
|
||||
printf("(\n");
|
||||
foreach_iter(exec_list_iterator, iter, *instructions) {
|
||||
ir_print_visitor v;
|
||||
|
||||
((ir_instruction *)iter.get())->accept(& v);
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n)");
|
||||
}
|
||||
|
||||
static void
|
||||
print_type(const glsl_type *t)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
#include "ir.h"
|
||||
#include "ir_visitor.h"
|
||||
|
||||
extern void _mesa_print_ir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
/**
|
||||
* Abstract base class of visitors of IR instruction trees
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user