[PATCH] D91367: Serialization: Merge three diagnostics to simplify ASTReader::getInputFile, NFC
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 13 13:23:14 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa2f2c2f3a463: Serialization: Merge three diagnostics to simplify ASTReader::getInputFile, NFC (authored by dexonsmith).
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91367/new/
https://reviews.llvm.org/D91367
Files:
clang/include/clang/Basic/DiagnosticSerializationKinds.td
clang/lib/Serialization/ASTReader.cpp
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) {
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">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91367.305248.patch
Type: text/x-patch
Size: 2314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201113/45cac518/attachment.bin>
More information about the cfe-commits
mailing list