[all-commits] [llvm/llvm-project] 4eab04: [libc++] Remove a bunch of conditionals on _LIBCPP...

Louis Dionne via All-commits all-commits at lists.llvm.org
Mon Jun 6 06:54:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4eab04f8491ab4fb8456eea9a73657701c554625
      https://github.com/llvm/llvm-project/commit/4eab04f8491ab4fb8456eea9a73657701c554625
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-06-06 (Mon, 06 Jun 2022)

  Changed paths:
    M libcxx/include/__hash_table
    M libcxx/include/__iterator/wrap_iter.h
    M libcxx/include/list
    M libcxx/include/span
    M libcxx/include/string
    M libcxx/include/vector

  Log Message:
  -----------
  [libc++] Remove a bunch of conditionals on _LIBCPP_DEBUG_LEVEL

Instead of providing two different constructors for iterators that
support the debug mode, provide a single constructor but leave the
container parameter unused when the debug mode is not enabled.

This allows simplifying all the call sites to unconditionally pass
the container, which removes a bunch of duplication in the container's
implementation.

Note that this patch does add some complexity to std::span, however
that is only because std::span has the ability to use raw pointers
as iterators instead of __wrap_iter. In retrospect, I believe it was
a mistake to provide that capability, and so it will be removed in a
future patch, along with the complexity added by this patch.

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




More information about the All-commits mailing list