[Syntax] Add iterators over children of syntax trees.
This gives us slightly nicer syntax (foreach) for idioms currently expressed as a loop, and the option to use range algorithms where it makes sense (e.g. llvm::all_of et al encapsulate the needed flow control in a useful way). It's also a building block for iteration over filtered views (e.g. iterate over all Stmt children, with the right type): for (const Statement &S : filter<Statement>(N.children())) ... I realize the recent direction has been mostly towards strongly-typed node-specific facilities, but I think it's important we have convenient generic facilities too. Differential Revision: https://reviews.llvm.org/D90023
Loading
Please sign in to comment