[llvm] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106621)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 00:49:31 PDT 2024


boomanaiden154 wrote:

> Well, I added such comments since during cleanups it is not always obvious why such headers are included.

I think you could make the same argument about any header?

> And clangd time to time reports these as unused.

If it nondeterministically reports them as unused, then that would be a determinism bug in `clangd`. If it just reports them as unused, I think that would still be a bug in `clangd`, maybe not if the uses get `ifdef`ed out due to platform specific reasons, but that's a separate case.

> Also, we already have here and there same comments.

I don't think this is a good precedent.

I'm not trying to block anything, but I really don't think adding comments on why a header is used is useful, it deviates from the vast majority of `include`s within LLVM, and they are reasonably liable to becoming out of date. There is also reasonable good tooling to deal with these sorts of things.

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


More information about the llvm-commits mailing list