diff options
author | Eric Anholt <eric@anholt.net> | 2010-05-11 11:31:09 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-06-01 15:15:04 -0700 |
commit | b145e903694fa932ab1e0d955e889555193ab604 (patch) | |
tree | ce6f4aab586b6fcffde5820242f127be9814f58c /ir.h | |
parent | f8bb17260a6afb48534ec70dc9d5584851d7e3c2 (diff) |
ir_vec_index_to_swizzle: Pass to convert indexing of vectors to swizzles.
This should remove the burden of handling constant vector indexing
well from backend codegen, and could help with swizzle optimizations.
Diffstat (limited to 'ir.h')
-rw-r--r-- | ir.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -56,6 +56,7 @@ public: virtual class ir_variable * as_variable() { return NULL; } virtual class ir_function * as_function() { return NULL; } virtual class ir_dereference * as_dereference() { return NULL; } + virtual class ir_dereference_array * as_dereference_array() { return NULL; } virtual class ir_rvalue * as_rvalue() { return NULL; } virtual class ir_label * as_label() { return NULL; } virtual class ir_loop * as_loop() { return NULL; } @@ -685,7 +686,6 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); -private: ir_rvalue *value; }; @@ -860,6 +860,11 @@ public: ir_dereference_array(ir_variable *var, ir_rvalue *array_index); + virtual ir_dereference_array *as_dereference_array() + { + return this; + } + /** * Get the variable that is ultimately referenced by an r-value */ |