================
@@ -478,6 +474,25 @@ bool ClauseProcessor::processDeviceType(
return false;
}
+bool ClauseProcessor::processIndirect(
+ mlir::omp::IndirectClauseOps &result) const {
+ if (auto *clause = findUniqueClause<omp::clause::Indirect>()) {
+ // Case: declare target ... indirect[(scalar-logical-constant)]
+ // An `indirect` clause with no argument defaults to `.true.`.
+ bool isIndirect = true;
+ if (clause->v) {
+ auto foldedExpr = Fortran::evaluate::Fold(
+ semaCtx.foldingContext(), Fortran::common::Clone(*clause->v));
+ if (auto logicalVal = Fortran::evaluate::GetScalarConstantValue<
----------------
chichunchen wrote:
Fortran::evaluate::LogicalResult is defined in
flang/include/flang/Evaluate/type.h as `using LogicalResult =
Type<TypeCategory::Logical, 4>;` so if the folded expression is logical(1) or
logical(8) then logicaVal well get `std::nullopt`. (.false._1 and .false._8 ->
true)
https://github.com/llvm/llvm-project/pull/208387
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits