[libc-commits] [libc] [libc][clang-tidy] Add llvm-header-guard to get consistant naming and prevent file copy/paste issues. (PR #66477)

Siva Chandra via libc-commits libc-commits at lists.llvm.org
Mon Sep 18 14:40:08 PDT 2023


sivachandra wrote:

> I may not fully grasp how the header inclusion mechanism works but I believe that -for the purpose of `llvm-header-guard` - some of the headers should be declared `isystem`.

Your conclusion is correct! We should specify `libc/include` and/or `<build-dir>/projects/libc/include` via `-isystem`.

> Also looking more closely at the above example command line, it seems to me that there are too many includes
> 
> * `-I/home/gchatelet/build/libc_x86/projects/libc/src/fenv`
> * `-I/home/gchatelet/git/llvm-project/libc/src/fenv`
> * `-I/home/gchatelet/build/libc_x86/include`
> * `-I/home/gchatelet/git/llvm-project/llvm/include`
> * `-I/home/gchatelet/git/llvm-project/libc`
> * `-I/home/gchatelet/build/libc_x86/projects/libc/include`
> 
> @sivachandra do we expect that many includes?

A lot of it is not required. We should only require:

* `<build-dir>/projects/libc/include`
*  `llvm-project/libc/`

Anything else seems like unnecessary at this point, but there could some land-mines hiding somewhere. I feel we can take them out with some cleanup.

https://github.com/llvm/llvm-project/pull/66477


More information about the libc-commits mailing list