glsl: Use ir_rvalue to represent generic error_type values.
[mesa.git] / src / glsl / ir_clone.cpp
index c63615c7eb32ffefd58f979413261d2db1666484..b6d0e8aa4a3fa9b0c9121647a792ad4b6945dade 100644 (file)
 #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,9 +167,6 @@ 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);
-
    exec_list new_parameters;
 
    foreach_iter(exec_list_iterator, iter, this->actual_parameters) {