This is an archive of the discontinued LLVM Phabricator instance.

[GraphTraits] Add support for iterating over children edges.
ClosedPublic

Authored by eraman on Jan 30 2018, 11:31 AM.

Details

Summary

This change is mostly adding comments to GraphTraits describing
interfaces to iterate over children edges of a node. These will
have to be implemented by specializations of GraphTraits. The
non-comment change is the addition of children_edges template
function that returns an iterator range.

The motivation for this is to use it in synthetic count propagation
algorithm and remove the CallGraphTraits class that provide similar
interfaces.

Diff Detail

Repository
rL LLVM

Event Timeline

eraman created this revision.Jan 30 2018, 11:31 AM
davidxl added inline comments.Jan 30 2018, 11:20 PM
include/llvm/ADT/GraphTraits.h
56 ↗(On Diff #132013)

Is there a convention on the naming here? why not call it out_edge_begin|end?

Related, any need for incoming edge iterations?

davidxl accepted this revision.Jan 31 2018, 11:58 AM

looks like the naming follows the node iteration interfaces. lgtm.

This revision is now accepted and ready to land.Jan 31 2018, 11:58 AM
This revision was automatically updated to reflect the committed changes.