Remove lldb's custom copy of the C++ demangler, used only on Mac

OS X.  Testsuite shows no change in results using the system runtime's
demangler.
<rdar://problem/12029914> 

llvm-svn: 185510
This commit is contained in:
Jason Molenda 2013-07-03 04:52:51 +00:00
parent 24fd7eed8a
commit 45f6b1f935
6 changed files with 0 additions and 11248 deletions

View File

@ -1,173 +0,0 @@
//===-------------------------- cxa_demangle.h ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _CXA_DEMANGLE_H
#define _CXA_DEMANGLE_H
// FreeBSD9-STABLE fix (define size_t before including cxxabi.h)
#include <cstdlib>
#include <cxxabi.h>
#pragma GCC visibility push(hidden)
namespace lldb_cxxabiv1
{
namespace __libcxxabi
{
class __demangle_tree;
class __node;
char*
__demangle(__demangle_tree, char*, size_t*, int*);
struct __demangle_tree_rv
{
__demangle_tree* ptr_;
explicit __demangle_tree_rv(__demangle_tree* ptr)
: ptr_(ptr) {}
};
class __demangle_tree
{
const char* __mangled_name_begin_;
const char* __mangled_name_end_;
int __status_;
__node* __root_;
__node* __node_begin_;
__node* __node_end_;
__node* __node_cap_;
__node** __sub_begin_;
__node** __sub_end_;
__node** __sub_cap_;
__node** __t_begin_;
__node** __t_end_;
__node** __t_cap_;
bool __tag_templates_;
bool __fix_forward_references_;
bool __owns_buf_;
__demangle_tree& operator=(const __demangle_tree&);
public:
__demangle_tree(const char*, char*, size_t);
~__demangle_tree();
__demangle_tree(__demangle_tree&);
__demangle_tree(__demangle_tree_rv);
operator __demangle_tree_rv() {return __demangle_tree_rv(this);}
int __status() const;
size_t size() const;
char* __get_demangled_name(char*) const;
void __parse();
private:
const char* __parse_encoding(const char*, const char*);
const char* __parse_type(const char*, const char*,
bool = true, bool = false);
const char* __parse_special_name(const char*, const char*);
const char* __parse_name(const char*, const char*);
const char* __parse_bare_function_type(const char*, const char*);
const char* __parse_call_offset(const char*, const char*);
const char* __parse_number(const char*, const char*);
const char* __parse_cv_qualifiers(const char* first, const char* last,
unsigned& cv, bool = false);
const char* __parse_nested_name(const char*, const char*);
const char* __parse_discriminator(const char*, const char*);
const char* __parse_local_name(const char*, const char*);
const char* __parse_unscoped_template_name(const char*, const char*);
const char* __parse_unscoped_name(const char*, const char*);
const char* __parse_operator_name(const char*, const char*, int* = 0);
const char* __parse_unqualified_name(const char*, const char*);
const char* __parse_source_name(const char*, const char*);
const char* __parse_ctor_dtor_name(const char*, const char*);
const char* __parse_unnamed_type_name(const char*, const char*);
const char* __parse_template_args(const char*, const char*);
const char* __parse_template_arg(const char*, const char*);
const char* __parse_expression(const char*, const char*);
const char* __parse_expr_primary(const char*, const char*);
const char* __parse_substitution(const char*, const char*);
const char* __parse_builtin_type(const char*, const char*);
const char* __parse_function_type(const char*, const char*);
const char* __parse_class_enum_type(const char*, const char*);
const char* __parse_array_type(const char*, const char*);
const char* __parse_pointer_to_member_type(const char*, const char*);
const char* __parse_decltype(const char*, const char*);
const char* __parse_template_param(const char*, const char*);
const char* __parse_unresolved_name(const char*, const char*);
const char* __parse_unresolved_type(const char*, const char*);
const char* __parse_base_unresolved_name(const char*, const char*);
const char* __parse_simple_id(const char*, const char*);
const char* __parse_destructor_name(const char*, const char*);
const char* __parse_function_param(const char*, const char*);
const char* __parse_const_cast_expr(const char*, const char*);
const char* __parse_alignof_expr(const char*, const char*);
const char* __parse_call_expr(const char*, const char*);
const char* __parse_conversion_expr(const char*, const char*);
const char* __parse_delete_array_expr(const char*, const char*);
const char* __parse_delete_expr(const char*, const char*);
const char* __parse_dynamic_cast_expr(const char*, const char*);
const char* __parse_dot_star_expr(const char*, const char*);
const char* __parse_dot_expr(const char*, const char*);
const char* __parse_decrement_expr(const char*, const char*);
const char* __parse_new_expr(const char*, const char*);
const char* __parse_increment_expr(const char*, const char*);
const char* __parse_arrow_expr(const char*, const char*);
const char* __parse_reinterpret_cast_expr(const char*, const char*);
const char* __parse_static_cast_expr(const char*, const char*);
const char* __parse_sizeof_type_expr(const char*, const char*);
const char* __parse_sizeof_param_pack_expr(const char*, const char*);
const char* __parse_typeid_expr(const char*, const char*);
const char* __parse_throw_expr(const char*, const char*);
const char* __parse_pack_expansion(const char*, const char*);
const char* __parse_sizeof_function_param_pack_expr(const char*, const char*);
const char* __parse_dot_suffix(const char*, const char*);
const char* __parse_unresolved_qualifier_level(const char*, const char*);
const char* __parse_vector_type(const char*, const char*);
const char* __parse_hex_number(const char*, const char*, unsigned long long&);
template <class _Tp> bool __make();
template <class _Tp, class _A0> bool __make(_A0 __a0);
template <class _Tp, class _A0, class _A1> bool __make(_A0 __a0, _A1 __a1);
template <class _Tp, class _A0, class _A1, class _A2>
bool __make(_A0 __a0, _A1 __a1, _A2 __a2);
template <class _Tp, class _A0, class _A1, class _A2, class _A3>
bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3);
template <class _Tp, class _A0, class _A1, class _A2, class _A3, class _A4>
bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3, _A4 __a4);
template <class _Tp, class _A0, class _A1, class _A2, class _A3, class _A4,
class _A5>
bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3, _A4 __a4, _A5 __a5);
friend
char*
__demangle(__demangle_tree, char*, size_t*, int*);
};
__demangle_tree
__demangle(const char*);
__demangle_tree
__demangle(const char*, char*, size_t);
} // __libcxxabi
char*
__cxa_demangle(const char* mangled_name, char* buf, size_t* n, int* status);
} // lldb__cxxabiv1
#pragma GCC visibility pop
#endif // _CXA_DEMANGLE_H

