[cfe-commits] r84240 - /cfe/trunk/lib/Basic/Diagnostic.cpp
Chris Lattner
sabre at nondot.org
Thu Oct 15 19:34:52 PDT 2009
Author: lattner
Date: Thu Oct 15 21:34:51 2009
New Revision: 84240
URL: http://llvm.org/viewvc/llvm-project?rev=84240&view=rev
Log:
increase helpfulness of assert message.
Modified:
cfe/trunk/lib/Basic/Diagnostic.cpp
Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=84240&r1=84239&r2=84240&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Thu Oct 15 21:34:51 2009
@@ -82,9 +82,14 @@
#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
More information about the cfe-commits
mailing list