diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-04-07 16:36:32 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-04-28 15:34:52 -0700 |
commit | 1a3a096bf51e86ddc63402def7dff39b41b7cd63 (patch) | |
tree | 03b72d966ebcb48f8b40bbb4717c56dae8e38543 | |
parent | 295bb7ff8d3c508320a6af60a69901999196f05f (diff) |
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.
-rw-r--r-- | ir_print_visitor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp index cbe7d976ce..6eb9a1dc41 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); |