This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE361952: [clangd] Remove the whitelist std symbols in
CanonicalIncludes. (authored by hokein, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D62527?vs=201869&id=201870#toc
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62527/new/
https://reviews.llvm.org/D62527
Files:
clangd/index/CanonicalIncludes.cpp
Index: clangd/index/CanonicalIncludes.cpp
===================================================================
--- clangd/index/CanonicalIncludes.cpp
+++ clangd/index/CanonicalIncludes.cpp
@@ -87,31 +87,14 @@
}
void addSystemHeadersMapping(CanonicalIncludes *Includes) {
- static const std::vector<std::pair<const char *, const char *>> SymbolMap = {
- // Map symbols in <iosfwd> to their preferred includes.
- {"std::basic_filebuf", "<fstream>"},
- {"std::filebuf", "<fstream>"},
- {"std::wfilebuf", "<fstream>"},
- {"std::basic_istream", "<istream>"},
- {"std::istream", "<istream>"},
- {"std::wistream", "<istream>"},
- {"std::basic_ostream", "<ostream>"},
- {"std::ostream", "<ostream>"},
- {"std::wostream", "<ostream>"},
- {"std::uint_least16_t", "<cstdint>"}, // <type_traits> redeclares these
- {"std::uint_least32_t", "<cstdint>"},
#define SYMBOL(Name, NameSpace, Header) { #NameSpace#Name, #Header },
#include "StdSymbolMap.inc"
#undef SYMBOL
};
- for (const auto &Pair : SymbolMap)
- Includes->addSymbolMapping(Pair.first, Pair.second);
// FIXME: remove the std header mapping once we support ambiguous symbols,
now
// it serves as a fallback to disambiguate:
// - symbols with mulitiple headers (e.g. std::move)
- // - symbols with a primary template in one header and a specialization in
- // another (std::abs)
static const std::vector<std::pair<const char *, const char *>>
SystemHeaderMap = {
{"include/__stddef_max_align_t.h", "<cstddef>"},
Index: clangd/index/CanonicalIncludes.cpp
===================================================================
--- clangd/index/CanonicalIncludes.cpp
+++ clangd/index/CanonicalIncludes.cpp
@@ -87,31 +87,14 @@
}
void addSystemHeadersMapping(CanonicalIncludes *Includes) {
- static const std::vector<std::pair<const char *, const char *>> SymbolMap = {
- // Map symbols in <iosfwd> to their preferred includes.
- {"std::basic_filebuf", "<fstream>"},
- {"std::filebuf", "<fstream>"},
- {"std::wfilebuf", "<fstream>"},
- {"std::basic_istream", "<istream>"},
- {"std::istream", "<istream>"},
- {"std::wistream", "<istream>"},
- {"std::basic_ostream", "<ostream>"},
- {"std::ostream", "<ostream>"},
- {"std::wostream", "<ostream>"},
- {"std::uint_least16_t", "<cstdint>"}, // <type_traits> redeclares these
- {"std::uint_least32_t", "<cstdint>"},
#define SYMBOL(Name, NameSpace, Header) { #NameSpace#Name, #Header },
#include "StdSymbolMap.inc"
#undef SYMBOL
};
- for (const auto &Pair : SymbolMap)
- Includes->addSymbolMapping(Pair.first, Pair.second);
// FIXME: remove the std header mapping once we support ambiguous symbols, now
// it serves as a fallback to disambiguate:
// - symbols with mulitiple headers (e.g. std::move)
- // - symbols with a primary template in one header and a specialization in
- // another (std::abs)
static const std::vector<std::pair<const char *, const char *>>
SystemHeaderMap = {
{"include/__stddef_max_align_t.h", "<cstddef>"},
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits