[flang] Add a proper TODO for polymorphic array lowering with vector subscript
authorValentin Clement <clementval@gmail.com>
Wed, 8 Feb 2023 09:29:41 +0000 (10:29 +0100)
committerValentin Clement <clementval@gmail.com>
Wed, 8 Feb 2023 09:30:39 +0000 (10:30 +0100)
Creation of polymorphic array temporary cannot be done inlined.
Add a TODO so the current code exit in a clean way when lowering
reach it. A solution involving the runtime will be put in place.

Depends on D143490

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D143491

flang/lib/Lower/ConvertExpr.cpp

index e4ccddc..90de4b8 100644 (file)
@@ -3785,6 +3785,12 @@ private:
   /// Lower rhs of an array expression.
   ExtValue lowerArrayExpression(const Fortran::lower::SomeExpr &exp) {
     mlir::Type resTy = converter.genType(exp);
+
+    if (fir::isPolymorphicType(resTy) &&
+        Fortran::evaluate::HasVectorSubscript(exp))
+      TODO(getLoc(),
+           "polymorphic array expression lowering with vector subscript");
+
     return std::visit(
         [&](const auto &e) { return lowerArrayExpression(genarr(e), resTy); },
         exp.u);