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

Duncan Sands baldrick at free.fr
Fri Mar 26 01:52:39 PDT 2010


Hi Trever,

> LLVM provides basic graph traversal for its CFGs, but I need
> additional operations, such as iterating over the edges. I thought I
> would solve this problem using the Boost graph library. It should be
> relatively simple to walk an LLVM CFG and add the BasicBlock objects
> to a Boost graph declared as:
>
>      typedef boost::directed_graph<llvm::BasicBlock>  Graph;

LLVM already has a "graph traits" abstraction, which can be used to
view the CFG as a graph (see: include/llvm/ADT/GraphTraits.h).

Ciao,

Duncan.



More information about the llvm-dev mailing list