[flang-commits] [flang] [flang] Lower non optional inquired argument in custom intrinsic lowering (PR #93592)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Tue May 28 11:19:05 PDT 2024


================
@@ -2486,12 +2487,34 @@ IntrinsicLibrary::genAssociated(mlir::Type resultType,
     // In both cases, ASSOCIATED should be false if POINTER is NULL.
     return builder.create<mlir::arith::AndIOp>(loc, sameTarget, notNull);
   }
+
+  const fir::ExtendedValue &target = args[1];
+
+  if (!args[0].getBoxOf<fir::MutableBoxValue>()) {
+    // Argument was lowered as a EntityWithAttribute. Try to retrieve the box
+    // reference.
+    if (auto declareOp = mlir::dyn_cast_or_null<hlfir::DeclareOp>(
----------------
clementval wrote:

I'm not sure if we have a better way to retrieve a MutableBox from an EntityWithAttribute. 

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


More information about the flang-commits mailing list