summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/GraphTraits.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/GraphTraits.h')
-rw-r--r--include/llvm/ADT/GraphTraits.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/include/llvm/ADT/GraphTraits.h b/include/llvm/ADT/GraphTraits.h
index 68149d9e3bf5..225d9eb847f0 100644
--- a/include/llvm/ADT/GraphTraits.h
+++ b/include/llvm/ADT/GraphTraits.h
@@ -1,4 +1,4 @@
-//===-- llvm/ADT/GraphTraits.h - Graph traits template ----------*- C++ -*-===//
+//===- llvm/ADT/GraphTraits.h - Graph traits template -----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -41,7 +41,6 @@ struct GraphTraits {
// static ChildIteratorType child_end (NodeRef)
// Return iterators that point to the beginning and ending of the child
// node list for the specified node.
- //
// typedef ...iterator nodes_iterator; - dereference to a NodeRef
// static nodes_iterator nodes_begin(GraphType *G)
@@ -50,7 +49,6 @@ struct GraphTraits {
// static unsigned size (GraphType *G)
// Return total number of nodes in the graph
- //
// If anyone tries to use this class without having an appropriate
// specialization, make an error. If you get this error, it's because you
@@ -58,11 +56,9 @@ struct GraphTraits {
// graph, or you need to define it for a new graph type. Either that or
// your argument to XXX_begin(...) is unknown or needs to have the proper .h
// file #include'd.
- //
- typedef typename GraphType::UnknownGraphTypeError NodeRef;
+ using NodeRef = typename GraphType::UnknownGraphTypeError;
};
-
// Inverse - This class is used as a little marker class to tell the graph
// iterator to iterate over the graph in a graph defined "Inverse" ordering.
// Not all graphs define an inverse ordering, and if they do, it depends on
@@ -73,7 +69,7 @@ struct GraphTraits {
// for (; I != E; ++I) { ... }
//
// Which is equivalent to:
-// df_iterator<Inverse<Method*> > I = idf_begin(M), E = idf_end(M);
+// df_iterator<Inverse<Method*>> I = idf_begin(M), E = idf_end(M);
// for (; I != E; ++I) { ... }
//
template <class GraphType>
@@ -114,6 +110,7 @@ inverse_children(const typename GraphTraits<GraphType>::NodeRef &G) {
return make_range(GraphTraits<Inverse<GraphType>>::child_begin(G),
GraphTraits<Inverse<GraphType>>::child_end(G));
}
-} // End llvm namespace
-#endif
+} // end namespace llvm
+
+#endif // LLVM_ADT_GRAPHTRAITS_H