diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSerializationKinds.td | 4 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSerializationKinds.td b/clang/include/clang/Basic/DiagnosticSerializationKinds.td index 1b45b10c122..9f630ae5c1c 100644 --- a/clang/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/clang/include/clang/Basic/DiagnosticSerializationKinds.td @@ -14,7 +14,7 @@ def err_fe_unable_to_read_pch_file : Error< def err_fe_not_a_pch_file : Error< "input is not a PCH file: '%0'">; def err_fe_pch_malformed : Error< - "malformed or corrupted PCH file: '%0'">, DefaultFatal; + "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< @@ -22,6 +22,8 @@ def err_fe_pch_file_modified : Error< DefaultFatal; def err_fe_pch_file_overridden : Error< "file '%0' from the precompiled header has been overridden">; +def note_module_cache_path : Note< + "after modifying system headers, please delete the module cache at '%0'">; def err_pch_targetopt_mismatch : Error< "PCH file was compiled for the %0 '%1' but the current translation " diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 4a1ad260e32..17f01380ed0 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -759,6 +759,10 @@ bool ASTReader::ReadDeclContextStorage(ModuleFile &M, void ASTReader::Error(StringRef Msg) { Error(diag::err_fe_pch_malformed, Msg); + if (Context.getLangOpts().Modules && !Diags.isDiagnosticInFlight()) { + Diag(diag::note_module_cache_path) + << PP.getHeaderSearchInfo().getModuleCachePath(); + } } void ASTReader::Error(unsigned DiagID, @@ -1715,6 +1719,10 @@ InputFile ASTReader::getInputFile(ModuleFile &F, unsigned ID, bool Complain) { )) { if (Complain) { Error(diag::err_fe_pch_file_modified, Filename, F.FileName); + if (Context.getLangOpts().Modules && !Diags.isDiagnosticInFlight()) { + Diag(diag::note_module_cache_path) + << PP.getHeaderSearchInfo().getModuleCachePath(); + } } IsOutOfDate = true; |