Page MenuHomePhabricator

[libc++] Use __debug_iterator instead of const_iterator to interact with the debug mode
AbandonedPublic

Authored by ldionne on Jun 8 2022, 3:19 PM.

Details

Reviewers
philnik
Group Reviewers
Restricted Project
Summary

This will become useful when adding the debug mode to classes that
don't have a const_iterator, such as std::span.

Diff Detail

Unit TestsFailed

TimeTest
890 mslibcxx CI Debug mode > llvm-libc++-shared-cfg-in.libcxx/containers/unord::non_const_comparator.incomplete.verify.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/c++ /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0
840 mslibcxx CI Debug mode > llvm-libc++-shared-cfg-in.libcxx/containers/unord::non_const_comparator.verify.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/c++ /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0
1,140 mslibcxx CI Debug mode > llvm-libc++-shared-cfg-in.libcxx/containers/unord/unord_multimap::assert.bucket.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/c++ /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ENABLE_ASSERTIONS=1 -lc++experimental -nostdlib++ -L /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/lib -lc++ -pthread -o /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/test/libcxx/containers/unord/unord.multimap/Output/assert.bucket.pass.cpp.dir/t.tmp.exe
1,190 mslibcxx CI Debug mode > llvm-libc++-shared-cfg-in.libcxx/containers/unord/unord_multimap::assert.bucket_size.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/c++ /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ENABLE_ASSERTIONS=1 -lc++experimental -nostdlib++ -L /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/lib -lc++ -pthread -o /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/test/libcxx/containers/unord/unord.multimap/Output/assert.bucket_size.pass.cpp.dir/t.tmp.exe
1,190 mslibcxx CI Debug mode > llvm-libc++-shared-cfg-in.libcxx/containers/unord/unord_multimap::assert.max_load_factor.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/c++ /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ENABLE_ASSERTIONS=1 -lc++experimental -nostdlib++ -L /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/lib -lc++ -pthread -o /home/libcxx-builder/.buildkite-agent/builds/f6cad99d2af2-1/llvm-project/libcxx-ci/build/generic-debug-mode/test/libcxx/containers/unord/unord.multimap/Output/assert.max_load_factor.pass.cpp.dir/t.tmp.exe
View Full Test Results (198 Failed)

Event Timeline

ldionne created this revision.Jun 8 2022, 3:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 3:19 PM
ldionne requested review of this revision.Jun 8 2022, 3:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 3:19 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik requested changes to this revision.Jun 8 2022, 3:26 PM
philnik added a subscriber: philnik.

How would it be useful? AFAICT you're not using __debug_iterator outside the class anywhere. Right now this only adds an indirection where none is needed.

This revision now requires changes to proceed.Jun 8 2022, 3:26 PM

How would it be useful? AFAICT you're not using __debug_iterator outside the class anywhere. Right now this only adds an indirection where none is needed.

As I mention in the review summary, it's useful e.g. for std::span, which doesn't have const_iterator. I uploaded DD127401 to show the follow-up.

ldionne planned changes to this revision.Jun 9 2022, 7:03 AM

Actually, upon making more progress on the successor to D127401, I'm not sure this will be relevant. Putting on the ice for now.

ldionne abandoned this revision.Jun 13 2022, 9:05 AM