[all-commits] [llvm/llvm-project] 25e94d: [flang][debug] Fix DIStringType size for arrays of...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Fri Jun 5 03:05:42 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 25e94da798b1ddc24c8680e8fe0b6f4099e7e876
      https://github.com/llvm/llvm-project/commit/25e94da798b1ddc24c8680e8fe0b6f4099e7e876
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
    M flang/lib/Optimizer/Transforms/DebugTypeGenerator.h
    A flang/test/Transforms/debug-char-type-2.fir

  Log Message:
  -----------
  [flang][debug] Fix DIStringType size for arrays of assumed-length chars. (#201649)

When generating DWARF for an assumed-shape array whose element type is
an assumed-length character, `convertBoxedSequenceType` called
`convertType` for the element, which in turn called
`convertCharacterType` with `hasDescriptor`=false. With no descriptor
and a non-constant length, none of the branches that set `sizeInBits` or
produce a length expression were taken, so the resulting
`DIStringTypeAttr` had `sizeInBits` equal to =0 and no
`stringLengthExp`, leaving GDB unable to determine the string length or
display the array elements.

Fix this by detecting a non-constant-length character element in
`convertBoxedSequenceType` and calling `convertCharacterType` directly
with `hasDescriptor=true`. This generates the correct `stringLengthExp`
that reads the element byte-size from the descriptor. A
`genStringLocation` parameter (default true) is also added to suppress
the string location expression for the element type, since the data
location of array elements is already provided by the enclosing array.

Fixes https://github.com/llvm/llvm-project/issues/113895



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