[all-commits] [llvm/llvm-project] b09ba4: Bug 51277: [DWARF] DW_AT_alignment incorrect when

MaggieYingYi via All-commits all-commits at lists.llvm.org
Fri Apr 22 04:16:19 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b09ba42620768c0092b20cf526a30b14752a5dc9
  Author: Ying Yi <maggieyi868 at gmail.com>
  Date:   2022-04-22 (Fri, 22 Apr 2022)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    A clang/test/CodeGenCXX/debug-info-struct-align.cpp

  Log Message:
  Bug 51277: [DWARF] DW_AT_alignment incorrect when
attribute((__aligned__)) is present but ignored`

In the original code, the 'getDeclAlignIfRequired' function is used.
The 'getDeclAlignIfRequired' function will return the max alignment
of all aligned attributes if the type has aligned attributes. The
function doesn't consider the type at all.

The 'getTypeAlignIfRequired' function uses the type's alignment value,
which also used by the 'alignof' function. I think we should use the
function of 'getTypeAlignIfRequired'.

Reviewed By: dblaikie, jmorse, wolfgangp

Differential Revision: https://reviews.llvm.org/D124006

More information about the All-commits mailing list