glsl: Fix type-deduction for and/or/xor expressions
[mesa.git] / src / glsl / ir_import_prototypes.cpp
index e553e12a4914931004ec8e50dbbb7638a3e6b70b..3585bf6b24bfd2e7a7b20e528a0a5ee1bdf112d2 100644 (file)
@@ -27,7 +27,6 @@
  *
  * \author Ian Romanick
  */
-#include <cstdio>
 #include "ir.h"
 #include "glsl_symbol_table.h"
 
@@ -64,7 +63,7 @@ public:
 
         /* Add the new function to the symbol table.
          */
-        this->symbols->add_function(this->function->name, this->function);
+        this->symbols->add_function(this->function);
       }
       return visit_continue;
    }
@@ -82,22 +81,7 @@ public:
    {
       assert(this->function != NULL);
 
-      ir_function_signature *copy =
-        new(mem_ctx) ir_function_signature(ir->return_type);
-
-      copy->is_defined = false;
-      copy->is_built_in = ir->is_built_in;
-
-      /* Clone the parameter list, but NOT the body.
-       */
-      foreach_list_const(node, &ir->parameters) {
-        const ir_variable *const param = (const ir_variable *) node;
-
-        assert(const_cast<ir_variable *>(param)->as_variable() != NULL);
-
-        ir_variable *const param_copy = param->clone(mem_ctx, NULL);
-        copy->parameters.push_tail(param_copy);
-      }
+      ir_function_signature *copy = ir->clone_prototype(mem_ctx, NULL);
 
       this->function->add_signature(copy);
 
@@ -124,7 +108,7 @@ private:
  * \param dest     Destination instruction stream where new \c ir_function and
  *                 \c ir_function_signature nodes will be stored
  * \param symbols  Symbol table where new functions will be stored
- * \param mem_ctx  talloc memory context used for new allocations
+ * \param mem_ctx  ralloc memory context used for new allocations
  */
 void
 import_prototypes(const exec_list *source, exec_list *dest,