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

    <tr>
        <th>Summary</th>
        <td>
            [libc] Document and have clang-tidy checks for inclusion of our own public headers in sources and tests.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy,
            libc
      </td>
    </tr>

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

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

<pre>
    Discussion from https://github.com/llvm/llvm-project/pull/83199 and https://github.com/llvm/llvm-project/pull/83374.

Our public headers in `libc/include/llvm-libc-*` folders might be included directly in our codes and tests, but since they are copied to the `${install dir}/include` folders, we might have a mixture of both `#include "include/llvm-libc-*"` and `#include "llvm-libc-*"`.  https://github.com/llvm/llvm-project/pull/83199 was trying to uniform this inclusion, by adding `libc/include` to our include dirs, but that broke our downstream users that are not using our cmake build system.

Since many downstream users do not use our cmake build system, and they might only have `libc/` in their include dirs, we need to officially document this assumption and add clang-tidy checks to make sure that `libc/include` folder is not accidentally added to our include dirs.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVM2S4jYQfhr50jWUkY3BBx9ml-KaQ55AltpYGVmi1NISv32qBYRNmD1szQUo0_r8_akVkT17xEHsvondsVI5zSEOzqeM1RjMOhwt6Uxkg4cphgXmlC4kmnchT0KezjbNedzosAh5cu7H4-vtEsNfqJOQp0t2TsjTodn2PShvvoDQ7NuNqI-ifr99_pEjXPLorIYZlcFIYD2IrnZ21EKerNcuG3wg8tM3Id9FV8MUXJlf7HlOMCLcZw0YG1EntzJUyBF0MEiFeEJKJOR3GHMCsl4jpBlXUBFBh4tFAynwI6YgZCv236ynpJxjULE__kTpSYEBr3gnMqsfCAoW-3fKESFMMIY03_Ca-1kQUv5KmZSMzGRfjnwyuIEvxnlVBCmu1p9ZefZ2CnGBNFu6-cm1KYatoIzhsddwuprPstMPssbGf21Os0owxvCBZcSEq6cUUS2QifMr_3MAPiTIxK8ooS3qA2HM1hmglRIu_ynOnyW8Rfn1FdGEOxb-AomplTpw9rfYgnfrLbunPhZmPU_ZV2lXBI-3voRpstoq55iLzgv6dHNQEeXlkvjm8euUMaCd8ue3ZM0Kekb9QQxQCBLXpZjxqcO3roGlok1pbQ36VF6qjLkT-V8Em8oMjembXlU4bPd1L5um6bpqHvay3zXdodFdLbtJTrtW1qZrD72aummqsbKDrGVbS9lve_6xOXR7hUp3rWm2u347irbGRVm34XZtQjxXlijjcGjarqmcGtFR2UlSPjVzaeV3rnLRJ3lhxaH0c8xnEm3tLCV6YiabXFlt5cDuCMeHwWUPcV6vjk4hPsvLN5B9CVf_yaahkKP-eTlsqhzd8Nt3qmincqvarvknAAD___u43Xk">