kadircet added a comment.

I can't fully remember the discussion but what about the case in which we don't 
have a declaration in the main file, but see a definition and multiple forward 
declarations. Is there a good reason to still include re-decls in this case?



================
Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:57
+    // because they're often unrelated.
+    if (const auto *RD = llvm::dyn_cast<RecordDecl>(TT->getDecl())) {
+      const auto *MostRecent = RD->getMostRecentDecl();
----------------
why don't we do this inside `add` instead? which can take care of duplication, 
and remain as the only place we modify `Result` ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114864

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to