diff options
| author | Richard Barton <richard.barton@arm.com> | 2015-10-16 20:15:29 +0000 |
|---|---|---|
| committer | Richard Barton <richard.barton@arm.com> | 2015-10-16 20:15:29 +0000 |
| commit | 8c11bcf73a034ccc96512ef89ea31639519b2130 (patch) | |
| tree | 7a36720c4acf11e6c4e9dc28589601e1ee8636e9 /clang/lib/Basic | |
| parent | e696583dba6ae49301c73e52f75cffb0a8858c76 (diff) | |
| download | bcm5719-llvm-8c11bcf73a034ccc96512ef89ea31639519b2130.tar.gz bcm5719-llvm-8c11bcf73a034ccc96512ef89ea31639519b2130.zip | |
Further increase helfulness of assert message
If you increase the number of diags of a particular type by one more than the
number available you get the nice assert message. If you do it by two more
than available you get the old non-helpful message. Combining the two makes
sense I think.
llvm-svn: 250546
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/DiagnosticIDs.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index 643503b00b9..b855ac2e32f 100644 --- a/clang/lib/Basic/DiagnosticIDs.cpp +++ b/clang/lib/Basic/DiagnosticIDs.cpp @@ -101,12 +101,9 @@ static const StaticDiagInfoRec *GetDiagInfo(unsigned DiagID) { static bool IsFirst = true; // So the check is only performed on first call. if (IsFirst) { for (unsigned i = 1; i != StaticDiagInfoSize; ++i) { - assert(StaticDiagInfo[i-1].DiagID != StaticDiagInfo[i].DiagID && + assert(StaticDiagInfo[i-1] < StaticDiagInfo[i] && "Diag ID conflict, the enums at the start of clang::diag (in " "DiagnosticIDs.h) probably need to be increased"); - - assert(StaticDiagInfo[i-1] < StaticDiagInfo[i] && - "Improperly sorted diag info"); } IsFirst = false; } |

