@@ -10242,13 +10242,15 @@ StmtResult SemaOpenMP::ActOnOpenMPSimdDirective(
1024210242 if (!AStmt)
1024310243 return StmtError();
1024410244
10245+ CapturedStmt *CS = setBranchProtectedScope(SemaRef, OMPD_simd, AStmt);
10246+
1024510247 assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
1024610248 OMPLoopBasedDirective::HelperExprs B;
1024710249 // In presence of clause 'collapse' or 'ordered' with number of loops, it will
1024810250 // define the nested loops number.
1024910251 unsigned NestedLoopCount = checkOpenMPLoop(
1025010252 OMPD_simd, getCollapseNumberExpr(Clauses), getOrderedNumberExpr(Clauses),
10251- AStmt , SemaRef, *DSAStack, VarsWithImplicitDSA, B);
10253+ CS , SemaRef, *DSAStack, VarsWithImplicitDSA, B);
1025210254 if (NestedLoopCount == 0)
1025310255 return StmtError();
1025410256
@@ -10258,7 +10260,6 @@ StmtResult SemaOpenMP::ActOnOpenMPSimdDirective(
1025810260 if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
1025910261 return StmtError();
1026010262
10261- SemaRef.setFunctionHasBranchProtectedScope();
1026210263 auto *SimdDirective = OMPSimdDirective::Create(
1026310264 getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
1026410265 return SimdDirective;
@@ -10295,13 +10296,15 @@ StmtResult SemaOpenMP::ActOnOpenMPForSimdDirective(
1029510296 if (!AStmt)
1029610297 return StmtError();
1029710298
10299+ CapturedStmt *CS = setBranchProtectedScope(SemaRef, OMPD_for_simd, AStmt);
10300+
1029810301 assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
1029910302 OMPLoopBasedDirective::HelperExprs B;
1030010303 // In presence of clause 'collapse' or 'ordered' with number of loops, it will
1030110304 // define the nested loops number.
1030210305 unsigned NestedLoopCount =
1030310306 checkOpenMPLoop(OMPD_for_simd, getCollapseNumberExpr(Clauses),
10304- getOrderedNumberExpr(Clauses), AStmt , SemaRef, *DSAStack,
10307+ getOrderedNumberExpr(Clauses), CS , SemaRef, *DSAStack,
1030510308 VarsWithImplicitDSA, B);
1030610309 if (NestedLoopCount == 0)
1030710310 return StmtError();
@@ -10312,7 +10315,6 @@ StmtResult SemaOpenMP::ActOnOpenMPForSimdDirective(
1031210315 if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
1031310316 return StmtError();
1031410317
10315- SemaRef.setFunctionHasBranchProtectedScope();
1031610318 return OMPForSimdDirective::Create(getASTContext(), StartLoc, EndLoc,
1031710319 NestedLoopCount, Clauses, AStmt, B);
1031810320}
@@ -10764,14 +10766,15 @@ StmtResult SemaOpenMP::ActOnOpenMPParallelForSimdDirective(
1076410766 if (!AStmt)
1076510767 return StmtError();
1076610768
10767- setBranchProtectedScope(SemaRef, OMPD_parallel_for_simd, AStmt);
10769+ CapturedStmt *CS =
10770+ setBranchProtectedScope(SemaRef, OMPD_parallel_for_simd, AStmt);
1076810771
1076910772 OMPLoopBasedDirective::HelperExprs B;
1077010773 // In presence of clause 'collapse' or 'ordered' with number of loops, it will
1077110774 // define the nested loops number.
1077210775 unsigned NestedLoopCount =
1077310776 checkOpenMPLoop(OMPD_parallel_for_simd, getCollapseNumberExpr(Clauses),
10774- getOrderedNumberExpr(Clauses), AStmt , SemaRef, *DSAStack,
10777+ getOrderedNumberExpr(Clauses), CS , SemaRef, *DSAStack,
1077510778 VarsWithImplicitDSA, B);
1077610779 if (NestedLoopCount == 0)
1077710780 return StmtError();
@@ -13121,14 +13124,17 @@ StmtResult SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(
1312113124 if (!AStmt)
1312213125 return StmtError();
1312313126
13127+ CapturedStmt *CS =
13128+ setBranchProtectedScope(SemaRef, OMPD_taskloop_simd, AStmt);
13129+
1312413130 assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
1312513131 OMPLoopBasedDirective::HelperExprs B;
1312613132 // In presence of clause 'collapse' or 'ordered' with number of loops, it will
1312713133 // define the nested loops number.
1312813134 unsigned NestedLoopCount =
1312913135 checkOpenMPLoop(OMPD_taskloop_simd, getCollapseNumberExpr(Clauses),
13130- /*OrderedLoopCountExpr=*/nullptr, AStmt , SemaRef,
13131- *DSAStack, VarsWithImplicitDSA, B);
13136+ /*OrderedLoopCountExpr=*/nullptr, CS , SemaRef, *DSAStack ,
13137+ VarsWithImplicitDSA, B);
1313213138 if (NestedLoopCount == 0)
1313313139 return StmtError();
1313413140
@@ -13149,7 +13155,6 @@ StmtResult SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(
1314913155 if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
1315013156 return StmtError();
1315113157
13152- SemaRef.setFunctionHasBranchProtectedScope();
1315313158 return OMPTaskLoopSimdDirective::Create(getASTContext(), StartLoc, EndLoc,
1315413159 NestedLoopCount, Clauses, AStmt, B);
1315513160}
@@ -13236,14 +13241,17 @@ StmtResult SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(
1323613241 if (!AStmt)
1323713242 return StmtError();
1323813243
13244+ CapturedStmt *CS =
13245+ setBranchProtectedScope(SemaRef, OMPD_master_taskloop_simd, AStmt);
13246+
1323913247 assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
1324013248 OMPLoopBasedDirective::HelperExprs B;
1324113249 // In presence of clause 'collapse' or 'ordered' with number of loops, it will
1324213250 // define the nested loops number.
1324313251 unsigned NestedLoopCount =
1324413252 checkOpenMPLoop(OMPD_master_taskloop_simd, getCollapseNumberExpr(Clauses),
13245- /*OrderedLoopCountExpr=*/nullptr, AStmt , SemaRef,
13246- *DSAStack, VarsWithImplicitDSA, B);
13253+ /*OrderedLoopCountExpr=*/nullptr, CS , SemaRef, *DSAStack ,
13254+ VarsWithImplicitDSA, B);
1324713255 if (NestedLoopCount == 0)
1324813256 return StmtError();
1324913257
@@ -13264,7 +13272,6 @@ StmtResult SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(
1326413272 if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
1326513273 return StmtError();
1326613274
13267- SemaRef.setFunctionHasBranchProtectedScope();
1326813275 return OMPMasterTaskLoopSimdDirective::Create(
1326913276 getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
1327013277}
@@ -13275,14 +13282,17 @@ StmtResult SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(
1327513282 if (!AStmt)
1327613283 return StmtError();
1327713284
13285+ CapturedStmt *CS =
13286+ setBranchProtectedScope(SemaRef, OMPD_masked_taskloop_simd, AStmt);
13287+
1327813288 assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
1327913289 OMPLoopBasedDirective::HelperExprs B;
1328013290 // In presence of clause 'collapse' or 'ordered' with number of loops, it will
1328113291 // define the nested loops number.
1328213292 unsigned NestedLoopCount =
1328313293 checkOpenMPLoop(OMPD_masked_taskloop_simd, getCollapseNumberExpr(Clauses),
13284- /*OrderedLoopCountExpr=*/nullptr, AStmt , SemaRef,
13285- *DSAStack, VarsWithImplicitDSA, B);
13294+ /*OrderedLoopCountExpr=*/nullptr, CS , SemaRef, *DSAStack ,
13295+ VarsWithImplicitDSA, B);
1328613296 if (NestedLoopCount == 0)
1328713297 return StmtError();
1328813298
@@ -13303,7 +13313,6 @@ StmtResult SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(
1330313313 if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
1330413314 return StmtError();
1330513315
13306- SemaRef.setFunctionHasBranchProtectedScope();
1330713316 return OMPMaskedTaskLoopSimdDirective::Create(
1330813317 getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
1330913318}
0 commit comments