Page MenuHomePhabricator

[libcxx][nfc] splices non-modifying algorithms into their own headers
AbandonedPublic

Authored by cjdb on May 28 2021, 10:59 AM.

Details

Reviewers
ldionne
zoecarver
Mordante
jdoerfert
Group Reviewers
Restricted Project
Summary
  • Moves all of [alg.nonmodifying] into <__algorithm/${ALGO_NAME}.h>.
  • Moves __search from <functional> into <__functional/__search.h> so we can stop including <functional> in <algorithm>.

Depends on D103329.

Diff Detail

Unit TestsFailed

TimeTest
980 mslibcxx CI Debug iterators > libc++.libcxx/diagnostics::nodiscard_extensions.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/clang++-tot /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp -v --target=x86_64-unknown-linux-gnu -include /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/include/c++/v1 -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DEBUG=1 -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/test/libcxx/diagnostics/Output/nodiscard_extensions.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.
930 mslibcxx CI Debug iterators > libc++.libcxx/diagnostics::nodiscard_extensions.verify.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/clang++-tot /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp -v --target=x86_64-unknown-linux-gnu -include /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/include/c++/v1 -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DEBUG=1 -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/test/libcxx/diagnostics/Output/nodiscard_extensions.verify.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -D_LIBCPP_ENABLE_NODISCARD -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0
1,000 mslibcxx CI Debug iterators > libc++.libcxx/fuzzing::make_heap.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/clang++-tot /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/libcxx/fuzzing/make_heap.pass.cpp -v --target=x86_64-unknown-linux-gnu -include /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/include/c++/v1 -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DEBUG=1 -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/test/libcxx/fuzzing/Output/make_heap.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848…
1,010 mslibcxx CI Debug iterators > libc++.libcxx/fuzzing::nth_element.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/clang++-tot /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp -v --target=x86_64-unknown-linux-gnu -include /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/include/c++/v1 -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DEBUG=1 -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/test/libcxx/fuzzing/Output/nth_element.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.buildkite…
1,010 mslibcxx CI Debug iterators > libc++.libcxx/fuzzing::partial_sort.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/clang++-tot /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/libcxx/fuzzing/partial_sort.pass.cpp -v --target=x86_64-unknown-linux-gnu -include /home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/include/c++/v1 -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DEBUG=1 -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/projects/libcxx/test/libcxx/fuzzing/Output/partial_sort.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -L/home/libcxx-builder/.buildkite-agent/builds/9a663ea0c848-1/llvm-project/libcxx-ci/build/generic-debug-iterators/./lib -Wl,-rpath,/home/libcxx-builder/.buildkite…
View Full Test Results (116 Failed)

Event Timeline

cjdb created this revision.May 28 2021, 10:59 AM
cjdb requested review of this revision.May 28 2021, 10:59 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.May 31 2021, 8:09 AM

LGTM, but can you please keep including <functional> in <algorithm> for now? Add a comment saying // TODO: Remove this include when we're sure it won't break people.

You can then perform the removal immediately after, but in a separate commit. The reason is that I suspect it's going to break a lot of code (which does not include-what-they-use), and so having a separate commit just to toggle that include is going to be helpful for vendors. For example, I might have to temporarily revert that commit for shipping it on Apple platforms until some internal stuff has been fixed - I suspect other vendors will be in the same boat.

This revision is now accepted and ready to land.May 31 2021, 8:09 AM

As usual, I'll leave my for-the-record comment that I really don't like this direction. It makes tons of little headers for no benefit... and I smell the upcoming PR where you add a bunch of C++20 Ranges dependencies into all of these little headers, making compilation slower for C++17 programs and complexifying the dependency graph.

Notice the failing Modules test; that's being discussed in the comments on D102781.

cjdb updated this revision to Diff 349416.Jun 2 2021, 4:58 PM

rebases so Zoe can use this

cjdb abandoned this revision.Jun 11 2021, 9:53 AM