[Lldb-commits] [lldb] r279808 - Add cmake option to choose whether to use the builtin demangler

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 26 02:47:58 PDT 2016


Author: labath
Date: Fri Aug 26 04:47:58 2016
New Revision: 279808

URL: http://llvm.org/viewvc/llvm-project?rev=279808&view=rev
Log:
Add cmake option to choose whether to use the builtin demangler

Summary:
Previously the builting demangler was on for platforms that explicitly set a flag by modifying
Mangled.cpp (windows, freebsd). The Xcode build always used builtin demangler by passing a
compiler flag. This adds a cmake flag (defaulting to ON) to configure the demangling library used
at build time. The flag is only available on non-windows platforms as there the system demangler
is not present (in the form we're trying to use it, at least).
The impact of this change is:
- linux: switches to the builtin demangler
- freebsd, windows: NFC (I hope)
- netbsd: switches to the builtin demangler
- osx cmake build: switches to the builtin demangler (matching the XCode build)

The main motivation for this is the cross-platform case, where it should bring more consistency
by removing the dependency on the host demangler (which can be completely unrelated to the debug
target).

Reviewers: zturner, emaste, krytarowski

Subscribers: emaste, clayborg, lldb-commits

Differential Revision: https://reviews.llvm.org/D23830

Modified:
    lldb/trunk/cmake/modules/LLDBConfig.cmake
    lldb/trunk/source/Core/Mangled.cpp

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=279808&r1=279807&r2=279808&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Fri Aug 26 04:47:58 2016
@@ -401,3 +401,12 @@ if(LLDB_USING_LIBSTDCXX)
             "- ignore this warning and accept occasional instability")
     endif()
 endif()
+
+if(MSVC)
+    set(LLDB_USE_BUILTIN_DEMANGLER ON)
+else()
+    option(LLDB_USE_BUILTIN_DEMANGLER "Use lldb's builtin demangler instead of the system one" ON)
+endif()
+if(LLDB_USE_BUILTIN_DEMANGLER)
+    add_definitions(-DLLDB_USE_BUILTIN_DEMANGLER)
+endif()

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=279808&r1=279807&r2=279808&view=diff
==============================================================================
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Fri Aug 26 04:47:58 2016
@@ -14,20 +14,15 @@
 #include "lldb/Host/windows/windows.h"
 #include <Dbghelp.h>
 #pragma comment(lib, "dbghelp.lib")
-#define LLDB_USE_BUILTIN_DEMANGLER
-#elif defined (__FreeBSD__)
-#define LLDB_USE_BUILTIN_DEMANGLER
-#else
-#include <cxxabi.h>
 #endif
 
 #ifdef LLDB_USE_BUILTIN_DEMANGLER
-
 // Provide a fast-path demangler implemented in FastDemangle.cpp until it can
 // replace the existing C++ demangler with a complete implementation
 #include "lldb/Core/FastDemangle.h"
 #include "lldb/Core/CxaDemangle.h"
-
+#else
+#include <cxxabi.h>
 #endif
 
 




More information about the lldb-commits mailing list