From 27f21e8c049b0cd20fd2d4e2fd9b96cad6c910cc Mon Sep 17 00:00:00 2001 From: dsmith Date: Mon, 6 Nov 2006 16:05:50 +0000 Subject: 2006-11-06 David Smith Added "limit EXP" support to foreach statements. * translate.cxx (c_tmpcounter::visit_foreach_loop): Handles "limit" member variable. (c_unparser::visit_foreach_loop): Ditto. * staptree.cxx (foreach_loop::print): Prints "limit EXP" addition. (traversing_visitor::visit_foreach_loop): Handles "limit" member variable. (deep_copy_visitor::visit_foreach_loop): Ditto. * staptree.h (struct foreach_loop): Added "limit" member variable. * stap.1.in: Added documentation for the "limit EXP" addition to foreach statement. * parse.cxx (lexer::scan): Added "limit" keyword for foreach statements. (parser::parse_foreach_loop): Parses "limit" keyword for foreach statements. * elaborate.cxx (symresolution_info::visit_foreach_loop): Handles "limit" member variable. (typeresolution_info::visit_foreach_loop): Ditto. --- elaborate.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index f6c9bf9a..c532d0b0 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1040,6 +1040,9 @@ symresolution_info::visit_foreach_loop (foreach_loop* e) hist->visit (this); } + if (e->limit) + e->limit->visit (this); + e->block->visit (this); } @@ -2375,6 +2378,12 @@ typeresolution_info::visit_foreach_loop (foreach_loop* e) } } + if (e->limit) + { + t = pe_long; + e->limit->visit (this); + } + t = pe_unknown; e->block->visit (this); } -- cgit