diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-07-19 05:06:39 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-07-19 05:06:39 +0000 |
commit | e397812dcb9052990c567182d72ba33dcee096c2 (patch) | |
tree | c7630306dd54df94b449775e175f98159e48ada1 | |
parent | 9419737fa8542cfa5045ffc2e442aff6efe4bfe4 (diff) | |
download | bcm5719-llvm-e397812dcb9052990c567182d72ba33dcee096c2.tar.gz bcm5719-llvm-e397812dcb9052990c567182d72ba33dcee096c2.zip |
[OPENMP] Removed loop statement as its body executes at most once, NFC.
Removed not required loop statement, addressing comments from Richard
Smith.
llvm-svn: 275947
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 9b8c95c1cb4..3f9c35c508b 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -771,18 +771,12 @@ DSAStackTy::DSAVarData DSAStackTy::hasInnermostDSA( 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( |