aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Basic/DiagnosticIDs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/lib/Basic/DiagnosticIDs.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Basic/DiagnosticIDs.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/contrib/llvm-project/clang/lib/Basic/DiagnosticIDs.cpp b/contrib/llvm-project/clang/lib/Basic/DiagnosticIDs.cpp
index 6c7bd50eefb7..cd42573968b2 100644
--- a/contrib/llvm-project/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/contrib/llvm-project/clang/lib/Basic/DiagnosticIDs.cpp
@@ -49,6 +49,7 @@ struct StaticDiagInfoDescriptionStringTable {
#include "clang/Basic/DiagnosticSemaKinds.inc"
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
#include "clang/Basic/DiagnosticRefactoringKinds.inc"
+#include "clang/Basic/DiagnosticInstallAPIKinds.inc"
// clang-format on
#undef DIAG
};
@@ -70,7 +71,8 @@ const StaticDiagInfoDescriptionStringTable StaticDiagInfoDescriptions = {
#include "clang/Basic/DiagnosticSemaKinds.inc"
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
#include "clang/Basic/DiagnosticRefactoringKinds.inc"
- // clang-format on
+#include "clang/Basic/DiagnosticInstallAPIKinds.inc"
+// clang-format on
#undef DIAG
};
@@ -95,12 +97,13 @@ const uint32_t StaticDiagInfoDescriptionOffsets[] = {
#include "clang/Basic/DiagnosticSemaKinds.inc"
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
#include "clang/Basic/DiagnosticRefactoringKinds.inc"
- // clang-format on
+#include "clang/Basic/DiagnosticInstallAPIKinds.inc"
+// clang-format on
#undef DIAG
};
// Diagnostic classes.
-enum {
+enum DiagnosticClass {
CLASS_NOTE = 0x01,
CLASS_REMARK = 0x02,
CLASS_WARNING = 0x03,
@@ -110,15 +113,22 @@ enum {
struct StaticDiagInfoRec {
uint16_t DiagID;
+ LLVM_PREFERRED_TYPE(diag::Severity)
uint8_t DefaultSeverity : 3;
+ LLVM_PREFERRED_TYPE(DiagnosticClass)
uint8_t Class : 3;
+ LLVM_PREFERRED_TYPE(DiagnosticIDs::SFINAEResponse)
uint8_t SFINAE : 2;
uint8_t Category : 6;
+ LLVM_PREFERRED_TYPE(bool)
uint8_t WarnNoWerror : 1;
+ LLVM_PREFERRED_TYPE(bool)
uint8_t WarnShowInSystemHeader : 1;
+ LLVM_PREFERRED_TYPE(bool)
uint8_t WarnShowInSystemMacro : 1;
uint16_t OptionGroupIndex : 15;
+ LLVM_PREFERRED_TYPE(bool)
uint16_t Deferrable : 1;
uint16_t DescriptionLen;
@@ -166,6 +176,7 @@ VALIDATE_DIAG_SIZE(CROSSTU)
VALIDATE_DIAG_SIZE(SEMA)
VALIDATE_DIAG_SIZE(ANALYSIS)
VALIDATE_DIAG_SIZE(REFACTORING)
+VALIDATE_DIAG_SIZE(INSTALLAPI)
#undef VALIDATE_DIAG_SIZE
#undef STRINGIFY_NAME
@@ -197,6 +208,7 @@ const StaticDiagInfoRec StaticDiagInfo[] = {
#include "clang/Basic/DiagnosticSemaKinds.inc"
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
#include "clang/Basic/DiagnosticRefactoringKinds.inc"
+#include "clang/Basic/DiagnosticInstallAPIKinds.inc"
// clang-format on
#undef DIAG
};
@@ -239,6 +251,7 @@ CATEGORY(CROSSTU, COMMENT)
CATEGORY(SEMA, CROSSTU)
CATEGORY(ANALYSIS, SEMA)
CATEGORY(REFACTORING, ANALYSIS)
+CATEGORY(INSTALLAPI, REFACTORING)
#undef CATEGORY
// Avoid out of bounds reads.
@@ -848,6 +861,9 @@ bool DiagnosticIDs::isUnrecoverable(unsigned DiagID) const {
if (isARCDiagnostic(DiagID))
return false;
+ if (isCodegenABICheckDiagnostic(DiagID))
+ return false;
+
return true;
}
@@ -855,3 +871,8 @@ bool DiagnosticIDs::isARCDiagnostic(unsigned DiagID) {
unsigned cat = getCategoryNumberForDiag(DiagID);
return DiagnosticIDs::getCategoryNameFromID(cat).starts_with("ARC ");
}
+
+bool DiagnosticIDs::isCodegenABICheckDiagnostic(unsigned DiagID) {
+ unsigned cat = getCategoryNumberForDiag(DiagID);
+ return DiagnosticIDs::getCategoryNameFromID(cat) == "Codegen ABI Check";
+}