[llvm] [llvm-debuginfo-analyzer] Fix ODR violation in llvm::logicalview::LVObject (PR #140265)
Javier Lopez-Gomez via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 10 11:10:18 PDT 2025
jalopezg-git wrote:
> The changes for `dump` I think make sense. I'm not fully convinced about the remainder of the change. I think that we do want the ID checking in the debug builds (it is meant to be a debugging tool). If we are building without assertions, then we can enable it with ABI breaking changes. That is, I think that `#if !defined(NDEBUG) || ENABLE_ABI_BREAKING_CHANGES` is the right approach.
Thanks for the review, @compnerd!
Note that, although the pull-request mentions `[llvm-debuginfo-analyzer]`, the issue is really in `DebugInfoLogicalView` (the underlying library used by `llvm-debuginfo-analyzer`). As described in https://github.com/llvm/llvm-project/issues/139098, the `LVObject` class layout may differ if the `NDEBUG` PP macro has different definition (other than it had when LLVM was built) in a downstream project that consumes the library.
Because in a downstream project, `NDEBUG` is usually used to indicate a Release build, using `#if !defined(NDEBUG) || ENABLE_ABI_BREAKING_CHANGES`, may still cause issues from the PoV of the consumer project.
https://github.com/llvm/llvm-project/pull/140265
More information about the llvm-commits
mailing list