[Lldb-commits] [PATCH] D23830: Add cmake option to choose whether to use the builtin demangler

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 24 03:54:23 PDT 2016

labath created this revision.
labath added reviewers: zturner, emaste, krytarowski.
labath added subscribers: lldb-commits, clayborg.
Herald added a subscriber: emaste.

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



Index: source/Core/Mangled.cpp
--- source/Core/Mangled.cpp
+++ source/Core/Mangled.cpp
@@ -14,20 +14,15 @@
 #include "lldb/Host/windows/windows.h"
 #include <Dbghelp.h>
 #pragma comment(lib, "dbghelp.lib")
-#elif defined (__FreeBSD__)
-#include <cxxabi.h>
 // 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"
+#include <cxxabi.h>
Index: cmake/modules/LLDBConfig.cmake
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -401,3 +401,12 @@
             "- ignore this warning and accept occasional instability")
+    option(LLDB_USE_BUILTIN_DEMANGLER "Use lldb's builtin demangler instead of the system one" ON)
+    add_definitions(-DLLDB_USE_BUILTIN_DEMANGLER)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23830.69093.patch
Type: text/x-patch
Size: 1266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160824/22227cf5/attachment.bin>

More information about the lldb-commits mailing list