Skip to content

Commit 1894906

Browse files
committed
Update std symbol mapping to v20240610; Move assertion to detect all ungrouped mappings
1 parent d502ba8 commit 1894906

File tree

3 files changed

+138
-32
lines changed

3 files changed

+138
-32
lines changed

clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,17 @@ static int initialize(Lang Language) {
115115
NSLen = 0;
116116
}
117117

118-
if (SymIndex >= 0 &&
119-
Mapping->SymbolNames[SymIndex].qualifiedName() == QName) {
120-
// Not a new symbol, use the same index.
118+
if (SymIndex > 0) {
121119
assert(llvm::none_of(llvm::ArrayRef(Mapping->SymbolNames, SymIndex),
122120
[&QName](const SymbolHeaderMapping::SymbolName &S) {
123121
return S.qualifiedName() == QName;
124122
}) &&
125123
"The symbol has been added before, make sure entries in the .inc "
126124
"file are grouped by symbol name!");
125+
}
126+
if (SymIndex >= 0 &&
127+
Mapping->SymbolNames[SymIndex].qualifiedName() == QName) {
128+
// Not a new symbol, use the same index.
127129
} else {
128130
// First symbol or new symbol, increment next available index.
129131
++SymIndex;

clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,37 @@ SYMBOL(ssize, std::, <string_view>)
232232
SYMBOL(ssize, std::, <unordered_map>)
233233
SYMBOL(ssize, std::, <unordered_set>)
234234
SYMBOL(ssize, std::, <vector>)
235+
// C++ [range.access.general]: ... the customization point objects
236+
// in [range.access] are available when the header <iterator> is included.
237+
SYMBOL(begin, std::ranges::, <ranges>)
238+
SYMBOL(begin, std::ranges::, <iterator>)
239+
SYMBOL(cbegin, std::ranges::, <ranges>)
240+
SYMBOL(cbegin, std::ranges::, <iterator>)
241+
SYMBOL(cdata, std::ranges::, <ranges>)
242+
SYMBOL(cdata, std::ranges::, <iterator>)
243+
SYMBOL(cend, std::ranges::, <ranges>)
244+
SYMBOL(cend, std::ranges::, <iterator>)
245+
SYMBOL(crbegin, std::ranges::, <ranges>)
246+
SYMBOL(crbegin, std::ranges::, <iterator>)
247+
SYMBOL(crend, std::ranges::, <ranges>)
248+
SYMBOL(crend, std::ranges::, <iterator>)
249+
SYMBOL(data, std::ranges::, <ranges>)
250+
SYMBOL(data, std::ranges::, <iterator>)
251+
SYMBOL(empty, std::ranges::, <ranges>)
252+
SYMBOL(empty, std::ranges::, <iterator>)
253+
SYMBOL(end, std::ranges::, <ranges>)
254+
SYMBOL(end, std::ranges::, <iterator>)
255+
SYMBOL(rbegin, std::ranges::, <ranges>)
256+
SYMBOL(rbegin, std::ranges::, <iterator>)
257+
SYMBOL(rend, std::ranges::, <ranges>)
258+
SYMBOL(rend, std::ranges::, <iterator>)
259+
SYMBOL(size, std::ranges::, <ranges>)
260+
SYMBOL(size, std::ranges::, <iterator>)
261+
SYMBOL(ssize, std::ranges::, <ranges>)
262+
SYMBOL(ssize, std::ranges::, <iterator>)
263+
264+
// Ignore specializations
265+
SYMBOL(hash, std::, <functional>)
235266

236267
// Add headers for generic integer-type abs.
237268
// Ignore other variants (std::complex, std::valarray, std::intmax_t)
@@ -352,20 +383,23 @@ SYMBOL(get, std::, /*no headers*/)
352383
// providing the type.
353384
SYMBOL(make_error_code, std::, /*no headers*/)
354385
SYMBOL(make_error_condition, std::, /*no headers*/)
386+
// Similar to std::get, has variants for multiple containers
387+
// (vector, deque, list, etc.)
388+
SYMBOL(erase, std::, /*no headers*/)
389+
SYMBOL(erase_if, std::, /*no headers*/)
355390

356391
// cppreference symbol index page was missing these symbols.
357392
// Remove them when the cppreference offline archive catches up.
358-
SYMBOL(index_sequence, std::, <utility>)
359-
SYMBOL(index_sequence_for, std::, <utility>)
360-
SYMBOL(make_index_sequence, std::, <utility>)
361-
SYMBOL(make_integer_sequence, std::, <utility>)
393+
SYMBOL(regular_invocable, std::, <concepts>)
362394

363395
// Symbols missing from the generated symbol map as reported by users.
364396
// Remove when the generator starts producing them.
365-
SYMBOL(make_any, std::, <any>)
366-
SYMBOL(any_cast, std::, <any>)
367397
SYMBOL(div, std::, <cstdlib>)
368398
SYMBOL(abort, std::, <cstdlib>)
399+
SYMBOL(atomic_wait, std::, <atomic>)
400+
SYMBOL(atomic_wait_explicit, std::, <atomic>)
401+
SYMBOL(move_backward, std::, <algorithm>)
402+
SYMBOL(month_weekday, std::chrono::, <chrono>)
369403

370404
// These are C symbols that are not under std namespace.
371405
SYMBOL(localtime_r, None, <ctime>)

0 commit comments

Comments
 (0)