diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-19 16:44:52 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-19 16:44:52 -0700 |
commit | 9578c87ce23a98472d52f15b0a7063f4df036c4d (patch) | |
tree | 324d084fab5fcdc5cc1901015ac91786f3a758e0 /ir.h | |
parent | 3359e58eac19dd7771a78310c8a0e3d3ded55063 (diff) |
Implement IR return instructions
Diffstat (limited to 'ir.h')
-rw-r--r-- | ir.h | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -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; |