Replace them with the library APIs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/index/CanonicalIncludes.cpp | ||
---|---|---|
753–754 | what about getting rid of StdSymbolMapping completely and changing CanonicalIncludes::mapSymbol to use tooling::stdlib ? |
address review comment: remove StdSymbolMapping in the CanonicalIncluedes.
clang-tools-extra/clangd/index/CanonicalIncludes.cpp | ||
---|---|---|
753–754 | Yeah, good idea. This simplifies the code further, thanks! |
clang-tools-extra/clangd/index/CanonicalIncludes.cpp | ||
---|---|---|
711 | i think the comment is misleading. as if we had some alternatives in the tooling::stdlib, it would already pick one for us. the issue is we don't have it in the mapping at all. | |
717 | this is a slight behaviour change. we'd actually return "" whenever the language isn't CPlusPlus or C11. could you retain that behaviour? | |
clang-tools-extra/clangd/index/SymbolCollector.cpp | ||
837–838 | nit: rather than creating a new copy of the symbol name everytime, i'd also update the mapSymbol interface to take in StringRef Scope, StringRef Name instead. |
thanks a lot. since this is the last (and only) upstream user of the raw mappings. can you also move them into clang/lib/Tooling/Inclusions/Stdlib/ as part of this patch?
clang-tools-extra/clangd/index/CanonicalIncludes.h | ||
---|---|---|
43 | these parameter comments are a little bit unconventional, maybe just mention that Scope should have trailing colons (e.g. std::) and name shouldn't have any (e.g. vector) ? also mention that it should be empty ("") for global namespace? |
As discussed, I will address this in a followup patch.
clang-tools-extra/clangd/index/CanonicalIncludes.cpp | ||
---|---|---|
711 | yeah, this comment was moved from the old version. I removed it as it is covered by the above FIXME. | |
clang-tools-extra/clangd/index/CanonicalIncludes.h | ||
43 | Removed the parameter comments, and refined the doc comment of the function. |
these parameter comments are a little bit unconventional, maybe just mention that Scope should have trailing colons (e.g. std::) and name shouldn't have any (e.g. vector) ? also mention that it should be empty ("") for global namespace?