[PATCH] D48881: [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.
Eric Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 4 02:48:30 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL336252: [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder. (authored by ioeric, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
https://reviews.llvm.org/D48881
Files:
clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
Index: clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
+++ clang-tools-extra/trunk/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
@@ -82,6 +82,14 @@
void EndSourceFileAction() override {
WrapperFrontendAction::EndSourceFileAction();
+ const auto &CI = getCompilerInstance();
+ if (CI.hasDiagnostics() &&
+ (CI.getDiagnosticClient().getNumErrors() > 0)) {
+ llvm::errs() << "Found errors in the translation unit. Igoring "
+ "collected symbols...\n";
+ return;
+ }
+
auto Symbols = Collector->takeSymbols();
for (const auto &Sym : Symbols) {
Ctx->reportResult(Sym.ID.str(), SymbolToYAML(Sym));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48881.154078.patch
Type: text/x-patch
Size: 911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180704/fdef1c6c/attachment.bin>
More information about the cfe-commits
mailing list