glsl: Remove ir_print_visitor.h includes and usage

We have ir->print() to do the old declaration of a visitor and having the
IR accept the visitor (yuck!).  And now you can call _mesa_print_ir()
safely anywhere that you know what an ir_instruction is.

A couple of missing printf("\n")s are added in error paths -- when an
expression is handed to the visitor, it doesn't print '\n' (since it might
be a step in printing a whole expression tree).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Eric Anholt 2013-06-12 16:21:28 -07:00
parent 2b049aa53e
commit 426ca34b7a
18 changed files with 8 additions and 26 deletions

View file

@ -32,7 +32,6 @@
#include "ir.h"
#include "ir_visitor.h"
#include "ir_rvalue_visitor.h"
#include "ir_print_visitor.h"
#include "glsl_types.h"
ir_visitor_status

View file

@ -34,7 +34,6 @@
#include "ast.h"
#include "glsl_parser_extras.h"
#include "ir_optimization.h"
#include "ir_print_visitor.h"
#include "program.h"
#include "loop_analysis.h"
#include "standalone_scaffolding.h"

View file

@ -36,7 +36,6 @@
#include "ir.h"
#include "ir_visitor.h"
#include "ir_rvalue_visitor.h"
#include "ir_print_visitor.h"
#include "glsl_types.h"
static bool debug = false;

View file

@ -32,7 +32,6 @@
#include "ir.h"
#include "ir_visitor.h"
#include "ir_rvalue_visitor.h"
#include "ir_print_visitor.h"
#include "glsl_types.h"
namespace {

View file

@ -34,7 +34,6 @@
#include "ir.h"
#include "ir_visitor.h"
#include "ir_print_visitor.h"
#include "ir_rvalue_visitor.h"
#include "glsl_types.h"

View file

@ -39,7 +39,6 @@
#include "ast.h"
#include "ir_optimization.h"
#include "ir_print_visitor.h"
#include "program.h"
#include "ir_reader.h"
#include "standalone_scaffolding.h"

View file

@ -48,7 +48,6 @@ extern "C" {
}
#include "brw_fs.h"
#include "glsl/glsl_types.h"
#include "glsl/ir_print_visitor.h"
void
fs_inst::init()

View file

@ -35,7 +35,6 @@ extern "C" {
#include "brw_fs.h"
#include "brw_cfg.h"
#include "glsl/ir_print_visitor.h"
fs_generator::fs_generator(struct brw_context *brw,
struct brw_wm_compile *c,

View file

@ -28,7 +28,6 @@
#include "brw_fs.h"
#include "glsl/glsl_types.h"
#include "glsl/ir_optimization.h"
#include "glsl/ir_print_visitor.h"
static void
assign_reg(int *reg_hw_locations, fs_reg *reg, int reg_width)

View file

@ -43,7 +43,6 @@ extern "C" {
}
#include "glsl/ir.h"
#include "glsl/ir_visitor.h"
#include "glsl/ir_print_visitor.h"
#include "glsl/ir_rvalue_visitor.h"
#include "glsl/glsl_types.h"

View file

@ -47,7 +47,6 @@ extern "C" {
#include "brw_fs.h"
#include "glsl/glsl_types.h"
#include "glsl/ir_optimization.h"
#include "glsl/ir_print_visitor.h"
void
fs_visitor::visit(ir_variable *ir)
@ -333,9 +332,9 @@ fs_visitor::visit(ir_expression *ir)
for (operand = 0; operand < ir->get_num_operands(); operand++) {
ir->operands[operand]->accept(this);
if (this->result.file == BAD_FILE) {
ir_print_visitor v;
fail("Failed to get tree for expression operand:\n");
ir->operands[operand]->accept(&v);
ir->operands[operand]->print();
printf("\n");
}
op[operand] = this->result;

View file

@ -29,7 +29,6 @@
#include "brw_vec4.h"
#include "glsl/glsl_types.h"
#include "glsl/ir_optimization.h"
#include "glsl/ir_print_visitor.h"
using namespace brw;

View file

@ -28,7 +28,6 @@ extern "C" {
}
#include "brw_fs.h"
#include "glsl/ir_optimization.h"
#include "glsl/ir_print_visitor.h"
struct gl_shader *
brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)

View file

@ -23,7 +23,6 @@
#include "brw_vec4.h"
#include "brw_cfg.h"
#include "glsl/ir_print_visitor.h"
extern "C" {
#include "main/macros.h"

View file

@ -27,7 +27,6 @@ extern "C" {
} /* extern "C" */
#include "brw_vec4.h"
#include "glsl/ir_print_visitor.h"
using namespace brw;

View file

@ -51,7 +51,6 @@ extern "C" {
#include "../glsl/glsl_symbol_table.h"
#include "../glsl/glsl_parser_extras.h"
#include "../glsl/ir_optimization.h"
#include "../glsl/ir_print_visitor.h"
#include "../program/ir_to_mesa.h"
using namespace ir_builder;

View file

@ -33,7 +33,6 @@
#include "main/compiler.h"
#include "ir.h"
#include "ir_visitor.h"
#include "ir_print_visitor.h"
#include "ir_expression_flattening.h"
#include "ir_uniform.h"
#include "glsl_types.h"
@ -1057,9 +1056,9 @@ ir_to_mesa_visitor::emit_swz(ir_expression *ir)
this->result.file = PROGRAM_UNDEFINED;
deref->accept(this);
if (this->result.file == PROGRAM_UNDEFINED) {
ir_print_visitor v;
printf("Failed to get tree for expression operand:\n");
deref->accept(&v);
deref->print();
printf("\n");
exit(1);
}
@ -1129,9 +1128,9 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
this->result.file = PROGRAM_UNDEFINED;
ir->operands[operand]->accept(this);
if (this->result.file == PROGRAM_UNDEFINED) {
ir_print_visitor v;
printf("Failed to get tree for expression operand:\n");
ir->operands[operand]->accept(&v);
ir->operands[operand]->print();
printf("\n");
exit(1);
}
op[operand] = this->result;

View file

@ -34,7 +34,6 @@
#include "main/compiler.h"
#include "ir.h"
#include "ir_visitor.h"
#include "ir_print_visitor.h"
#include "ir_expression_flattening.h"
#include "glsl_types.h"
#include "glsl_parser_extras.h"
@ -1396,9 +1395,9 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
this->result.file = PROGRAM_UNDEFINED;
ir->operands[operand]->accept(this);
if (this->result.file == PROGRAM_UNDEFINED) {
ir_print_visitor v;
printf("Failed to get tree for expression operand:\n");
ir->operands[operand]->accept(&v);
ir->operands[operand]->print();
printf("\n");
exit(1);
}
op[operand] = this->result;