Author: abataev Date: Tue Jul 19 00:06:39 2016 New Revision: 275947 URL: http://llvm.org/viewvc/llvm-project?rev=275947&view=rev Log: [OPENMP] Removed loop statement as its body executes at most once, NFC.
Removed not required loop statement, addressing comments from Richard Smith. Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=275947&r1=275946&r2=275947&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original) +++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Tue Jul 19 00:06:39 2016 @@ -771,18 +771,12 @@ DSAStackTy::DSAVarData DSAStackTy::hasIn D = getCanonicalDecl(D); auto StartI = std::next(Stack.rbegin()); auto EndI = Stack.rend(); - if (FromParent && StartI != EndI) { + if (FromParent && StartI != EndI) StartI = std::next(StartI); - } - for (auto I = StartI, EE = EndI; I != EE; ++I) { - if (!DPred(I->Directive)) - break; - DSAVarData DVar = getDSA(I, D); - if (CPred(DVar.CKind)) - return DVar; + if (StartI == EndI || !DPred(StartI->Directive)) return DSAVarData(); - } - return DSAVarData(); + DSAVarData DVar = getDSA(StartI, D); + return CPred(DVar.CKind) ? DVar : DSAVarData(); } bool DSAStackTy::hasExplicitDSA( _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits