[PATCH] D50120: [ADT] Add some documentation for GraphTraits.

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 11:42:32 PDT 2018


timshen updated this revision to Diff 158589.
timshen added a comment.

Update based on comments.


https://reviews.llvm.org/D50120

Files:
  llvm/include/llvm/ADT/GraphTraits.h


Index: llvm/include/llvm/ADT/GraphTraits.h
===================================================================
--- llvm/include/llvm/ADT/GraphTraits.h
+++ llvm/include/llvm/ADT/GraphTraits.h
@@ -25,6 +25,13 @@
 // GraphTraits - This class should be specialized by different graph types...
 // which is why the default version is empty.
 //
+// This template evolved from supporting `BasicBlock` to also later supporting
+// more complex types (e.g. CFG and DomTree).
+//
+// GraphTraits can be used to create a view over a graph interpreting it
+// differently without requiring a copy of the original graph. This could
+// be achieved by carrying more data in NodeRef. See LoopBodyTraits for one
+// example.
 template<class GraphType>
 struct GraphTraits {
   // Elements to provide:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50120.158589.patch
Type: text/x-patch
Size: 786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180801/983c097a/attachment.bin>


More information about the llvm-commits mailing list