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

Nick Lewycky nicholas at mxc.ca
Mon Mar 31 22:19:03 PDT 2008


Don't add this to User.h. Create Support/DataFlow.h? UseDef.h? Not sure.

No tabs allowed.

You have a lot of whitespace errors. Decide, is it "User *X" or "User* 
X"? I suggest the former. Also, there should be a space after the "if" 
keyword.

Include a version that works on non-const User.

+//===----------------------------------------------------------------------===//
+// Provide specializations of GraphTraits to be able to treat a 
def-use/use-def chains
+// as graphs

80 column rule. That line is 88 columns.

Nick

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?
> 
> Please review this patch, and let me know if I am allowed to commit it.
> 
> Thanks,
> --Edwin




More information about the llvm-commits mailing list