diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-16 02:34:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-16 02:34:51 +0000 |
commit | 5a3ce9b10c164d9bf75a70d429e55d4e171a9a9e (patch) | |
tree | ae7a3617d2ffd47642e700bd308ca45ec77f8c3e /lib/Basic/Diagnostic.cpp | |
parent | 410f7640cfa7483132b1524138b1333b9fb9ab33 (diff) |
increase helpfulness of assert message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 4a29997a2c..7ae7c76bb5 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -82,9 +82,14 @@ static const StaticDiagInfoRec *GetDiagInfo(unsigned DiagID) { #ifndef NDEBUG static bool IsFirst = true; if (IsFirst) { - for (unsigned i = 1; i != NumDiagEntries; ++i) + for (unsigned i = 1; i != NumDiagEntries; ++i) { + assert(StaticDiagInfo[i-1].DiagID != StaticDiagInfo[i].DiagID && + "Diag ID conflict, the enums at the start of clang::diag (in " + "Diagnostic.h) probably need to be increased"); + assert(StaticDiagInfo[i-1] < StaticDiagInfo[i] && "Improperly sorted diag info"); + } IsFirst = false; } #endif |