[flang-commits] [flang] [Flang]: Lowering reference to functions that return a procedure pointer (PR #78194)
    via flang-commits 
    flang-commits at lists.llvm.org
       
    Thu Jan 18 05:21:44 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()) {
----------------
jeanPerier wrote:
I think I would prefer `caller.mustMapInterfaceSymbols` and `caller.callerAllocateResult()` to return false in the Procedure pointer result case instead of overriding that here.
https://github.com/llvm/llvm-project/pull/78194
    
    
More information about the flang-commits
mailing list