summaryrefslogtreecommitdiff
path: root/ir_print_visitor.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-04-21 12:30:22 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-21 15:36:36 -0700
commit9fa99f3b6c84fe927ba97e6584cd919f097a6c9a (patch)
tree453be040c7a1948bbb4d9eadbac8ad8ba8c887cd /ir_print_visitor.cpp
parentf96c52ba2e290e3ba5f14cd7f87ba5b4382a1785 (diff)
Refactor IR function representation.
Now, ir_function is emitted as part of the IR instructions, rather than simply existing in the symbol table. Individual ir_function_signatures are not emitted themselves, but only as part of ir_function.
Diffstat (limited to 'ir_print_visitor.cpp')
-rw-r--r--ir_print_visitor.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp
index 908f1c3ad8..5d98937c9c 100644
--- a/ir_print_visitor.cpp
+++ b/ir_print_visitor.cpp
@@ -75,14 +75,14 @@ void ir_print_visitor::visit(ir_label *ir)
void ir_print_visitor::visit(ir_function_signature *ir)
{
- printf("(paramaters\n");
+ printf("(signature\n (parameters\n");
foreach_iter(exec_list_iterator, iter, ir->parameters) {
ir_variable *const inst = (ir_variable *) iter.get();
inst->accept(this);
printf("\n");
}
- printf(")\n");
+ printf(" )\n(");
foreach_iter(exec_list_iterator, iter, ir->body) {
ir_instruction *const inst = (ir_instruction *) iter.get();
@@ -90,12 +90,20 @@ void ir_print_visitor::visit(ir_function_signature *ir)
inst->accept(this);
printf("\n");
}
+ printf("))\n");
}
void ir_print_visitor::visit(ir_function *ir)
{
printf("(function %s\n", ir->name);
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_function_signature *const sig = (ir_function_signature *) iter.get();
+
+ sig->accept(this);
+ printf("\n");
+ }
+
printf(")\n");
}