ir_function constructor now takes the function name as a parameter
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 24 Mar 2010 00:42:04 +0000 (17:42 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 24 Mar 2010 00:42:04 +0000 (17:42 -0700)
ast_to_hir.cpp
ir.cpp
ir.h

index ace80718d591ffbf8467318b7de406618fec56c4..f7c82fab4bf627bce1dc8d6480fef098a4281c1e 100644 (file)
@@ -1095,9 +1095,7 @@ ast_function_definition::hir(exec_list *instructions,
                       "non-function", name);
       signature = NULL;
    } else {
-      f = new ir_function();
-      f->name = name;
-
+      f = new ir_function(name);
       state->symbols->add_function(f->name, f);
    }
 
diff --git a/ir.cpp b/ir.cpp
index 4f7ea1bf1af7f2deb726e6ae9f3b0dcf1066579f..26e73943053a2642692a24941724c524fda9438c 100644 (file)
--- a/ir.cpp
+++ b/ir.cpp
@@ -103,8 +103,8 @@ ir_function_signature::ir_function_signature(const glsl_type *return_type)
 }
 
 
-ir_function::ir_function(void)
-   : ir_instruction(ir_op_func)
+ir_function::ir_function(const char *name)
+   : ir_instruction(ir_op_func), name(name)
 {
    /* empty */
 }
diff --git a/ir.h b/ir.h
index 997a37c0795c3c884e694b8014bd74c25a31074d..7db617d65b8de5818e74fc45bf2969cce780dfa8 100644 (file)
--- a/ir.h
+++ b/ir.h
@@ -157,7 +157,7 @@ public:
  */
 class ir_function : public ir_instruction {
 public:
-   ir_function(void);
+   ir_function(const char *name);
 
    virtual void accept(ir_visitor *v)
    {