summaryrefslogtreecommitdiff
path: root/src/typeinfo.cc
diff options
context:
space:
mode:
authoranonymous <local@localhost>2011-05-02 12:51:25 +0000
committeranonymous <local@localhost>2011-05-09 15:05:54 +0700
commit6f9032852fb6c55846c4b4a23f8b8976442cce51 (patch)
tree8b5222c3778ee59173bb753f5e7b446a20706b2f /src/typeinfo.cc
parentb12153bb8ad75cf2bf51d486895fce2769fe66d9 (diff)
downloadlibcxxrt-6f9032852fb6c55846c4b4a23f8b8976442cce51.tar.gz
libcxxrt-6f9032852fb6c55846c4b4a23f8b8976442cce51.tar.bz2
libcxxrt-6f9032852fb6c55846c4b4a23f8b8976442cce51.tar.xz
Tidy up of the libcxxrt sources. Added missing comments, fixed some inconsistent indenting.
Diffstat (limited to 'src/typeinfo.cc')
-rw-r--r--src/typeinfo.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/typeinfo.cc b/src/typeinfo.cc
index 6d16668..28af5c9 100644
--- a/src/typeinfo.cc
+++ b/src/typeinfo.cc
@@ -47,11 +47,29 @@ ABI_NAMESPACE::__pointer_to_member_type_info::~__pointer_to_member_type_info() {
extern "C" char *cpp_demangle_gnu3(const char *);
extern "C" bool is_cpp_mangled_gnu3(const char *);
+/**
+ * Demangles a C++ symbol or type name. The buffer, if non-NULL, must be
+ * allocated with malloc() and must be *n bytes or more long. This function
+ * may call realloc() on the value pointed to by buf, and will return the
+ * length of the string via *n.
+ *
+ * The value pointed to by status is set to one of the following:
+ *
+ * 0: success
+ * -1: memory allocation failure
+ * -2: invalid mangled name
+ * -3: invalid arguments
+ */
extern "C" char* __cxa_demangle(const char* mangled_name,
char* buf,
size_t* n,
int* status)
{
+ // TODO: We should probably just be linking against libelf-tc, rather than
+ // copying their code. This requires them to do an actual release,
+ // however, and for our changes to be pushed upstream. We also need to
+ // call a different demangling function here depending on the ABI (e.g.
+ // ARM).
char *demangled = cpp_demangle_gnu3(mangled_name);
if (NULL != demangled)
{