[flang-commits] [flang] [Flang]: Lowering reference to functions that return a procedure pointer (PR #78194)
    Daniel Chen via flang-commits 
    flang-commits at lists.llvm.org
       
    Sat Jan 27 09:15:01 PST 2024
    
    
  
================
@@ -156,7 +156,10 @@ fir::ExtendedValue Fortran::lower::genCallOpAndResult(
   using PassBy = Fortran::lower::CallerInterface::PassEntityBy;
   // Handle cases where caller must allocate the result or a fir.box for it.
   bool mustPopSymMap = false;
-  if (caller.mustMapInterfaceSymbols()) {
+
+  // Is procedure pointer functin result.
+  bool isProcedurePointer = resultType && resultType->isa<fir::BoxProcType>();
+  if (!isProcedurePointer && caller.mustMapInterfaceSymbols()) {
----------------
DanielCChen wrote:
The relevant change for the `callerAllocatedResult` is addressed below. The extra change is indeed not needed.
Move the check for procedure pointer inside `caller.mustMapInterfaceSymbols`.
https://github.com/llvm/llvm-project/pull/78194
    
    
More information about the flang-commits
mailing list