From: Chris Lattner Date: Wed, 12 Dec 2007 18:11:49 +0000 (+0000) Subject: simplify some code, bump j. This fixes the remaining test failures. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=609e4c72d9190a57636836d658b3563d9a9545ae;p=clang simplify some code, bump j. This fixes the remaining test failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44941 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaDeclObjC.cpp b/Sema/SemaDeclObjC.cpp index 376e8e6fe7..1a56e4822a 100644 --- a/Sema/SemaDeclObjC.cpp +++ b/Sema/SemaDeclObjC.cpp @@ -414,11 +414,10 @@ void Sema::CheckImplementationIvars(ObjcImplementationDecl *ImpDecl, // names and types must match. // unsigned j = 0; - bool err = false; ObjcInterfaceDecl::ivar_iterator IVI = IDecl->ivar_begin(), IVE = IDecl->ivar_end(); for (; numIvars > 0 && IVI != IVE; ++IVI) { - ObjcIvarDecl* ImplIvar = ivars[j]; + ObjcIvarDecl* ImplIvar = ivars[j++]; ObjcIvarDecl* ClsIvar = *IVI; assert (ImplIvar && "missing implementation ivar"); assert (ClsIvar && "missing class ivar"); @@ -435,15 +434,15 @@ void Sema::CheckImplementationIvars(ObjcImplementationDecl *ImpDecl, ImplIvar->getIdentifier()->getName()); Diag(ClsIvar->getLocation(), diag::err_previous_definition, ClsIvar->getIdentifier()->getName()); - err = true; - break; + return; } --numIvars; } - if (!err && (numIvars > 0 || IVI != IVE)) - Diag(numIvars > 0 ? ivars[j]->getLocation() : (*IVI)->getLocation(), - diag::err_inconsistant_ivar); - + + if (numIvars > 0) + Diag(ivars[j]->getLocation(), diag::err_inconsistant_ivar); + else if (IVI != IVE) + Diag((*IVI)->getLocation(), diag::err_inconsistant_ivar); } /// CheckProtocolMethodDefs - This routine checks unimpletented methods