]> granicus.if.org Git - clang/commitdiff
Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.
authorCraig Topper <craig.topper@gmail.com>
Fri, 19 Jul 2013 03:59:51 +0000 (03:59 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 19 Jul 2013 03:59:51 +0000 (03:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186649 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/DiagnosticIDs.cpp

index c2cb366e5e03e2bcfa1848d93b895ead3d5892d5..a703876da1237465d3859b7849422f2c16c04a9a 100644 (file)
@@ -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