[PATCH] D35043: [ADT] Enable reverse iteration for DenseMap

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 6 02:16:08 PDT 2017


mgrang marked an inline comment as done.
mgrang added inline comments.


================
Comment at: include/llvm/Support/PointerLikeTypeTraits.h:35
+// Trait to check if T is pointer.
+template<typename T>
+struct is_pointer { static const bool value = false; };
----------------
Just checking if T is a complete type is not enough due to the presence of specialization for const T:
template <typename T> class PointerLikeTypeTraits<const T>

In this case, for a const int the type is complete but it's not a pointer type. So to handle such cases I had to check for is_pointer too.


Repository:
  rL LLVM

https://reviews.llvm.org/D35043





More information about the llvm-commits mailing list