glsl: Add copy-constructor for ast_struct_specifier.
authorMatt Turner <mattst88@gmail.com>
Wed, 26 Jun 2013 22:52:28 +0000 (15:52 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 12 Jul 2013 03:58:59 +0000 (20:58 -0700)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast.h

index 3bb33c5ad2c69650b72f0a322ff4522b5f8abb34..87f987682cd304d5c55a44fc8efe7d889cea3e7e 100644 (file)
@@ -453,6 +453,18 @@ class ast_declarator_list;
 
 class ast_struct_specifier : public ast_node {
 public:
+   /**
+    * \brief Make a shallow copy of an ast_struct_specifier.
+    *
+    * Use only if the objects are allocated from the same context and will not
+    * be modified. Zeros the inherited ast_node's fields.
+    */
+   ast_struct_specifier(const ast_struct_specifier& that):
+      ast_node(), name(that.name), declarations(that.declarations)
+   {
+      /* empty */
+   }
+
    ast_struct_specifier(const char *identifier,
                        ast_declarator_list *declarator_list);
    virtual void print(void) const;