sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clangd/CodeComplete.cpp:249
+      if (SemaResult->Kind == CodeCompletionResult::RK_Declaration) {
+        if (const auto *D = SemaResult->getDeclaration()) {
+          const auto &SM = D->getASTContext().getSourceManager();
----------------
do you need to iterate over all redecls?


================
Comment at: clangd/CodeComplete.cpp:251
+          const auto &SM = D->getASTContext().getSourceManager();
+          ShouldInsertInclude =
+              !SM.isInMainFile(SM.getExpansionLoc(D->getLocStart()));
----------------
`ShouldInsertInclude = ShouldInsertInclude && ...` would be a little more 
future-proof


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D47466



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

Reply via email to