From 1a3a096bf51e86ddc63402def7dff39b41b7cd63 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 7 Apr 2010 16:36:32 -0700 Subject: [PATCH] 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. --- ir_print_visitor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.30.2