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

    <tr>
        <th>Summary</th>
        <td>
            libc++ should ship an IWYU mapping file
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

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

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

<pre>
    After running IWYU on some ChromeOS third-party packages, I've observed that it pulls in a lot of the implementation headers instead of the standard ones. This can be fixed either by IWYU mapping every standard library symbol in their default mapping file, or by libc++ shipping its own header [mapping file](https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md). While the former would be nice, it doesn't scale particularly well (my understanding is that you'd need to account for all the nested and semi-private symbols too), and is much more error-prone.

libc++'s Python tooling should be able to account for this, and it would probably go a long way to helping with the header migration that you're hoping to see in the future.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9U8tu2zAQ_BrpsrAgS7ZsH3RwEgTIoWiBtgh65GMlMaVIgQ-7-vsuZTuJDy0gWA_u7M7OjLmVc3vsAjpw0Rhlenh5_fUTrAFvR4THwdHt63cIg3JyNTEXZpiY-M169Fn1CC9ZtTshWO7RnVBSHQugAkxRaw_KAANtA9iOThDUOGkc0QQWFI0YkEl0qcwHerxV-cCMZI7eDfoCfgzKg2AGOEKn_tAQVFTmgM8XsiObpsQcT-jmD7RW3LH0YR651YkLoZQDiR2LOrzDOqUxrWKXjoQSWfVAF_hBXSpU8GDPN76QbR_usNunrNoPIUw-q49Z9UxXTwwjL4Qd6UUZoaPE1Zm0Wc02rqLHf3_m2nK6jYw0cfQgrSCln9OmXy5TfTHKrDoU8DrQ-EWyzrqRmJ1t1DLpZJRYdiInpEVvyKUAXjAqTx4qETVzeoYzag3EfpwhmuRFEm9Z2V-sJF6ElWAwmWuBCWGjCWkgMMKm4eRSoFNCgsdRrSanTizgVXhqZC3RTXRSCXUeoxhgtA4BnbOOAOR0kZVPWXm8_H64QNM9fJvDQHmhRjqR88NtT8aTAPe0KKr-fVi4akIjOBXP0NslktTlzOYEHVAvVp7JsmWdq8uj6t0lpp-EIMqDXcoJ6RGvqYIuhuiwyLFdN9tDs2nqapfLtpaH-sDyoILG9i5ZC6kUMKJ5n-IUqTw63f4nUVqfbrck3huKkALlfUz_yudtc6h3-dCyzabZYyO6XbnbCclxx2uUYs8aKXDTrXPNOGrfUqCzqvqseUWhzlVblVVV7stNVW6rsim67iA7dqhLuW66er_ONiWOTOkiESms63PXLpx47D0dauWD_zhk3quegrTMo_4skquuFW-S5wv3diH-F5AekRc">