[PATCH] D41495: [clangd] Skip function bodies when building the preamble

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 02:36:12 PST 2017


ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdUnit.cpp:536
+      // so we set SkipFunctionBodies back to false after preamble is built.
+      assert(!CI->getFrontendOpts().SkipFunctionBodies);
+      CI->getFrontendOpts().SkipFunctionBodies = true;
----------------
sammccall wrote:
> Nit: I think the comment/assert focus too much on the 'what' at the expense of the 'why' - just the first sentence here is probably enough (without the second and without the assert).
> 
> And below, something like:
>     // For the main file, we do want the AST and diagnostics for function bodies. 
That looks better. Updated the comments, thanks.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D41495





More information about the cfe-commits mailing list