diff --git a/clang/include/clang/Tooling/Inclusions/StdSymbolMap.inc b/clang/include/clang/Tooling/Inclusions/StdSymbolMap.inc --- a/clang/include/clang/Tooling/Inclusions/StdSymbolMap.inc +++ b/clang/include/clang/Tooling/Inclusions/StdSymbolMap.inc @@ -149,32 +149,56 @@ SYMBOL(barrier, std::, ) SYMBOL(basic_common_reference, std::, ) SYMBOL(basic_filebuf, std::, ) +SYMBOL(basic_filebuf, std::, ) SYMBOL(basic_format_arg, std::, ) SYMBOL(basic_format_args, std::, ) SYMBOL(basic_format_context, std::, ) SYMBOL(basic_format_parse_context, std::, ) SYMBOL(basic_fstream, std::, ) +SYMBOL(basic_fstream, std::, ) SYMBOL(basic_ifstream, std::, ) +SYMBOL(basic_ifstream, std::, ) SYMBOL(basic_ios, std::, ) +SYMBOL(basic_ios, std::, ) +SYMBOL(basic_ios, std::, ) SYMBOL(basic_iostream, std::, ) +SYMBOL(basic_iostream, std::, ) +SYMBOL(basic_iostream, std::, ) SYMBOL(basic_ispanstream, std::, ) +SYMBOL(basic_ispanstream, std::, ) SYMBOL(basic_istream, std::, ) +SYMBOL(basic_istream, std::, ) +SYMBOL(basic_istream, std::, ) SYMBOL(basic_istringstream, std::, ) +SYMBOL(basic_istringstream, std::, ) SYMBOL(basic_ofstream, std::, ) +SYMBOL(basic_ofstream, std::, ) SYMBOL(basic_ospanstream, std::, ) +SYMBOL(basic_ospanstream, std::, ) SYMBOL(basic_ostream, std::, ) +SYMBOL(basic_ostream, std::, ) +SYMBOL(basic_ostream, std::, ) SYMBOL(basic_ostringstream, std::, ) +SYMBOL(basic_ostringstream, std::, ) SYMBOL(basic_osyncstream, std::, ) +SYMBOL(basic_osyncstream, std::, ) SYMBOL(basic_regex, std::, ) SYMBOL(basic_spanbuf, std::, ) +SYMBOL(basic_spanbuf, std::, ) SYMBOL(basic_spanstream, std::, ) +SYMBOL(basic_spanstream, std::, ) SYMBOL(basic_stacktrace, std::, ) SYMBOL(basic_streambuf, std::, ) +SYMBOL(basic_streambuf, std::, ) +SYMBOL(basic_streambuf, std::, ) SYMBOL(basic_string, std::, ) SYMBOL(basic_string_view, std::, ) SYMBOL(basic_stringbuf, std::, ) +SYMBOL(basic_stringbuf, std::, ) SYMBOL(basic_stringstream, std::, ) +SYMBOL(basic_stringstream, std::, ) SYMBOL(basic_syncbuf, std::, ) +SYMBOL(basic_syncbuf, std::, ) SYMBOL(bernoulli_distribution, std::, ) SYMBOL(beta, std::, ) SYMBOL(betaf, std::, ) @@ -198,6 +222,7 @@ SYMBOL(bitset, std::, ) SYMBOL(bool_constant, std::, ) SYMBOL(boolalpha, std::, ) +SYMBOL(boolalpha, std::, ) SYMBOL(boyer_moore_horspool_searcher, std::, ) SYMBOL(boyer_moore_searcher, std::, ) SYMBOL(bsearch, std::, ) @@ -329,6 +354,7 @@ SYMBOL(cyl_neumannf, std::, ) SYMBOL(cyl_neumannl, std::, ) SYMBOL(dec, std::, ) +SYMBOL(dec, std::, ) SYMBOL(deca, std::, ) SYMBOL(decay, std::, ) SYMBOL(decay_t, std::, ) @@ -341,6 +367,7 @@ SYMBOL(default_sentinel, std::, ) SYMBOL(default_sentinel_t, std::, ) SYMBOL(defaultfloat, std::, ) +SYMBOL(defaultfloat, std::, ) SYMBOL(defer_lock, std::, ) SYMBOL(defer_lock_t, std::, ) SYMBOL(denorm_absent, std::, ) @@ -377,12 +404,15 @@ SYMBOL(ellint_3f, std::, ) SYMBOL(ellint_3l, std::, ) SYMBOL(emit_on_flush, std::, ) +SYMBOL(emit_on_flush, std::, ) SYMBOL(enable_if, std::, ) SYMBOL(enable_if_t, std::, ) SYMBOL(enable_shared_from_this, std::, ) SYMBOL(endian, std::, ) SYMBOL(endl, std::, ) +SYMBOL(endl, std::, ) SYMBOL(ends, std::, ) +SYMBOL(ends, std::, ) SYMBOL(equal, std::, ) SYMBOL(equal_range, std::, ) SYMBOL(equal_to, std::, ) @@ -454,6 +484,8 @@ SYMBOL(fgetwc, std::, ) SYMBOL(fgetws, std::, ) SYMBOL(filebuf, std::, ) +SYMBOL(filebuf, std::, ) +SYMBOL(filebuf, std::, ) SYMBOL(fill, std::, ) SYMBOL(fill_n, std::, ) SYMBOL(find, std::, ) @@ -463,6 +495,7 @@ SYMBOL(find_if_not, std::, ) SYMBOL(fisher_f_distribution, std::, ) SYMBOL(fixed, std::, ) +SYMBOL(fixed, std::, ) SYMBOL(float_denorm_style, std::, ) SYMBOL(float_round_style, std::, ) SYMBOL(float_t, std::, ) @@ -471,7 +504,9 @@ SYMBOL(floorf, std::, ) SYMBOL(floorl, std::, ) SYMBOL(flush, std::, ) +SYMBOL(flush, std::, ) SYMBOL(flush_emit, std::, ) +SYMBOL(flush_emit, std::, ) SYMBOL(fma, std::, ) SYMBOL(fmaf, std::, ) SYMBOL(fmal, std::, ) @@ -505,6 +540,8 @@ SYMBOL(forward_list, std::, ) SYMBOL(fpclassify, std::, ) SYMBOL(fpos, std::, ) +SYMBOL(fpos, std::, ) +SYMBOL(fpos, std::, ) SYMBOL(fpos_t, std::, ) SYMBOL(fprintf, std::, ) SYMBOL(fputc, std::, ) @@ -527,6 +564,7 @@ SYMBOL(fseek, std::, ) SYMBOL(fsetpos, std::, ) SYMBOL(fstream, std::, ) +SYMBOL(fstream, std::, ) SYMBOL(ftell, std::, ) SYMBOL(function, std::, ) SYMBOL(future, std::, ) @@ -577,13 +615,16 @@ SYMBOL(hermitef, std::, ) SYMBOL(hermitel, std::, ) SYMBOL(hex, std::, ) +SYMBOL(hex, std::, ) SYMBOL(hexfloat, std::, ) +SYMBOL(hexfloat, std::, ) SYMBOL(holds_alternative, std::, ) SYMBOL(hypot, std::, ) SYMBOL(hypotf, std::, ) SYMBOL(hypotl, std::, ) SYMBOL(identity, std::, ) SYMBOL(ifstream, std::, ) +SYMBOL(ifstream, std::, ) SYMBOL(ignore, std::, ) SYMBOL(ilogb, std::, ) SYMBOL(ilogbf, std::, ) @@ -647,6 +688,7 @@ SYMBOL(integral, std::, ) SYMBOL(integral_constant, std::, ) SYMBOL(internal, std::, ) +SYMBOL(internal, std::, ) SYMBOL(intmax_t, std::, ) SYMBOL(intptr_t, std::, ) SYMBOL(invalid_argument, std::, ) @@ -656,10 +698,17 @@ SYMBOL(invoke_result, std::, ) SYMBOL(invoke_result_t, std::, ) SYMBOL(io_errc, std::, ) +SYMBOL(io_errc, std::, ) SYMBOL(ios, std::, ) +SYMBOL(ios, std::, ) +SYMBOL(ios, std::, ) SYMBOL(ios_base, std::, ) +SYMBOL(ios_base, std::, ) SYMBOL(iostream, std::, ) +SYMBOL(iostream, std::, ) +SYMBOL(iostream, std::, ) SYMBOL(iostream_category, std::, ) +SYMBOL(iostream_category, std::, ) SYMBOL(iota, std::, ) SYMBOL(is_abstract, std::, ) SYMBOL(is_abstract_v, std::, ) @@ -852,13 +901,18 @@ SYMBOL(isnan, std::, ) SYMBOL(isnormal, std::, ) SYMBOL(ispanstream, std::, ) +SYMBOL(ispanstream, std::, ) SYMBOL(isprint, std::, ) SYMBOL(ispunct, std::, ) SYMBOL(isspace, std::, ) SYMBOL(istream, std::, ) +SYMBOL(istream, std::, ) +SYMBOL(istream, std::, ) SYMBOL(istream_iterator, std::, ) SYMBOL(istreambuf_iterator, std::, ) +SYMBOL(istreambuf_iterator, std::, ) SYMBOL(istringstream, std::, ) +SYMBOL(istringstream, std::, ) SYMBOL(istrstream, std::, ) SYMBOL(isunordered, std::, ) SYMBOL(isupper, std::, ) @@ -905,6 +959,7 @@ SYMBOL(ldiv, std::, ) SYMBOL(ldiv_t, std::, ) SYMBOL(left, std::, ) +SYMBOL(left, std::, ) SYMBOL(legendre, std::, ) SYMBOL(legendref, std::, ) SYMBOL(legendrel, std::, ) @@ -1074,7 +1129,9 @@ SYMBOL(nexttowardf, std::, ) SYMBOL(nexttowardl, std::, ) SYMBOL(noboolalpha, std::, ) +SYMBOL(noboolalpha, std::, ) SYMBOL(noemit_on_flush, std::, ) +SYMBOL(noemit_on_flush, std::, ) SYMBOL(none_of, std::, ) SYMBOL(noop_coroutine, std::, ) SYMBOL(noop_coroutine_handle, std::, ) @@ -1082,9 +1139,13 @@ SYMBOL(norm, std::, ) SYMBOL(normal_distribution, std::, ) SYMBOL(noshowbase, std::, ) +SYMBOL(noshowbase, std::, ) SYMBOL(noshowpoint, std::, ) +SYMBOL(noshowpoint, std::, ) SYMBOL(noshowpos, std::, ) +SYMBOL(noshowpos, std::, ) SYMBOL(noskipws, std::, ) +SYMBOL(noskipws, std::, ) SYMBOL(nostopstate, std::, ) SYMBOL(nostopstate_t, std::, ) SYMBOL(not_equal_to, std::, ) @@ -1093,7 +1154,9 @@ SYMBOL(nothrow_t, std::, ) SYMBOL(notify_all_at_thread_exit, std::, ) SYMBOL(nounitbuf, std::, ) +SYMBOL(nounitbuf, std::, ) SYMBOL(nouppercase, std::, ) +SYMBOL(nouppercase, std::, ) SYMBOL(nth_element, std::, ) SYMBOL(nullopt, std::, ) SYMBOL(nullopt_t, std::, ) @@ -1104,16 +1167,24 @@ SYMBOL(numpunct, std::, ) SYMBOL(numpunct_byname, std::, ) SYMBOL(oct, std::, ) +SYMBOL(oct, std::, ) SYMBOL(ofstream, std::, ) +SYMBOL(ofstream, std::, ) SYMBOL(once_flag, std::, ) SYMBOL(optional, std::, ) SYMBOL(ospanstream, std::, ) +SYMBOL(ospanstream, std::, ) SYMBOL(ostream, std::, ) +SYMBOL(ostream, std::, ) +SYMBOL(ostream, std::, ) SYMBOL(ostream_iterator, std::, ) SYMBOL(ostreambuf_iterator, std::, ) +SYMBOL(ostreambuf_iterator, std::, ) SYMBOL(ostringstream, std::, ) +SYMBOL(ostringstream, std::, ) SYMBOL(ostrstream, std::, ) SYMBOL(osyncstream, std::, ) +SYMBOL(osyncstream, std::, ) SYMBOL(out_of_range, std::, ) SYMBOL(out_ptr, std::, ) SYMBOL(out_ptr_t, std::, ) @@ -1258,6 +1329,7 @@ SYMBOL(riemann_zetaf, std::, ) SYMBOL(riemann_zetal, std::, ) SYMBOL(right, std::, ) +SYMBOL(right, std::, ) SYMBOL(rint, std::, ) SYMBOL(rintf, std::, ) SYMBOL(rintl, std::, ) @@ -1284,6 +1356,7 @@ SYMBOL(scalbnl, std::, ) SYMBOL(scanf, std::, ) SYMBOL(scientific, std::, ) +SYMBOL(scientific, std::, ) SYMBOL(scoped_allocator_adaptor, std::, ) SYMBOL(scoped_lock, std::, ) SYMBOL(search, std::, ) @@ -1314,8 +1387,11 @@ SYMBOL(shift_left, std::, ) SYMBOL(shift_right, std::, ) SYMBOL(showbase, std::, ) +SYMBOL(showbase, std::, ) SYMBOL(showpoint, std::, ) +SYMBOL(showpoint, std::, ) SYMBOL(showpos, std::, ) +SYMBOL(showpos, std::, ) SYMBOL(shuffle, std::, ) SYMBOL(shuffle_order_engine, std::, ) SYMBOL(sig_atomic_t, std::, ) @@ -1330,6 +1406,7 @@ SYMBOL(sinl, std::, ) SYMBOL(sized_sentinel_for, std::, ) SYMBOL(skipws, std::, ) +SYMBOL(skipws, std::, ) SYMBOL(slice, std::, ) SYMBOL(slice_array, std::, ) SYMBOL(smatch, std::, ) @@ -1340,7 +1417,9 @@ SYMBOL(source_location, std::, ) SYMBOL(span, std::, ) SYMBOL(spanbuf, std::, ) +SYMBOL(spanbuf, std::, ) SYMBOL(spanstream, std::, ) +SYMBOL(spanstream, std::, ) SYMBOL(sph_bessel, std::, ) SYMBOL(sph_besself, std::, ) SYMBOL(sph_bessell, std::, ) @@ -1383,16 +1462,23 @@ SYMBOL(strcpy, std::, ) SYMBOL(strcspn, std::, ) SYMBOL(streambuf, std::, ) +SYMBOL(streambuf, std::, ) +SYMBOL(streambuf, std::, ) SYMBOL(streamoff, std::, ) +SYMBOL(streamoff, std::, ) +SYMBOL(streampos, std::, ) SYMBOL(streampos, std::, ) SYMBOL(streamsize, std::, ) +SYMBOL(streamsize, std::, ) SYMBOL(strerror, std::, ) SYMBOL(strftime, std::, ) SYMBOL(strict_weak_order, std::, ) SYMBOL(string, std::, ) SYMBOL(string_view, std::, ) SYMBOL(stringbuf, std::, ) +SYMBOL(stringbuf, std::, ) SYMBOL(stringstream, std::, ) +SYMBOL(stringstream, std::, ) SYMBOL(strlen, std::, ) SYMBOL(strncat, std::, ) SYMBOL(strncmp, std::, ) @@ -1427,6 +1513,7 @@ SYMBOL(swprintf, std::, ) SYMBOL(swscanf, std::, ) SYMBOL(syncbuf, std::, ) +SYMBOL(syncbuf, std::, ) SYMBOL(system, std::, ) SYMBOL(system_category, std::, ) SYMBOL(system_error, std::, ) @@ -1495,12 +1582,15 @@ SYMBOL(type_index, std::, ) SYMBOL(type_info, std::, ) SYMBOL(u16streampos, std::, ) +SYMBOL(u16streampos, std::, ) SYMBOL(u16string, std::, ) SYMBOL(u16string_view, std::, ) SYMBOL(u32streampos, std::, ) +SYMBOL(u32streampos, std::, ) SYMBOL(u32string, std::, ) SYMBOL(u32string_view, std::, ) SYMBOL(u8streampos, std::, ) +SYMBOL(u8streampos, std::, ) SYMBOL(u8string, std::, ) SYMBOL(u8string_view, std::, ) SYMBOL(uint16_t, std::, ) @@ -1542,6 +1632,7 @@ SYMBOL(unique_lock, std::, ) SYMBOL(unique_ptr, std::, ) SYMBOL(unitbuf, std::, ) +SYMBOL(unitbuf, std::, ) SYMBOL(unordered_map, std::, ) SYMBOL(unordered_multimap, std::, ) SYMBOL(unordered_multiset, std::, ) @@ -1552,6 +1643,7 @@ SYMBOL(unsigned_integral, std::, ) SYMBOL(upper_bound, std::, ) SYMBOL(uppercase, std::, ) +SYMBOL(uppercase, std::, ) SYMBOL(use_facet, std::, ) SYMBOL(uses_allocator, std::, ) SYMBOL(uses_allocator_construction_args, std::, ) @@ -1633,44 +1725,71 @@ SYMBOL(weakly_incrementable, std::, ) SYMBOL(weibull_distribution, std::, ) SYMBOL(wfilebuf, std::, ) +SYMBOL(wfilebuf, std::, ) +SYMBOL(wfilebuf, std::, ) SYMBOL(wformat_args, std::, ) SYMBOL(wformat_context, std::, ) SYMBOL(wformat_parse_context, std::, ) SYMBOL(wfstream, std::, ) +SYMBOL(wfstream, std::, ) SYMBOL(wifstream, std::, ) +SYMBOL(wifstream, std::, ) SYMBOL(wios, std::, ) +SYMBOL(wios, std::, ) +SYMBOL(wios, std::, ) SYMBOL(wiostream, std::, ) +SYMBOL(wiostream, std::, ) +SYMBOL(wiostream, std::, ) SYMBOL(wispanstream, std::, ) +SYMBOL(wispanstream, std::, ) SYMBOL(wistream, std::, ) +SYMBOL(wistream, std::, ) +SYMBOL(wistream, std::, ) SYMBOL(wistringstream, std::, ) +SYMBOL(wistringstream, std::, ) SYMBOL(wmemchr, std::, ) SYMBOL(wmemcmp, std::, ) SYMBOL(wmemcpy, std::, ) SYMBOL(wmemmove, std::, ) SYMBOL(wmemset, std::, ) SYMBOL(wofstream, std::, ) +SYMBOL(wofstream, std::, ) SYMBOL(wospanstream, std::, ) +SYMBOL(wospanstream, std::, ) SYMBOL(wostream, std::, ) +SYMBOL(wostream, std::, ) +SYMBOL(wostream, std::, ) SYMBOL(wostringstream, std::, ) +SYMBOL(wostringstream, std::, ) SYMBOL(wosyncstream, std::, ) +SYMBOL(wosyncstream, std::, ) SYMBOL(wprintf, std::, ) SYMBOL(wregex, std::, ) SYMBOL(ws, std::, ) +SYMBOL(ws, std::, ) SYMBOL(wscanf, std::, ) SYMBOL(wsmatch, std::, ) SYMBOL(wspanbuf, std::, ) +SYMBOL(wspanbuf, std::, ) SYMBOL(wspanstream, std::, ) +SYMBOL(wspanstream, std::, ) SYMBOL(wsregex_iterator, std::, ) SYMBOL(wsregex_token_iterator, std::, ) SYMBOL(wssub_match, std::, ) SYMBOL(wstreambuf, std::, ) +SYMBOL(wstreambuf, std::, ) +SYMBOL(wstreambuf, std::, ) +SYMBOL(wstreampos, std::, ) SYMBOL(wstreampos, std::, ) SYMBOL(wstring, std::, ) SYMBOL(wstring_convert, std::, ) SYMBOL(wstring_view, std::, ) SYMBOL(wstringbuf, std::, ) +SYMBOL(wstringbuf, std::, ) SYMBOL(wstringstream, std::, ) +SYMBOL(wstringstream, std::, ) SYMBOL(wsyncbuf, std::, ) +SYMBOL(wsyncbuf, std::, ) SYMBOL(yocto, std::, ) SYMBOL(yotta, std::, ) SYMBOL(zepto, std::, ) @@ -1924,6 +2043,7 @@ SYMBOL(get_unexpected, std::, ) SYMBOL(gets, std::, ) SYMBOL(io_state, std::, ) +SYMBOL(io_state, std::, ) SYMBOL(is_literal_type, std::, ) SYMBOL(is_literal_type_v, std::, ) SYMBOL(mem_fun, std::, ) @@ -1935,6 +2055,7 @@ SYMBOL(not1, std::, ) SYMBOL(not2, std::, ) SYMBOL(open_mode, std::, ) +SYMBOL(open_mode, std::, ) SYMBOL(pointer_safety, std::, ) SYMBOL(preferred, std::, ) SYMBOL(ptr_fun, std::, ) @@ -1944,6 +2065,7 @@ SYMBOL(result_of_t, std::, ) SYMBOL(return_temporary_buffer, std::, ) SYMBOL(seek_dir, std::, ) +SYMBOL(seek_dir, std::, ) SYMBOL(set_unexpected, std::, ) SYMBOL(strict, std::, ) SYMBOL(unary_function, std::, ) diff --git a/clang/tools/include-mapping/gen_std.py b/clang/tools/include-mapping/gen_std.py --- a/clang/tools/include-mapping/gen_std.py +++ b/clang/tools/include-mapping/gen_std.py @@ -40,6 +40,7 @@ import os import sys + CODE_PREFIX = """\ //===-- gen_std.py generated file -------------------------------*- C++ -*-===// // @@ -66,6 +67,108 @@ required=True) return parser.parse_args() +def AdditionalHeadersForIOSymbols(symbol): + # IO-related symbols declared in the header, per C++ + # [iosfwd.syn 31.3.1]: + iosfwd_symbols = [ + 'basic_ios', + 'basic_streambuf', + 'basic_istream', + 'basic_ostream', + 'basic_iostream', + + 'basic_stringbuf', + 'basic_istringstream', + 'basic_ostringstream', + 'basic_stringstream', + + 'basic_spanbuf', + 'basic_ispanstream', + 'basic_ospanstream', + 'basic_spanstream', + + 'basic_filebuf', + 'basic_ifstream', + 'basic_ofstream', + 'basic_fstream', + + 'basic_syncbuf', + 'basic_osyncstream', + + 'istreambuf_iterator', + 'ostreambuf_iterator', + + 'ios', + 'wios', + + 'streambuf', + 'istream', + 'ostream', + 'iostream', + + 'stringbuf', + 'istringstream', + 'ostringstream', + 'stringstream', + + 'spanbuf', + 'ispanstream', + 'ospanstream', + 'spanstream', + + 'filebuf', + 'ifstream', + 'ofstream', + 'fstream', + + 'syncbuf', + 'osyncstream', + + 'wstreambuf', + 'wistream', + 'wostream', + 'wiostream', + + 'wstringbuf', + 'wistringstream', + 'wostringstream', + 'wstringstream', + + 'wspanbuf', + 'wispanstream', + 'wospanstream', + 'wspanstream', + + 'wfilebuf', + 'wifstream', + 'wofstream', + 'wfstream', + + 'wsyncbuf', + 'wosyncstream', + + 'fpos', + 'streampos', + 'wstreampos', + 'u8streampos', + 'u16streampos', + 'u32streampos', + ] + assert(len(symbol.headers) == 1) + sym_header = symbol.headers[0] + headers = [] + # is preferred than + + # is an alternative of , , , . + # per C++ [iostream.syn 31.4.1] + if sym_header in ["", "", "", ""]: + headers.append("") + + if symbol.name in iosfwd_symbols: + headers.append("") + + return headers + def main(): args = ParseArg() @@ -109,8 +212,10 @@ for symbol in symbols: if len(symbol.headers) == 1: # SYMBOL(unqualified_name, namespace, header) - print("SYMBOL(%s, %s, %s)" % (symbol.name, symbol.namespace, - symbol.headers[0])) + symbol.headers.extend(AdditionalHeadersForIOSymbols(symbol)) + for header in symbol.headers: + print("SYMBOL(%s, %s, %s)" % (symbol.name, symbol.namespace, + header)) elif len(symbol.headers) == 0: sys.stderr.write("No header found for symbol %s\n" % symbol.name) else: