IR print visitor: print expressions
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 26 Mar 2010 01:25:37 +0000 (18:25 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 26 Mar 2010 01:40:48 +0000 (18:40 -0700)
Not quite complete.  The operator is not yet printed.

ir_print_visitor.cpp

index 9e4c4412ae384bcbe9e9b9a70b184c19fb4a0d36..40e3d057db9a396005873346423a507268176766 100644 (file)
@@ -90,8 +90,19 @@ void ir_print_visitor::visit(ir_function *ir)
 
 void ir_print_visitor::visit(ir_expression *ir)
 {
-   printf("%s:%d:\n", __func__, __LINE__);
-   (void) ir;
+   printf("(expression ");
+
+   printf("(FINISHME: operator) ");
+
+   printf("(");
+   if (ir->operands[0])
+      ir->operands[0]->accept(this);
+   printf(") ");
+
+   printf("(");
+   if (ir->operands[1])
+      ir->operands[1]->accept(this);
+   printf(")) ");
 }