summaryrefslogtreecommitdiff
path: root/ir_print_visitor.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-06-23 11:37:12 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-23 15:20:29 -0700
commit4b6fd39c89f308a379882426c1ed3616d60c4628 (patch)
tree2c8f6f7e2e3eae5922a91c61a686457c614068fe /ir_print_visitor.cpp
parent02fc4b34e40f655eebc99f6502293b4d4000e0b3 (diff)
Add a virtual clone() method to ir_instruction.
This will be used by function inlining, the linker, and avoiding double usage of the LHS deref chains in ++, *=, and similar operations.
Diffstat (limited to 'ir_print_visitor.cpp')
-rw-r--r--ir_print_visitor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp
index 60fb33e2f5..f15ffb6614 100644
--- a/ir_print_visitor.cpp
+++ b/ir_print_visitor.cpp
@@ -28,10 +28,12 @@
static void print_type(const glsl_type *t);
void
-ir_instruction::print(void)
+ir_instruction::print(void) const
{
+ ir_instruction *deconsted = const_cast<ir_instruction *>(this);
+
ir_print_visitor v;
- accept(&v);
+ deconsted->accept(&v);
}
void