[all-commits] [llvm/llvm-project] 7ad49a: [libc++] Split allocator_traits and pointer_traits...

Louis Dionne via All-commits all-commits at lists.llvm.org
Mon Dec 14 13:18:39 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ad49aec125b3c1205b164331d0aa954d773f890
      https://github.com/llvm/llvm-project/commit/7ad49aec125b3c1205b164331d0aa954d773f890
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    A libcxx/include/__memory/allocator_traits.h
    A libcxx/include/__memory/base.h
    A libcxx/include/__memory/pointer_traits.h
    M libcxx/include/exception
    M libcxx/include/iterator
    M libcxx/include/memory
    M libcxx/include/type_traits
    M libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp

  Log Message:
  -----------
  [libc++] Split allocator_traits and pointer_traits out of <memory>

In addition to making the code a lot easier to grasp by localizing many
helper functions to the only file where they are actually needed, this
will allow creating helper functions that depend on allocator_traits
outside of <memory>.

This is done as part of implementing array support in allocate_shared,
which requires non-trivial array initialization algorithms that would be
better to keep out of <memory> for sanity. It's also a first step towards
splitting up our monolithic headers into finer grained ones, which will
make it easier to reuse functionality across the library. For example,
it's just weird that we had to define `addressof` inside <type_traits>
to avoid circular dependencies -- instead it's better to implement those
in true helper headers.

Differential Revision: https://reviews.llvm.org/D93074




More information about the All-commits mailing list