Notice that the data layout is changed: instead of using
std::pair<PointerIntPair<NodeType*, 1>, ChildItTy>, now use
std::pair<NodeRef, Optional<ChildItTy>>.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Removing the ability to compare non-end iterators seems like a loss of functionality & would be pretty tricky for the average user (would catch them by surprise that only end iterators are comparable).
Unless there's a reason the design already precludes comparing non-end iterators, I'd say it's best to preserve the existing behavior there.
Other than that, it looks pretty reasonable.
include/llvm/ADT/DepthFirstIterator.h | ||
---|---|---|
111 ↗ | (On Diff #66746) | I'd just write this as "if (!Opt)" - but up to you. |
114–117 ↗ | (On Diff #66746) | For a separate patch: any idea why this isn't a normal for (or even range-for) loop? |
121 ↗ | (On Diff #66746) | We aren't really using braced init like that much in the project so far. I'd probably stick with () when calling a ctor. (same feedback elsewhere) |
include/llvm/ADT/DepthFirstIterator.h | ||
---|---|---|
114–117 ↗ | (On Diff #66875) | Oops I already fixed it. I don't think that it's a functional change, but just a modernization. |
Looks good, thanks! (I realize we've got to wait to finalize the Optional stuff first, of course)