[all-commits] [llvm/llvm-project] b64cf3: [flang][debug] Support assumed shape arrays. (#94644)

Abid Qadeer via All-commits all-commits at lists.llvm.org
Tue Jun 11 00:12:09 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b64cf381a7cf3d04c1f9297862bc6b1f3b6da4cf
      https://github.com/llvm/llvm-project/commit/b64cf381a7cf3d04c1f9297862bc6b1f3b6da4cf
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2024-06-11 (Tue, 11 Jun 2024)

  Changed paths:
    A flang/include/flang/Optimizer/CodeGen/DescriptorModel.h
    R flang/lib/Optimizer/CodeGen/DescriptorModel.h
    M flang/lib/Optimizer/CodeGen/TypeConverter.cpp
    M flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
    M flang/lib/Optimizer/Transforms/DebugTypeGenerator.h
    A flang/test/Integration/debug-assumed-shape-array.f90
    M flang/test/Transforms/debug-90683.fir
    A flang/test/Transforms/debug-assumed-shape-array.fir
    M flang/test/Transforms/debug-complex-1.fir
    M flang/test/Transforms/debug-fixed-array-type.fir
    M flang/test/Transforms/debug-line-table-existing.fir
    M flang/test/Transforms/debug-line-table-inc-file.fir
    M flang/test/Transforms/debug-line-table-inc-same-file.fir
    M flang/test/Transforms/debug-line-table.fir
    M flang/test/Transforms/debug-module-1.fir

  Log Message:
  -----------
  [flang][debug] Support assumed shape arrays. (#94644)

This PR generates dwarf to extract the information about the arrays from
descriptor. The DWARF needs the offset of the fields like `lower_bound`
and `extent`. The getComponentOffset has been added to calculate
them which pushes the issue of host and target data size into
getDescFieldTypeModel.

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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list