Index: llvm/include/llvm/ADT/GraphTraits.h =================================================================== --- llvm/include/llvm/ADT/GraphTraits.h +++ llvm/include/llvm/ADT/GraphTraits.h @@ -25,6 +25,14 @@ // GraphTraits - This class should be specialized by different graph types... // which is why the default version is empty. // +// GraphTraits is not designed in the most convenient and intuitive way, as it +// started with simple and limited scenarios (aka BasicBlock), and over time +// evolved to facncier applications (e.g. CFG and DomTree). +// +// One of the common "fancy" uses of GraphTraits is to create a view of a +// physical graph. The view interprets the physical graph slightly differently +// without incurring significant memory footprint. Such application is possible +// by hacking on NodeRef. LoopBodyTraits is a good example. template struct GraphTraits { // Elements to provide: