From 4c5a0d1683e1bc5d0e12de8806b37ffbdc8c5904 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 29 May 2019 12:08:11 +0000 Subject: [PATCH] [clangd] Remove the whitelist std symbols in CanonicalIncludes. Summary: These symbols have been included via StdSymbolMap.inc. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62527 llvm-svn: 361952 --- clang-tools-extra/clangd/index/CanonicalIncludes.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/clang-tools-extra/clangd/index/CanonicalIncludes.cpp b/clang-tools-extra/clangd/index/CanonicalIncludes.cpp index 25bbffb..4b04594 100644 --- a/clang-tools-extra/clangd/index/CanonicalIncludes.cpp +++ b/clang-tools-extra/clangd/index/CanonicalIncludes.cpp @@ -87,31 +87,14 @@ collectIWYUHeaderMaps(CanonicalIncludes *Includes) { } void addSystemHeadersMapping(CanonicalIncludes *Includes) { - static const std::vector> SymbolMap = { - // Map symbols in to their preferred includes. - {"std::basic_filebuf", ""}, - {"std::filebuf", ""}, - {"std::wfilebuf", ""}, - {"std::basic_istream", ""}, - {"std::istream", ""}, - {"std::wistream", ""}, - {"std::basic_ostream", ""}, - {"std::ostream", ""}, - {"std::wostream", ""}, - {"std::uint_least16_t", ""}, // redeclares these - {"std::uint_least32_t", ""}, #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> SystemHeaderMap = { {"include/__stddef_max_align_t.h", ""}, -- 2.7.4