diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp index 0fa1ac76d57ed..31d5df040c5d6 100644 --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -3233,7 +3233,6 @@ static void genOMP(Fortran::lower::AbstractConverter &converter, Fortran::lower::pft::Evaluation &eval, const Fortran::parser::OpenMPSectionConstruct §ionConstruct) { - fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder(); mlir::Location currentLocation = converter.getCurrentLocation(); const Fortran::parser::OpenMPConstruct *parentOmpConstruct = eval.parentConstruct->getIf(); @@ -3251,10 +3250,9 @@ genOMP(Fortran::lower::AbstractConverter &converter, .t); // Currently only private/firstprivate clause is handled, and // all privatization is done within `omp.section` operations. - mlir::omp::SectionOp sectionOp = - firOpBuilder.create(currentLocation); - createBodyOfOp(sectionOp, converter, currentLocation, - eval, §ionsClauseList); + genOpWithBody(converter, eval, currentLocation, + /*outerCombined=*/false, + §ionsClauseList); } static void