diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp index 94c2c78be5be9..50a96d444b352 100644 --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -111,9 +111,8 @@ static void gatherFuncAndVarSyms( } static Fortran::lower::pft::Evaluation * -getCollapsedEval(Fortran::lower::pft::Evaluation &eval, int collapseValue) { - // Return the Evaluation of the innermost collapsed loop, or the current - // evaluation, if there is nothing to collapse. +getCollapsedLoopEval(Fortran::lower::pft::Evaluation &eval, int collapseValue) { + // Return the Evaluation of the innermost collapsed loop. if (collapseValue == 0) return &eval; @@ -132,7 +131,7 @@ static void genNestedEvaluations(Fortran::lower::AbstractConverter &converter, Fortran::lower::pft::Evaluation &eval, int collapseValue = 0) { Fortran::lower::pft::Evaluation *curEval = - getCollapsedEval(eval, collapseValue); + collapseValue == 0 ? &eval : getCollapsedLoopEval(eval, collapseValue); for (Fortran::lower::pft::Evaluation &e : curEval->getNestedEvaluations()) converter.genEval(e);