Skip to content
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

[flang][debug] Support assumed shape arrays. #94644

Merged
merged 4 commits into from
Jun 11, 2024
Merged

[flang][debug] Support assumed shape arrays. #94644

merged 4 commits into from
Jun 11, 2024

Commits on Jun 10, 2024

  1. [flang][debug] Support assume shape arrays.

    This PR generates dwarf to extract the information about the arrays
    from descriptor. To calculate the offset of the fields in the
    descriptor, we are adding up the sizes of the fields above. It seems to
    work ok for 64-bit target. Will have to see if some changes are
    required for 32-bits targets.
    
    As we use data layout now, some tests needed to be adjusted to have
    a dummy data layout to avoid failure.
    
    With this change in place, GDB is able show the assumed shape arrays
    correctly.
    
      subroutine ff(n, m, arr)
        integer n, m
        integer :: arr(:, :)
        print *, arr
        do i = 1, n
          do j = 1, m
            arr(j, i) = (i * 5) + j + 10
          end do
        end do
        print *, arr
      end subroutine ff
    
    Breakpoint 1, ff (n=4, m=3, arr=...) at test1.f90:13
    13          print *, arr
    (gdb) p arr
    $1 = ((6, 7, 8, 9) (11, 12, 13, 14) (16, 17, 18, 19))
    (gdb) ptype arr
    type = integer (4,3)
    (gdb) c
    Continuing.
     6 7 8 9 11 12 13 14 16 17 18 19
    abidh committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    421180e View commit details
    Browse the repository at this point in the history
  2. Fix build error.

    Add static to getModel() and constexpr to template specializations.
    abidh committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    e866ca1 View commit details
    Browse the repository at this point in the history
  3. Handle review comments.

    1. Return if data layout is null.
    2. Use getComponentOffset to calculate the offset of any field in the descriptor.
    This was suggested by @jeanPerier.
    abidh committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    1d502d0 View commit details
    Browse the repository at this point in the history
  4. Handle review comments.

    abidh committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    acde7d7 View commit details
    Browse the repository at this point in the history