@@ -10242,13 +10242,15 @@ StmtResult SemaOpenMP::ActOnOpenMPSimdDirective(
10242
10242
if (!AStmt)
10243
10243
return StmtError();
10244
10244
10245
+ CapturedStmt *CS = setBranchProtectedScope(SemaRef, OMPD_simd, AStmt);
10246
+
10245
10247
assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
10246
10248
OMPLoopBasedDirective::HelperExprs B;
10247
10249
// In presence of clause 'collapse' or 'ordered' with number of loops, it will
10248
10250
// define the nested loops number.
10249
10251
unsigned NestedLoopCount = checkOpenMPLoop(
10250
10252
OMPD_simd, getCollapseNumberExpr(Clauses), getOrderedNumberExpr(Clauses),
10251
- AStmt , SemaRef, *DSAStack, VarsWithImplicitDSA, B);
10253
+ CS , SemaRef, *DSAStack, VarsWithImplicitDSA, B);
10252
10254
if (NestedLoopCount == 0)
10253
10255
return StmtError();
10254
10256
@@ -10258,7 +10260,6 @@ StmtResult SemaOpenMP::ActOnOpenMPSimdDirective(
10258
10260
if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
10259
10261
return StmtError();
10260
10262
10261
- SemaRef.setFunctionHasBranchProtectedScope();
10262
10263
auto *SimdDirective = OMPSimdDirective::Create(
10263
10264
getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
10264
10265
return SimdDirective;
@@ -10295,13 +10296,15 @@ StmtResult SemaOpenMP::ActOnOpenMPForSimdDirective(
10295
10296
if (!AStmt)
10296
10297
return StmtError();
10297
10298
10299
+ CapturedStmt *CS = setBranchProtectedScope(SemaRef, OMPD_for_simd, AStmt);
10300
+
10298
10301
assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
10299
10302
OMPLoopBasedDirective::HelperExprs B;
10300
10303
// In presence of clause 'collapse' or 'ordered' with number of loops, it will
10301
10304
// define the nested loops number.
10302
10305
unsigned NestedLoopCount =
10303
10306
checkOpenMPLoop(OMPD_for_simd, getCollapseNumberExpr(Clauses),
10304
- getOrderedNumberExpr(Clauses), AStmt , SemaRef, *DSAStack,
10307
+ getOrderedNumberExpr(Clauses), CS , SemaRef, *DSAStack,
10305
10308
VarsWithImplicitDSA, B);
10306
10309
if (NestedLoopCount == 0)
10307
10310
return StmtError();
@@ -10312,7 +10315,6 @@ StmtResult SemaOpenMP::ActOnOpenMPForSimdDirective(
10312
10315
if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
10313
10316
return StmtError();
10314
10317
10315
- SemaRef.setFunctionHasBranchProtectedScope();
10316
10318
return OMPForSimdDirective::Create(getASTContext(), StartLoc, EndLoc,
10317
10319
NestedLoopCount, Clauses, AStmt, B);
10318
10320
}
@@ -10764,14 +10766,15 @@ StmtResult SemaOpenMP::ActOnOpenMPParallelForSimdDirective(
10764
10766
if (!AStmt)
10765
10767
return StmtError();
10766
10768
10767
- setBranchProtectedScope(SemaRef, OMPD_parallel_for_simd, AStmt);
10769
+ CapturedStmt *CS =
10770
+ setBranchProtectedScope(SemaRef, OMPD_parallel_for_simd, AStmt);
10768
10771
10769
10772
OMPLoopBasedDirective::HelperExprs B;
10770
10773
// In presence of clause 'collapse' or 'ordered' with number of loops, it will
10771
10774
// define the nested loops number.
10772
10775
unsigned NestedLoopCount =
10773
10776
checkOpenMPLoop(OMPD_parallel_for_simd, getCollapseNumberExpr(Clauses),
10774
- getOrderedNumberExpr(Clauses), AStmt , SemaRef, *DSAStack,
10777
+ getOrderedNumberExpr(Clauses), CS , SemaRef, *DSAStack,
10775
10778
VarsWithImplicitDSA, B);
10776
10779
if (NestedLoopCount == 0)
10777
10780
return StmtError();
@@ -13121,14 +13124,17 @@ StmtResult SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(
13121
13124
if (!AStmt)
13122
13125
return StmtError();
13123
13126
13127
+ CapturedStmt *CS =
13128
+ setBranchProtectedScope(SemaRef, OMPD_taskloop_simd, AStmt);
13129
+
13124
13130
assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
13125
13131
OMPLoopBasedDirective::HelperExprs B;
13126
13132
// In presence of clause 'collapse' or 'ordered' with number of loops, it will
13127
13133
// define the nested loops number.
13128
13134
unsigned NestedLoopCount =
13129
13135
checkOpenMPLoop(OMPD_taskloop_simd, getCollapseNumberExpr(Clauses),
13130
- /*OrderedLoopCountExpr=*/nullptr, AStmt , SemaRef,
13131
- *DSAStack, VarsWithImplicitDSA, B);
13136
+ /*OrderedLoopCountExpr=*/nullptr, CS , SemaRef, *DSAStack ,
13137
+ VarsWithImplicitDSA, B);
13132
13138
if (NestedLoopCount == 0)
13133
13139
return StmtError();
13134
13140
@@ -13149,7 +13155,6 @@ StmtResult SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(
13149
13155
if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
13150
13156
return StmtError();
13151
13157
13152
- SemaRef.setFunctionHasBranchProtectedScope();
13153
13158
return OMPTaskLoopSimdDirective::Create(getASTContext(), StartLoc, EndLoc,
13154
13159
NestedLoopCount, Clauses, AStmt, B);
13155
13160
}
@@ -13236,14 +13241,17 @@ StmtResult SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(
13236
13241
if (!AStmt)
13237
13242
return StmtError();
13238
13243
13244
+ CapturedStmt *CS =
13245
+ setBranchProtectedScope(SemaRef, OMPD_master_taskloop_simd, AStmt);
13246
+
13239
13247
assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
13240
13248
OMPLoopBasedDirective::HelperExprs B;
13241
13249
// In presence of clause 'collapse' or 'ordered' with number of loops, it will
13242
13250
// define the nested loops number.
13243
13251
unsigned NestedLoopCount =
13244
13252
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);
13247
13255
if (NestedLoopCount == 0)
13248
13256
return StmtError();
13249
13257
@@ -13264,7 +13272,6 @@ StmtResult SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(
13264
13272
if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
13265
13273
return StmtError();
13266
13274
13267
- SemaRef.setFunctionHasBranchProtectedScope();
13268
13275
return OMPMasterTaskLoopSimdDirective::Create(
13269
13276
getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
13270
13277
}
@@ -13275,14 +13282,17 @@ StmtResult SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(
13275
13282
if (!AStmt)
13276
13283
return StmtError();
13277
13284
13285
+ CapturedStmt *CS =
13286
+ setBranchProtectedScope(SemaRef, OMPD_masked_taskloop_simd, AStmt);
13287
+
13278
13288
assert(isa<CapturedStmt>(AStmt) && "Captured statement expected");
13279
13289
OMPLoopBasedDirective::HelperExprs B;
13280
13290
// In presence of clause 'collapse' or 'ordered' with number of loops, it will
13281
13291
// define the nested loops number.
13282
13292
unsigned NestedLoopCount =
13283
13293
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);
13286
13296
if (NestedLoopCount == 0)
13287
13297
return StmtError();
13288
13298
@@ -13303,7 +13313,6 @@ StmtResult SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(
13303
13313
if (checkSimdlenSafelenSpecified(SemaRef, Clauses))
13304
13314
return StmtError();
13305
13315
13306
- SemaRef.setFunctionHasBranchProtectedScope();
13307
13316
return OMPMaskedTaskLoopSimdDirective::Create(
13308
13317
getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
13309
13318
}
0 commit comments