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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] improve diagnostics of -Wframe-larger-than=
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang,
            new-feature,
            clang:diagnostics
      </td>
    </tr>

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

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

<pre>
    When encountering an instance of `-Wframe-larger-than=`, it can be tricky to know which variables from which function are larger than the rest.  Due to inlining, some of the largest variables may have been from an inlined function, which may not be immediately obvious when browsing the source of the function that produced the diagnostic.

The way I debug these is to rebuild with debug info, then either use a hacky+broken [script I wrote](https://github.com/ClangBuiltLinux/frame-larger-than) or `llvm-dwarfdump` to try to understand the size of variables within the frame.  Dumping the IR then running `llc` and observing the output of prolog+epilog insertion can also lead to clues.

@ilovepi and I were discussing this. Perhaps the diagnostic could provide more info to track down the causes of these warnings?  I suspect we may have lost the identifier used in the sources at the point we generate the diagnostic.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VE2P2yAQ_TX2BSVycOzEBx92G1Wq1ENVVeoZwzimi8FiIO7213fA6e72Q5UifwDz3rx5zxmceu6_TmAZWOmiDeC1vTJhmbYYhJXA3MiKttp9Hb2YYWeEv4LfhUnYor7QRsHfMR2YpJIBWPBaPj2z4NiTdStbJy0ndhNei8EAstG7-b44RiuDdpYJD2xDZQmVLsA8YNgzdomQoLQ12lJbiQrdnFtKp3IVhjf4s3hmk7gBtUKSMluWQvWgXigTztZEOm9dSJ3reQalRQDzzNxw0y4iHSKUwbsV01ASJbro5UsDLxqo8cAW71SUxJO2COpqHQYt90V1KaqH7fqFtlYi_cAUDDFjInFjkulpRRvFVh2m-7a2o0vdhuwQrdOQIhUIUklzLvgjdfdEe0XziNLrJRDy6l2AorkU_DyFsGBRPxT8Pf2uBBCHvXQzvbwzwl4fiTB81DZ-p5W_DeYdcz65b8xt3qlV-FHFeaGF1G_w2ehoFfiUlU046h95Pq-mJD168zVTZGPn5ddIP3ze5Plok8kbnUwcCdINCP7266yLYYkhwdOwjaNEPMKi6SHFFXz2IiVRGHTMgFCpQWki4G8uFMeKim5UmjloZOCTZSgj3q3WuGefwE9iwT_8ZPSdkEvUwE0rYLOj0uTTNhKyhSm3bnKlILPwnhZMzvskkRx5z4gVIy4gA7G_BtcQR64lbBv0qDfHFbtPcAsgMrGdWpy2GeAKFjyl98_wldAf2vbYnc_nw6lUfa26uhNl0MFAT6nJMaCwUP6Tore1ufF_f_dl9Kb_T7hSXu63HcF-I5X0qhHJCXpozof2XE592zZtd-zauoLuWPGhPbXQgOqa0_l0FPVYGjGAwdRnwbnMrXKePgi6WVh3I4gQPbwubmfqhzcq0mZzKXXPK84PVdUc2qauT_uWjyfi4A0feNeImkIBs9Bmn7reO38tfZ8F0IeItGk0BnzdFJSUq4U8xIQvYpic7y39_ylAEY0l67DMmvss-Cedl94S">