Make function bodies rely on the parameter variable declarations.

Previously, generating inlined function bodies was going to be
difficult, as there was no mapping between the body's declaration of
variables where parameter values were supposed to live and the
parameter variables that a caller would use in paramater setup.
Presumably this also have been a problem for actual codegen.
This commit is contained in:
Eric Anholt
2010-04-07 14:32:53 -07:00
committed by Ian Romanick
parent 6173312d84
commit fbc7c0b8f2
4 changed files with 12 additions and 15 deletions

View File

@@ -67,6 +67,7 @@ void ir_print_visitor::visit(ir_variable *ir)
void ir_print_visitor::visit(ir_label *ir)
{
printf("\n(label %s\n", ir->label);
ir->signature->accept(this);
printf(")");
}
@@ -74,6 +75,15 @@ void ir_print_visitor::visit(ir_label *ir)
void ir_print_visitor::visit(ir_function_signature *ir)
{
printf("(paramaters\n");
foreach_iter(exec_list_iterator, iter, ir->parameters) {
ir_variable *const inst = (ir_variable *) iter.get();
inst->accept(this);
printf("\n");
}
printf(")\n");
foreach_iter(exec_list_iterator, iter, ir->body) {
ir_instruction *const inst = (ir_instruction *) iter.get();