[all-commits] [llvm/llvm-project] bd3f5a: [libc++][pstl] Improve exception handling (#88998)

Louis Dionne via All-commits all-commits at lists.llvm.org
Wed May 22 12:39:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bd3f5a4bd3d9d7ee8ae801c24c5081073b20abd4
      https://github.com/llvm/llvm-project/commit/bd3f5a4bd3d9d7ee8ae801c24c5081073b20abd4
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2024-05-22 (Wed, 22 May 2024)

  Changed paths:
    M libcxx/include/__algorithm/pstl_copy.h
    M libcxx/include/__algorithm/pstl_count.h
    M libcxx/include/__algorithm/pstl_equal.h
    M libcxx/include/__algorithm/pstl_fill.h
    M libcxx/include/__algorithm/pstl_find.h
    M libcxx/include/__algorithm/pstl_generate.h
    M libcxx/include/__algorithm/pstl_is_partitioned.h
    M libcxx/include/__algorithm/pstl_merge.h
    M libcxx/include/__algorithm/pstl_replace.h
    M libcxx/include/__algorithm/pstl_sort.h
    R libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.modifying.operations/alg.move/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.nonmodifying/alg.all_of/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.nonmodifying/alg.any_of/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.nonmodifying/alg.find/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.nonmodifying/alg.none_of/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.sorting/alg.merge/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/numeric.ops/reduce/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/numeric.ops/reduce/pstl.reduce.pass.cpp
    R libcxx/test/std/algorithms/numeric.ops/transform.reduce/pstl.exception_handling.pass.cpp
    R libcxx/test/std/algorithms/numeric.ops/transform.reduce/pstl.transform_reduce.binary.pass.cpp
    R libcxx/test/std/algorithms/numeric.ops/transform.reduce/pstl.transform_reduce.unary.pass.cpp
    A libcxx/test/std/algorithms/pstl.exception_handling.pass.cpp
    A libcxx/test/std/numerics/numeric.ops/reduce/pstl.reduce.pass.cpp
    A libcxx/test/std/numerics/numeric.ops/transform.reduce/pstl.transform_reduce.binary.pass.cpp
    A libcxx/test/std/numerics/numeric.ops/transform.reduce/pstl.transform_reduce.unary.pass.cpp

  Log Message:
  -----------
  [libc++][pstl] Improve exception handling (#88998)

There were various places where we incorrectly handled exceptions in the
PSTL. Typical issues were missing `noexcept` and taking iterators by
value instead of by reference.

This patch fixes those inconsistent and incorrect instances, and adds
proper tests for all of those. Note that the previous tests were often
incorrectly turned into no-ops by the compiler due to copy ellision,
which doesn't happen with these new tests.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list