summaryrefslogtreecommitdiff
path: root/ir.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-19 16:44:52 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-19 16:44:52 -0700
commit9578c87ce23a98472d52f15b0a7063f4df036c4d (patch)
tree324d084fab5fcdc5cc1901015ac91786f3a758e0 /ir.h
parent3359e58eac19dd7771a78310c8a0e3d3ded55063 (diff)
Implement IR return instructions
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/ir.h b/ir.h
index c7fd981200..ab598ee0b0 100644
--- a/ir.h
+++ b/ir.h
@@ -323,6 +323,51 @@ private:
};
+/**
+ * \name Jump-like IR instructions.
+ *
+ * These include \c break, \c continue, \c return, and \c discard.
+ */
+/*@{*/
+class ir_jump : public ir_instruction {
+protected:
+ ir_jump()
+ : ir_instruction(ir_op_jump)
+ {
+ /* empty */
+ }
+};
+
+class ir_return : public ir_jump {
+public:
+ ir_return()
+ : value(NULL)
+ {
+ /* empty */
+ }
+
+ ir_return(ir_expression *value)
+ : value(value)
+ {
+ /* empty */
+ }
+
+ ir_expression *get_value() const
+ {
+ return value;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+private:
+ ir_expression *value;
+};
+/*@}*/
+
+
struct ir_swizzle_mask {
unsigned x:2;
unsigned y:2;