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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: Renaud Kauffmann (Renaud-K)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/72171.diff


1 Files Affected:

- (modified) flang/lib/Optimizer/Dialect/FIRType.cpp (+1-1) 


``````````diff
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();

``````````

</details>


https://github.com/llvm/llvm-project/pull/72171


More information about the flang-commits mailing list