Skip to content

Commit

Permalink
[Flang][OpenMP] Improved reduction clause TODO message
Browse files Browse the repository at this point in the history
Provide the name of the construct and the clause info (reduction)
in the TODO mesage.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D145061
  • Loading branch information
kiranchandramohan committed Mar 2, 2023
1 parent 5be7f8a commit 0ca86a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion flang/lib/Lower/OpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,13 @@ genOMP(Fortran::lower::AbstractConverter &converter,
&clause.u)) {
priorityClauseOperand = fir::getBase(converter.genExprValue(
*Fortran::semantics::GetExpr(priorityClause->v), stmtCtx));
} else if (std::get_if<Fortran::parser::OmpClause::Reduction>(&clause.u)) {
TODO(currentLocation,
"Reduction in OpenMP " +
llvm::omp::getOpenMPDirectiveName(blockDirective.v) +
" construct");
} else {
TODO(currentLocation, "OpenMP Block construct clauses");
TODO(converter.getCurrentLocation(), "OpenMP Block construct clause");
}
}

Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/OpenMP/Todo/parallel-reduction.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s

! CHECK: not yet implemented: OpenMP Block construct clauses
! CHECK: not yet implemented: Reduction in OpenMP parallel construct
subroutine reduction_parallel
integer :: x
!$omp parallel reduction(+:x)
Expand Down

0 comments on commit 0ca86a4

Please sign in to comment.