Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[llvm-debuginfo-analyzer] Use LLVM_BUILD_DEBUG in class definitions #140265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[cmake] Add LLVM_BUILD_DEBUG to llvm-config.h
Some LLVM libraries may conditionally define some class members
depending on whether LLVM build type == Debug.
However, relying on `NDEBUG` for this may create situations in
which the consumer of a header in a downstream project has a
different definition for `NDEBUG`, resulting in an ODR violation.

The use of `LLVM_BUILD_DEBUG` should be preferred in these cases.
  • Loading branch information
jalopezg-git committed May 17, 2025
commit 97148cb1d946987d40b061c3f66b9a4413f4d840
5 changes: 5 additions & 0 deletions 5 llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) # --libdir
set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} ) # --src-root
set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include ) # --includedir
set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ) # --prefix
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
set(LLVM_BUILD_DEBUG ON)
else()
set(LLVM_BUILD_DEBUG OFF)
endif()


# Note: LLVM_CMAKE_DIR does not include generated files
Expand Down
3 changes: 3 additions & 0 deletions 3 llvm/include/llvm/Config/llvm-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
/* Define to 1 if you have the <sysexits.h> header file. */
#cmakedefine HAVE_SYSEXITS_H ${HAVE_SYSEXITS_H}

/* Define if this LLVM build is a Debug build */
#cmakedefine LLVM_BUILD_DEBUG

/* Define if building libLLVM shared library */
#cmakedefine LLVM_BUILD_LLVM_DYLIB

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.