[clangd] only ignore collected symbols if TU has uncompilable errors.
authorEric Liu <ioeric@google.com>
Wed, 4 Jul 2018 10:39:48 +0000 (10:39 +0000)
committerEric Liu <ioeric@google.com>
Wed, 4 Jul 2018 10:39:48 +0000 (10:39 +0000)
llvm-svn: 336260

clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp

index 1cfda57..1082cf6 100644 (file)
@@ -84,9 +84,10 @@ public:
 
         const auto &CI = getCompilerInstance();
         if (CI.hasDiagnostics() &&
-            (CI.getDiagnosticClient().getNumErrors() > 0)) {
-          llvm::errs() << "Found errors in the translation unit. Igoring "
-                          "collected symbols...\n";
+            CI.getDiagnostics().hasUncompilableErrorOccurred()) {
+          llvm::errs()
+              << "Found uncompilable errors in the translation unit. Igoring "
+                 "collected symbols...\n";
           return;
         }