[llvm] [llvm-debuginfo-analyzer] Use `LLVM_BUILD_DEBUG` in class definitions (PR #140265)

Javier Lopez-Gomez via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 10:12:46 PDT 2025


jalopezg-git wrote:

> I don't understand the motivation of this change. I realize that `NDEBUG` is a confusing macro, but this is not about a _debug_ build. `NDEBUG` indicates whether assertions are enabled or not.

Basically, when using `debuginfologicalview` as a library from a downstream project, `NDEBUG` may be defined if the downstream project is built in Release mode.
This results in a different class layout (e.g. for `LVObject`), given that, by the time the `LVObject.h` is parsed in a downstream project, `NDEBUG` may be defined (or not) regardless of whether it was defined (or not) when LLVM was built.

Thus, `NDEBUG` cannot be relied for anything that affects class layout (at least on public headers).  Looking at @dwblaikie and @compnerd comments, perhaps using `LLVM_ENABLE_ABI_BREAKING_CHECKS` (instead of introducing a new `LLVM_BUILD_DEBUG` PP macro) is the way to go :thinking:  (?)

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


More information about the llvm-commits mailing list