[PATCH] D29767: GraphTraits: Add range versions of graph traits functions (graph_nodes, graph_children, inverse_graph_nodes, inverse_graph_children).

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 10:22:45 PST 2017


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Looks good - sounds like you answered your own main question: no way to find the graph from the node type, so the children ops do need an explicit template param.

& I'd probably drop the "graph_" prefix - up to you though if you think that's better or worse, etc.



================
Comment at: lib/Target/Hexagon/HexagonBitSimplify.cpp:264
+  for (auto *DTN : graph_children<MachineDomTreeNode*>(MDT->getNode(&B)))
+    Changed |= visitBlock(*(DTN->getBlock()), T, NewAVs);
+
----------------
I probably wouldn't bother with the extra parens there:

  *DTN->getBlock()

rather than:

  *(DTN->getBlock())


https://reviews.llvm.org/D29767





More information about the llvm-commits mailing list