From ed1236d041fd41ec4b447581b21f021bd127a8f0 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 19 Jul 2013 03:59:51 +0000 Subject: [PATCH] Remove unnecessary IsFirst variable from debug codde in GetDiagInfo. llvm-svn: 186649 --- clang/lib/Basic/DiagnosticIDs.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index c2cb366..a703876 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 -- 2.7.4