typedef SmallVector<SharingMapTy, 8>::reverse_iterator reverse_iterator;
- DSAVarData getDSA(StackTy::reverse_iterator Iter, ValueDecl *D);
+ DSAVarData getDSA(StackTy::reverse_iterator& Iter, ValueDecl *D);
/// \brief Checks if the variable is a local for OpenMP region.
bool isOpenMPLocal(VarDecl *D, StackTy::reverse_iterator Iter);
return D;
}
-DSAStackTy::DSAVarData DSAStackTy::getDSA(StackTy::reverse_iterator Iter,
+DSAStackTy::DSAVarData DSAStackTy::getDSA(StackTy::reverse_iterator& Iter,
ValueDecl *D) {
D = getCanonicalDecl(D);
auto *VD = dyn_cast<VarDecl>(D);
// For constructs other than task, if no default clause is present, these
// variables inherit their data-sharing attributes from the enclosing
// context.
- return getDSA(std::next(Iter), D);
+ return getDSA(++Iter, D);
}
Expr *DSAStackTy::addUniqueAligned(ValueDecl *D, Expr *NewDE) {
bool FromParent) {
D = getCanonicalDecl(D);
auto StartI = std::next(Stack.rbegin());
- auto EndI = std::prev(Stack.rend());
+ auto EndI = Stack.rend();
if (FromParent && StartI != EndI) {
StartI = std::next(StartI);
}
DirectivesPredicate DPred, bool FromParent) {
D = getCanonicalDecl(D);
auto StartI = std::next(Stack.rbegin());
- auto EndI = std::prev(Stack.rend());
+ auto EndI = Stack.rend();
if (FromParent && StartI != EndI) {
StartI = std::next(StartI);
}