summaryrefslogtreecommitdiffstats
path: root/ir_print_visitor.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-04-07 13:19:11 -0700
committerIan Romanick <[email protected]>2010-04-07 17:23:23 -0700
commit894ea972a4defdaafeaa3a248c113b06c7ae0c7e (patch)
tree2efd3473b4375e0ee1ea2714f7530f590054a7aa /ir_print_visitor.cpp
parentf1ddca9f2143e377d2a70941dcedbb1f5c699e07 (diff)
Put function bodies under function signatures, instead of flat in the parent.
This will let us know the length of function bodies for the purpose of inlining (among other uses).
Diffstat (limited to 'ir_print_visitor.cpp')
-rw-r--r--ir_print_visitor.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp
index 20f9a5b5c50..8396973f6c5 100644
--- a/ir_print_visitor.cpp
+++ b/ir_print_visitor.cpp
@@ -66,14 +66,20 @@ void ir_print_visitor::visit(ir_variable *ir)
void ir_print_visitor::visit(ir_label *ir)
{
- printf("\n(label %s)", ir->label);
+ printf("\n(label %s\n", ir->label);
+ ir->signature->accept(this);
+ printf(")");
}
void ir_print_visitor::visit(ir_function_signature *ir)
{
- printf("%s:%d:\n", __func__, __LINE__);
- (void) ir;
+ foreach_iter(exec_list_iterator, iter, ir->body) {
+ ir_instruction *const inst = (ir_instruction *) iter.get();
+
+ inst->accept(this);
+ printf("\n");
+ }
}