[llvm] r344522 - [ADT] Adds equality operators for DenseMap and DenseSet, and an initializer_list

Marshall Clow via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 09:15:42 PDT 2018


On Mon, Oct 15, 2018 at 8:28 AM Lang Hames via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: lhames
> Date: Mon Oct 15 08:26:47 2018
> New Revision: 344522
>
> URL: http://llvm.org/viewvc/llvm-project?rev=344522&view=rev
> Log:
> [ADT] Adds equality operators for DenseMap and DenseSet, and an
> initializer_list
> constructor for DenseMap (DenseSet already had an initializer_list
> constructor).
>
> These changes make it easier to migrate existing code that uses std::map
> and
> std::set (which support initializer_list construction and equality
> comparison)
> to DenseMap and DenseSet.
>
> Modified:
>     llvm/trunk/include/llvm/ADT/DenseMap.h
>     llvm/trunk/include/llvm/ADT/DenseSet.h
>     llvm/trunk/unittests/ADT/DenseMapTest.cpp
>     llvm/trunk/unittests/ADT/DenseSetTest.cpp
>
> Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=344522&r1=344521&r2=344522&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
> +++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon Oct 15 08:26:47 2018
> @@ -25,6 +25,7 @@
>  #include <cassert>
>  #include <cstddef>
>  #include <cstring>
> +#include <initializer_list>
>  #include <iterator>
>  #include <new>
>  #include <type_traits>
> @@ -38,6 +39,9 @@ namespace detail {
>  // implementation without requiring two members.
>  template <typename KeyT, typename ValueT>
>  struct DenseMapPair : public std::pair<KeyT, ValueT> {
> +
> +  using std::pair<KeyT, ValueT>::pair;
> +
>

This bit apparently breaks building LLVM on Mac OS 10.11.
Removing it causes the build to to fail differently, though.
(1 failure instead of many)

Details available if you want them.

--- Marshall

P.S. Sorry for the slow bug report; I was traveling last week.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181023/f94f5eca/attachment.html>


More information about the llvm-commits mailing list