[flang] Add TODO instead of crashing on assert
authorValentin Clement <clementval@gmail.com>
Thu, 16 Feb 2023 13:05:03 +0000 (14:05 +0100)
committerValentin Clement <clementval@gmail.com>
Thu, 16 Feb 2023 13:06:06 +0000 (14:06 +0100)
Current code are crashing on the assert `assert(seqTy && "must be an array");`.

Add a TODO instead until the support is in.

Reviewed By: jeanPerier

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

flang/lib/Lower/ConvertExpr.cpp

index c7c35b5..78fa89c 100644 (file)
@@ -4305,11 +4305,13 @@ private:
   fir::ArrayLoadOp
   createAndLoadSomeArrayTemp(mlir::Type type,
                              llvm::ArrayRef<mlir::Value> shape) {
+    mlir::Location loc = getLoc();
+    if (fir::isPolymorphicType(type))
+      TODO(loc, "polymorphic array temporary");
     if (ccLoadDest)
       return (*ccLoadDest)(shape);
     auto seqTy = type.dyn_cast<fir::SequenceType>();
     assert(seqTy && "must be an array");
-    mlir::Location loc = getLoc();
     // TODO: Need to thread the LEN parameters here. For character, they may
     // differ from the operands length (e.g concatenation). So the array loads
     // type parameters are not enough.