Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang-tools-extra/clangd/index/SymbolCollector.cpp | ||
|---|---|---|
| 841–858 | can you also get rid of this piece, and SymbolProviders map ? | |
| 883–884 | we can drop this too | |
| 910–934 | rather than duplicating some of the checks, can we rewrite this block as: llvm::StringRef IncludeHeader = getStdlibHeader(*S, ASTCtx->getLangOpts());
if (IncludeHeader.empty())
IncludeHeader = HeaderFileURIs->getIncludeHeader(FID);
if (!IncludeHeader.empty()) {
auto NewSym = *S;
NewSym.IncludeHeaders.push_back({IncludeHeader, 1, Directives});
Symbols.insert(NewSym);
} | |
| 912 | let's pass in the language options from ASTCtx into here | |
| 915–919 | i think the old order of, first dealing with std::move and then using tooling::stdlib is less error-prone and the order in which we apply the mapping in include-cleaner, so that would be a more compatible change going forward. | |
| 919–954 | let's drop this block to not create confusion | |
| clang-tools-extra/clangd/index/SymbolCollector.cpp | ||
|---|---|---|
| 910 | we shouldn't be overriding the include header if it's already set above. also i think it would be easier to have this out of the way so that reverting to old behaviour is easier: llvm::StringRef getStdHeader(const Symbol *S, const LanguageOptions &LO) {
tooling::stdlib::Lang Lang = tooling::stdlib::Lang::CXX;
if (ASTCtx->getLangOpts().C11)
Lang = tooling::stdlib::Lang::C;
else if(!ASTCtx->getLangOpts().CPlusPlus)
return "";
if (S->Scope == "std::" && S->Name == "move") {
if (!S->Signature.contains(','))
return "<utility>";
return "<algorithm>";
}
if (auto StdSym = tooling::stdlib::Symbol::named(S->Scope, S->Name, Lang))
if (auto Header = StdSym->header())
return Header->name();
return "";
} | |
| clang-tools-extra/clangd/index/SymbolCollector.cpp | ||
|---|---|---|
| 842–858 | can you also move this into an anonymous namespace? | |
can you also get rid of this piece, and SymbolProviders map ?