forked from OSchip/llvm-project
Reinstantiate better diagnostic, this time with a fatal error so we don't add a dependency onto gtest from the header.
llvm-svn: 244722
This commit is contained in:
parent
a77cea49d1
commit
9b2c45398f
|
@ -76,8 +76,13 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr,
|
|||
FileContent.second);
|
||||
}
|
||||
Invocation.setDiagnosticConsumer(&DiagConsumer);
|
||||
if (!Invocation.run())
|
||||
return "";
|
||||
if (!Invocation.run()) {
|
||||
std::string ErrorText;
|
||||
for (const auto &Error:Context.getErrors()) {
|
||||
ErrorText += Error.Message.Message + "\n";
|
||||
}
|
||||
llvm::report_fatal_error(ErrorText);
|
||||
}
|
||||
|
||||
DiagConsumer.finish();
|
||||
tooling::Replacements Fixes;
|
||||
|
|
Loading…
Reference in New Issue