[Lldb-commits] [lldb] r314929 - LLDB cmake fix: define LLDB_CONFIGURATION_xxx based on the build type

Leonard Mosescu via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 4 13:23:57 PDT 2017


Author: lemo
Date: Wed Oct  4 13:23:56 2017
New Revision: 314929

URL: http://llvm.org/viewvc/llvm-project?rev=314929&view=rev
Log:
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


Modified:
    lldb/trunk/CMakeLists.txt
    lldb/trunk/include/lldb/Utility/SharingPtr.h

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=314929&r1=314928&r2=314929&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Wed Oct  4 13:23:56 2017
@@ -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()

Modified: lldb/trunk/include/lldb/Utility/SharingPtr.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/SharingPtr.h?rev=314929&r1=314928&r2=314929&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/SharingPtr.h (original)
+++ lldb/trunk/include/lldb/Utility/SharingPtr.h Wed Oct  4 13:23:56 2017
@@ -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_; }




More information about the lldb-commits mailing list