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

    <tr>
        <th>Summary</th>
        <td>
            [clang][DebugInfo] Missing debug info for alias of variable declared later in the scope
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          kavitha-natarajan
      </td>
    </tr>
</table>

<pre>
    Consider the example:

extern int newname __attribute__((alias("oldname")));
int oldname = 1;

No debug info would be generated for 'newname' in this case as the aliasee 'oldname' is declared later.
Fix compiler to generate "newname" as DW_TAG_imported_declaration pointing to the DIE of "oldname".

Refer https://reviews.llvm.org/D120989 (Support for generating debug info for alias variables).

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1Us2OmzAQfhq4jBaBCQQfOOyWptpDe2gr9YgMDMRbYyPbJNu375jQdLdShWXGjPn-7M4Mv-oPRjs5oAV_RsBXMS8Ko_wxSpso3Wd89Wg1SO1B41WLGaFthfdWdqvHto1YRUMoKdxWMqOGsIuqiPF95E83sICy9yHKG8jundv8xcCA3ToR3WjgalY1QIcwoUYrPA4wGgsRO-5KqKKdJF466IVDEG5zsqlBDDvvaminI_BeCUs4itBsciM9yVfozbxIFYIwdzb6nd2JWMBufrTfHz-1cl6MJTXtDU54aTQshsxJPQWEoKF5_ghmhHeBJG-9fsWR-M7eLy5Ezk40LF4kXl2i1GVOjJ3oU5OxlFecgKpv6xKItxB2kYHwTWKhs5mHi7BSdArpUPhOGw91PvCci9hLr7COiieSr6eoaKhsAsozgdASPkvn_gtNrv6g_xPo7TAQXG8WjFer6vf2JunPa5dQ2LQIHvfXw2LNC_aelkS8BtGnokyzLD7XLBuyimdVjiw7kJ5DxvKyzPtjygUveBkr0aFywc3tvGCDCNevaGJZs5SxtMxyetKiTDreYX_kaX8cx6pjXXRIcRZS3SOPbb1JIuOOmko6__c8YkG5TBq38AK-WP3Z2PqnuJA18aCFp_vwInS8iag3E78BT3gbWw">