From 894ea972a4defdaafeaa3a248c113b06c7ae0c7e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 7 Apr 2010 13:19:11 -0700 Subject: 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). --- ir_print_visitor.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ir_print_visitor.cpp') 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"); + } } -- cgit v1.2.3