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 | cb4e68c34032d5de2983e3ae6bebfbb25875dd23 (patch) | |
tree | 324dcd652c23faf4be5c5cb0a4f09afc51aed155 /clang/lib/Basic | |
parent | 4794b2b27b89f7cea1df5fc10ef840daaf7d2d29 (diff) | |
download | bcm5719-llvm-cb4e68c34032d5de2983e3ae6bebfbb25875dd23.tar.gz bcm5719-llvm-cb4e68c34032d5de2983e3ae6bebfbb25875dd23.zip |
increase helpfulness of assert message.
llvm-svn: 84240
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 4a29997a2cc..7ae7c76bb5c 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/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 |