diff options
author | Eric Anholt <eric@anholt.net> | 2010-05-04 13:04:40 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-05-04 17:00:42 -0700 |
commit | 5c89f0ecb9581cbe83442ab3f41f2f3701fffab0 (patch) | |
tree | c598e307fcc03ba9eaf5c89c19fe1d1e7b261bc4 /ir.h | |
parent | 05a4e59c2410292f595cfe0cc552a86ae69b20d2 (diff) |
ir_copy_propagation: New pass to rewrite dereferences to avoid copies.
This is pretty basic. Right now it only handles pure assignments --
same type on each side, no swizzling, and only within basic blocks.
Diffstat (limited to 'ir.h')
-rw-r--r-- | ir.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -62,6 +62,7 @@ public: virtual class ir_return * as_return() { return NULL; } virtual class ir_if * as_if() { return NULL; } virtual class ir_swizzle * as_swizzle() { return NULL; } + virtual class ir_constant * as_constant() { return NULL; } /*@}*/ protected: @@ -787,6 +788,11 @@ public: ir_constant(int i); ir_constant(float f); + virtual ir_constant *as_constant() + { + return this; + } + virtual void accept(ir_visitor *v) { v->visit(this); |