This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][modularisation] splices `<iterator>` into individual headers
ClosedPublic

Authored by cjdb on Jun 28 2021, 8:14 PM.

Details

Diff Detail

Event Timeline

cjdb created this revision.Jun 28 2021, 8:14 PM
cjdb requested review of this revision.Jun 28 2021, 8:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2021, 8:14 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Jul 5 2021, 12:42 PM
ldionne added inline comments.
libcxx/include/CMakeLists.txt
133

Please keep everything sorted.

140–141

Please keep at one level of nesting.

This revision now requires changes to proceed.Jul 5 2021, 12:42 PM
cjdb updated this revision to Diff 356564.Jul 5 2021, 2:39 PM

applies @ldionne's feedback

cjdb added a comment.Jul 5 2021, 8:05 PM

The single failure I'm seeing is completely unrelated and has happened on several patches I've made. Since it's thread-related, I'm thinking it might be a race condition?

ldionne accepted this revision.Jul 6 2021, 8:48 AM

LGTM, but please remove the stray whitespace change before committing. Thanks!

libcxx/include/__iterator/wrap_iter.h
16 ↗(On Diff #356564)

Stray whitespace change.

This revision is now accepted and ready to land.Jul 6 2021, 8:48 AM
This revision was landed with ongoing or failed builds.Jul 6 2021, 10:59 AM
This revision was automatically updated to reflect the committed changes.
mehdi_amini added a subscriber: mehdi_amini.EditedJul 6 2021, 11:13 AM

I think this breaks the bootstrap of clang somehow:

[491/508] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o
FAILED: libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o
/tmp/ci-2ohZKYWbsH/./bin/clang++ --target=x86_64-unknown-linux-gnu -DNDEBUG -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_LINK_PTHREAD_LIB -D_LIBCPP_LINK_RT_LIB -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilibcxx/include/c++build -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3  -DLIBCXX_BUILDING_LIBCXXABI -faligned-allocation -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -Wall -Wextra -W -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-ignored-attributes -Wno-error -I/tmp/ci-2ohZKYWbsH/include/c++/v1 -I/tmp/ci-2ohZKYWbsH/include/x86_64-unknown-linux-gnu/c++/v1 -std=c++20 -MD -MT libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o -MF libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o.d -o libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o -c /var/lib/buildkite-agent/builds/buildkite-74bcfb76f5-mkp7s-1/mlir/mlir-core/libcxx/src/filesystem/directory_iterator.cpp
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /tmp/ci-2ohZKYWbsH/./bin/clang++ --target=x86_64-unknown-linux-gnu -DNDEBUG -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_LINK_PTHREAD_LIB -D_LIBCPP_LINK_RT_LIB -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilibcxx/include/c++build -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DLIBCXX_BUILDING_LIBCXXABI -faligned-allocation -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -Wall -Wextra -W -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-ignored-attributes -Wno-error -I/tmp/ci-2ohZKYWbsH/include/c++/v1 -I/tmp/ci-2ohZKYWbsH/include/x86_64-unknown-linux-gnu/c++/v1 -std=c++20 -MD -MT libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o -MF libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o.d -o libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o -c /var/lib/buildkite-agent/builds/buildkite-74bcfb76f5-mkp7s-1/mlir/mlir-core/libcxx/src/filesystem/directory_iterator.cpp
1.	<eof> parser at end of file
2.	Optimizer
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x23)[0x2eac243]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x2eaa0ae]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm3sys15CleanupOnSignalEm+0xe2)[0x2eab6d2]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x2e1f2bf]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f1660d5f980]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x1b6b48b]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm16MemoryDepChecker11isDependentERKNS_14PointerIntPairIPNS_5ValueELj1EbNS_21PointerLikeTypeTraitsIS3_EENS_18PointerIntPairInfoIS3_Lj1ES5_EEEEjSA_jRKNS_8DenseMapIPKS2_S3_NS_12DenseMapInfoISD_EENS_6detail12DenseMapPairISD_S3_EEEE+0x360)[0x22d9e60]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm16MemoryDepChecker11areDepsSafeERNS_18EquivalenceClassesINS_14PointerIntPairIPNS_5ValueELj1EbNS_21PointerLikeTypeTraitsIS4_EENS_18PointerIntPairInfoIS4_Lj1ES6_EEEEEERNS_11SmallVectorIS9_Lj8EEERKNS_8DenseMapIPKS3_S4_NS_12DenseMapInfoISH_EENS_6detail12DenseMapPairISH_S4_EEEE+0x6e4)[0x22da9a4]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm14LoopAccessInfo11analyzeLoopEPNS_9AAResultsEPNS_8LoopInfoEPKNS_17TargetLibraryInfoEPNS_13DominatorTreeE+0x1733)[0x22dc7c3]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm18LoopAccessAnalysis3runERNS_4LoopERNS_15AnalysisManagerIS1_JRNS_27LoopStandardAnalysisResultsEEEES5_+0x2d)[0x22deb2d]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x3e194e5]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm15AnalysisManagerINS_4LoopEJRNS_27LoopStandardAnalysisResultsEEE13getResultImplEPNS_11AnalysisKeyERS1_S3_+0x2d2)[0x2c38b02]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x302f474]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm25LoopVectorizationLegality18canVectorizeMemoryEv+0x28)[0x3035998]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm25LoopVectorizationLegality12canVectorizeEb+0x156)[0x3037186]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm17LoopVectorizePass11processLoopEPNS_4LoopE+0x2a8)[0x301be18]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm17LoopVectorizePass7runImplERNS_8FunctionERNS_15ScalarEvolutionERNS_8LoopInfoERNS_19TargetTransformInfoERNS_13DominatorTreeERNS_18BlockFrequencyInfoEPNS_17TargetLibraryInfoERNS_12DemandedBitsERNS_9AAResultsERNS_15AssumptionCacheERSt8functionIFRKNS_14LoopAccessInfoERNS_4LoopEEERNS_25OptimizationRemarkEmitterEPNS_18ProfileSummaryInfoE+0x1a7)[0x3021647]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm17LoopVectorizePass3runERNS_8FunctionERNS_15AnalysisManagerIS1_JEEE+0x2aa)[0x3021b1a]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x3e2c63d]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm11PassManagerINS_8FunctionENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x17c)[0x27bf35c]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x1daa21d]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm27ModuleToFunctionPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x1a3)[0x27c2493]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x1daa09d]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x189)[0x27be509]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x30d7638]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN5clang17EmitBackendOutputERNS_17DiagnosticsEngineERKNS_19HeaderSearchOptionsERKNS_14CodeGenOptionsERKNS_13TargetOptionsERKNS_11LangOptionsEN4llvm9StringRefEPNSE_6ModuleENS_13BackendActionESt10unique_ptrINSE_17raw_pwrite_streamESt14default_deleteISK_EE+0x12ef)[0x30d0f9f]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x37e2ac2]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN5clang8ParseASTERNS_4SemaEbb+0x273)[0x4621c03]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN5clang14FrontendAction7ExecuteEv+0x10b)[0x37398ab]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x32b)[0x36a78cb]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x659)[0x37ddbd9]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x92f)[0x1ad9f3f]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x1ad8418]
/tmp/ci-2ohZKYWbsH/./bin/clang++[0x3545272]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0xd7)[0x2e1f0a7]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZNK5clang6driver10CC1Command7ExecuteEN4llvm8ArrayRefINS2_8OptionalINS2_9StringRefEEEEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPb+0x139)[0x3544d89]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x196)[0x350f5b6]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x8a)[0x350fa5a]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x188)[0x35282c8]
/tmp/ci-2ohZKYWbsH/./bin/clang++(main+0x2b17)[0x1ad7e17]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f165f7ebbf7]
/tmp/ci-2ohZKYWbsH/./bin/clang++(_start+0x2a)[0x1ad502a]
clang-13: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project 8517a26d442fa1b3d01e52a83ae76023ba7c9784)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /tmp/ci-2ohZKYWbsH/./bin

https://buildkite.com/mlir/mlir-core/builds/15006#3b694d67-a3cc-4b56-81d6-19e7bc279570

cjdb added a comment.Jul 6 2021, 11:18 AM

Yikes! @ldionne, I'm going to look into this now. @mehdi_amini can you ping me on chat?

Actually other than this change being about "iterator" and the file crashing clang being libcxx/directory_iterator.cpp, there is no specific link. I'm bisecting the blame list...

Actually other than this change being about "iterator" and the file crashing clang being libcxx/directory_iterator.cpp, there is no specific link. I'm bisecting the blame list...

Bisected to https://reviews.llvm.org/D104806 which just got reverted! Sorry for the noise :)