[flang-commits] [flang] [flang][hlfir] Return function call result as AsExpr. (PR #67769)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Fri Sep 29 08:56:56 PDT 2023


================
@@ -171,8 +171,11 @@ struct AsExprOpConversion : public mlir::OpConversionPattern<hlfir::AsExprOp> {
     fir::FirOpBuilder builder(rewriter, module);
     if (asExpr.isMove()) {
       // Move variable storage for the hlfir.expr buffer.
+      hlfir::Entity varEntity = hlfir::Entity{adaptor.getVar()};
+      varEntity = hlfir::derefPointersAndAllocatables(loc, builder, varEntity);
----------------
vzakhari wrote:

Thanks for explaining the issue!  I tried it before, but it caused tests fallout, so I thought I could do it another way.  I will see if I can resolve those issues after moving the deref to lowering.

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


More information about the flang-commits mailing list