[all-commits] [llvm/llvm-project] 030179: [flang][debug] Support ClassType. (#114809)
Abid Qadeer via All-commits
all-commits at lists.llvm.org
Mon Nov 18 03:26:59 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 030179c2cb113ab35e5cc71229816075e51dd8ab
https://github.com/llvm/llvm-project/commit/030179c2cb113ab35e5cc71229816075e51dd8ab
Author: Abid Qadeer <haqadeer at amd.com>
Date: 2024-11-18 (Mon, 18 Nov 2024)
Changed paths:
M flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
A flang/test/Transforms/debug-class-type.fir
Log Message:
-----------
[flang][debug] Support ClassType. (#114809)
This PR adds the handling of `ClassType`. It is treated as pointer to
the underlying type. Note that `ClassType` when passed to the function
have double indirection so it is represented as pointer to type
(compared to other types which may have a single indirection).
If `ClassType` wraps a pointer or allocatable then we take care to
generate it as PTR -> type (and not PTR -> PTR -> type).
This is how it looks like in the debugger.
```
subroutine test_proc (this)
class(test_type), intent (inout) :: this
allocate (this%b (3, 2))
call fill_array_2d (this%b)
print *, this%a
end
```
```
(gdb) p this
$6 = (PTR TO -> ( Type test_type )) 0x2052a0
(gdb) p this%a
$7 = 0
(gdb) p this%b
$8 = ((1, 2, 3) (4, 5, 6))
```
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