View File

@ -595,7 +595,6 @@
AFF87C89150FF672000E1742 /* com.apple.debugserver-secure.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C88150FF672000E1742 /* com.apple.debugserver-secure.plist */; }; AFF87C89150FF672000E1742 /* com.apple.debugserver-secure.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C88150FF672000E1742 /* com.apple.debugserver-secure.plist */; };
AFF87C8F150FF688000E1742 /* com.apple.debugserver.applist.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */; }; AFF87C8F150FF688000E1742 /* com.apple.debugserver.applist.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */; };
B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */; }; B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */; };
B21EB71515CC99F100E60059 /* cxa_demangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B21EB71415CC99F100E60059 /* cxa_demangle.cpp */; settings = {COMPILER_FLAGS = "-frtti"; }; };
B2462247141AD37D00F3D409 /* OptionGroupWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */; }; B2462247141AD37D00F3D409 /* OptionGroupWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */; };
B27318421416AC12006039C8 /* WatchpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27318411416AC12006039C8 /* WatchpointList.cpp */; }; B27318421416AC12006039C8 /* WatchpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27318411416AC12006039C8 /* WatchpointList.cpp */; };
B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; }; B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; };
@ -1721,8 +1720,6 @@
AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; }; AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectWatchpoint.cpp; path = source/Commands/CommandObjectWatchpoint.cpp; sourceTree = "<group>"; }; B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectWatchpoint.cpp; path = source/Commands/CommandObjectWatchpoint.cpp; sourceTree = "<group>"; };
B207C4941429609C00F36E4E /* CommandObjectWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectWatchpoint.h; path = source/Commands/CommandObjectWatchpoint.h; sourceTree = "<group>"; }; B207C4941429609C00F36E4E /* CommandObjectWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectWatchpoint.h; path = source/Commands/CommandObjectWatchpoint.h; sourceTree = "<group>"; };
B21EB71415CC99F100E60059 /* cxa_demangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cxa_demangle.cpp; path = source/Core/cxa_demangle.cpp; sourceTree = "<group>"; };
B21EB71815CC9B7500E60059 /* cxa_demangle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = cxa_demangle.h; path = include/lldb/Core/cxa_demangle.h; sourceTree = "<group>"; };
B23DD24F12EDFAC1000C3894 /* ARMUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMUtils.h; path = Utility/ARMUtils.h; sourceTree = "<group>"; }; B23DD24F12EDFAC1000C3894 /* ARMUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMUtils.h; path = Utility/ARMUtils.h; sourceTree = "<group>"; };
B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupWatchpoint.cpp; path = source/Interpreter/OptionGroupWatchpoint.cpp; sourceTree = "<group>"; }; B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupWatchpoint.cpp; path = source/Interpreter/OptionGroupWatchpoint.cpp; sourceTree = "<group>"; };
B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupWatchpoint.h; path = include/lldb/Interpreter/OptionGroupWatchpoint.h; sourceTree = "<group>"; }; B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupWatchpoint.h; path = include/lldb/Interpreter/OptionGroupWatchpoint.h; sourceTree = "<group>"; };
@ -2611,9 +2608,7 @@
26BC7D6810F1B77400F91463 /* Log.h */, 26BC7D6810F1B77400F91463 /* Log.h */,
26BC7E7F10F1B85900F91463 /* Log.cpp */, 26BC7E7F10F1B85900F91463 /* Log.cpp */,
26BC7D6910F1B77400F91463 /* Mangled.h */, 26BC7D6910F1B77400F91463 /* Mangled.h */,
B21EB71815CC9B7500E60059 /* cxa_demangle.h */,
26BC7E8010F1B85900F91463 /* Mangled.cpp */, 26BC7E8010F1B85900F91463 /* Mangled.cpp */,
B21EB71415CC99F100E60059 /* cxa_demangle.cpp */,
2682100C143A59AE004BCF2D /* MappedHash.h */, 2682100C143A59AE004BCF2D /* MappedHash.h */,
26BC7D6A10F1B77400F91463 /* Module.h */, 26BC7D6A10F1B77400F91463 /* Module.h */,
26BC7E8110F1B85900F91463 /* Module.cpp */, 26BC7E8110F1B85900F91463 /* Module.cpp */,
@ -4267,7 +4262,6 @@
2694E99D14FC0BB30076DE67 /* PlatformFreeBSD.cpp in Sources */, 2694E99D14FC0BB30076DE67 /* PlatformFreeBSD.cpp in Sources */,
2694E9A414FC0BBD0076DE67 /* PlatformLinux.cpp in Sources */, 2694E9A414FC0BBD0076DE67 /* PlatformLinux.cpp in Sources */,
26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */, 26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */,
B21EB71515CC99F100E60059 /* cxa_demangle.cpp in Sources */,
260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */, 260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */,
260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */, 260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */,
260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */, 260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */,

