[clang] [Tooling/Inclusion] Add binary search related `std::ranges` symbols to the mapping. (PR #113796)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 07:41:08 PDT 2024


https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/113796

>From aa9e5c50287aa3d60fe1145ccda6b1e5f90c53a8 Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Sun, 27 Oct 2024 14:15:23 +0800
Subject: [PATCH 1/3] add Binary search operations (on sorted ranges)

---
 clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc b/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc
index b46bd2e4d7a4b5..48d1afc378d54f 100644
--- a/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc
+++ b/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc
@@ -3547,6 +3547,7 @@ SYMBOL(as_rvalue_view, std::ranges::, <ranges>)
 SYMBOL(basic_istream_view, std::ranges::, <ranges>)
 SYMBOL(begin, std::ranges::, <ranges>)
 SYMBOL(bidirectional_range, std::ranges::, <ranges>)
+SYMBOL(binary_search, std::ranges::, <algorithm>)
 SYMBOL(binary_transform_result, std::ranges::, <algorithm>)
 SYMBOL(borrowed_iterator_t, std::ranges::, <ranges>)
 SYMBOL(borrowed_range, std::ranges::, <ranges>)
@@ -3592,6 +3593,7 @@ SYMBOL(enable_view, std::ranges::, <ranges>)
 SYMBOL(end, std::ranges::, <ranges>)
 SYMBOL(ends_with, std::ranges::, <algorithm>)
 SYMBOL(equal, std::ranges::, <algorithm>)
+SYMBOL(equal_range, std::ranges::, <algorithm>)
 SYMBOL(equal_to, std::ranges::, <functional>)
 SYMBOL(fill, std::ranges::, <algorithm>)
 SYMBOL(fill_n, std::ranges::, <algorithm>)
@@ -3643,6 +3645,7 @@ SYMBOL(lazy_split_view, std::ranges::, <ranges>)
 SYMBOL(less, std::ranges::, <functional>)
 SYMBOL(less_equal, std::ranges::, <functional>)
 SYMBOL(lexicographical_compare, std::ranges::, <algorithm>)
+SYMBOL(lower_bound, std::ranges::, <algorithm>)
 SYMBOL(make_heap, std::ranges::, <algorithm>)
 SYMBOL(max, std::ranges::, <algorithm>)
 SYMBOL(max_element, std::ranges::, <algorithm>)
@@ -3765,6 +3768,7 @@ SYMBOL(uninitialized_value_construct_n, std::ranges::, <memory>)
 SYMBOL(unique, std::ranges::, <algorithm>)
 SYMBOL(unique_copy, std::ranges::, <algorithm>)
 SYMBOL(unique_copy_result, std::ranges::, <algorithm>)
+SYMBOL(upper_bound, std::ranges::, <algorithm>)
 SYMBOL(values_view, std::ranges::, <ranges>)
 SYMBOL(view, std::ranges::, <ranges>)
 SYMBOL(view_base, std::ranges::, <ranges>)

>From 1b538cbd01511e4dd2b7248ab412175f1f85b540 Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Tue, 29 Oct 2024 22:39:33 +0800
Subject: [PATCH 2/3] Update StdSpecialSymbolMap.inc

---
 clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc b/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
index 0d351d688a3296..c02b79a2be1df2 100644
--- a/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
+++ b/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
@@ -377,6 +377,11 @@ SYMBOL(gmtime_r, None, <time.h>)
 SYMBOL(gmtime_s, None, <ctime>)
 SYMBOL(gmtime_s, None, <time.h>)
 
+SYMBOL(binary_search, std::ranges::, <algorithm>)
+SYMBOL(equal_range, std::ranges::, <algorithm>)
+SYMBOL(lower_bound, std::ranges::, <algorithm>)
+SYMBOL(upper_bound, std::ranges::, <algorithm>)
+
 // The std::placeholder symbols (_1, ..., _N) are listed in the cppreference
 // placeholder.html, but the index only contains a single entry with "_1, _2, ..., _N"
 // text, which are not handled by the script.

>From 08b8fa1c511165ef46dc243a848dafce3f9cf2fd Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Tue, 29 Oct 2024 22:40:33 +0800
Subject: [PATCH 3/3] Update StdSymbolMap.inc

---
 clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc b/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc
index 48d1afc378d54f..b46bd2e4d7a4b5 100644
--- a/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc
+++ b/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc
@@ -3547,7 +3547,6 @@ SYMBOL(as_rvalue_view, std::ranges::, <ranges>)
 SYMBOL(basic_istream_view, std::ranges::, <ranges>)
 SYMBOL(begin, std::ranges::, <ranges>)
 SYMBOL(bidirectional_range, std::ranges::, <ranges>)
-SYMBOL(binary_search, std::ranges::, <algorithm>)
 SYMBOL(binary_transform_result, std::ranges::, <algorithm>)
 SYMBOL(borrowed_iterator_t, std::ranges::, <ranges>)
 SYMBOL(borrowed_range, std::ranges::, <ranges>)
@@ -3593,7 +3592,6 @@ SYMBOL(enable_view, std::ranges::, <ranges>)
 SYMBOL(end, std::ranges::, <ranges>)
 SYMBOL(ends_with, std::ranges::, <algorithm>)
 SYMBOL(equal, std::ranges::, <algorithm>)
-SYMBOL(equal_range, std::ranges::, <algorithm>)
 SYMBOL(equal_to, std::ranges::, <functional>)
 SYMBOL(fill, std::ranges::, <algorithm>)
 SYMBOL(fill_n, std::ranges::, <algorithm>)
@@ -3645,7 +3643,6 @@ SYMBOL(lazy_split_view, std::ranges::, <ranges>)
 SYMBOL(less, std::ranges::, <functional>)
 SYMBOL(less_equal, std::ranges::, <functional>)
 SYMBOL(lexicographical_compare, std::ranges::, <algorithm>)
-SYMBOL(lower_bound, std::ranges::, <algorithm>)
 SYMBOL(make_heap, std::ranges::, <algorithm>)
 SYMBOL(max, std::ranges::, <algorithm>)
 SYMBOL(max_element, std::ranges::, <algorithm>)
@@ -3768,7 +3765,6 @@ SYMBOL(uninitialized_value_construct_n, std::ranges::, <memory>)
 SYMBOL(unique, std::ranges::, <algorithm>)
 SYMBOL(unique_copy, std::ranges::, <algorithm>)
 SYMBOL(unique_copy_result, std::ranges::, <algorithm>)
-SYMBOL(upper_bound, std::ranges::, <algorithm>)
 SYMBOL(values_view, std::ranges::, <ranges>)
 SYMBOL(view, std::ranges::, <ranges>)
 SYMBOL(view_base, std::ranges::, <ranges>)



More information about the cfe-commits mailing list