[flang-commits] [flang] 1947781 - [flang] Make C_F_POINTER a generic interface

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu Aug 25 15:47:37 PDT 2022


Author: Peter Klausler
Date: 2022-08-25T15:47:17-07:00
New Revision: 194778117e57360686eac9bfec7a85f43bbdc628

URL: https://github.com/llvm/llvm-project/commit/194778117e57360686eac9bfec7a85f43bbdc628
DIFF: https://github.com/llvm/llvm-project/commit/194778117e57360686eac9bfec7a85f43bbdc628.diff

LOG: [flang] Make C_F_POINTER a generic interface

The intrinsic procedure C_F_POINTER needs to be a generic interface
in intrinsic module ISO_C_BINDING.  (It also needs to be implemented,
but that remains a TODO for either lowering or the runtime.)

Differential Revision: https://reviews.llvm.org/D132685

Added: 
    

Modified: 
    flang/module/iso_c_binding.f90

Removed: 
    


################################################################################
diff  --git a/flang/module/iso_c_binding.f90 b/flang/module/iso_c_binding.f90
index 347b917223d83..0fcebc7bd7514 100644
--- a/flang/module/iso_c_binding.f90
+++ b/flang/module/iso_c_binding.f90
@@ -83,6 +83,10 @@ module iso_c_binding
   end interface
   private :: c_associated_c_ptr, c_associated_c_funptr
 
+  interface c_f_procpointer
+    module procedure c_f_procpointer
+  end interface
+
   ! gfortran extensions
   integer, parameter :: &
     c_float128 = 16, &
@@ -120,6 +124,10 @@ function c_funloc(x)
     c_funloc = c_funptr(loc(x))
   end function c_funloc
 
-  ! TODO c_f_procpointer
+  subroutine c_f_procpointer(cptr, fptr)
+    type(c_funptr), intent(in) :: cptr
+    procedure(), pointer, intent(out) :: fptr
+    ! TODO: implement
+  end subroutine c_f_procpointer
 
 end module iso_c_binding


        


More information about the flang-commits mailing list