Lines Matching full:procedure
9 # Procedure Pointer
11 A procedure pointer is a procedure that has the EXTERNAL and POINTER attributes.
13 This document summarizes what of context the procedure pointers should appear,
17 to LLVM IR, and thus will not be lowering the procedure-pointer-related
23 for procedure pointers.
32 - A procedure pointer shall not be referenced unless it is pointer associated
33 with a target procedure.
37 - (4) A procedure pointer declared in the scoping unit of a main program,
44 - 10.2.2.4 Procedure pointer assignment
49 - 15.2.2.4 Procedure pointers
50 - A procedure pointer may be pointer associated with an external procedure, an
51 internal procedure, an intrinsic procedure, a module procedure, or a dummy
52 procedure that is not a procedure pointer.
53 - 15.4.3.6 Procedure declaration statement
54 - 15.5.2.9(5) Actual arguments associated with dummy procedure entities
56 - POINTER may be a procedure pointer, and TARGET may be proc-target in a
59 - MOLD may be a procedure pointer.
61 - FPTR shall be a procedure pointer, and not be a component of a coindexed
63 - C.1.1 A procedure that is not a procedure pointer can be an actual argument
64 that corresponds to a procedure pointer dummy argument with the INTENT(IN)
71 ### Procedure pointer `!fir.ref<!fir.boxproc<T>>`
73 A procedure pointer may have an explicit or implicit interface. T in
75 procedure pointer has the implicit interface declared as
76 `procedure(), pointer :: p`.
78 A procedure declaration statement specifies EXTERNAL attribute (8.5.9) for all
79 entities for all entities in the procedure declaration list.
81 ### Actual arguments associated with dummy procedure entities
83 The actual argument may be a procedure pointer, a valid target for the dummy
85 returns a procedure pointer.
87 If the interface is explicit, and the dummy argument is procedure pointer, the
88 reference is resolved as the pointer to the procedure; otherwise, the reference
99 procedure(func), pointer :: p
109 procedure(func), pointer :: q
135 procedure(func), pointer, save :: p
145 procedure(func), pointer :: q
178 procedure(func), pointer :: p
188 procedure(func), pointer :: q
210 It is possible to pass procedure pointers to a C function. If the C function has
211 an explicit interface in fortran code, and the dummy argument is a procedure
212 pointer, the code passes a pointer to the procedure as the actual argument
213 (see Case 5); Otherwise, the code passes the procedure pointer target as the
226 procedure(), pointer :: pp
237 Note that the internal procedure is not one good usage, but it works in
238 implementation. It is better to use BIND(C) external or module procedure as
253 procedure(), pointer :: p
256 procedure(), pointer :: pp
269 C_F_PROCPOINTER is used to associate a procedure pointer with the target of a C
273 ### Procedure pointer to function returning a character type
275 The dummy procedure pointer may not have a function type with an assumed length
278 ### Procedure pointer to internal procedure
285 ### Procedure pointer assignment `p => proc`
287 The right-hand side may be a procedure, a procedure pointer, or a function whose
288 result is a procedure pointer.
290 The procedure could be a BIND(C) procedure. The lowering of it is the same as
291 that of an external or module procedure. The case of internal procedure has been
307 procedure(func), bind(C, name="func_") :: proc
308 procedure(func), pointer :: pp
323 procedure(func), pointer :: arg0, arg1
324 real, external, bind(C, name="Procedure") :: proc
335 procedure(func), pointer :: pp
338 function proc(x) bind(C, name="Procedure")
346 func.func @Procedure(%arg0 : !fir.ref<i32>) -> f32 {
363 // case 1: assignment from external procedure
364 %1 = fir.address_of(@Procedure) : (!fir.ref<i32>) -> f32
370 // case3: assignment from a reference to a function whose result is a procedure pointer
379 ### Procedure pointer components
381 Having procedure pointers in derived types permits `methods` to be dynamically
382 bound to objects. Such procedure pointer components will have the type
395 procedure(func), pointer, nopass :: solve
398 procedure(func) :: f
431 semantically equivalent to a Fortran procedure in LLVM IR level, and a pointer
432 to a C function pointer is semantically equivalent to a Fortran procedure
433 pointer in LLVM IR level. That is, a Fortran procedure will be converted to a
435 a Fortran procedure pointer will be converted to a opaque pointer pointing to
446 - internal/external/module procedure or a C function as the target
447 - procedure pointer initialization
448 - procedure pointer assignment
449 - procedure pointer, procedure pointer target passed to a C function
450 - procedure pointer, procedure pointer target passed to a Fortran procedure
451 - procedure pointer component in derived types
457 - `flang/lib/Lower/CallInterface.cpp:708`: not yet implemented: procedure pointer result not yet ha…
458 - `flang/lib/Lower/CallInterface.cpp:961`: not yet implemented: procedure pointer arguments
459 - `flang/lib/Lower/CallInterface.cpp:993`: not yet implemented: procedure pointer results
460 - `flang/lib/Lower/ConvertExpr.cpp:1119`: not yet implemented: procedure pointer component in deriv…
461 - `flang/lib/Lower/ConvertType.cpp:228`: not yet implemented: procedure pointers
462 - `flang/lib/Lower/Bridge.cpp:2438`: not yet implemented: procedure pointer assignment
463 - `flang/lib/Lower/ConvertVariable.cpp:348`: not yet implemented: procedure pointer component defau…
464 - `flang/lib/Lower/ConvertVariable.cpp:416`: not yet implemented: procedure pointer globals
465 - `flang/lib/Lower/ConvertVariable.cpp:1459`: not yet implemented: procedure pointers
466 …wer/HostAssociations.cpp:162`: not yet implemented: capture procedure pointer in internal procedure
467 - lowering of procedure pointers in ASSOCIATED, NULL, and C_F_PROCPOINTER