[PATCH] D59935: Disable warnings when indexing as a standalone action.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 28 07:53:13 PDT 2019


sammccall created this revision.
sammccall added a reviewer: hokein.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, ioeric, ilya-biryukov.
Herald added a project: clang.

- we don't record the warnings at all
- even when -Werror is set, we don't want to stop indexing for a warning
- this allows some analyses to be skipped which can save some CPU

https://github.com/clangd/clangd/issues/24


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D59935

Files:
  clangd/index/IndexAction.cpp


Index: clangd/index/IndexAction.cpp
===================================================================
--- clangd/index/IndexAction.cpp
+++ clangd/index/IndexAction.cpp
@@ -135,6 +135,9 @@
   bool BeginInvocation(CompilerInstance &CI) override {
     // We want all comments, not just the doxygen ones.
     CI.getLangOpts().CommentOpts.ParseAllComments = true;
+    // Index the whole file even if there are warnings and -Werror is't set.
+    // Avoids some analyses too.
+    CI.getDiagnosticOpts().IgnoreWarnings = true;
     return WrapperFrontendAction::BeginInvocation(CI);
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59935.192636.patch
Type: text/x-patch
Size: 589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190328/cd8de805/attachment.bin>


More information about the cfe-commits mailing list