@@ -1405,10 +1405,9 @@ const Expr *DSAStackTy::addUniqueAligned(const ValueDecl *D,
1405
1405
assert(!isStackEmpty() && "Data sharing attributes stack is empty");
1406
1406
D = getCanonicalDecl(D);
1407
1407
SharingMapTy &StackElem = getTopOfStack();
1408
- auto It = StackElem.AlignedMap.find(D );
1409
- if (It == StackElem.AlignedMap.end() ) {
1408
+ auto [It, Inserted] = StackElem.AlignedMap.try_emplace(D, NewDE );
1409
+ if (Inserted ) {
1410
1410
assert(NewDE && "Unexpected nullptr expr to be added into aligned map");
1411
- StackElem.AlignedMap[D] = NewDE;
1412
1411
return nullptr;
1413
1412
}
1414
1413
assert(It->second && "Unexpected nullptr expr in the aligned map");
@@ -1420,10 +1419,9 @@ const Expr *DSAStackTy::addUniqueNontemporal(const ValueDecl *D,
1420
1419
assert(!isStackEmpty() && "Data sharing attributes stack is empty");
1421
1420
D = getCanonicalDecl(D);
1422
1421
SharingMapTy &StackElem = getTopOfStack();
1423
- auto It = StackElem.NontemporalMap.find(D );
1424
- if (It == StackElem.NontemporalMap.end() ) {
1422
+ auto [It, Inserted] = StackElem.NontemporalMap.try_emplace(D, NewDE );
1423
+ if (Inserted ) {
1425
1424
assert(NewDE && "Unexpected nullptr expr to be added into aligned map");
1426
- StackElem.NontemporalMap[D] = NewDE;
1427
1425
return nullptr;
1428
1426
}
1429
1427
assert(It->second && "Unexpected nullptr expr in the aligned map");
@@ -21650,9 +21648,7 @@ SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(
21650
21648
while (Filter.hasNext()) {
21651
21649
auto *PrevDecl = cast<OMPDeclareReductionDecl>(Filter.next());
21652
21650
if (InCompoundScope) {
21653
- auto I = UsedAsPrevious.find(PrevDecl);
21654
- if (I == UsedAsPrevious.end())
21655
- UsedAsPrevious[PrevDecl] = false;
21651
+ UsedAsPrevious.try_emplace(PrevDecl, false);
21656
21652
if (OMPDeclareReductionDecl *D = PrevDecl->getPrevDeclInScope())
21657
21653
UsedAsPrevious[D] = true;
21658
21654
}
@@ -21906,9 +21902,7 @@ SemaOpenMP::DeclGroupPtrTy SemaOpenMP::ActOnOpenMPDeclareMapperDirective(
21906
21902
while (Filter.hasNext()) {
21907
21903
auto *PrevDecl = cast<OMPDeclareMapperDecl>(Filter.next());
21908
21904
if (InCompoundScope) {
21909
- auto I = UsedAsPrevious.find(PrevDecl);
21910
- if (I == UsedAsPrevious.end())
21911
- UsedAsPrevious[PrevDecl] = false;
21905
+ UsedAsPrevious.try_emplace(PrevDecl, false);
21912
21906
if (OMPDeclareMapperDecl *D = PrevDecl->getPrevDeclInScope())
21913
21907
UsedAsPrevious[D] = true;
21914
21908
}
0 commit comments