diff --git a/clang/include/clang/Tooling/Inclusions/CSymbolMap.inc b/clang/include/clang/Tooling/Inclusions/CSymbolMap.inc --- a/clang/include/clang/Tooling/Inclusions/CSymbolMap.inc +++ b/clang/include/clang/Tooling/Inclusions/CSymbolMap.inc @@ -77,6 +77,16 @@ SYMBOL(FLT_ROUNDS, None, ) SYMBOL(FLT_TRUE_MIN, None, ) SYMBOL(FOPEN_MAX, None, ) +SYMBOL(FP_FAST_FMA, None, ) +SYMBOL(FP_FAST_FMA, None, ) +SYMBOL(FP_FAST_FMAF, None, ) +SYMBOL(FP_FAST_FMAF, None, ) +SYMBOL(FP_FAST_FMAL, None, ) +SYMBOL(FP_FAST_FMAL, None, ) +SYMBOL(FP_ILOGB0, None, ) +SYMBOL(FP_ILOGB0, None, ) +SYMBOL(FP_ILOGBNAN, None, ) +SYMBOL(FP_ILOGBNAN, None, ) SYMBOL(FP_INFINITE, None, ) SYMBOL(FP_NAN, None, ) SYMBOL(FP_NORNAL, None, ) @@ -87,14 +97,24 @@ SYMBOL(HUGE_VALL, None, ) SYMBOL(I, None, ) SYMBOL(INFINITY, None, ) +SYMBOL(INT16_C, None, ) +SYMBOL(INT16_C, None, ) SYMBOL(INT16_MAX, None, ) SYMBOL(INT16_MIN, None, ) +SYMBOL(INT32_C, None, ) +SYMBOL(INT32_C, None, ) SYMBOL(INT32_MAX, None, ) SYMBOL(INT32_MIN, None, ) +SYMBOL(INT64_C, None, ) +SYMBOL(INT64_C, None, ) SYMBOL(INT64_MAX, None, ) SYMBOL(INT64_MIN, None, ) +SYMBOL(INT8_C, None, ) +SYMBOL(INT8_C, None, ) SYMBOL(INT8_MAX, None, ) SYMBOL(INT8_MIN, None, ) +SYMBOL(INTMAX_C, None, ) +SYMBOL(INTMAX_C, None, ) SYMBOL(INTMAX_MAX, None, ) SYMBOL(INTMAX_MIN, None, ) SYMBOL(INTPTR_MAX, None, ) @@ -146,13 +166,328 @@ SYMBOL(MB_CUR_MAX, None, ) SYMBOL(MB_LEN_MAX, None, ) SYMBOL(NAN, None, ) +SYMBOL(NULL, None, ) +SYMBOL(NULL, None, ) +SYMBOL(NULL, None, ) +SYMBOL(NULL, None, ) +SYMBOL(NULL, None, ) +SYMBOL(NULL, None, ) +SYMBOL(NULL, None, ) SYMBOL(ONCE_FLAG_INIT, None, ) +SYMBOL(PRIX16, None, ) +SYMBOL(PRIX16, None, ) +SYMBOL(PRIX32, None, ) +SYMBOL(PRIX32, None, ) +SYMBOL(PRIX64, None, ) +SYMBOL(PRIX64, None, ) +SYMBOL(PRIX8, None, ) +SYMBOL(PRIX8, None, ) +SYMBOL(PRIXFAST16, None, ) +SYMBOL(PRIXFAST16, None, ) +SYMBOL(PRIXFAST32, None, ) +SYMBOL(PRIXFAST32, None, ) +SYMBOL(PRIXFAST64, None, ) +SYMBOL(PRIXFAST64, None, ) +SYMBOL(PRIXFAST8, None, ) +SYMBOL(PRIXFAST8, None, ) +SYMBOL(PRIXLEAST16, None, ) +SYMBOL(PRIXLEAST16, None, ) +SYMBOL(PRIXLEAST32, None, ) +SYMBOL(PRIXLEAST32, None, ) +SYMBOL(PRIXLEAST64, None, ) +SYMBOL(PRIXLEAST64, None, ) +SYMBOL(PRIXLEAST8, None, ) +SYMBOL(PRIXLEAST8, None, ) +SYMBOL(PRIXMAX, None, ) +SYMBOL(PRIXMAX, None, ) +SYMBOL(PRIXPTR, None, ) +SYMBOL(PRIXPTR, None, ) +SYMBOL(PRId16, None, ) +SYMBOL(PRId16, None, ) +SYMBOL(PRId32, None, ) +SYMBOL(PRId32, None, ) +SYMBOL(PRId64, None, ) +SYMBOL(PRId64, None, ) +SYMBOL(PRId8, None, ) +SYMBOL(PRId8, None, ) +SYMBOL(PRIdFAST16, None, ) +SYMBOL(PRIdFAST16, None, ) +SYMBOL(PRIdFAST32, None, ) +SYMBOL(PRIdFAST32, None, ) +SYMBOL(PRIdFAST64, None, ) +SYMBOL(PRIdFAST64, None, ) +SYMBOL(PRIdFAST8, None, ) +SYMBOL(PRIdFAST8, None, ) +SYMBOL(PRIdLEAST16, None, ) +SYMBOL(PRIdLEAST16, None, ) +SYMBOL(PRIdLEAST32, None, ) +SYMBOL(PRIdLEAST32, None, ) +SYMBOL(PRIdLEAST64, None, ) +SYMBOL(PRIdLEAST64, None, ) +SYMBOL(PRIdLEAST8, None, ) +SYMBOL(PRIdLEAST8, None, ) +SYMBOL(PRIdMAX, None, ) +SYMBOL(PRIdMAX, None, ) +SYMBOL(PRIdPTR, None, ) +SYMBOL(PRIdPTR, None, ) +SYMBOL(PRIi16, None, ) +SYMBOL(PRIi16, None, ) +SYMBOL(PRIi32, None, ) +SYMBOL(PRIi32, None, ) +SYMBOL(PRIi64, None, ) +SYMBOL(PRIi64, None, ) +SYMBOL(PRIi8, None, ) +SYMBOL(PRIi8, None, ) +SYMBOL(PRIiFAST16, None, ) +SYMBOL(PRIiFAST16, None, ) +SYMBOL(PRIiFAST32, None, ) +SYMBOL(PRIiFAST32, None, ) +SYMBOL(PRIiFAST64, None, ) +SYMBOL(PRIiFAST64, None, ) +SYMBOL(PRIiFAST8, None, ) +SYMBOL(PRIiFAST8, None, ) +SYMBOL(PRIiLEAST16, None, ) +SYMBOL(PRIiLEAST16, None, ) +SYMBOL(PRIiLEAST32, None, ) +SYMBOL(PRIiLEAST32, None, ) +SYMBOL(PRIiLEAST64, None, ) +SYMBOL(PRIiLEAST64, None, ) +SYMBOL(PRIiLEAST8, None, ) +SYMBOL(PRIiLEAST8, None, ) +SYMBOL(PRIiMAX, None, ) +SYMBOL(PRIiMAX, None, ) +SYMBOL(PRIiPTR, None, ) +SYMBOL(PRIiPTR, None, ) +SYMBOL(PRIo16, None, ) +SYMBOL(PRIo16, None, ) +SYMBOL(PRIo32, None, ) +SYMBOL(PRIo32, None, ) +SYMBOL(PRIo64, None, ) +SYMBOL(PRIo64, None, ) +SYMBOL(PRIo8, None, ) +SYMBOL(PRIo8, None, ) +SYMBOL(PRIoFAST16, None, ) +SYMBOL(PRIoFAST16, None, ) +SYMBOL(PRIoFAST32, None, ) +SYMBOL(PRIoFAST32, None, ) +SYMBOL(PRIoFAST64, None, ) +SYMBOL(PRIoFAST64, None, ) +SYMBOL(PRIoFAST8, None, ) +SYMBOL(PRIoFAST8, None, ) +SYMBOL(PRIoLEAST16, None, ) +SYMBOL(PRIoLEAST16, None, ) +SYMBOL(PRIoLEAST32, None, ) +SYMBOL(PRIoLEAST32, None, ) +SYMBOL(PRIoLEAST64, None, ) +SYMBOL(PRIoLEAST64, None, ) +SYMBOL(PRIoLEAST8, None, ) +SYMBOL(PRIoLEAST8, None, ) +SYMBOL(PRIoMAX, None, ) +SYMBOL(PRIoMAX, None, ) +SYMBOL(PRIoPTR, None, ) +SYMBOL(PRIoPTR, None, ) +SYMBOL(PRIu16, None, ) +SYMBOL(PRIu16, None, ) +SYMBOL(PRIu32, None, ) +SYMBOL(PRIu32, None, ) +SYMBOL(PRIu64, None, ) +SYMBOL(PRIu64, None, ) +SYMBOL(PRIu8, None, ) +SYMBOL(PRIu8, None, ) +SYMBOL(PRIuFAST16, None, ) +SYMBOL(PRIuFAST16, None, ) +SYMBOL(PRIuFAST32, None, ) +SYMBOL(PRIuFAST32, None, ) +SYMBOL(PRIuFAST64, None, ) +SYMBOL(PRIuFAST64, None, ) +SYMBOL(PRIuFAST8, None, ) +SYMBOL(PRIuFAST8, None, ) +SYMBOL(PRIuLEAST16, None, ) +SYMBOL(PRIuLEAST16, None, ) +SYMBOL(PRIuLEAST32, None, ) +SYMBOL(PRIuLEAST32, None, ) +SYMBOL(PRIuLEAST64, None, ) +SYMBOL(PRIuLEAST64, None, ) +SYMBOL(PRIuLEAST8, None, ) +SYMBOL(PRIuLEAST8, None, ) +SYMBOL(PRIuMAX, None, ) +SYMBOL(PRIuMAX, None, ) +SYMBOL(PRIuPTR, None, ) +SYMBOL(PRIuPTR, None, ) +SYMBOL(PRIx16, None, ) +SYMBOL(PRIx16, None, ) +SYMBOL(PRIx32, None, ) +SYMBOL(PRIx32, None, ) +SYMBOL(PRIx64, None, ) +SYMBOL(PRIx64, None, ) +SYMBOL(PRIx8, None, ) +SYMBOL(PRIx8, None, ) +SYMBOL(PRIxFAST16, None, ) +SYMBOL(PRIxFAST16, None, ) +SYMBOL(PRIxFAST32, None, ) +SYMBOL(PRIxFAST32, None, ) +SYMBOL(PRIxFAST64, None, ) +SYMBOL(PRIxFAST64, None, ) +SYMBOL(PRIxFAST8, None, ) +SYMBOL(PRIxFAST8, None, ) +SYMBOL(PRIxLEAST16, None, ) +SYMBOL(PRIxLEAST16, None, ) +SYMBOL(PRIxLEAST32, None, ) +SYMBOL(PRIxLEAST32, None, ) +SYMBOL(PRIxLEAST64, None, ) +SYMBOL(PRIxLEAST64, None, ) +SYMBOL(PRIxLEAST8, None, ) +SYMBOL(PRIxLEAST8, None, ) +SYMBOL(PRIxMAX, None, ) +SYMBOL(PRIxMAX, None, ) +SYMBOL(PRIxPTR, None, ) +SYMBOL(PRIxPTR, None, ) SYMBOL(PTRDIFF_MAX, None, ) SYMBOL(PTRDIFF_MIN, None, ) SYMBOL(RAND_MAX, None, ) SYMBOL(RSIZE_MAX, None, ) SYMBOL(SCHAR_MAX, None, ) SYMBOL(SCHAR_MIN, None, ) +SYMBOL(SCNd16, None, ) +SYMBOL(SCNd16, None, ) +SYMBOL(SCNd32, None, ) +SYMBOL(SCNd32, None, ) +SYMBOL(SCNd64, None, ) +SYMBOL(SCNd64, None, ) +SYMBOL(SCNd8, None, ) +SYMBOL(SCNd8, None, ) +SYMBOL(SCNdFAST16, None, ) +SYMBOL(SCNdFAST16, None, ) +SYMBOL(SCNdFAST32, None, ) +SYMBOL(SCNdFAST32, None, ) +SYMBOL(SCNdFAST64, None, ) +SYMBOL(SCNdFAST64, None, ) +SYMBOL(SCNdFAST8, None, ) +SYMBOL(SCNdFAST8, None, ) +SYMBOL(SCNdLEAST16, None, ) +SYMBOL(SCNdLEAST16, None, ) +SYMBOL(SCNdLEAST32, None, ) +SYMBOL(SCNdLEAST32, None, ) +SYMBOL(SCNdLEAST64, None, ) +SYMBOL(SCNdLEAST64, None, ) +SYMBOL(SCNdLEAST8, None, ) +SYMBOL(SCNdLEAST8, None, ) +SYMBOL(SCNdMAX, None, ) +SYMBOL(SCNdMAX, None, ) +SYMBOL(SCNdPTR, None, ) +SYMBOL(SCNdPTR, None, ) +SYMBOL(SCNi16, None, ) +SYMBOL(SCNi16, None, ) +SYMBOL(SCNi32, None, ) +SYMBOL(SCNi32, None, ) +SYMBOL(SCNi64, None, ) +SYMBOL(SCNi64, None, ) +SYMBOL(SCNi8, None, ) +SYMBOL(SCNi8, None, ) +SYMBOL(SCNiFAST16, None, ) +SYMBOL(SCNiFAST16, None, ) +SYMBOL(SCNiFAST32, None, ) +SYMBOL(SCNiFAST32, None, ) +SYMBOL(SCNiFAST64, None, ) +SYMBOL(SCNiFAST64, None, ) +SYMBOL(SCNiFAST8, None, ) +SYMBOL(SCNiFAST8, None, ) +SYMBOL(SCNiLEAST16, None, ) +SYMBOL(SCNiLEAST16, None, ) +SYMBOL(SCNiLEAST32, None, ) +SYMBOL(SCNiLEAST32, None, ) +SYMBOL(SCNiLEAST64, None, ) +SYMBOL(SCNiLEAST64, None, ) +SYMBOL(SCNiLEAST8, None, ) +SYMBOL(SCNiLEAST8, None, ) +SYMBOL(SCNiMAX, None, ) +SYMBOL(SCNiMAX, None, ) +SYMBOL(SCNiPTR, None, ) +SYMBOL(SCNiPTR, None, ) +SYMBOL(SCNo16, None, ) +SYMBOL(SCNo16, None, ) +SYMBOL(SCNo32, None, ) +SYMBOL(SCNo32, None, ) +SYMBOL(SCNo64, None, ) +SYMBOL(SCNo64, None, ) +SYMBOL(SCNo8, None, ) +SYMBOL(SCNo8, None, ) +SYMBOL(SCNoFAST16, None, ) +SYMBOL(SCNoFAST16, None, ) +SYMBOL(SCNoFAST32, None, ) +SYMBOL(SCNoFAST32, None, ) +SYMBOL(SCNoFAST64, None, ) +SYMBOL(SCNoFAST64, None, ) +SYMBOL(SCNoFAST8, None, ) +SYMBOL(SCNoFAST8, None, ) +SYMBOL(SCNoLEAST16, None, ) +SYMBOL(SCNoLEAST16, None, ) +SYMBOL(SCNoLEAST32, None, ) +SYMBOL(SCNoLEAST32, None, ) +SYMBOL(SCNoLEAST64, None, ) +SYMBOL(SCNoLEAST64, None, ) +SYMBOL(SCNoLEAST8, None, ) +SYMBOL(SCNoLEAST8, None, ) +SYMBOL(SCNoMAX, None, ) +SYMBOL(SCNoMAX, None, ) +SYMBOL(SCNoPTR, None, ) +SYMBOL(SCNoPTR, None, ) +SYMBOL(SCNu16, None, ) +SYMBOL(SCNu16, None, ) +SYMBOL(SCNu32, None, ) +SYMBOL(SCNu32, None, ) +SYMBOL(SCNu64, None, ) +SYMBOL(SCNu64, None, ) +SYMBOL(SCNu8, None, ) +SYMBOL(SCNu8, None, ) +SYMBOL(SCNuFAST16, None, ) +SYMBOL(SCNuFAST16, None, ) +SYMBOL(SCNuFAST32, None, ) +SYMBOL(SCNuFAST32, None, ) +SYMBOL(SCNuFAST64, None, ) +SYMBOL(SCNuFAST64, None, ) +SYMBOL(SCNuFAST8, None, ) +SYMBOL(SCNuFAST8, None, ) +SYMBOL(SCNuLEAST16, None, ) +SYMBOL(SCNuLEAST16, None, ) +SYMBOL(SCNuLEAST32, None, ) +SYMBOL(SCNuLEAST32, None, ) +SYMBOL(SCNuLEAST64, None, ) +SYMBOL(SCNuLEAST64, None, ) +SYMBOL(SCNuLEAST8, None, ) +SYMBOL(SCNuLEAST8, None, ) +SYMBOL(SCNuMAX, None, ) +SYMBOL(SCNuMAX, None, ) +SYMBOL(SCNuPTR, None, ) +SYMBOL(SCNuPTR, None, ) +SYMBOL(SCNx16, None, ) +SYMBOL(SCNx16, None, ) +SYMBOL(SCNx32, None, ) +SYMBOL(SCNx32, None, ) +SYMBOL(SCNx64, None, ) +SYMBOL(SCNx64, None, ) +SYMBOL(SCNx8, None, ) +SYMBOL(SCNx8, None, ) +SYMBOL(SCNxFAST16, None, ) +SYMBOL(SCNxFAST16, None, ) +SYMBOL(SCNxFAST32, None, ) +SYMBOL(SCNxFAST32, None, ) +SYMBOL(SCNxFAST64, None, ) +SYMBOL(SCNxFAST64, None, ) +SYMBOL(SCNxFAST8, None, ) +SYMBOL(SCNxFAST8, None, ) +SYMBOL(SCNxLEAST16, None, ) +SYMBOL(SCNxLEAST16, None, ) +SYMBOL(SCNxLEAST32, None, ) +SYMBOL(SCNxLEAST32, None, ) +SYMBOL(SCNxLEAST64, None, ) +SYMBOL(SCNxLEAST64, None, ) +SYMBOL(SCNxLEAST8, None, ) +SYMBOL(SCNxLEAST8, None, ) +SYMBOL(SCNxMAX, None, ) +SYMBOL(SCNxMAX, None, ) +SYMBOL(SCNxPTR, None, ) +SYMBOL(SCNxPTR, None, ) SYMBOL(SEEK_CUR, None, ) SYMBOL(SEEK_END, None, ) SYMBOL(SEEK_SET, None, ) @@ -175,10 +510,20 @@ SYMBOL(TMP_MAX_S, None, ) SYMBOL(TSS_DTOR_ITERATIONS, None, ) SYMBOL(UCHAR_MAX, None, ) +SYMBOL(UINT16_C, None, ) +SYMBOL(UINT16_C, None, ) SYMBOL(UINT16_MAX, None, ) +SYMBOL(UINT32_C, None, ) +SYMBOL(UINT32_C, None, ) SYMBOL(UINT32_MAX, None, ) +SYMBOL(UINT64_C, None, ) +SYMBOL(UINT64_C, None, ) SYMBOL(UINT64_MAX, None, ) +SYMBOL(UINT8_C, None, ) +SYMBOL(UINT8_C, None, ) SYMBOL(UINT8_MAX, None, ) +SYMBOL(UINTMAX_C, None, ) +SYMBOL(UINTMAX_C, None, ) SYMBOL(UINTMAX_MAX, None, ) SYMBOL(UINTPTR_MAX, None, ) SYMBOL(UINT_FAST16_MAX, None, ) @@ -416,6 +761,10 @@ SYMBOL(ctime, None, ) SYMBOL(ctime_s, None, ) SYMBOL(difftime, None, ) +SYMBOL(div, None, ) +SYMBOL(div, None, ) +SYMBOL(div_t, None, ) +SYMBOL(div_t, None, ) SYMBOL(double_t, None, ) SYMBOL(erf, None, ) SYMBOL(erfc, None, ) @@ -424,6 +773,8 @@ SYMBOL(erff, None, ) SYMBOL(erfl, None, ) SYMBOL(errno, None, ) +SYMBOL(errno_t, None, ) +SYMBOL(errno_t, None, ) SYMBOL(exit, None, ) SYMBOL(exp, None, ) SYMBOL(exp2, None, ) @@ -525,6 +876,10 @@ SYMBOL(ilogbl, None, ) SYMBOL(imaginary, None, ) SYMBOL(imaxabs, None, ) +SYMBOL(imaxdiv, None, ) +SYMBOL(imaxdiv, None, ) +SYMBOL(imaxdiv_t, None, ) +SYMBOL(imaxdiv_t, None, ) SYMBOL(int16_t, None, ) SYMBOL(int32_t, None, ) SYMBOL(int64_t, None, ) @@ -581,10 +936,18 @@ SYMBOL(ldexp, None, ) SYMBOL(ldexpf, None, ) SYMBOL(ldexpl, None, ) +SYMBOL(ldiv, None, ) +SYMBOL(ldiv, None, ) +SYMBOL(ldiv_t, None, ) +SYMBOL(ldiv_t, None, ) SYMBOL(lgamma, None, ) SYMBOL(lgammaf, None, ) SYMBOL(lgammal, None, ) SYMBOL(llabs, None, ) +SYMBOL(lldiv, None, ) +SYMBOL(lldiv, None, ) +SYMBOL(lldiv_t, None, ) +SYMBOL(lldiv_t, None, ) SYMBOL(llrint, None, ) SYMBOL(llrintf, None, ) SYMBOL(llrintl, None, ) @@ -627,6 +990,8 @@ SYMBOL(mbsinit, None, ) SYMBOL(mbsrtowcs, None, ) SYMBOL(mbsrtowcs_s, None, ) +SYMBOL(mbstate_t, None, ) +SYMBOL(mbstate_t, None, ) SYMBOL(mbstowcs, None, ) SYMBOL(mbstowcs_s, None, ) SYMBOL(mbtowc, None, ) @@ -734,6 +1099,13 @@ SYMBOL(sinhf, None, ) SYMBOL(sinhl, None, ) SYMBOL(sinl, None, ) +SYMBOL(size_t, None, ) +SYMBOL(size_t, None, ) +SYMBOL(size_t, None, ) +SYMBOL(size_t, None, ) +SYMBOL(size_t, None, ) +SYMBOL(size_t, None, ) +SYMBOL(size_t, None, ) SYMBOL(snprintf, None, ) SYMBOL(snprintf_s, None, ) SYMBOL(snwprintf_s, None, ) 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 @@ -97,36 +97,6 @@ SYMBOL(atoi, std::, ) SYMBOL(atol, std::, ) SYMBOL(atoll, std::, ) -SYMBOL(atomic_compare_exchange_strong, std::, ) -SYMBOL(atomic_compare_exchange_strong_explicit, std::, ) -SYMBOL(atomic_compare_exchange_weak, std::, ) -SYMBOL(atomic_compare_exchange_weak_explicit, std::, ) -SYMBOL(atomic_exchange, std::, ) -SYMBOL(atomic_exchange_explicit, std::, ) -SYMBOL(atomic_fetch_add, std::, ) -SYMBOL(atomic_fetch_add_explicit, std::, ) -SYMBOL(atomic_fetch_and, std::, ) -SYMBOL(atomic_fetch_and_explicit, std::, ) -SYMBOL(atomic_fetch_or, std::, ) -SYMBOL(atomic_fetch_or_explicit, std::, ) -SYMBOL(atomic_fetch_sub, std::, ) -SYMBOL(atomic_fetch_sub_explicit, std::, ) -SYMBOL(atomic_fetch_xor, std::, ) -SYMBOL(atomic_fetch_xor_explicit, std::, ) -SYMBOL(atomic_flag, std::, ) -SYMBOL(atomic_flag_clear, std::, ) -SYMBOL(atomic_flag_clear_explicit, std::, ) -SYMBOL(atomic_flag_test_and_set, std::, ) -SYMBOL(atomic_flag_test_and_set_explicit, std::, ) -SYMBOL(atomic_init, std::, ) -SYMBOL(atomic_is_lockfree, std::, ) -SYMBOL(atomic_load, std::, ) -SYMBOL(atomic_load_explicit, std::, ) -SYMBOL(atomic_ref, std::, ) -SYMBOL(atomic_signal_fence, std::, ) -SYMBOL(atomic_store, std::, ) -SYMBOL(atomic_store_explicit, std::, ) -SYMBOL(atomic_thread_fence, std::, ) SYMBOL(atto, std::, ) SYMBOL(auto_ptr, std::, ) SYMBOL(back_insert_iterator, std::, ) @@ -226,6 +196,8 @@ SYMBOL(conjunction, std::, ) SYMBOL(conjunction_v, std::, ) SYMBOL(const_pointer_cast, std::, ) +SYMBOL(consume_header, std::, ) +SYMBOL(consume_header, std::, ) SYMBOL(contract_violation, std::, ) SYMBOL(copy, std::, ) SYMBOL(copy_backward, std::, ) @@ -403,6 +375,8 @@ SYMBOL(gcd, std::, ) SYMBOL(generate, std::, ) SYMBOL(generate_canonical, std::, ) +SYMBOL(generate_header, std::, ) +SYMBOL(generate_header, std::, ) SYMBOL(generate_n, std::, ) SYMBOL(generic_category, std::, ) SYMBOL(geometric_distribution, std::, ) @@ -711,6 +685,8 @@ SYMBOL(lgamma, std::, ) SYMBOL(linear_congruential_engine, std::, ) SYMBOL(list, std::, ) +SYMBOL(little_endian, std::, ) +SYMBOL(little_endian, std::, ) SYMBOL(llabs, std::, ) SYMBOL(lldiv, std::, ) SYMBOL(lldiv_t, std::, ) @@ -764,6 +740,8 @@ SYMBOL(mbrtowc, std::, ) SYMBOL(mbsinit, std::, ) SYMBOL(mbsrtowcs, std::, ) +SYMBOL(mbstate_t, std::, ) +SYMBOL(mbstate_t, std::, ) SYMBOL(mbstowcs, std::, ) SYMBOL(mbtowc, std::, ) SYMBOL(mega, std::, ) @@ -1043,6 +1021,12 @@ SYMBOL(sin, std::, ) SYMBOL(sinh, std::, ) SYMBOL(size, std::, ) +SYMBOL(size_t, std::, ) +SYMBOL(size_t, std::, ) +SYMBOL(size_t, std::, ) +SYMBOL(size_t, std::, ) +SYMBOL(size_t, std::, ) +SYMBOL(size_t, std::, ) SYMBOL(skipws, std::, ) SYMBOL(slice, std::, ) SYMBOL(slice_array, std::, ) @@ -1104,6 +1088,8 @@ SYMBOL(student_t_distribution, std::, ) SYMBOL(sub_match, std::, ) SYMBOL(subtract_with_carry_engine, std::, ) +SYMBOL(swap, std::, ) +SYMBOL(swap, std::, ) SYMBOL(swap_ranges, std::, ) SYMBOL(swprintf, std::, ) SYMBOL(swscanf, std::, ) @@ -1288,6 +1274,8 @@ SYMBOL(wfilebuf, std::, ) SYMBOL(wfstream, std::, ) SYMBOL(wifstream, std::, ) +SYMBOL(wint_t, std::, ) +SYMBOL(wint_t, std::, ) SYMBOL(wios, std::, ) SYMBOL(wiostream, std::, ) SYMBOL(wistream, std::, ) diff --git a/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp b/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp --- a/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp +++ b/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp @@ -8,6 +8,7 @@ #include "clang/Tooling/Inclusions/StandardLibrary.h" #include "clang/AST/Decl.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Casting.h" @@ -17,7 +18,7 @@ static llvm::StringRef *HeaderNames; static std::pair *SymbolNames; -static unsigned *SymbolHeaderIDs; +static llvm::SmallVector *SymbolHeaderIDs; static llvm::DenseMap *HeaderIDs; // Maps symbol name -> Symbol::ID, within a namespace. using NSSymbolMap = llvm::DenseMap; @@ -46,18 +47,29 @@ return HeaderIDs->try_emplace(Header, HeaderIDs->size()).first->second; }; - auto Add = [&, SymIndex(0)](llvm::StringRef Name, llvm::StringRef NS, - llvm::StringRef HeaderName) mutable { + auto Add = [&, NextAvailSymIndex(0)](llvm::StringRef Name, llvm::StringRef NS, + llvm::StringRef HeaderName) mutable { if (NS == "None") NS = ""; + bool IsNewSymbol = true; + unsigned SymIndex = NextAvailSymIndex; + if (NSSymbolMap *NSSymbols = NamespaceSymbols->lookup(NS)) { + auto It = NSSymbols->find(Name); + if (It != NSSymbols->end()) { + SymIndex = It->getSecond(); + IsNewSymbol = false; + } + } + SymbolNames[SymIndex] = {NS, Name}; - SymbolHeaderIDs[SymIndex] = AddHeader(HeaderName); + SymbolHeaderIDs[SymIndex].emplace_back(AddHeader(HeaderName)); NSSymbolMap &NSSymbols = AddNS(NS); NSSymbols.try_emplace(Name, SymIndex); - ++SymIndex; + if (IsNewSymbol) + ++NextAvailSymIndex; }; #define SYMBOL(Name, NS, Header) Add(#Name, #NS, #Header); #include "clang/Tooling/Inclusions/CSymbolMap.inc" @@ -87,7 +99,7 @@ llvm::StringRef Symbol::scope() const { return SymbolNames[ID].first; } llvm::StringRef Symbol::name() const { return SymbolNames[ID].second; } std::optional Symbol::named(llvm::StringRef Scope, - llvm::StringRef Name) { + llvm::StringRef Name) { ensureInitialized(); if (NSSymbolMap *NSSymbols = NamespaceSymbols->lookup(Scope)) { auto It = NSSymbols->find(Name); @@ -96,9 +108,14 @@ } return std::nullopt; } -Header Symbol::header() const { return Header(SymbolHeaderIDs[ID]); } + +Header Symbol::header() const { return Header(SymbolHeaderIDs[ID][0]); } llvm::SmallVector
Symbol::headers() const { - return {header()}; // FIXME: multiple in case of ambiguity + llvm::SmallVector
result; + for (auto HeaderID : SymbolHeaderIDs[ID]) { + result.emplace_back(Header(HeaderID)); + } + return result; } Recognizer::Recognizer() { ensureInitialized(); } diff --git a/clang/tools/include-mapping/cppreference_parser.py b/clang/tools/include-mapping/cppreference_parser.py --- a/clang/tools/include-mapping/cppreference_parser.py +++ b/clang/tools/include-mapping/cppreference_parser.py @@ -118,7 +118,7 @@ return _ParseSymbolPage(f.read(), name) -def _GetSymbols(pool, root_dir, index_page_name, namespace, variants_to_accept): +def _GetSymbols(pool, root_dir, index_page_name, namespace): """Get all symbols listed in the index page. All symbols should be in the given namespace. @@ -135,11 +135,7 @@ # Read each symbol page in parallel. results = [] # (symbol_name, promise of [header...]) for symbol_name, symbol_page_path, variant in _ParseIndexPage(f.read()): - # Variant symbols (e.g. the std::locale version of isalpha) add ambiguity. - # FIXME: use these as a fallback rather than ignoring entirely. - variants_for_symbol = variants_to_accept.get( - (namespace or "") + symbol_name, ()) - if variant and variant not in variants_for_symbol: + if variant: continue path = os.path.join(root_dir, symbol_page_path) if os.path.isfile(path): @@ -166,13 +162,6 @@ Args: parse_pages: a list of tuples (page_root_dir, index_page_name, namespace) """ - # By default we prefer the non-variant versions, as they're more common. But - # there are some symbols, whose variant is more common. This list describes - # those symbols. - variants_to_accept = { - # std::remove<> has variant algorithm. - "std::remove": ("algorithm"), - } symbols = [] # Run many workers to process individual symbol pages under the symbol index. # Don't allow workers to capture Ctrl-C. @@ -180,8 +169,7 @@ initializer=lambda: signal.signal(signal.SIGINT, signal.SIG_IGN)) try: for root_dir, page_name, namespace in parse_pages: - symbols.extend(_GetSymbols(pool, root_dir, page_name, namespace, - variants_to_accept)) + symbols.extend(_GetSymbols(pool, root_dir, page_name, namespace)) finally: pool.terminate() pool.join() 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 @@ -14,10 +14,7 @@ The generated files are located in clang/include/Tooling/Inclusions. Caveats and FIXMEs: - - only symbols directly in "std" namespace are added, we should also add std's - subnamespace symbols (e.g. chrono). - - symbols with multiple variants or defined in multiple headers aren't added, - e.g. std::move, std::swap + - symbols with multiple variants aren't added, e.g., std::move Usage: 1. Install BeautifulSoup dependency, see instruction: @@ -41,6 +38,7 @@ import datetime import os import sys +import re CODE_PREFIX = """\ //===-- gen_std.py generated file -------------------------------*- C++ -*-===// @@ -109,18 +107,16 @@ cppreference_modified_date = datetime.datetime.fromtimestamp( os.stat(index_page_path).st_mtime).strftime('%Y-%m-%d') print(CODE_PREFIX % (args.symbols.upper(), cppreference_modified_date)) + # FIXME: take care of overloads 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])) - elif len(symbol.headers) == 0: + if re.match("^div$|^remove$|atomic.*", symbol.name) and symbol.namespace == "std::": + continue + if len(symbol.headers) == 0: sys.stderr.write("No header found for symbol %s\n" % symbol.name) else: - # FIXME: support symbols with multiple headers (e.g. std::move). - sys.stderr.write("Ambiguous header for symbol %s: %s\n" % ( - symbol.name, ', '.join(symbol.headers))) - - + for header in symbol.headers: + # SYMBOL(unqualified_name, namespace, header) + print("SYMBOL(%s, %s, %s)" % (symbol.name, symbol.namespace, + header)) if __name__ == '__main__': main()