Began implementing "child iterator" interface for Stmts and Exprs. Each
subclass of Stmt will implement child_begin() and child_end(), which will be used to iterate over all the children (subexpressions/substatements) of a Stmt object. This will provide for easy traversal over the AST, which is useful for a variety of purposes. None of the interfaces to subclasses of Stmt will be changed (other than adding the child_begin and child_end methods). The only caveat is that the implementation of subclasses of Stmt will require colocating all substatements (subexpressions) in an array. This is because we define child_iterator as Stmt**. All accessor methods to subexpressions will need to be altered to reflect this new implementation. This patch includes the typedefs for child_iterator, as well the implementation for child_begin/child_end for the primary expressions and some postfix expressions. llvm-svn: 41363
Loading
Please register or sign in to comment