DominatorTree already has getDescendants, but that always builds up a SmallVector. This is more efficient when the caller doesn't need a vector.
Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Would it make sense to use one of the llvm graph iterators and have descendants_begin() and descendants_end() functions instead?
Comment Actions
OK, I can see that this is exactly what you want to avoid in the related revision. In this case, isn't it possible to provide a dummy storage to DepthFirstIterator and use it to efficiently traverse trees?