View File

@ -15,7 +15,6 @@ add_lldb_library(lldbCore
ConnectionMachPort.cpp ConnectionMachPort.cpp
ConnectionSharedMemory.cpp ConnectionSharedMemory.cpp
ConstString.cpp ConstString.cpp
cxa_demangle.cpp
DataBufferHeap.cpp DataBufferHeap.cpp
DataBufferMemoryMap.cpp DataBufferMemoryMap.cpp
DataEncoder.cpp DataEncoder.cpp
@ -75,11 +74,3 @@ add_lldb_library(lldbCore
#Windows.cpp #Windows.cpp
) )
#FIXME: Below we append -frtti to cxa_demangle.cpp (and let the compiler choose to ignore the
# -fno-rtti that is added due to LLVM_NO_RTTI at the top of this file.) It would be
# better to replace -fno-rtti with -frtti rather than just appending the latter option.
set_property(
SOURCE cxa_demangle.cpp
PROPERTY COMPILE_FLAGS -frtti
)

View File

@ -12,15 +12,3 @@ LIBRARYNAME := lldbCore
BUILD_ARCHIVE = 1 BUILD_ARCHIVE = 1
include $(LLDB_LEVEL)/Makefile include $(LLDB_LEVEL)/Makefile
# Enable RTTI on GCC builds because one source file in this directory
# (cxa_demangle.cpp) uses dynamic_cast<> and GCC (at least 4.6 and 4.7)
# complain if we try to compile it with -fno-rtti.
$(info shell basename CXX is $(shell basename $(CXX)))
ifeq (g++,$(shell basename $(CXX) | colrm 4))
$(ObjDir)/cxa_demangle.o: Compile.CXX := $(filter-out -fno-rtti,$(Compile.CXX)) -frtti
endif
ifeq (Darwin,$(shell uname -s))
$(ObjDir)/cxa_demangle.o: Compile.CXX := $(filter-out -fno-rtti,$(Compile.CXX)) -frtti
endif

View File

@ -8,17 +8,9 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#if defined(__APPLE__)
#define USE_BUILTIN_LIBCXXABI_DEMANGLER 1
#endif
#if defined(USE_BUILTIN_LIBCXXABI_DEMANGLER)
#include "lldb/Core/cxa_demangle.h"
#else
// FreeBSD9-STABLE requires this to know about size_t in cxxabi.h // FreeBSD9-STABLE requires this to know about size_t in cxxabi.h
#include <cstddef> #include <cstddef>
#include <cxxabi.h> #include <cxxabi.h>
#endif
#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMap.h"
@ -207,11 +199,7 @@ Mangled::GetDemangledName () const
{ {
// We didn't already mangle this name, demangle it and if all goes well // We didn't already mangle this name, demangle it and if all goes well
// add it to our map. // add it to our map.
#if defined(USE_BUILTIN_LIBCXXABI_DEMANGLER)
char *demangled_name = lldb_cxxabiv1::__cxa_demangle (mangled_cstr, NULL, NULL, NULL);
#else
char *demangled_name = abi::__cxa_demangle (mangled_cstr, NULL, NULL, NULL); char *demangled_name = abi::__cxa_demangle (mangled_cstr, NULL, NULL, NULL);
#endif
if (demangled_name) if (demangled_name)
{ {

File diff suppressed because it is too large Load Diff