Skip to content

Commit 85e8652

Browse files
authored
[flang] Use createOpWithBody for section op, NFC (#74659)
Replace explicit calls to ``` op = builder.create<SectionOp>(...) createBodyOfOp<SectionOp>(op, ...) ``` with a single call to ``` createOpWithBody<SectionOp>(...) ``` This is NFC, that's what the `createOpWithBody` function does.
1 parent f2f0778 commit 85e8652

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,7 +3233,6 @@ static void
32333233
genOMP(Fortran::lower::AbstractConverter &converter,
32343234
Fortran::lower::pft::Evaluation &eval,
32353235
const Fortran::parser::OpenMPSectionConstruct &sectionConstruct) {
3236-
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
32373236
mlir::Location currentLocation = converter.getCurrentLocation();
32383237
const Fortran::parser::OpenMPConstruct *parentOmpConstruct =
32393238
eval.parentConstruct->getIf<Fortran::parser::OpenMPConstruct>();
@@ -3251,10 +3250,9 @@ genOMP(Fortran::lower::AbstractConverter &converter,
32513250
.t);
32523251
// Currently only private/firstprivate clause is handled, and
32533252
// all privatization is done within `omp.section` operations.
3254-
mlir::omp::SectionOp sectionOp =
3255-
firOpBuilder.create<mlir::omp::SectionOp>(currentLocation);
3256-
createBodyOfOp<mlir::omp::SectionOp>(sectionOp, converter, currentLocation,
3257-
eval, &sectionsClauseList);
3253+
genOpWithBody<mlir::omp::SectionOp>(converter, eval, currentLocation,
3254+
/*outerCombined=*/false,
3255+
&sectionsClauseList);
32583256
}
32593257

32603258
static void

0 commit comments

Comments
 (0)