Index: clang/include/clang/Basic/DiagnosticSerializationKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSerializationKinds.td +++ clang/include/clang/Basic/DiagnosticSerializationKinds.td @@ -17,17 +17,10 @@ "malformed or corrupted AST file: '%0'">, DefaultFatal; def err_fe_pch_malformed_block : Error< "malformed block record in PCH file: '%0'">, DefaultFatal; -def err_fe_pch_file_modified : Error< - "file '%0' has been modified since the precompiled header '%1' was built" - ": %select{size|mtime|content}2 changed">, - DefaultFatal; -def err_fe_module_file_modified : Error< - "file '%0' has been modified since the module file '%1' was built" - ": %select{size|mtime|content}2 changed">, - DefaultFatal; def err_fe_ast_file_modified : Error< - "file '%0' has been modified since the AST file '%1' was built" - ": %select{size|mtime|content}2 changed">, + "file '%0' has been modified since the " + "%select{precompiled header|module file|AST file}1 '%2' was built" + ": %select{size|mtime|content}3 changed">, DefaultFatal; def err_fe_pch_file_overridden : Error< "file '%0' from the precompiled header has been overridden">; Index: clang/lib/Serialization/ASTReader.cpp =================================================================== --- clang/lib/Serialization/ASTReader.cpp +++ clang/lib/Serialization/ASTReader.cpp @@ -2397,17 +2397,9 @@ // The top-level PCH is stale. StringRef TopLevelPCHName(ImportStack.back()->FileName); - unsigned DiagnosticKind = - moduleKindForDiagnostic(ImportStack.back()->Kind); - if (DiagnosticKind == 0) - Diag(diag::err_fe_pch_file_modified) - << Filename << TopLevelPCHName << FileChange; - else if (DiagnosticKind == 1) - Diag(diag::err_fe_module_file_modified) - << Filename << TopLevelPCHName << FileChange; - else - Diag(diag::err_fe_ast_file_modified) - << Filename << TopLevelPCHName << FileChange; + Diag(diag::err_fe_ast_file_modified) + << Filename << moduleKindForDiagnostic(ImportStack.back()->Kind) + << TopLevelPCHName << FileChange; // Print the import stack. if (ImportStack.size() > 1) {