[ADT] Add some documentation for GraphTraits.

Summary: Add some context for GraphTraits.

Reviewers: dblaikie, asbirlea

Subscribers: sanjoy, jlebar, bixia, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D50120

llvm-svn: 338660
This commit is contained in:
Tim Shen 2018-08-02 00:21:12 +00:00
parent ebca0f1609
commit 994068268d
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,13 @@ namespace llvm {
// 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: