From: Kenneth Graunke Date: Wed, 7 Apr 2010 23:36:32 +0000 (-0700) Subject: ir_print_visitor: print the type of expressions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a3a096bf51e86ddc63402def7dff39b41b7cd63;p=mesa.git ir_print_visitor: print the type of expressions. This can be useful for debugging - it allows us to see that the inferred type is what we think it should be. Furthermore, it will allow the IR reader to avoid complex, operator-specific type inference. --- diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp index cbe7d976ce7..6eb9a1dc415 100644 --- a/ir_print_visitor.cpp +++ b/ir_print_visitor.cpp @@ -148,10 +148,13 @@ void ir_print_visitor::visit(ir_expression *ir) printf("(expression "); + print_type(ir->type); + assert((unsigned int)ir->operation < sizeof(operators) / sizeof(operators[0])); - printf("%s", operators[ir->operation]); + printf(" %s ", operators[ir->operation]); + printf("("); if (ir->operands[0]) ir->operands[0]->accept(this);