================
@@ -56,28 +56,33 @@ void walkUsed(llvm::ArrayRef<Decl *> ASTRoots,
const auto &SM = PP.getSourceManager();
// This is duplicated in writeHTMLReport, changes should be mirrored there.
tooling::stdlib::Recognizer Recognizer;
+ ObjCSelectorMap SelectorDecls;
+ if (!ASTRoots.empty()) {
+ SelectorDecls = buildObjCSelectorMap(ASTRoots.front()->getASTContext());
----------------
nico wrote:
If I understand correctly, this does a walk of the whole TU at "startup". This
will deserialize all decls in preamble PCHs, which is bad for perf and memory
usage. (walkUsed can be called from clangd in relatively common code paths,
right? And it passes in not the whole root, to prevent a full deserialize as
far as I understand: `rg -A1 walkUsed clang-tools-extra/clangd`)
Not sure what to do instead though!
It'd be slightly better to do this lazily when it's first needed, but having to
walk all decls is unfortunate.
https://github.com/llvm/llvm-project/pull/212564
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits