[all-commits] [llvm/llvm-project] 043222: [flang][debug] Support allocatables. (#95557)

Abid Qadeer via All-commits all-commits at lists.llvm.org
Mon Jun 17 06:09:48 PDT 2024


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

  Changed paths:
    M flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
    M flang/lib/Optimizer/Transforms/DebugTypeGenerator.h
    A flang/test/Integration/debug-allocatable-1.f90
    A flang/test/Transforms/debug-allocatable-1.fir

  Log Message:
  -----------
  [flang][debug] Support allocatables. (#95557)

This PR adds debug support for allocatable. The allocatable arrays use
the existing functionality to read the array information from
descriptor. The allocatable for the scalar shows up as pointer to the
scalar.

While testing this, I notices that values of allocated and associated
flags were swapped. This is also fixed in this PR.

Here is how the debugging of the allocatable looks like with this patch
in place.

integer, allocatable :: ar1(:, :)
real, allocatable :: sc

allocate(sc)
allocate(ar1(3, 4))

(gdb) ptype ar1
type = integer, allocatable (3,4)
(gdb) p ar1
$1 = ((5, 6, 7) (9, 10, 11) (13, 14, 15) (17, 18, 19)) (gdb) p sc
$2 = (PTR TO -> ( real )) 0x205300
(gdb) p *sc
$3 = 3.1400001



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