diff options
author | Leonard Mosescu <mosescu@google.com> | 2017-10-04 20:23:56 +0000 |
---|---|---|
committer | Leonard Mosescu <mosescu@google.com> | 2017-10-04 20:23:56 +0000 |
commit | 63ed8c6c2e28300d4841389a21bc5853b9f43a99 (patch) | |
tree | a6cffff9e7a165c90a7f476504a93420d23636df | |
parent | 7a737573589f9cae54ef5a9c2fc497511ea909fd (diff) | |
download | bcm5719-llvm-63ed8c6c2e28300d4841389a21bc5853b9f43a99.tar.gz bcm5719-llvm-63ed8c6c2e28300d4841389a21bc5853b9f43a99.zip |
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
-rw-r--r-- | lldb/CMakeLists.txt | 7 | ||||
-rw-r--r-- | lldb/include/lldb/Utility/SharingPtr.h | 9 |
2 files changed, 7 insertions, 9 deletions
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 707d4c47913..9efb7ef5219 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -11,6 +11,13 @@ include(LLDBStandalone) include(LLDBConfig) include(AddLLDB) +# Define the LLDB_CONFIGURATION_xxx matching the build type +if( uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" ) + add_definitions( -DLLDB_CONFIGURATION_DEBUG ) +else() + add_definitions( -DLLDB_CONFIGURATION_RELEASE ) +endif() + if (CMAKE_SYSTEM_NAME MATCHES "Windows|Android") set(LLDB_DEFAULT_DISABLE_LIBEDIT 1) else() diff --git a/lldb/include/lldb/Utility/SharingPtr.h b/lldb/include/lldb/Utility/SharingPtr.h index 49b0020da3e..41fa0c8121d 100644 --- a/lldb/include/lldb/Utility/SharingPtr.h +++ b/lldb/include/lldb/Utility/SharingPtr.h @@ -529,16 +529,7 @@ public: ~IntrusiveSharingPtr() { release_shared(); -#if defined(LLDB_CONFIGURATION_DEBUG) || defined(LLDB_CONFIGURATION_RELEASE) - // NULL out the pointer in objects which can help with leaks detection. - // We don't enable this for LLDB_CONFIGURATION_BUILD_AND_INTEGRATION or - // when none of the LLDB_CONFIGURATION_XXX macros are defined since - // those would be builds for release. But for debug and release builds - // that are for development, we NULL out the pointers to catch potential - // issues. ptr_ = nullptr; -#endif // #if defined (LLDB_CONFIGURATION_DEBUG) || defined - // (LLDB_CONFIGURATION_RELEASE) } T &operator*() const { return *ptr_; } |