[all-commits] [llvm/llvm-project] 31e820: [libc++] NFCI: Simplify macro definitions for the ...

Louis Dionne via All-commits all-commits at lists.llvm.org
Fri Oct 2 12:11:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 31e820378b8ae4d81e9d206a7dae64ccf4b4c97f
      https://github.com/llvm/llvm-project/commit/31e820378b8ae4d81e9d206a7dae64ccf4b4c97f
  Author: Louis Dionne <ldionne at apple.com>
  Date:   2020-10-02 (Fri, 02 Oct 2020)

  Changed paths:
    M libcxx/include/__config
    M libcxx/include/__debug
    M libcxx/include/__hash_table
    M libcxx/include/iterator
    M libcxx/include/list
    M libcxx/include/locale
    M libcxx/include/string
    M libcxx/include/unordered_map
    M libcxx/include/unordered_set
    M libcxx/include/vector

  Log Message:
  -----------
  [libc++] NFCI: Simplify macro definitions for the debug mode

The debug mode always had three possibilities:
- _LIBCPP_DEBUG is undefined => no assertions
- _LIBCPP_DEBUG == 0         => some assertions
- _LIBCPP_DEBUG == 1         => some assertions + iterator checks

This was documented that way, however the code did not make this clear
at all. The discrepancy between _LIBCPP_DEBUG and _LIBCPP_DEBUG_LEVEL
was especially confusing. I reworked how the various macros are defined
without changing anything else to make the code clearer.


  Commit: 870827f65222ebb1a9701d4d0e916f315dc692a8
      https://github.com/llvm/llvm-project/commit/870827f65222ebb1a9701d4d0e916f315dc692a8
  Author: Louis Dionne <ldionne at apple.com>
  Date:   2020-10-02 (Fri, 02 Oct 2020)

  Changed paths:
    M libcxx/include/__debug
    M libcxx/include/__hash_table

  Log Message:
  -----------
  [libc++] NFCI: Remove the _LIBCPP_DEBUG_MODE helper macro

It was used inconsistently and the name was pretty confusing, so we might
as well use `#if _LIBCPP_DEBUG_LEVEL == 2` consistently everywhere.


Compare: https://github.com/llvm/llvm-project/compare/66cf68ed4678...870827f65222


More information about the All-commits mailing list