ir_print_visitor: print the type of expressions.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 7 Apr 2010 23:36:32 +0000 (16:36 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 28 Apr 2010 22:34:52 +0000 (15:34 -0700)
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

index cbe7d976ce79706704a9bb07aff9f6d80ceb529a..6eb9a1dc4152cd9b0e8f0d65214c96b9c3c08674 100644 (file)
@@ -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);