[Mlir-commits] [lld] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used, last part. (PR #107615)

Mehdi Amini llvmlistbot at llvm.org
Sat Sep 7 14:19:00 PDT 2024


joker-eph wrote:

>  One of approaches to use such defines is '#ifdef'

The right fix for this IMO is to stop using ifdef and use if instead, with `-Wundef` (which is [already enabled in MLIR](https://github.com/llvm/llvm-project/blob/main/mlir/CMakeLists.txt#L74-L78) by the way, just for this reason!

> clangd is usually used to report unused headers for a source file. But it can falsely report such config headers as unused (that I also got in PR https://github.com/llvm/llvm-project/pull/104825).

I don't quite the explanation, or rather I still don't see the connection: how is this patch adding these headers will impact what clangd says? Seems like you're describing a bug in clang?

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


More information about the Mlir-commits mailing list