[PATCH] D23522: [ADT] Change PostOrderIterator to use NodeRef. NFC.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 14:01:25 PDT 2016


dblaikie added inline comments.

================
Comment at: include/llvm/ADT/PostOrderIterator.h:93-95
@@ +92,5 @@
+class po_iterator
+    : public std::iterator<std::forward_iterator_tag, typename GT::NodeRef,
+                           ptrdiff_t, typename GT::NodeRef,
+                           typename GT::NodeRef>,
+      public po_iterator_storage<SetType, ExtStorage> {
----------------
Having T == Pointer == Reference seems wrong. Could you explain how that works?

================
Comment at: include/llvm/ADT/PostOrderIterator.h:126
@@ -123,3 +125,3 @@
       : po_iterator_storage<SetType, ExtStorage>(S) {
-    if (this->insertEdge((NodeType*)nullptr, BB)) {
+    if (this->insertEdge(Optional<NodeRef>(), BB)) {
       VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB)));
----------------
Optional<T>() => None

(& in a few other places)


https://reviews.llvm.org/D23522





More information about the llvm-commits mailing list