Skip to content

Commit 63ed8c6

Browse files
author
Leonard Mosescu
committedOct 4, 2017
LLDB cmake fix: define LLDB_CONFIGURATION_xxx based on the build type
Neither LLDB_CONFIGURATION_DEBUG nor LLDB_CONFIGURATION_RELEASE were ever set in the CMake LLDB project. Also cleaned up a questionable #ifdef in SharingPtr.h, removing all the references to LLDB_CONFIGURATION_BUILD_AND_INTEGRATION in the process. Differential Revision: https://reviews.llvm.org/D38552 llvm-svn: 314929
1 parent 7a73757 commit 63ed8c6

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed
 

‎lldb/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ include(LLDBStandalone)
1111
include(LLDBConfig)
1212
include(AddLLDB)
1313

14+
# Define the LLDB_CONFIGURATION_xxx matching the build type
15+
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
16+
add_definitions( -DLLDB_CONFIGURATION_DEBUG )
17+
else()
18+
add_definitions( -DLLDB_CONFIGURATION_RELEASE )
19+
endif()
20+
1421
if (CMAKE_SYSTEM_NAME MATCHES "Windows|Android")
1522
set(LLDB_DEFAULT_DISABLE_LIBEDIT 1)
1623
else()

‎lldb/include/lldb/Utility/SharingPtr.h

-9
Original file line numberDiff line numberDiff line change
@@ -529,16 +529,7 @@ template <typename T> class IntrusiveSharingPtr {
529529

530530
~IntrusiveSharingPtr() {
531531
release_shared();
532-
#if defined(LLDB_CONFIGURATION_DEBUG) || defined(LLDB_CONFIGURATION_RELEASE)
533-
// NULL out the pointer in objects which can help with leaks detection.
534-
// We don't enable this for LLDB_CONFIGURATION_BUILD_AND_INTEGRATION or
535-
// when none of the LLDB_CONFIGURATION_XXX macros are defined since
536-
// those would be builds for release. But for debug and release builds
537-
// that are for development, we NULL out the pointers to catch potential
538-
// issues.
539532
ptr_ = nullptr;
540-
#endif // #if defined (LLDB_CONFIGURATION_DEBUG) || defined
541-
// (LLDB_CONFIGURATION_RELEASE)
542533
}
543534

544535
T &operator*() const { return *ptr_; }

0 commit comments

Comments
 (0)
Please sign in to comment.