Diag(DiagID) << Arg1 << Arg2 << Arg3;
}
-void ASTReader::Error(unsigned DiagID, StringRef Arg1, StringRef Arg2,
- unsigned Select) const {
- if (!Diags.isDiagnosticInFlight())
- Diag(DiagID) << Arg1 << Arg2 << Select;
-}
-
void ASTReader::Error(llvm::Error &&Err) const {
Error(toString(std::move(Err)));
}
auto FileChange = HasInputFileChanged();
// For an overridden file, there is nothing to validate.
if (!Overridden && FileChange != ModificationType::None) {
- if (Complain) {
+ if (Complain && !Diags.isDiagnosticInFlight()) {
// Build a list of the PCH imports that got us here (in reverse).
SmallVector<ModuleFile *, 4> ImportStack(1, &F);
while (!ImportStack.back()->ImportedBy.empty())
unsigned DiagnosticKind =
moduleKindForDiagnostic(ImportStack.back()->Kind);
if (DiagnosticKind == 0)
- Error(diag::err_fe_pch_file_modified, Filename, TopLevelPCHName,
- (unsigned)FileChange);
+ Diag(diag::err_fe_pch_file_modified)
+ << Filename << TopLevelPCHName << FileChange;
else if (DiagnosticKind == 1)
- Error(diag::err_fe_module_file_modified, Filename, TopLevelPCHName,
- (unsigned)FileChange);
+ Diag(diag::err_fe_module_file_modified)
+ << Filename << TopLevelPCHName << FileChange;
else
- Error(diag::err_fe_ast_file_modified, Filename, TopLevelPCHName,
- (unsigned)FileChange);
+ Diag(diag::err_fe_ast_file_modified)
+ << Filename << TopLevelPCHName << FileChange;
// Print the import stack.
- if (ImportStack.size() > 1 && !Diags.isDiagnosticInFlight()) {
+ if (ImportStack.size() > 1) {
Diag(diag::note_pch_required_by)
<< Filename << ImportStack[0]->FileName;
for (unsigned I = 1; I < ImportStack.size(); ++I)
<< ImportStack[I-1]->FileName << ImportStack[I]->FileName;
}
- if (!Diags.isDiagnosticInFlight())
- Diag(diag::note_pch_rebuild_required) << TopLevelPCHName;
+ Diag(diag::note_pch_rebuild_required) << TopLevelPCHName;
}
IsOutOfDate = true;