[flang-commits] [flang] 725115d - Fix fir::unwrapSeqOrBoxedSeqType (#72171)

via flang-commits flang-commits at lists.llvm.org
Mon Nov 13 18:55:11 PST 2023


Author: Renaud Kauffmann
Date: 2023-11-13T18:55:07-08:00
New Revision: 725115d7bba2faf3d0c21442f4661dea77b8a77c

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

LOG: Fix fir::unwrapSeqOrBoxedSeqType (#72171)

Fixing fir::unwrapSeqOrBoxedSeqType check for fir::BaseBoxType to add
support for fir::BoxType and fir::ClassType

Added: 
    

Modified: 
    flang/lib/Optimizer/Dialect/FIRType.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/Dialect/FIRType.cpp b/flang/lib/Optimizer/Dialect/FIRType.cpp
index efaead599bee169..730317a9bc238b5 100644
--- a/flang/lib/Optimizer/Dialect/FIRType.cpp
+++ b/flang/lib/Optimizer/Dialect/FIRType.cpp
@@ -405,7 +405,7 @@ mlir::Type unwrapAllRefAndSeqType(mlir::Type ty) {
 mlir::Type unwrapSeqOrBoxedSeqType(mlir::Type ty) {
   if (auto seqTy = ty.dyn_cast<fir::SequenceType>())
     return seqTy.getEleTy();
-  if (auto boxTy = ty.dyn_cast<fir::BoxType>()) {
+  if (auto boxTy = ty.dyn_cast<fir::BaseBoxType>()) {
     auto eleTy = unwrapRefType(boxTy.getEleTy());
     if (auto seqTy = eleTy.dyn_cast<fir::SequenceType>())
       return seqTy.getEleTy();


        


More information about the flang-commits mailing list