summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2013-06-24 21:38:30 -0700
committerMatt Turner <mattst88@gmail.com>2013-07-11 20:58:58 -0700
commit43757135b281b58838224e5cef8375c22a2beee5 (patch)
tree10f45aa6e10a55af1dfcfdcdc00492062a939a25 /src/glsl/ast.h
parentb85f0c5121e4508af1125ff30db4221bcda10ac9 (diff)
downloadexternal_mesa3d-43757135b281b58838224e5cef8375c22a2beee5.zip
external_mesa3d-43757135b281b58838224e5cef8375c22a2beee5.tar.gz
external_mesa3d-43757135b281b58838224e5cef8375c22a2beee5.tar.bz2
glsl: Add a constructor for ast_type_specifier.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r--src/glsl/ast.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index b86f97b..3bb33c5 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -469,6 +469,22 @@ public:
class ast_type_specifier : public ast_node {
public:
+ /**
+ * \brief Make a shallow copy of an ast_type_specifier, specifying array
+ * fields.
+ *
+ * Use only if the objects are allocated from the same context and will not
+ * be modified. Zeros the inherited ast_node's fields.
+ */
+ ast_type_specifier(const ast_type_specifier *that, bool is_array,
+ ast_expression *array_size)
+ : ast_node(), type_name(that->type_name), structure(that->structure),
+ is_array(is_array), array_size(array_size), precision(that->precision),
+ is_precision_statement(that->is_precision_statement)
+ {
+ /* empty */
+ }
+
/** Construct a type specifier from a type name */
ast_type_specifier(const char *name)
: type_name(name), structure(NULL),