[flang][debug] Describe procedure pointer arguments by their own type (#246397)
When the type of a normal subroutine is created, we unwrap the reference
from each of its arguments. The same was not done for a procedure
pointer, which makes their types differ as shown below. Notice
(integer(kind=4)) vs (PTR TO -> ( integer(kind=4) )) in the gdb output.
module m
contains
subroutine sub(n)
integer :: n
end subroutine
end module
program test
use m
procedure(sub), pointer :: ptr
ptr => sub
end program
(gdb) ptype sub
type = void (integer(kind=4))
(gdb) ptype ptr
type = PTR TO -> ( void () (PTR TO -> ( integer(kind=4) )) )
This patch unwraps the reference for procedure pointer arguments too, so
ptr is now PTR TO -> ( void () (integer(kind=4)) ).