[LLVMdev] Why is BasicBlock's copy constructor private?

Trevor Harmon Trevor.W.Harmon at nasa.gov
Fri Mar 26 11:17:17 PDT 2010


On Mar 25, 2010, at 5:40 PM, Tobias Grosser wrote:

> Some basic functionality for graph traversal is already in LLVM (as  
> you
> mentioned) like iterating over edges, children or doing stuff like
> depthfirstsearch or post order search.
> What kind of graph algorithm would you like to execute that is not
> available in LLVM?

Well, iterating over the edges was one of the first things I'd wanted  
to do. But I spent hours reading the source code and couldn't figure  
out how. AFAICT there are no actual "edge" objects that can be  
iterated over.

The edges also need to have IDs assigned to them so that, for example,  
if Basic Block "A" has a successor "B", the outgoing edge of A will  
have the same ID as the incoming edge of B.

But it wasn't just this functionality I needed from Boost. The sample  
code and documentation would also be a big help, as I was having  
trouble figuring out LLVM's graph functionality just from its source  
code. That's why I'm trying to convert LLVM's CFG into a Boost graph.

Trevor




More information about the llvm-dev mailing list