summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-04-28 12:44:24 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-28 15:34:52 -0700
commitbff6013d469b3d4e54cdc5731801c56994a523ec (patch)
treecfbd67f0ab174146df188d4e7563dafbe0084fc8 /ir.cpp
parent0d605cb97c9cd2f9a170e3aa15bdf4021a75fc14 (diff)
Factor out parameter list replacement for later reuse.
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/ir.cpp b/ir.cpp
index 8912c00e82..e7e5dee00c 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -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(&parameters);
+}
+
+
ir_function::ir_function(const char *name)
: name(name)
{