summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-07-19 03:59:51 +0000
committerCraig Topper <craig.topper@gmail.com>2013-07-19 03:59:51 +0000
commited1236d041fd41ec4b447581b21f021bd127a8f0 (patch)
treefc4c9227d617904fdd5620336d87543e468444d3 /clang/lib/Basic
parent5a7bbce587f26ef0bc81774b99530cc65754387e (diff)
downloadbcm5719-llvm-ed1236d041fd41ec4b447581b21f021bd127a8f0.tar.gz
bcm5719-llvm-ed1236d041fd41ec4b447581b21f021bd127a8f0.zip
Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.
llvm-svn: 186649
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/DiagnosticIDs.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index c2cb366e5e0..a703876da12 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/lib/Basic/DiagnosticIDs.cpp
@@ -94,17 +94,13 @@ static const unsigned StaticDiagInfoSize =
static const StaticDiagInfoRec *GetDiagInfo(unsigned DiagID) {
// If assertions are enabled, verify that the StaticDiagInfo array is sorted.
#ifndef NDEBUG
- static bool IsFirst = true;
- if (IsFirst) {
- for (unsigned i = 1; i != StaticDiagInfoSize; ++i) {
- assert(StaticDiagInfo[i-1].DiagID != StaticDiagInfo[i].DiagID &&
- "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;
+ for (unsigned i = 1; i != StaticDiagInfoSize; ++i) {
+ assert(StaticDiagInfo[i-1].DiagID != StaticDiagInfo[i].DiagID &&
+ "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");
}
#endif
OpenPOWER on IntegriCloud