diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-08-09 03:39:14 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-08-09 03:39:14 +0000 |
commit | 6948bc4bcbd92502d90b877780a3b746275efa5b (patch) | |
tree | d0de97d17211bf2a35f6def30e261834baa90e8b /include/clang/Basic/DiagnosticIDs.h | |
parent | 38559ec75fefa1e37db664494af55c7010207829 (diff) | |
download | clang-6948bc4bcbd92502d90b877780a3b746275efa5b.tar.gz clang-6948bc4bcbd92502d90b877780a3b746275efa5b.tar.bz2 clang-6948bc4bcbd92502d90b877780a3b746275efa5b.tar.xz |
Provide diag_iterator for iterating over the built-in diagnostic IDs/names in the internal table of DiagnosticIDs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticIDs.h')
-rw-r--r-- | include/clang/Basic/DiagnosticIDs.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index 8bbb1610c0..e9a38c14c5 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -195,6 +195,25 @@ public: /// getFullExplanation - Given a diagnostic ID, return a full explanation /// of the issue static StringRef getFullExplanation(unsigned DiagID); + + /// Iterator class used for traversing all statically declared + /// diagnostics. + class diag_iterator { + const void *impl; + + friend class DiagnosticIDs; + diag_iterator(const void *im) : impl(im) {}; + public: + diag_iterator &operator++(); + bool operator==(const diag_iterator &x) const { return impl == x.impl; } + bool operator!=(const diag_iterator &x) const { return impl != x.impl; } + + llvm::StringRef getDiagName() const; + unsigned getDiagID() const; + }; + + static diag_iterator diags_begin(); + static diag_iterator diags_end(); private: /// setDiagnosticGroupMapping - Change an entire diagnostic group (e.g. |