diff options
author | Eric Anholt <eric@anholt.net> | 2010-06-22 12:09:21 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-06-22 18:18:30 -0700 |
commit | e46a454305af64710ce8deadafc718f75363ac7e (patch) | |
tree | 7119b50e95dff28694865fb574270d2c42ac1634 /ir_print_visitor.cpp | |
parent | 216580dbd733aa2e64df4ca95e37a0eb102c6ede (diff) |
ir: Give ir_instruction a print visitor helper.
This avoids spamming each file with includes of ir_print_visitor.h
because someone was doing debugging at some point, and is less typing
when doing debugging.
Diffstat (limited to 'ir_print_visitor.cpp')
-rw-r--r-- | ir_print_visitor.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp index 40fac8803c..60fb33e2f5 100644 --- a/ir_print_visitor.cpp +++ b/ir_print_visitor.cpp @@ -28,6 +28,13 @@ static void print_type(const glsl_type *t); void +ir_instruction::print(void) +{ + ir_print_visitor v; + accept(&v); +} + +void _mesa_print_ir(exec_list *instructions, struct _mesa_glsl_parse_state *state) { @@ -48,9 +55,7 @@ _mesa_print_ir(exec_list *instructions, printf("(\n"); foreach_iter(exec_list_iterator, iter, *instructions) { - ir_print_visitor v; - - ((ir_instruction *)iter.get())->accept(& v); + ((ir_instruction *)iter.get())->print(); printf("\n"); } printf("\n)"); |