[flang-commits] [flang] e97fc50 - [flang] Add TODO instead of crashing on assert

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Thu Feb 16 05:06:12 PST 2023


Author: Valentin Clement
Date: 2023-02-16T14:06:06+01:00
New Revision: e97fc5007e72d183085ecd408ad098b5b5e1319e

URL: https://github.com/llvm/llvm-project/commit/e97fc5007e72d183085ecd408ad098b5b5e1319e
DIFF: https://github.com/llvm/llvm-project/commit/e97fc5007e72d183085ecd408ad098b5b5e1319e.diff

LOG: [flang] Add TODO instead of crashing on assert

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

Added: 
    

Modified: 
    flang/lib/Lower/ConvertExpr.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/ConvertExpr.cpp b/flang/lib/Lower/ConvertExpr.cpp
index c7c35b5df988c..78fa89cbd211f 100644
--- a/flang/lib/Lower/ConvertExpr.cpp
+++ b/flang/lib/Lower/ConvertExpr.cpp
@@ -4305,11 +4305,13 @@ class ArrayExprLowering {
   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
     // 
diff er from the operands length (e.g concatenation). So the array loads
     // type parameters are not enough.


        


More information about the flang-commits mailing list