Add some needed symbols to cxa_new_delete.cpp and put the display() stuff under #DEBUG (again).

llvm-svn: 148860
This commit is contained in:
Howard Hinnant 2012-01-24 21:35:18 +00:00
parent 6fa5727939
commit 421bbe5cc5
3 changed files with 119 additions and 56 deletions

View File

@ -192,3 +192,40 @@ operator delete[] (void* ptr, const std::nothrow_t&)
{
::operator delete[](ptr);
}
namespace std
{
// bad_alloc
bad_alloc::bad_alloc() _NOEXCEPT
{
}
bad_alloc::~bad_alloc() _NOEXCEPT
{
}
const char*
bad_alloc::what() const _NOEXCEPT
{
return "std::bad_alloc";
}
// bad_array_new_length
bad_array_new_length::bad_array_new_length() _NOEXCEPT
{
}
bad_array_new_length::~bad_array_new_length() _NOEXCEPT
{
}
const char*
bad_array_new_length::what() const _NOEXCEPT
{
return "bad_array_new_length";
}
} // std

View File

@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
#define __name __type_name
#include "private_typeinfo.h"
#ifdef DEBUG
#include <iostream>
#endif
namespace __cxxabiv1
{
@ -34,66 +34,92 @@ __fundamental_type_info::~__fundamental_type_info()
{
}
void
__fundamental_type_info::display() const
{
std::cout << "__fundamental_type_info " << __type_name << '\n';
}
// __array_type_info
__array_type_info::~__array_type_info()
{
}
void
__array_type_info::display() const
{
std::cout << "__array_type_info " << __type_name << '\n';
}
// __function_type_info
__function_type_info::~__function_type_info()
{
}
void
__function_type_info::display() const
{
std::cout << "__function_type_info " << __type_name << '\n';
}
// __enum_type_info
__enum_type_info::~__enum_type_info()
{
}
void
__enum_type_info::display() const
{
std::cout << "__enum_type_info " << __type_name << '\n';
}
// __class_type_info
__class_type_info::~__class_type_info()
{
}
void
__class_type_info::display() const
{
std::cout << "__class_type_info " << __type_name << '\n';
}
// __si_class_type_info
__si_class_type_info::~__si_class_type_info()
{
}
// __vmi_class_type_info
__vmi_class_type_info::~__vmi_class_type_info()
{
}
// __pbase_type_info
__pbase_type_info::~__pbase_type_info()
{
}
// __pointer_type_info
__pointer_type_info::~__pointer_type_info()
{
}
// __pointer_to_member_type_info
__pointer_to_member_type_info::~__pointer_to_member_type_info()
{
}
#ifdef DEBUG
void
__fundamental_type_info::display() const
{
std::cout << "__fundamental_type_info " << __type_name << '\n';
}
void
__array_type_info::display() const
{
std::cout << "__array_type_info " << __type_name << '\n';
}
void
__function_type_info::display() const
{
std::cout << "__function_type_info " << __type_name << '\n';
}
void
__enum_type_info::display() const
{
std::cout << "__enum_type_info " << __type_name << '\n';
}
void
__class_type_info::display() const
{
std::cout << "__class_type_info " << __type_name << '\n';
}
void
__si_class_type_info::display() const
{
@ -102,12 +128,6 @@ __si_class_type_info::display() const
__base_type->display();
}
// __vmi_class_type_info
__vmi_class_type_info::~__vmi_class_type_info()
{
}
void
__vmi_class_type_info::display() const
{
@ -129,18 +149,6 @@ __base_class_type_info::display() const
__base_type->display();
}
// __pbase_type_info
__pbase_type_info::~__pbase_type_info()
{
}
// __pointer_type_info
__pointer_type_info::~__pointer_type_info()
{
}
void
__pointer_type_info::display() const
{
@ -159,12 +167,6 @@ __pointer_type_info::display() const
__pointee->display();
}
// __pointer_to_member_type_info
__pointer_to_member_type_info::~__pointer_to_member_type_info()
{
}
void
__pointer_to_member_type_info::display() const
{
@ -185,6 +187,8 @@ __pointer_to_member_type_info::display() const
__pointee->display();
}
#endif
// can_catch
// A handler is a match for an exception object of type E if

View File

@ -25,7 +25,9 @@ public:
virtual ~__shim_type_info();
virtual bool can_catch(const __shim_type_info* thrown_type, void*& adjustedPtr) const;
#ifdef DEBUG
virtual void display() const = 0;
#endif
};
class __fundamental_type_info
@ -34,7 +36,9 @@ class __fundamental_type_info
public:
virtual ~__fundamental_type_info();
virtual bool can_catch(const __shim_type_info*, void*&) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
class __array_type_info
@ -43,7 +47,9 @@ class __array_type_info
public:
virtual ~__array_type_info();
virtual bool can_catch(const __shim_type_info*, void*&) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
class __function_type_info
@ -52,7 +58,9 @@ class __function_type_info
public:
virtual ~__function_type_info();
virtual bool can_catch(const __shim_type_info*, void*&) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
class __enum_type_info
@ -61,7 +69,9 @@ class __enum_type_info
public:
virtual ~__enum_type_info();
virtual bool can_catch(const __shim_type_info*, void*&) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
enum
@ -136,7 +146,9 @@ public:
virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const;
virtual bool can_catch(const __shim_type_info*, void*&) const;
virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
// Has one non-virtual public base class at offset zero
@ -151,7 +163,9 @@ public:
virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const;
virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const;
virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
struct __base_class_type_info
@ -170,7 +184,9 @@ public:
void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const;
void search_below_dst(__dynamic_cast_info*, const void*, int) const;
void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
#ifdef DEBUG
void display() const;
#endif
};
// Has one or more base classes
@ -195,7 +211,9 @@ public:
virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const;
virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const;
virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
class __pbase_type_info
@ -224,7 +242,9 @@ class __pointer_type_info
public:
virtual ~__pointer_type_info();
virtual bool can_catch(const __shim_type_info*, void*&) const;
#ifdef DEBUG
virtual void display() const;
#endif
};
class __pointer_to_member_type_info
@ -234,7 +254,9 @@ public:
const __class_type_info* __context;
virtual ~__pointer_to_member_type_info();
#ifdef DEBUG
virtual void display() const;
#endif
};
#pragma GCC visibility pop