<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/90958>90958</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLDB does not respect alignment on typedefs
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          labath
      </td>
    </tr>
</table>

<pre>
    c++11 `alignas` does not work on typedefs, but `__attribute__((aligned))` (gcc) and `__declspec(align)` (msvc) do.

Clang correctly emits DW_AT_alignment for these types, but lldb just ignores it.

I don't know of anything specific broken by this, but one can imagine a failure where lldb constructs (in an expression) an under-aligned object and passes is to a inferior function which expects it to be aligned (and explodes when it isn't).

Fixing this is somewhat tricky because lldb constructs ASTs for typedefs lazily, which means it's necessary to store the alignment in the Type::m_payload field. Currently all bits of the (32-bit) field are taken, so we may need to increase the size of that field or reduce the number of bits used by the clang module id.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkVE2vmzoQ_TXOZnQj4gQICxb3Q5Ge1N270ltGY3sAN8aOPHZT-uufDLe9rSohkOD4nDNnZkBmO3qiXtQvon7bYU5TiL1DhWnaqWCWXgv5IuTL4QCiqdDZ0SOLpgITiMGHBI8QbxA8pOVOhgYW8hVUTgV-vWJK0aqc6HoV8izkeWUgI2RXrqYCIc-j1kJ2gN5shwxpx3fSP-GfyJm_rVAT9qJ6E9Xzdn916EfQIUbSyS1As00Mb_9dn9-vK8NMPsEQIqSJmFarv3w6ZxR8zZzAjj5EYrDpD_Z_wAQvZJvg5sMDwgDolzRZP0JxaQerQcVwIw9qgTTZX9TBE2j0YGccrSdAGNC6HAkeE0XapHXwnGLWiUuF1gN6oO_3SMy26JZgIHtD8ekjPAjqK-m0BnZH5mKZIQVAsH6gaEOEIXudbPDwmKyeCiEVBZsKThH8pCoZe1O-u2CIizFfUJbXkoXs_sjiYr-XukuRRZPDTI8JE6Ro9W0BRRoz_13Y87_vvOX_MSTg8Id1SwlqMzgT-mJPyJbBkyZmjEsxyylEKo2Dz1Zav754X-4kjs_i-Dxf77i4gAYGS87s4TXHSL4MAzoHqsxDGNZDQp6P8kkVqW5DAxYBvJEvfjjAg2DGBTyRKQ6s15GQNxNsf9BGhenjeIgQyWS9AXyeFcUCWVUzk9nmgkCvczoHkx2BNfud6Y-mO3a4o_7QHk7t8dTVzW7qdVs35tR0p2Y4ywGxVaojlBUOClts9M72spKnqq6Oh8Ohrpt9ezw158MwKKkN1qdWnCqa0bq9c9_mfYjjzjJn6ruqq887h4ocr1svZWmWkLLsf-wL_EnlkcWpcpYTfxIkmxz1X768vXwuf6SyAum31vz2J9jl6PoppTuXJsmLkJfRpimrvQ6zkJfC_PF4usdQZlrIy-qThbysVv8PAAD__-AOjqY">