mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-11 10:26:44 +00:00
[clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.
Summary: For example, template parameter might not be resolved in a broken TU, which can result in wrong USR/SymbolID. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48881 llvm-svn: 336252
This commit is contained in:
parent
98a7a31d1e
commit
bd225cff89
@ -82,6 +82,14 @@ public:
|
||||
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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user