r186649 - Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.

Craig Topper craig.topper at gmail.com
Thu Jul 18 20:59:51 PDT 2013


Author: ctopper
Date: Thu Jul 18 22:59:51 2013
New Revision: 186649

URL: http://llvm.org/viewvc/llvm-project?rev=186649&view=rev
Log:
Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.

Modified:
    cfe/trunk/lib/Basic/DiagnosticIDs.cpp

Modified: cfe/trunk/lib/Basic/DiagnosticIDs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/DiagnosticIDs.cpp?rev=186649&r1=186648&r2=186649&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/DiagnosticIDs.cpp (original)
+++ cfe/trunk/lib/Basic/DiagnosticIDs.cpp Thu Jul 18 22:59:51 2013
@@ -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");
+  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;
+    assert(StaticDiagInfo[i-1] < StaticDiagInfo[i] &&
+           "Improperly sorted diag info");
   }
 #endif
 





More information about the cfe-commits mailing list