[LLVMdev] Iterating on the DSGraph...
sabre at nondot.org
Fri Nov 8 17:18:01 PST 2002
> What is the best way to implement a traversal of the DS graph, starting at
> a scalar and processing all nodes to which the scalar allows access?
> Currently the links vector is not public and there is no apparent way to
> bound the getLink call (ie a getNumLinks call)....
Warning, untested code follows, but you should get the idea:
DSNode *N = ...
// Visit all children of a node...
for (DSNode::iterator I = N->begin(), E = N->end(); I != E; ++I)
// Depth first traversal from a node:
for (df_iterator<DSNode*> I = df_begin(N), E = df_end(); I != E; ++I)
Note that this hasn't been tested recently, but it should basically
More information about the llvm-dev