[all-commits] [llvm/llvm-project] d556e3: [flang][debug] Support derived type components wit...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Mon Sep 30 02:32:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d556e38fe8062d4c03258bd268f62afee10aaebe
      https://github.com/llvm/llvm-project/commit/d556e38fe8062d4c03258bd268f62afee10aaebe
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2024-09-30 (Mon, 30 Sep 2024)

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

  Log Message:
  -----------
  [flang][debug] Support derived type components with box types. (#109424)

Our support for derived types uses `getTypeSizeAndAlignment` to
calculate the offset of the members. The `fir.box` was not supported in
that function. It meant that any member which required descriptor was
not supported in the derived type.
    
We convert the type into an llvm type and then use the DataLayout to
calculate the size/offset of a member. There is no dependency on
`getTypeSizeAndAlignment` to get the size of the types.

There are 2 other changes in this PR:

1. The `recID` field is used to handle cases where we have a member
references its parent type.

2. A type cache is maintained to avoid duplication. It is also needed
for circular reference case.


Fixes #108001.



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