From a4f5252bfb766c29e8a0de7500870946d6f9354c 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186649 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/DiagnosticIDs.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index c2cb366e5e..a703876da1 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/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.40.0