diff options
author | Eric Anholt <eric@anholt.net> | 2010-04-07 14:32:53 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-04-07 17:23:23 -0700 |
commit | fbc7c0b8f2e161bce1c048c63d2d5cfcdeb096f1 (patch) | |
tree | 844b220fd9ba21041473312f5d1f847221ea41f2 /ast_to_hir.cpp | |
parent | 6173312d84daabaf6dbe8fa15558cba4c9cb9f5e (diff) |
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.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r-- | ast_to_hir.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index d74e54c602..aa9a3a1a04 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -1925,13 +1925,9 @@ ast_function_definition::hir(exec_list *instructions, */ state->symbols->push_scope(); foreach_iter(exec_list_iterator, iter, signature->parameters) { - ir_variable *const proto = ((ir_instruction *) iter.get())->as_variable(); + ir_variable *const var = ((ir_instruction *) iter.get())->as_variable(); - assert(proto != NULL); - - ir_variable *const var = proto->clone(); - - signature->body.push_tail(var); + assert(var != NULL); /* The only way a parameter would "exist" is if two parameters have * the same name. |