*/
(void) instructions;
(void) state;
- return NULL;
+ return ir_call::get_error_instruction();
}
ir_instruction *
{
/* empty */
}
+
+
+ir_call *
+ir_call::get_error_instruction()
+{
+ ir_call *call = new ir_call;
+
+ call->type = glsl_error_type;
+ return call;
+}
ir_op_label,
ir_op_constant,
ir_op_func_sig,
- ir_op_func
+ ir_op_func,
+ ir_op_call,
};
/**
};
+/**
+ * IR instruction representing a function call
+ */
+class ir_call : public ir_instruction {
+public:
+ ir_call()
+ : ir_instruction(ir_op_call), callee(NULL)
+ {
+ /* empty */
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ /**
+ * Get a generic ir_call object when an error occurs
+ */
+ static ir_call *get_error_instruction();
+
+private:
+ ir_function_signature *callee;
+ exec_list actual_parameters;
+};
+
+
struct ir_swizzle_mask {
unsigned x:2;
unsigned y:2;
printf(" (FINISHME: value goes here)\n");
printf(")\n");
}
+
+
+void
+ir_print_visitor::visit(ir_call *ir)
+{
+ (void) ir;
+
+ printf("(call FINISHME: function name here\n");
+ printf(" (FINISHME: function paramaters here))\n");
+}
virtual void visit(ir_dereference *);
virtual void visit(ir_assignment *);
virtual void visit(ir_constant *);
+ virtual void visit(ir_call *);
/*@}*/
};
virtual void visit(class ir_dereference *) = 0;
virtual void visit(class ir_assignment *) = 0;
virtual void visit(class ir_constant *) = 0;
+ virtual void visit(class ir_call *) = 0;
/*@}*/
};