[flang-commits] [flang] [flang][hlfir] patch for assumed shape dummy with VALUE keyword when lowering to HLFIR (PR #70391)

via flang-commits flang-commits at lists.llvm.org
Mon Nov 6 05:51:03 PST 2023


================
@@ -977,10 +977,14 @@ class Fortran::lower::CallInterfaceImpl {
       addPassedArg(PassEntityBy::MutableBox, entity, characteristics);
     } else if (dummyRequiresBox(obj, isBindC)) {
       // Pass as fir.box or fir.class
-      if (isValueAttr)
-        TODO(loc, "assumed shape dummy argument with VALUE attribute");
-      addFirOperand(boxType, nextPassedArgPosition(), Property::Box, attrs);
-      addPassedArg(PassEntityBy::Box, entity, characteristics);
+      Property prop = Property::Box;
+      PassEntityBy passBy = PassEntityBy::Box;
+      if (isValueAttr) {
+        passBy = PassEntityBy::BaseAddressValueAttribute;
+        prop = Property::Value;
+      }
----------------
jeanPerier wrote:

Thanks for the update, please remove the commented code (and I would avoid creating the "prop" and "passBy" variable and keep the original code instead). Otherwise LGTM.

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


More information about the flang-commits mailing list