diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-04-28 12:44:24 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-04-28 15:34:52 -0700 |
commit | bff6013d469b3d4e54cdc5731801c56994a523ec (patch) | |
tree | cfbd67f0ab174146df188d4e7563dafbe0084fc8 /ir.cpp | |
parent | 0d605cb97c9cd2f9a170e3aa15bdf4021a75fc14 (diff) |
Factor out parameter list replacement for later reuse.
Diffstat (limited to 'ir.cpp')
-rw-r--r-- | ir.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -364,6 +364,24 @@ ir_function_signature::qualifiers_match(exec_list *params) } +void +ir_function_signature::replace_parameters(exec_list *new_params) +{ + /* Destroy all of the previous parameter information. If the previous + * parameter information comes from the function prototype, it may either + * specify incorrect parameter names or not have names at all. + */ + foreach_iter(exec_list_iterator, iter, parameters) { + assert(((ir_instruction *) iter.get())->as_variable() != NULL); + + iter.remove(); + delete (ir_instruction*) iter.get(); + } + + new_params->move_nodes_to(¶meters); +} + + ir_function::ir_function(const char *name) : name(name) { |