aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_clone.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/ir_clone.cpp')
-rw-r--r--mesalib/src/glsl/ir_clone.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/mesalib/src/glsl/ir_clone.cpp b/mesalib/src/glsl/ir_clone.cpp
index c63615c7e..26b0d8f5f 100644
--- a/mesalib/src/glsl/ir_clone.cpp
+++ b/mesalib/src/glsl/ir_clone.cpp
@@ -27,6 +27,13 @@
#include "glsl_types.h"
#include "program/hash_table.h"
+ir_rvalue *
+ir_rvalue::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ /* The only possible instantiation is the generic error value. */
+ return error_value(mem_ctx);
+}
+
/**
* Duplicate an IR variable
*
@@ -160,8 +167,9 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
ir_call *
ir_call::clone(void *mem_ctx, struct hash_table *ht) const
{
- if (this->type == glsl_type::error_type)
- return ir_call::get_error_instruction(mem_ctx);
+ ir_dereference_variable *new_return_ref = NULL;
+ if (this->return_deref != NULL)
+ new_return_ref = this->return_deref->clone(mem_ctx, ht);
exec_list new_parameters;
@@ -170,7 +178,7 @@ ir_call::clone(void *mem_ctx, struct hash_table *ht) const
new_parameters.push_tail(ir->clone(mem_ctx, ht));
}
- return new(mem_ctx) ir_call(this->callee, &new_parameters);
+ return new(mem_ctx) ir_call(this->callee, new_return_ref, &new_parameters);
}
ir_expression *
@@ -390,9 +398,9 @@ public:
* table. If it is found, replace it with the value from the table.
*/
ir_function_signature *sig =
- (ir_function_signature *) hash_table_find(this->ht, ir->get_callee());
+ (ir_function_signature *) hash_table_find(this->ht, ir->callee);
if (sig != NULL)
- ir->set_callee(sig);
+ ir->callee = sig;
/* Since this may be used before function call parameters are flattened,
* the children also need to be processed.