[llvm-commits] [PATCH] Enable edge pruning in PostOrderIterator.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Jul 16 20:05:39 PDT 2012


All,

Please review the attached patch which generalizes the po_iterator class template such that it is possible to prune graph edges from the DFS traversal.

It is already possible to limit the traversal to a subset of graph nodes by providing a custom SetType class, see for example the LoopBlocksTraversal class which limits a post-order traversal to blocks inside a loop. It is currently not possible to remove edges from the graph, though. For example, it would be useful to run a post-order traversal over loop blocks while omitting the back edges.

This patch makes it possible to prune graph edges by specializing the po_iterator_storage base class and implementing the insertEdge() function. The patch also pulls the existing DFSetTraits trick into the po_iterator_storage base class.

/jakob

-------------- next part --------------
A non-text attachment was scrubbed...
Name: post-order-edges.patch
Type: application/octet-stream
Size: 5716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120716/6b49168d/attachment.obj>


More information about the llvm-commits mailing list