sammccall added a comment.

Wow, nice!
Just unsure about the test helper. (We can rewrite it in another way if needed)



================
Comment at: clangd/ClangdUnit.h:88
 
-  /// This function returns all top-level decls, including those that come
-  /// from Preamble. Decls, coming from Preamble, have to be deserialized, so
-  /// this call might be expensive.
-  ArrayRef<const Decl *> getTopLevelDecls();
+  /// This function returns top-level decls, present in the main file of the
+  /// AST. The result does not include the decls that come from the preamble.
----------------
nit: remove comma


================
Comment at: unittests/clangd/TestTU.cpp:77
   const NamedDecl *Result = nullptr;
-  for (const Decl *D : AST.getTopLevelDecls()) {
+  for (const Decl *D : AST.getLocalTopLevelDecls()) {
     auto *ND = dyn_cast<NamedDecl>(D);
----------------
isn't this incorrect? Or should be "findDeclInMainFile" or similar?

I'd think this would conflict with your other patch, which uses this to test 
the boost of things that come from the header.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D47331



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

Reply via email to