[llvm-commits] [PATCH] add GraphTraits for class User

Dan Gohman gohman at apple.com
Mon Mar 31 18:08:19 PDT 2008


On Mar 31, 2008, at 10:51 AM, Török Edwin wrote:
> Hi,
>
> This patch adds GraphTraits for class User, allowing to use a
> depth-first iterator to find out all values that depend on (use)  a
> certain Value.
> This can currently be done only by coding a recursive function.
>
> I tried to use forward declaration of GraphTraits/Inverse to avoid
> including the header for it, but that doesn't work, because of  
> Inverse.
> Is it ok to include those headers in User.h? If not, where should I  
> move
> this GraphTraits code?

Including those headers in User.h would be undesirable. Could you put
this code in a new header file, similar to how
llvm/Support/CFG.h contains the graph traits for BasicBlock objects?
Maybe the new file could be named llvm/Support/SSAGraph.h.

Also, please use two-space indentation.

Otherwise, the patch looks ok to me.

Dan





More information about the llvm-commits mailing list