[PATCH] D127184: [clangd] Add <bits/ranges_algo.h> to header map

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 20 06:01:30 PDT 2022


sammccall added a comment.

Apologies for not getting to this before vacation, and thanks Nathan for looking at this. (I'll leave for you to stamp)

This is fine with me as-is, but I think this mapping shouldn't be our *preferred* way to solve this problem, and should eventually go away.

We also have a mapping of **symbol** names to headers (StdSymbols.inc). This is obviously more portable, both in the sense that it works when editing using e.g. MS STL etc, and that the results don't reflect quirks of the stdlib you're using.
The reason this mapping fails for `std::ranges::transform` is that the mapping file was extracted from an old C++17 cppreference dump. The cppreference format has changed so to run it on a newer dump it'd need some updates.



================
Comment at: clang-tools-extra/clangd/index/CanonicalIncludes.cpp:197
       {"bits/basic_string.tcc", "<string>"},
+      {"bits/boost_concept_check.h", "<numeric>"},
       {"bits/char_traits.h", "<string>"},
----------------
nridge wrote:
> The choice of `<numeric>` is pretty random here, as is already the case for `bits/concept_check.h`.
> 
> Given that these headers don't declare any standard symbols, only symbols which are pure libstdc++ implementation details, maybe we should just omit them from the list?
< Given that these headers don't declare any standard symbols, only symbols which are pure libstdc++ implementation details, maybe we should just omit them from the list?

+1


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127184/new/

https://reviews.llvm.org/D127184



More information about the cfe-commits mailing list