diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-04-15 22:04:17 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-04-15 22:04:17 +0000 |
commit | 7d2b8c1fcc2b707be78b09930a7767477822462f (patch) | |
tree | 51cf1d026a1422af05b549cda1dec2e352c09cc8 /include/clang/Basic/DiagnosticIDs.h | |
parent | f9af524b818f7a6f0ed812334482a5d657b2ff5b (diff) | |
download | clang-7d2b8c1fcc2b707be78b09930a7767477822462f.tar.gz clang-7d2b8c1fcc2b707be78b09930a7767477822462f.tar.bz2 clang-7d2b8c1fcc2b707be78b09930a7767477822462f.tar.xz |
Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticIDs.h')
-rw-r--r-- | include/clang/Basic/DiagnosticIDs.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index 2b03cae565..f4dec257ef 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -42,7 +42,8 @@ namespace clang { // Get typedefs for common diagnostics. enum { -#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE,ACCESS,CATEGORY) ENUM, +#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\ + SFINAE,ACCESS,CATEGORY,BRIEF,FULL) ENUM, #include "clang/Basic/DiagnosticCommonKinds.inc" NUM_BUILTIN_COMMON_DIAGNOSTICS #undef DIAG @@ -99,7 +100,7 @@ public: /// issue. const char *getDescription(unsigned DiagID) const; - /// isNoteWarningOrExtension - Return true if the unmapped diagnostic + /// isBuiltinWarningOrExtension - Return true if the unmapped diagnostic /// level of the specified diagnostic ID is a Warning or Extension. /// This only works on builtin diagnostics, not custom ones, and is not legal to /// call on NOTEs. @@ -130,7 +131,7 @@ public: /// the diagnostic, this returns null. static const char *getWarningOptionForDiag(unsigned DiagID); - /// getWarningOptionForDiag - Return the category number that a specified + /// getCategoryNumberForDiag - Return the category number that a specified /// DiagID belongs to, or 0 if no category. static unsigned getCategoryNumberForDiag(unsigned DiagID); @@ -174,6 +175,20 @@ public: /// are not SFINAE errors. static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID); + /// getName - Given a diagnostic ID, return its name + static const char *getName(unsigned DiagID); + + /// getIdFromName - Given a diagnostic name, return its ID, or 0 + static unsigned getIdFromName(char const *Name); + + /// getBriefExplanation - Given a diagnostic ID, return a brief explanation + /// of the issue + static const char *getBriefExplanation(unsigned DiagID); + + /// getFullExplanation - Given a diagnostic ID, return a full explanation + /// of the issue + static const char *getFullExplanation(unsigned DiagID); + private: /// setDiagnosticGroupMapping - Change an entire diagnostic group (e.g. /// "unknown-pragmas" to have the specified mapping. This returns true and |