Skip to content

[flang][debug] Wrong signature for function returning derived types. #112902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
abidh opened this issue Oct 18, 2024 · 2 comments
Open

[flang][debug] Wrong signature for function returning derived types. #112902

abidh opened this issue Oct 18, 2024 · 2 comments
Assignees

Comments

@abidh
Copy link
Contributor

abidh commented Oct 18, 2024

Consider the following code

module mod
    type cart
        integer :: x1
    end type
contains
    type(cart) function build(x)
        integer :: x
        build%x1 = x
    end function
end module

program function_calls
    use mod
    implicit none
    type(cart) :: b
    b = build(4)
    print *, b
end program

This is what GDB shows for the type of the build function. Notice return type and first argument.

(gdb) ptype mod::build
type = void (Type cart, integer)

This seems to be done in AbstractResultOpt pass but debug info needs to have the function signature as it was in the source.

@abidh abidh self-assigned this Oct 18, 2024
@github-actions github-actions bot added the flang Flang issues not falling into any other category label Oct 18, 2024
@EugeneZelenko EugeneZelenko added debuginfo flang:ir and removed flang Flang issues not falling into any other category labels Oct 18, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 18, 2024

@llvm/issue-subscribers-flang-ir

Author: Abid Qadeer (abidh)

Consider the following code
module mod
    type cart
        integer :: x1
    end type
contains
    type(cart) function build(x)
        integer :: x
        build%x1 = x
    end function
end module

program function_calls
    use mod
    implicit none
    type(cart) :: b
    b = build(4)
    print *, b
end program

This is what GDB shows for the type of the build function. Notice return type and first argument.

(gdb) ptype mod::build
type = void (Type cart, integer)

This seems to be done in AbstractResultOpt pass but debug info needs to have the function signature as it was in the source.

@llvmbot
Copy link
Member

llvmbot commented Oct 18, 2024

@llvm/issue-subscribers-debuginfo

Author: Abid Qadeer (abidh)

Consider the following code
module mod
    type cart
        integer :: x1
    end type
contains
    type(cart) function build(x)
        integer :: x
        build%x1 = x
    end function
end module

program function_calls
    use mod
    implicit none
    type(cart) :: b
    b = build(4)
    print *, b
end program

This is what GDB shows for the type of the build function. Notice return type and first argument.

(gdb) ptype mod::build
type = void (Type cart, integer)

This seems to be done in AbstractResultOpt pass but debug info needs to have the function signature as it was in the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants