[PATCH] D28111: Misc cleanups and simplifications for NewGVN.Mostly use a bit more idiomatic C++ where we can, so we can combine some things later.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 26 09:55:53 PST 2016


davide added inline comments.


================
Comment at: include/llvm/Transforms/Scalar/GVNExpression.h:232-233
+  op_inserter &operator*() { return *this; }
+  op_inserter &operator++() { return *this; }
+  op_inserter &operator++(int) { return *this; }
+};
----------------
dberlin wrote:
> davide wrote:
> > hmm, this is a quite peculiar implementation of operator preincrement/postincrement as they actually don't increment anything.
> This is standard for inserters.
> See https://gcc.gnu.org/onlinedocs/gcc-4.6.2/libstdc++/api/a01052_source.html#l00408
> and
> http://en.cppreference.com/w/cpp/iterator/back_insert_iterator
> " Incrementing the std::back_insert_iterator is a no-op."
> 
yeah, makes sense, maybe adding a comment (up to you, not feeling strong about it).


https://reviews.llvm.org/D28111





More information about the llvm-commits mailing list