diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-26 17:42:10 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-26 17:42:10 -0700 |
commit | d1dfe8b994218e4b593b71fc756055a48d469527 (patch) | |
tree | d3014d1ac49e31f4307fe30cb3abd03ed566785f | |
parent | 0b7dcc80eb3163b46d40c5175a27a2ea4264fcd3 (diff) |
IR print visitor: Print expressions a little better
-rw-r--r-- | ir_print_visitor.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp index 0e89f10c3f..6d0f797807 100644 --- a/ir_print_visitor.cpp +++ b/ir_print_visitor.cpp @@ -88,9 +88,20 @@ void ir_print_visitor::visit(ir_expression *ir) { printf("(expression "); - printf("(FINISHME: operator) "); + const char *str; + char buf[256]; + + switch (ir->operation) { + case ir_unop_f2i: str = "f2i"; break; + case ir_unop_i2f: str = "i2f"; break; + case ir_unop_u2f: str = "u2f"; break; + default: + snprintf(buf, sizeof(buf), "operator %u", ir->operation); + str = buf; + break; + } - printf("("); + printf("(%s) (", str); if (ir->operands[0]) ir->operands[0]->accept(this); printf(") "); |