Skip to content

[libc++][NFC] Rename fold.h to ranges_fold.h #109696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 23, 2024

This follows the pattern we use consistently for ranges algorithms.

@ldionne ldionne requested a review from a team as a code owner September 23, 2024 17:56
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

This follows the pattern we use consistently for ranges algorithms.


Full diff: https://github.com/llvm/llvm-project/pull/109696.diff

4 Files Affected:

  • (modified) libcxx/include/CMakeLists.txt (+1-1)
  • (renamed) libcxx/include/__algorithm/ranges_fold.h (+3-3)
  • (modified) libcxx/include/algorithm (+1-1)
  • (modified) libcxx/include/module.modulemap (+1-1)
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 8c61009167ddce..c73507723392e0 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -23,7 +23,6 @@ set(files
   __algorithm/find_if.h
   __algorithm/find_if_not.h
   __algorithm/find_segment_if.h
-  __algorithm/fold.h
   __algorithm/for_each.h
   __algorithm/for_each_n.h
   __algorithm/for_each_segment.h
@@ -98,6 +97,7 @@ set(files
   __algorithm/ranges_find_if.h
   __algorithm/ranges_find_if_not.h
   __algorithm/ranges_find_last.h
+  __algorithm/ranges_fold.h
   __algorithm/ranges_for_each.h
   __algorithm/ranges_for_each_n.h
   __algorithm/ranges_generate.h
diff --git a/libcxx/include/__algorithm/fold.h b/libcxx/include/__algorithm/ranges_fold.h
similarity index 97%
rename from libcxx/include/__algorithm/fold.h
rename to libcxx/include/__algorithm/ranges_fold.h
index 1bcb3be9aadabe..d2c39213985044 100644
--- a/libcxx/include/__algorithm/fold.h
+++ b/libcxx/include/__algorithm/ranges_fold.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FOLD_H
-#define _LIBCPP___ALGORITHM_FOLD_H
+#ifndef _LIBCPP___ALGORITHM_RANGES_FOLD_H
+#define _LIBCPP___ALGORITHM_RANGES_FOLD_H
 
 #include <__concepts/assignable.h>
 #include <__concepts/constructible.h>
@@ -126,4 +126,4 @@ _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
 
-#endif // _LIBCPP___ALGORITHM_FOLD_H
+#endif // _LIBCPP___ALGORITHM_RANGES_FOLD_H
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 36fd035b7e51b3..17d63ce0cf1c0f 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -2020,10 +2020,10 @@ template <class BidirectionalIterator, class Compare>
 #endif
 
 #if _LIBCPP_STD_VER >= 23
-#  include <__algorithm/fold.h>
 #  include <__algorithm/ranges_contains_subrange.h>
 #  include <__algorithm/ranges_ends_with.h>
 #  include <__algorithm/ranges_find_last.h>
+#  include <__algorithm/ranges_fold.h>
 #  include <__algorithm/ranges_starts_with.h>
 #endif // _LIBCPP_STD_VER >= 23
 
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index c1181a3622513f..932730995db709 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -714,7 +714,6 @@ module std_private_algorithm_find_first_of                               [system
 module std_private_algorithm_find_if                                     [system] { header "__algorithm/find_if.h" }
 module std_private_algorithm_find_if_not                                 [system] { header "__algorithm/find_if_not.h" }
 module std_private_algorithm_find_segment_if                             [system] { header "__algorithm/find_segment_if.h" }
-module std_private_algorithm_fold                                        [system] { header "__algorithm/fold.h" }
 module std_private_algorithm_for_each                                    [system] { header "__algorithm/for_each.h" }
 module std_private_algorithm_for_each_n                                  [system] { header "__algorithm/for_each_n.h" }
 module std_private_algorithm_for_each_segment                            [system] { header "__algorithm/for_each_segment.h" }
@@ -823,6 +822,7 @@ module std_private_algorithm_ranges_find_first_of                        [system
 module std_private_algorithm_ranges_find_if                              [system] { header "__algorithm/ranges_find_if.h" }
 module std_private_algorithm_ranges_find_if_not                          [system] { header "__algorithm/ranges_find_if_not.h" }
 module std_private_algorithm_ranges_find_last                            [system] { header "__algorithm/ranges_find_last.h" }
+module std_private_algorithm_ranges_fold                                 [system] { header "__algorithm/ranges_fold.h" }
 module std_private_algorithm_ranges_for_each                             [system] {
   header "__algorithm/ranges_for_each.h"
   export std_private_algorithm_in_fun_result

This follows the pattern we use consistently for ranges algorithms.
@ldionne ldionne force-pushed the review/rename-ranges-fold branch from 2f5f11f to 843363b Compare September 26, 2024 17:26
@ldionne ldionne merged commit 24bc324 into llvm:main Sep 27, 2024
62 checks passed
@ldionne ldionne deleted the review/rename-ranges-fold branch September 27, 2024 05:02
Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this pull request Sep 27, 2024
This follows the pattern we use consistently for ranges algorithms.
llvm-beanz added a commit to llvm-beanz/llvm-project that referenced this pull request Sep 28, 2024
ldionne added a commit that referenced this pull request Sep 30, 2024
This follows the pattern we use consistently for ranges algorithms.

This is a re-application of 24bc324 which had been reverted in
f11abac due to unrelated failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants