[flang-commits] [PATCH] D132685: [flang] Make C_F_POINTER a generic interface

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Aug 25 10:55:22 PDT 2022


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

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.)


https://reviews.llvm.org/D132685

Files:
  flang/module/iso_c_binding.f90


Index: flang/module/iso_c_binding.f90
===================================================================
--- flang/module/iso_c_binding.f90
+++ flang/module/iso_c_binding.f90
@@ -83,6 +83,10 @@
   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 @@
     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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132685.455653.patch
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220825/5fa7554e/attachment.bin>


More information about the flang-commits mailing list