From 71572ba8dfa3b045dfdcd0c8e0a2db168659ea10 Mon Sep 17 00:00:00 2001 From: graydon Date: Thu, 8 Dec 2005 02:33:55 +0000 Subject: 2005-12-07 Graydon Hoare * staptree.cxx (traversing_visitor::visit_foreach_loop): Visit the base indexable of the foreach loop. * translate.cxx (c_tmpcounter::visit_foreach_loop): Implement histogram bucket iteration arm. (c_unparser::visit_foreach_loop): Likewise. (c_tmpcounter::visit_arrayindex): Fix typo. * testsuite/buildok/iterate_histogram_buckets.stp: New test. --- staptree.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'staptree.cxx') diff --git a/staptree.cxx b/staptree.cxx index 2ad2d906..87c9b383 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -1245,6 +1245,14 @@ traversing_visitor::visit_for_loop (for_loop* s) void traversing_visitor::visit_foreach_loop (foreach_loop* s) { + symbol *array = NULL; + hist_op *hist = NULL; + classify_indexable (s->base, array, hist); + if (array) + array->visit(this); + else + hist->visit(this); + for (unsigned i=0; iindexes.size(); i++) s->indexes[i]->visit (this); s->block->visit (this); -- cgit