[flang-commits] [PATCH] D145255: [flang] Ensure "dtv" args are passed by descriptor when polymorphic

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Mar 9 09:55:42 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG099a62e16ca3: [flang] Ensure "dtv" args passed by descriptor when polymorphic (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145255/new/

https://reviews.llvm.org/D145255

Files:
  flang/lib/Semantics/runtime-type-info.cpp


Index: flang/lib/Semantics/runtime-type-info.cpp
===================================================================
--- flang/lib/Semantics/runtime-type-info.cpp
+++ flang/lib/Semantics/runtime-type-info.cpp
@@ -1112,15 +1112,18 @@
       }
     } else { // user defined derived type I/O
       CHECK(proc->dummyArguments.size() >= 4);
+      const auto *ddo{std::get_if<evaluate::characteristics::DummyDataObject>(
+          &proc->dummyArguments[0].u)};
+      if (!ddo) {
+        return;
+      }
       if (derivedTypeSpec &&
-          !std::get<evaluate::characteristics::DummyDataObject>(
-              proc->dummyArguments[0].u)
-               .type.type()
-               .IsTkCompatibleWith(evaluate::DynamicType{*derivedTypeSpec})) {
+          !ddo->type.type().IsTkCompatibleWith(
+              evaluate::DynamicType{*derivedTypeSpec})) {
         // Defined I/O specific procedure is not for this derived type.
         return;
       }
-      if (binding) {
+      if (ddo->type.type().IsPolymorphic()) {
         isArgDescriptorSet |= 1;
       }
       switch (io.value()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145255.503816.patch
Type: text/x-patch
Size: 1098 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230309/3d979f2d/attachment.bin>


More information about the flang-commits mailing list