summaryrefslogtreecommitdiff
path: root/ast.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-10 14:12:22 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-10 14:12:22 -0800
commit3821761e45c455374c9fdb4cd02104f420373360 (patch)
tree91ab3ac7676bbb21c78ddac6553a342d4fc36f0e /ast.h
parent986b8f798272d3ae2898617c8fb089156a5941c0 (diff)
Differentiate in ast_function_expression between constructors and func. calls
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/ast.h b/ast.h
index ad614e9..d823257 100644
--- a/ast.h
+++ b/ast.h
@@ -198,16 +198,35 @@ public:
*/
class ast_function_expression : public ast_expression {
public:
- ast_function_expression(ast_node *callee)
- : ast_expression(ast_function_call, (ast_expression *) callee,
- NULL, NULL)
+ ast_function_expression(ast_expression *callee)
+ : ast_expression(ast_function_call, callee,
+ NULL, NULL),
+ cons(false)
{
/* empty */
}
+ ast_function_expression(class ast_type_specifier *type)
+ : ast_expression(ast_function_call, (ast_expression *) type,
+ NULL, NULL),
+ cons(true)
+ {
+ /* empty */
+ }
+
+ bool is_constructor() const
+ {
+ return cons;
+ }
virtual ir_instruction *hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state);
+
+private:
+ /**
+ * Is this function call actually a constructor?
+ */
+ bool cons;
};