summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx
diff options
context:
space:
mode:
authorthegeorg <[email protected]>2024-12-26 20:51:38 +0300
committerthegeorg <[email protected]>2024-12-26 21:34:35 +0300
commitbdc1680410d66d515192998b7aaf8a4679781dfa (patch)
tree591b1b64f728edac3689d6468a09a31da5d64249 /contrib/libs/cxxsupp/libcxx
parent4f2c0d19cf934dead8b3a8872a0655740360177c (diff)
contrib/libs/libcxx: Backport accepted version of PR #93316
This backports [PR #93316](https://github.com/llvm/llvm-project/pull/93316) for real. commit_hash:c06d30afb498591c84dd306c44227026d402b479
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h15
-rw-r--r--contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-09-cache-direntry.patch (renamed from contrib/libs/cxxsupp/libcxx/patches/pr93316-cache-direntry.patch)51
2 files changed, 40 insertions, 26 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h
index 70a10dd8fa9..90e44f5d13d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/directory_entry.h
@@ -200,11 +200,11 @@ private:
_Empty,
_IterSymlink,
_IterNonSymlink,
- _IterCachedSymlink,
- _IterCachedNonSymlink,
_RefreshSymlink,
_RefreshSymlinkUnresolved,
- _RefreshNonSymlink
+ _RefreshNonSymlink,
+ _IterCachedSymlink,
+ _IterCachedNonSymlink
};
struct __cached_data {
@@ -313,9 +313,9 @@ private:
if (__ec)
__ec->clear();
return file_type::symlink;
- case _IterNonSymlink:
case _IterCachedNonSymlink:
- case _RefreshNonSymlink:
+ case _IterNonSymlink:
+ case _RefreshNonSymlink: {
file_status __st(__data_.__type_);
if (__ec && !filesystem::exists(__st))
*__ec = make_error_code(errc::no_such_file_or_directory);
@@ -323,6 +323,7 @@ private:
__ec->clear();
return __data_.__type_;
}
+ }
__libcpp_unreachable();
}
@@ -333,8 +334,8 @@ private:
case _IterCachedSymlink:
case _RefreshSymlinkUnresolved:
return __status(__p_, __ec).type();
- case _IterNonSymlink:
case _IterCachedNonSymlink:
+ case _IterNonSymlink:
case _RefreshNonSymlink:
case _RefreshSymlink: {
file_status __st(__data_.__type_);
@@ -430,10 +431,10 @@ private:
case _Empty:
case _IterNonSymlink:
case _IterSymlink:
+ case _IterCachedSymlink:
case _RefreshSymlinkUnresolved:
return filesystem::__last_write_time(__p_, __ec);
case _IterCachedNonSymlink:
- case _IterCachedSymlink:
case _RefreshSymlink:
case _RefreshNonSymlink: {
error_code __m_ec;
diff --git a/contrib/libs/cxxsupp/libcxx/patches/pr93316-cache-direntry.patch b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-09-cache-direntry.patch
index 80166c52e0f..825a61722eb 100644
--- a/contrib/libs/cxxsupp/libcxx/patches/pr93316-cache-direntry.patch
+++ b/contrib/libs/cxxsupp/libcxx/patches/00-future-2024-09-09-cache-direntry.patch
@@ -1,16 +1,18 @@
diff --git a/include/__filesystem/directory_entry.h b/include/__filesystem/directory_entry.h
-index 016ad94..70a10dd 100644
+index 016ad94..90e44f5 100644
--- a/include/__filesystem/directory_entry.h
+++ b/include/__filesystem/directory_entry.h
-@@ -200,6 +200,8 @@ private:
- _Empty,
- _IterSymlink,
+@@ -202,7 +202,9 @@ private:
_IterNonSymlink,
-+ _IterCachedSymlink,
-+ _IterCachedNonSymlink,
_RefreshSymlink,
_RefreshSymlinkUnresolved,
- _RefreshNonSymlink
+- _RefreshNonSymlink
++ _RefreshNonSymlink,
++ _IterCachedSymlink,
++ _IterCachedNonSymlink
+ };
+
+ struct __cached_data {
@@ -241,6 +243,29 @@ private:
return __data;
}
@@ -41,7 +43,7 @@ index 016ad94..70a10dd 100644
_LIBCPP_HIDE_FROM_ABI void __assign_iter_entry(_Path&& __p, __cached_data __dt) {
__p_ = std::move(__p);
__data_ = __dt;
-@@ -282,12 +307,14 @@ private:
+@@ -282,13 +307,15 @@ private:
case _Empty:
return __symlink_status(__p_, __ec).type();
case _IterSymlink:
@@ -51,24 +53,33 @@ index 016ad94..70a10dd 100644
if (__ec)
__ec->clear();
return file_type::symlink;
- case _IterNonSymlink:
+ case _IterCachedNonSymlink:
- case _RefreshNonSymlink:
+ case _IterNonSymlink:
+- case _RefreshNonSymlink:
++ case _RefreshNonSymlink: {
file_status __st(__data_.__type_);
if (__ec && !filesystem::exists(__st))
-@@ -303,9 +330,11 @@ private:
+ *__ec = make_error_code(errc::no_such_file_or_directory);
+@@ -296,6 +323,7 @@ private:
+ __ec->clear();
+ return __data_.__type_;
+ }
++ }
+ __libcpp_unreachable();
+ }
+
+@@ -303,8 +331,10 @@ private:
switch (__data_.__cache_type_) {
case _Empty:
case _IterSymlink:
+ case _IterCachedSymlink:
case _RefreshSymlinkUnresolved:
return __status(__p_, __ec).type();
- case _IterNonSymlink:
+ case _IterCachedNonSymlink:
+ case _IterNonSymlink:
case _RefreshNonSymlink:
case _RefreshSymlink: {
- file_status __st(__data_.__type_);
-@@ -324,8 +353,10 @@ private:
+@@ -324,8 +354,10 @@ private:
case _Empty:
case _IterNonSymlink:
case _IterSymlink:
@@ -79,7 +90,7 @@ index 016ad94..70a10dd 100644
case _RefreshNonSymlink:
case _RefreshSymlink:
return file_status(__get_ft(__ec), __data_.__non_sym_perms_);
-@@ -339,8 +370,10 @@ private:
+@@ -339,8 +371,10 @@ private:
case _IterNonSymlink:
case _IterSymlink:
return __symlink_status(__p_, __ec);
@@ -90,7 +101,7 @@ index 016ad94..70a10dd 100644
case _RefreshSymlink:
case _RefreshSymlinkUnresolved:
return file_status(__get_sym_ft(__ec), __data_.__sym_perms_);
-@@ -353,8 +386,10 @@ private:
+@@ -353,8 +387,10 @@ private:
case _Empty:
case _IterNonSymlink:
case _IterSymlink:
@@ -101,7 +112,7 @@ index 016ad94..70a10dd 100644
case _RefreshSymlink:
case _RefreshNonSymlink: {
error_code __m_ec;
-@@ -375,6 +410,8 @@ private:
+@@ -375,6 +411,8 @@ private:
case _Empty:
case _IterNonSymlink:
case _IterSymlink:
@@ -110,12 +121,14 @@ index 016ad94..70a10dd 100644
case _RefreshSymlinkUnresolved:
return filesystem::__hard_link_count(__p_, __ec);
case _RefreshSymlink:
-@@ -395,6 +432,8 @@ private:
+@@ -393,8 +431,10 @@ private:
+ case _Empty:
+ case _IterNonSymlink:
case _IterSymlink:
++ case _IterCachedSymlink:
case _RefreshSymlinkUnresolved:
return filesystem::__last_write_time(__p_, __ec);
+ case _IterCachedNonSymlink:
-+ case _IterCachedSymlink:
case _RefreshSymlink:
case _RefreshNonSymlink: {
error_code __m_ec;