[flang-commits] [flang] [flang][hlfir] Cast actual cst len character to stmt func dummy type (PR #68598)

via flang-commits flang-commits at lists.llvm.org
Mon Oct 9 10:06:06 PDT 2023


================
@@ -1947,13 +1947,15 @@ void Fortran::lower::mapSymbolAttributes(
   if (ba.isChar()) {
     if (arg) {
       assert(!preAlloc && "dummy cannot be pre-allocated");
-      if (arg.getType().isa<fir::BoxCharType>()) {
+      if (arg.getType().isa<fir::BoxCharType>())
         std::tie(addr, len) = charHelp.createUnboxChar(arg);
-        // Ensure proper type is given to array/scalar that transited via
-        // fir.boxchar arg.
-        mlir::Type castTy = builder.getRefType(converter.genType(var));
-        addr = builder.createConvert(loc, castTy, addr);
-      }
+      else if (!addr)
+        addr = arg;
+      // Ensure proper type is given to array/scalar that transited via
----------------
jeanPerier wrote:

Thanks Pete, I intended "transited", but using "transmitted" may just be clearer. I updated the comment.

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


More information about the flang-commits mailing list