summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-05-04 20:44:26 +0000
committerChris Lattner <sabre@nondot.org>2010-05-04 20:44:26 +0000
commit216c33bebaeca38dbf1dd98a7094875bf8ad78d1 (patch)
tree5fa7a698aed365db420cb88ac874283190d48cfa /clang/lib
parentb3d221964bf01f4770115216c0899405bf4a6e72 (diff)
downloadbcm5719-llvm-216c33bebaeca38dbf1dd98a7094875bf8ad78d1.tar.gz
bcm5719-llvm-216c33bebaeca38dbf1dd98a7094875bf8ad78d1.zip
add the ability to associate 'category' names with diagnostics
and diagnostic groups. This allows the compiler to group diagnostics together (e.g. "Logic Warning", "Format String Warning", etc) like the static analyzer does. This is not exposed through anything in the compiler yet. llvm-svn: 103051
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 1870195ded0..9e6f168f171 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -51,6 +51,8 @@ struct StaticDiagInfoRec {
unsigned Mapping : 3;
unsigned Class : 3;
bool SFINAE : 1;
+ unsigned Category : 5;
+
const char *Description;
const char *OptionGroup;
@@ -63,8 +65,8 @@ struct StaticDiagInfoRec {
};
static const StaticDiagInfoRec StaticDiagInfo[] = {
-#define DIAG(ENUM,CLASS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) \
- { diag::ENUM, DEFAULT_MAPPING, CLASS, SFINAE, DESC, GROUP },
+#define DIAG(ENUM,CLASS,DEFAULT_MAPPING,DESC,GROUP,SFINAE, CATEGORY) \
+ { diag::ENUM, DEFAULT_MAPPING, CLASS, SFINAE, CATEGORY, DESC, GROUP },
#include "clang/Basic/DiagnosticCommonKinds.inc"
#include "clang/Basic/DiagnosticDriverKinds.inc"
#include "clang/Basic/DiagnosticFrontendKinds.inc"
@@ -73,7 +75,7 @@ static const StaticDiagInfoRec StaticDiagInfo[] = {
#include "clang/Basic/DiagnosticASTKinds.inc"
#include "clang/Basic/DiagnosticSemaKinds.inc"
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
- { 0, 0, 0, 0, 0, 0}
+ { 0, 0, 0, 0, 0, 0, 0}
};
#undef DIAG
@@ -99,7 +101,7 @@ static const StaticDiagInfoRec *GetDiagInfo(unsigned DiagID) {
#endif
// Search the diagnostic table with a binary search.
- StaticDiagInfoRec Find = { DiagID, 0, 0, 0, 0, 0 };
+ StaticDiagInfoRec Find = { DiagID, 0, 0, 0, 0, 0, 0 };
const StaticDiagInfoRec *Found =
std::lower_bound(StaticDiagInfo, StaticDiagInfo + NumDiagEntries, Find);
OpenPOWER on IntegriCloud