[PATCH] D63817: [clangd] No longer getting template instantiations from header files in Main AST.
    Ilya Biryukov via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Jun 26 07:49:48 PDT 2019
    
    
  
ilya-biryukov added inline comments.
================
Comment at: clang-tools-extra/clangd/ClangdUnit.cpp:47
 #include <memory>
+#include <iostream>
 
----------------
NIT: This include is redundant, maybe remove?
Probably added by accident.
================
Comment at: clang-tools-extra/clangd/ClangdUnit.cpp:71
     for (Decl *D : DG) {
-      if (D->isFromASTFile())
+      if (!D->getASTContext().getSourceManager().isInMainFile(D->getLocation()))
         continue;
----------------
Please use `isWrittenInMainFile` instead.
`isInMainFile` takes `#line` markers into account, we don't want that in clangd.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63817/new/
https://reviews.llvm.org/D63817
    
    
More information about the cfe-commits
mailing list